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

Commit db17db5d authored by Presubmit Automerger Backend's avatar Presubmit Automerger Backend Committed by Chinmay Dhodapkar
Browse files

DO NOT MERGE [automerge] DO NOT MERGE do not process content uri in call Intents 2p: 298e4ced

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/20659352

Bug: 257030107
Change-Id: I8ecdc26438538f44c1a4e0d6a12fb4dea5055d52
Merged-In: Ic2c3014cecfd5db84dc2023b4c247d96ad1c3414
parents cc6243dc 298e4ced
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -314,8 +314,18 @@ public class NewOutgoingCallIntentBroadcaster {
    }

    private String getNumberFromCallIntent(Intent intent) {
        String number;
        number = mPhoneNumberUtilsAdapter.getNumberFromIntent(intent, mContext);
        String number = null;

        Uri uri = intent.getData();
        if (uri != null) {
            String scheme = uri.getScheme();
            if (scheme != null) {
                if (scheme.equals("tel") || scheme.equals("sip")) {
                    number = uri.getSchemeSpecificPart();
                }
            }
        }

        if (TextUtils.isEmpty(number)) {
            Log.w(this, "Empty number obtained from the call intent.");
            return null;
+13 −0
Original line number Diff line number Diff line
@@ -214,6 +214,19 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {
        verifyNoCallPlaced();
    }

    @Test
    public void testNoCallsPlacedWithContentUri() {
        Uri handle = Uri.parse("content://com.android.contacts/data/1");
        Intent intent = new Intent(Intent.ACTION_CALL, handle);

        int result = processIntent(intent, true).disconnectCause;

        assertEquals(DisconnectCause.NO_PHONE_NUMBER_SUPPLIED, result);
        verify(mContext, never()).getContentResolver();
        verifyNoBroadcastSent();
        verifyNoCallPlaced();
    }

    @SmallTest
    @Test
    public void testEmergencyCallWithNonDefaultDialer() {