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

Commit 4bbead43 authored by Chinmay Dhodapkar's avatar Chinmay Dhodapkar Committed by Automerger Merge Worker
Browse files

DO NOT MERGE do not process content uri in call Intents am: 12073ab4 am:...

DO NOT MERGE do not process content uri in call Intents am: 12073ab4 am: 29742541 am: 2d32277e

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



Change-Id: I030c176f3b6d5b6678c0fb18616a50a60b870257
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 89566625 2d32277e
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() {