You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cdb845f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(region): read a bare number in the phone's own country
Region rules read every bare ten- or eleven-digit number as North American.
Android leaves a caller ID in national form when it can't validate it for
the phone's home region, so on an Italian phone a domestic number that stayed
bare never matched the user's own +39 entry and was blocked as out of region,
while ten digits shaped like a New York number counted as NY.
- RegionCallingCodes maps each ISO region to its ITU-T calling code (245
regions, generated from libphonenumber's metadata via Python phonenumbers
9.0.39); Android exposes no public API for it.
- regionCode() and isOutsideAllowedRegions() take the phone's home region. A
bare number is NANP only where the home region uses +1 or is unknown (the
old behavior); elsewhere it is read with the home calling code and never
gets a US state or Canadian province.
- RegionBlockChecker reads the home region (PhoneIdentityCanonicalizer's
TTL-cached value) only for a bare number.
Tests: Italian-phone cases (a bare domestic number allowed by +39 and blocked
by +44, ten NY-shaped digits not read as NY), NANP-home and unknown-region
cases keeping the old reading, and the table's NANP coverage. The home-region
branch was mutation-checked (the mutant failed exactly the Italian-phone
test). 1376 JVM tests pass; lint, ktlint and detekt are clean.
0 commit comments