Make routing type an enum instead of boolean
This will keep it aligned with older interpretation in code in case
we dont have official value for routing
Bug: 238359415
Test: atest TeleServiceTests:EccDataTest#testEccDataContent
Test: atest EmergencyNumberTrackerTest
Change-Id: I6927be923319a743f2a5607758b92ada3ac1d3ec
diff --git a/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto b/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
index 528e4b0..088b5b7 100644
--- a/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
+++ b/ecc/conversion_toolset_v1/proto/protobuf_ecc_data.proto
@@ -19,6 +19,12 @@
AIEC = 7;
}
+ enum Routing {
+ UNKNOWN = 0;
+ EMERGENCY = 1;
+ NORMAL= 2;
+ }
+
// Required: Every EccInfo shall contain a phone number.
optional string phone_number = 1;
@@ -26,11 +32,11 @@
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: By default, routing is assumed to be 'UNKNOWN'
+ optional Routing routing = 3 [default = UNKNOWN];
- //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
+ //Optional: This field is evaluated only if routing is set to NORMAL
+ //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;
diff --git a/tests/src/com/android/phone/ecc/EccDataTest.java b/tests/src/com/android/phone/ecc/EccDataTest.java
index a52e2e7..baa4c7b 100644
--- a/tests/src/com/android/phone/ecc/EccDataTest.java
+++ b/tests/src/com/android/phone/ecc/EccDataTest.java
@@ -66,7 +66,7 @@
assertThat(loadedNumbers.contains(eccInfo.phoneNumber)).isFalse();
assertThat(eccInfo.types).isNotEmpty();
loadedNumbers.add(eccInfo.phoneNumber);
- if (eccInfo.isNormalRouted) {
+ if (eccInfo.routing == ProtobufEccData.EccInfo.Routing.NORMAL) {
loadedMncs.clear();
for (String mnc : eccInfo.normalRoutingMncs) {
assertThat(mnc).isNotEmpty();