Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0626e664 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add new flag for "robust number verification".

Also added a test case for number normalization to verify it can handle the
particular case we're interested in.

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
parent e41480ed
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -29,6 +29,18 @@ flag {
    }
}

# OWNER=tgunn TARGET=25Q2
flag {
    name: "robust_number_verification"
    namespace: "telephony"
    description: "Makes range matching more robust for TelephonyManager#requestNumberVerification"
    bug:"400984263"
    is_exported: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

# OWNER=stevestatia TARGET=24Q4
flag {
    name: "remove_country_code_from_local_singapore_calls"
+4 −2
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;

import com.android.internal.telephony.flags.Flags;

import android.net.Uri;
import android.platform.test.flag.junit.SetFlagsRule;
import android.telephony.PhoneNumberUtils;
@@ -32,6 +30,8 @@ import android.text.style.TtsSpan;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;

import com.android.internal.telephony.flags.Flags;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@@ -560,6 +560,8 @@ public class PhoneNumberUtilsTest {
        assertEquals("+16502910000", PhoneNumberUtils.formatNumberToE164("650 2910000", "US"));
        assertNull(PhoneNumberUtils.formatNumberToE164("1234567", "US"));
        assertEquals("+18004664114", PhoneNumberUtils.formatNumberToE164("800-GOOG-114", "US"));

        assertEquals("+447445032046", PhoneNumberUtils.formatNumberToE164("0 7445 032046", "GB"));
    }

    @SmallTest