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

Unverified Commit e9049331 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-11.0.0_r66' of...

Merge tag 'android-security-11.0.0_r66' of https://android.googlesource.com/platform/packages/services/Telecomm into staging/lineage-18.1_merge_android-security-11.0.0_r66

Android Security 11.0.0 Release 66 (9682389)

* tag 'android-security-11.0.0_r66' of https://android.googlesource.com/platform/packages/services/Telecomm:
  DO NOT MERGE do not process content uri in call Intents
  Ensure service unbind when receiving a null call screening service in onBind.

Change-Id: Ie07614b071a9fa5564edc6ee74f85d4b6d435fa8
parents 5caa29b1 8b52ae20
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() {