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

Commit 7fac473e authored by Alex Stetson's avatar Alex Stetson
Browse files

DO NOT MERGE Re-restrict phone ops on user addition

When a user is added, the phone ops need to be re-restricted since
otherwise the new user will not have the restrictions until the device
is rebooted.

Bug: 186518774
Test: manual, atest AppOpsTest#ensurePhoneCallOpsRestricted
Change-Id: I2918b194198487184ad7f7401bc7d10738462639
parent fa571473
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -947,6 +947,15 @@ public class InCallController extends CallsManagerListenerBase implements
        }
    };

    private final BroadcastReceiver mUserAddedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (Intent.ACTION_USER_ADDED.equals(intent.getAction())) {
                restrictPhoneCallOps();
            }
        }
    };

    private final SystemStateListener mSystemStateListener = new SystemStateListener() {
        @Override
        public void onCarModeChanged(int priority, String packageName, boolean isCarMode) {
@@ -1055,6 +1064,7 @@ public class InCallController extends CallsManagerListenerBase implements
        mSystemStateHelper.addListener(mSystemStateListener);
        mClockProxy = clockProxy;
        restrictPhoneCallOps();
        mContext.registerReceiver(mUserAddedReceiver, new IntentFilter(Intent.ACTION_USER_ADDED));
    }

    private void restrictPhoneCallOps() {