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 4bfc47b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(region): allow countries by calling code so two-letter codes stay NANP
5a0830d put ISO country codes in the same allowlist as US state and
Canadian province codes. CO, IN, PA, AL, AR, DE, ID, IL, MA and NL exist in
both, and isOutsideAllowedRegions treated an allowed state as the country as
well, so a Colorado user allowing CO also let every Colombian number ring and
an Indiana user allowed all of India.
Countries are now entered and stored as calling codes (+57, +39). A code must
be a whole assigned ITU-T code (prefix-free check shared with the report
normalizer, moved to util/PhoneDigits), so +3, +35 and +391 are rejected.
+1 plus an area code (+1809) names the Caribbean countries that share +1, and
"+1 809" typed with a space is read as that area code rather than all of +1.
Two-letter codes keep their NANP meaning, so stored values are unchanged; the
ISO form never shipped in a release.
regionCode() also stops reading a ten-digit international number as NANP:
Penang's +60 4 counted as Vancouver 604 and Hamilton NZ's +64 7 as Toronto
647, so allowing BC or ON let them ring (shipped in v1.7.38).
Tests: the five country cases in RegionRulesTest asserted the colliding ISO
behavior (CO allowing +57); they now use calling codes, and new cases pin CO,
IN and PA both ways, code validation, the spaced area code and the ten-digit
misread. The NANP guard was mutation-checked. UI hint, disclosure and README
describe the calling-code form; zh-rCN strings updated to match.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ All detection layers implement a shared `IChecker` interface and run in priority
102
102
| 4850 |**Caller Name Trust**| Allow | Carrier-presented name matches one of your trust patterns (requires the device to provide a name during screening) |
103
103
| 4700 |**Push-Alert Bridge** (A3) | Allow | Uber/DoorDash/Amazon/Gmail notification about an arriving call? Let it through |
Copy file name to clipboardExpand all lines: app/src/main/res/values/strings.xml
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1619,15 +1619,15 @@
1619
1619
<stringname="reg_prefix_india_1600_allow">Protect India 1600 series</string>
1620
1620
<stringname="reg_prefix_india_1600_allow_desc">India\'s 1600 series is used by banks, insurers, and government. TRAI prohibits blocking it.</string>
1621
1621
<stringname="region_rules_title">Region & caller-name rules</string>
1622
-
<stringname="region_rules_disclosure">These rules run entirely on your device. Region blocking uses the incoming number\'s NANP area code. Caller-name trust uses only a carrier-presented name that Android exposes to the screening service.</string>
1622
+
<stringname="region_rules_disclosure">These rules run entirely on your device. Region blocking reads the area code of a North American number and the country code of any other. Caller-name trust uses only a carrier-presented name that Android exposes to the screening service.</string>
<stringname="region_rules_block_outside_desc">Allow selected US states, Canadian provinces, and territories; block other and international numbers.</string>
1624
+
<stringname="region_rules_block_outside_desc">Only the regions and countries you list can ring. Calls from anywhere else are blocked.</string>
1625
1625
<stringname="region_rules_allowed_regions">Allowed region codes</string>
1626
-
<stringname="region_rules_regions_hint">Comma-separated two-letter codes, for example NY, NJ, ON. Use TF for toll-free.</string>
1627
-
<stringname="region_rules_regions_required">Add at least one valid two-letter region code.</string>
1626
+
<stringname="region_rules_regions_hint">Separate with commas. Use two letters for a US state or Canadian province (NY, ON) and TF for toll-free. Use + and the calling code for a country, like +39 for Italy or +1809 for the Dominican Republic.</string>
1627
+
<stringname="region_rules_regions_required">Add at least one valid region or country code.</string>
1628
1628
<pluralsname="region_rules_regions_count">
1629
-
<itemquantity="one">%1$d valid region code</item>
1630
-
<itemquantity="other">%1$d valid region codes</item>
1629
+
<itemquantity="one">%1$d valid code</item>
1630
+
<itemquantity="other">%1$d valid codes</item>
1631
1631
</plurals>
1632
1632
<stringname="cnap_device_unavailable_notice">This device hasn\'t provided a caller name during screening. These rules won\'t take effect until it does.</string>
1633
1633
<stringname="cnap_trust_title">Trust a presented caller name</string>
0 commit comments