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

Commit 656c408d authored by josephpv's avatar josephpv Committed by Joseph Vincent
Browse files

Allow BAL permission for UserManagerService

On passing a pending intent to requestQuiteModeEnabled if authenticated
successfully then after disabling quiet mode it is used to start the
activity. This commit is to explicitly permit UserManagerService to
allow launch an activity from background by passing
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED when it calls
startIntentSender.
go/debug-bal

BUG: 319886822
Test: Build and verified manually

Change-Id: Ifeb887df410c851500df23ad9df85b2390200868
parent b738e563
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.BroadcastOptions;
import android.app.IActivityManager;
import android.app.IStopUserCallback;
@@ -587,7 +588,10 @@ public class UserManagerService extends IUserManager.Stub {
        public void onFinished(int id, Bundle extras) {
            mHandler.post(() -> {
                try {
                    mContext.startIntentSender(mTarget, null, 0, 0, 0);
                    ActivityOptions activityOptions =
                            ActivityOptions.makeBasic().setPendingIntentBackgroundActivityStartMode(
                                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                    mContext.startIntentSender(mTarget, null, 0, 0, 0, activityOptions.toBundle());
                } catch (IntentSender.SendIntentException e) {
                    Slog.e(LOG_TAG, "Failed to start the target in the callback", e);
                }