Numbers without a country code are formatted using the system language's region instead of the SIM/network country
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #948 de @AcideFluorhydrique — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- internationalization, mobile
Línea de trabajo
Start with Config.regionHint to see how SIM, network and locale country are ordered, then read formatPhoneNumber() in commons/src/main/kotlin/org/fossify/commons/extensions/String.kt. Follow its callers in CallContactHelper.kt and RecentCallsAdapter.kt, where Locale.getDefault().country also feeds PhoneNumberUtil.parse() and PhoneNumberOfflineGeocoder. Done means formatting and the location label use the SIM/network region hint, verified on an en-US device with a Chinese SIM; note the Commons change affects other apps.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Checklist
- I can reproduce the bug with the latest version given here.
- I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- This issue contains only one bug.
- I have read and understood the contribution guidelines.
Affected app version
1.11.1
Affected Android/Custom ROM version
Android 16 HyperOS 3
Affected device model
Redmi Note 15
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
- Set the system language to English (United States) (
en-US) on a phone with a Chinese SIM card, used in mainland China. - Make sure "Format phone numbers" is enabled in the app settings.
- Receive a call from a domestic Chinese mobile number. Domestic calls arrive without
+86, e.g.13912341234(example number). - Look at the incoming call screen and at the call history.
Expected behavior
The number is formatted with Chinese conventions, as the system dialer does: 139 1234 1234.
Actual behavior
The number is formatted as if it were a North American number: 1 (391) 234-1234. The leading 1 of the Chinese mobile number is treated as the NANP trunk prefix, and the remaining 10 digits as a US number. Every Chinese mobile number starts with 1 and has 11 digits, so this affects almost every domestic call.
The caller location in the call history is also computed as if the number were a US number.
Screenshots/Screen recordings
No response
Additional information
The cause is that the formatting uses Locale.getDefault().country as the default region:
formatPhoneNumber()in Commons (commons/src/main/kotlin/org/fossify/commons/extensions/String.kt) callsPhoneNumberUtils.formatNumber(this, Locale.getDefault().country). This app uses it inCallContactHelper.kt(call screen) and inRecentCallsAdapter.kt(call history and "Show call details").RecentCallsAdapter.ktalso passesLocale.getDefault().countrytoPhoneNumberUtil.parse()and toPhoneNumberOfflineGeocoder.getDescriptionForNumber()for the location label.
Many people use a system language such as en-US outside of the US, so the language's region is not a reliable way to know which country the user is in. The app already has better logic: Config.regionHint takes the SIM country first, then the network country, and only then the locale. It is currently used only to normalize numbers for the "remember SIM" feature.
Possibly related: #295 (a +1 number shown incorrectly on a phone with a Russian locale, fixed by disabling "Format phone numbers") and #824 (Swiss numbers formatted as French).
I have a fix ready that uses the SIM/network country for formatting and for the location label, and I am happy to open a PR if this gets the help wanted label. Since formatPhoneNumber() lives in Commons and is also used by other apps (e.g. Contacts), please let me know if you would prefer the fix in Commons instead.
- Lenguaje dominante
- Kotlin
- Estrellas
- 1.4k
- Forks
- 213
- Merge medio
- 13 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FossifyOrg/Phone
-
Tab to tap and Scroll UpAbiertofeature request needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
FossifyOrg/Phone#922 ·
Los mantenedores suelen responder en 1 día
-
bug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
FossifyOrg/Phone#914 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FossifyOrg/Phone#889 ·
Los mantenedores suelen responder en 1 día
-
feature request needs triage
Dificultad 2/5 Medio día Aptitud para principiantes 60/100
FossifyOrg/Phone#822 ·
Los mantenedores suelen responder en 1 día
-
Feature Request: Send Caller ID only to saved contacts (auto-prepend *31# when Caller ID is hidden)Abiertofeature request needs triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
FossifyOrg/Phone#952 ·
Los mantenedores suelen responder en 1 día
Todos los issues de FossifyOrg/Phone
Issues similares
-
bug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
grote/Transportr#1029 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
TeamAmaze/AmazeFileManager#4800 ·
Los mantenedores suelen responder en 1 día
-
bug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
FossifyOrg/Gallery#1235 ·
Los mantenedores suelen responder en 1 día
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryAbiertobug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsotto/sotto-authenticator#139 ·
Los mantenedores suelen responder en 1 día
-
enhancement module:webview p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
NucleusFramework/Nucleus#1004 ·
Los mantenedores suelen responder en 1 día