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

Commit 8b52ae20 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/21224930',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/21224930', 'googleplex-android-review.googlesource.com/20660096'] into security-aosp-rvc-release.

Change-Id: I8d92e217f8024175d3cb1b7b90a0910821f5f9d6
parents fb8d6105 3f2d4360
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -152,6 +152,23 @@ public class CallScreeningServiceHelper {
                                "Cancelling outgoing call screen due to service disconnect.");
                    }
                    mFuture.complete(null);
                    mContext.unbindService(this);
                } finally {
                    Log.endSession();
                }
            }

            @Override
            public void onNullBinding(ComponentName name) {
                // No locking needed -- CompletableFuture only lets one thread call complete.
                Log.continueSession(mLoggingSession, "CSSH.oNB");
                try {
                    if (!mFuture.isDone()) {
                        Log.w(CallScreeningServiceHelper.this,
                                "Cancelling outgoing call screen due to null binding.");
                    }
                    mFuture.complete(null);
                    mContext.unbindService(this);
                } finally {
                    Log.endSession();
                }
+12 −2
Original line number Diff line number Diff line
@@ -315,8 +315,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;
+2 −0
Original line number Diff line number Diff line
@@ -201,12 +201,14 @@ public class CallScreeningServiceFilter extends CallFilter {
        public void onServiceDisconnected(ComponentName componentName) {
            mResultFuture.complete(mPriorStageResult);
            Log.i(this, "Service disconnected.");
            unbindCallScreeningService();
        }

        @Override
        public void onBindingDied(ComponentName name) {
            mResultFuture.complete(mPriorStageResult);
            Log.i(this, "Binding died.");
            unbindCallScreeningService();
        }

        @Override
+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() {