Convert incoming numbers to E.164 prior to range matching.
TelephonyManager#requestNumberVerification performs range checking on the
original unformatted phone number from the network. In some regions like
the UK, the country prefix may not be present and a leading `0` may be
present in the phone number.
To ensure that these numbers are properly handled, we will now use
PhoneNumberUtils to convert the incoming number from the network into
`E.164` format prior to passing for match checking. Since a 0 prefixed
number received from a UK carrier is formatted correctly with the `+44`
country code, this ensures that these numbers are handled correctly
by the matching API.
Test: Added new unit tests to cover matching of these numbers.
Test: Manual testing using shell command to confirm correct behavior of
the API from an end-to-end standpoint.
Test: Via test app and shell override.
Flag: com.android.internal.telephony.flags.robust_number_verification
Fixes: 400984263
Change-Id: I8bef2480af3a9bb0337eb5a1bdc08cf39bc06a9d
diff --git a/testapps/TelephonyManagerTestApp/Android.bp b/testapps/TelephonyManagerTestApp/Android.bp
index 0ff917e..28cad76 100644
--- a/testapps/TelephonyManagerTestApp/Android.bp
+++ b/testapps/TelephonyManagerTestApp/Android.bp
@@ -9,4 +9,7 @@
javacflags: ["-parameters"],
platform_apis: true,
certificate: "platform",
+ static_libs: [
+ "androidx.appcompat_appcompat",
+ ],
}