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

Commit 3df3bfd3 authored by Michal Karpinski's avatar Michal Karpinski Committed by Android (Google) Code Review
Browse files

Merge "Temporarily whitelist receivers responding to ACTION_NEW_OUTGOING_CALL...

Merge "Temporarily whitelist receivers responding to ACTION_NEW_OUTGOING_CALL to open activities from background"
parents fe2c8ea5 5ee428c0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.telecom;
import android.app.AppOpsManager;

import android.app.Activity;
import android.app.BroadcastOptions;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -399,11 +400,14 @@ public class NewOutgoingCallIntentBroadcaster {

        checkAndCopyProviderExtras(originalCallIntent, broadcastIntent);

        final BroadcastOptions options = BroadcastOptions.makeBasic();
        options.setAllowBackgroundActivityStarts(true);
        mContext.sendOrderedBroadcastAsUser(
                broadcastIntent,
                targetUser,
                android.Manifest.permission.PROCESS_OUTGOING_CALLS,
                AppOpsManager.OP_PROCESS_OUTGOING_CALLS,
                options.toBundle(),
                receiverRequired ? new NewOutgoingCallBroadcastIntentReceiver() : null,
                null,  // scheduler
                Activity.RESULT_OK,  // initialCode
+7 −0
Original line number Diff line number Diff line
@@ -307,6 +307,13 @@ public class ComponentContextFixture implements TestFixture<Context> {
                Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
        }

        @Override
        public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user,
                String receiverPermission, int appOp, Bundle options,
                BroadcastReceiver resultReceiver, Handler scheduler, int initialCode,
                String initialData, Bundle initialExtras) {
        }

        @Override
        public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
                throws PackageManager.NameNotFoundException {
+2 −0
Original line number Diff line number Diff line
@@ -445,6 +445,7 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {
                eq(UserHandle.CURRENT),
                eq(Manifest.permission.PROCESS_OUTGOING_CALLS),
                eq(AppOpsManager.OP_PROCESS_OUTGOING_CALLS),
                any(Bundle.class),
                receiverCaptor.capture(),
                isNull(Handler.class),
                eq(Activity.RESULT_OK),
@@ -483,6 +484,7 @@ public class NewOutgoingCallIntentBroadcasterTest extends TelecomTestCase {
                any(UserHandle.class),
                anyString(),
                anyInt(),
                any(Bundle.class),
                any(BroadcastReceiver.class),
                any(Handler.class),
                anyInt(),
+1 −0
Original line number Diff line number Diff line
@@ -739,6 +739,7 @@ public class TelecomSystemTest extends TelecomTestCase {
                            any(UserHandle.class),
                            anyString(),
                            anyInt(),
                            any(Bundle.class),
                            newOutgoingCallReceiver.capture(),
                            nullable(Handler.class),
                            anyInt(),