add routing support in eccdata proto
-add optional routing field for an emergency number
-also add ability to restrict normal routing to specific MNCs (rare)
Bug: 238359415
Test: atest TeleServiceTests:EccDataTest#testEccDataContent
Change-Id: Ia8f8bb07b0825f49f9f20d4c88a0a1d62b910f40
diff --git a/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto b/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
index c1a826a..8128963 100644
--- a/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
+++ b/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
@@ -24,6 +24,16 @@
// Extra rules: Every Ecc should have at least 1 valid type.
repeated Type types = 2 [packed=true];
+
+
+ //Optional: By default, the emergency number is assumed to be 'emergency routed'
+ optional bool is_normal_routed = 3 [default = false];
+
+ //Optional: This field is evaluated only if is_normal_routed is set to true
+ //If the field is empty, normal routing is used for all MNCs
+ //Else normal routing is used only for list of MNCs specified
+ repeated string normal_routing_mncs = 4;
+
}
// CountryInfo represents available ECCs of a country/region, recognized
diff --git a/tests/src/com/android/phone/ecc/EccDataTest.java b/tests/src/com/android/phone/ecc/EccDataTest.java
index 911d3c5..2cc622e 100644
--- a/tests/src/com/android/phone/ecc/EccDataTest.java
+++ b/tests/src/com/android/phone/ecc/EccDataTest.java
@@ -49,6 +49,7 @@
HashSet loadedIsos = new HashSet(300);
HashSet loadedNumbers = new HashSet(5);
+ HashSet loadedMncs = new HashSet(5);
for (ProtobufEccData.CountryInfo countryInfo : allEccMessages.countries) {
assertThat(countryInfo.isoCode).isNotEmpty();
@@ -63,6 +64,17 @@
assertThat(loadedNumbers.contains(eccInfo.phoneNumber)).isFalse();
assertThat(eccInfo.types).isNotEmpty();
loadedNumbers.add(eccInfo.phoneNumber);
+ if (eccInfo.isNormalRouted) {
+ loadedMncs.clear();
+ for (String mnc : eccInfo.normalRoutingMncs) {
+ assertThat(mnc).isNotEmpty();
+ assertThat(mnc).isEqualTo(mnc.trim());
+ assertThat(loadedMncs.contains(mnc)).isFalse();
+ assertThat(mnc.length()).isGreaterThan(1);
+ assertThat(mnc.length()).isLessThan(4);
+ loadedMncs.add(mnc);
+ }
+ }
}
}
}