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

Commit 1e7bed2a authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Don't allowlist on BOOT_COMPLETED for unstop

When coming out of force-stop, don't allowlist the app
to start FGS, as this isn't the use case for allowing
FGS starts on boot. If the app is being manually
launched after force-stop (most likely scenario),
allowlisting isn't needed.

This fixes the expectation in the CtsAppTestCases that
the app doesn't have FGS permission when bound by
another app in a background state, etc.

Fixes: 319092316
Test: atest CtsAppTestCases:ActivityManagerFgsBgStartTest
Change-Id: I784f4a52a823fe82d91d43266991e1aac81c9d17
parent 246f57f7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -5087,13 +5087,11 @@ public class ActivityManagerService extends IActivityManager.Stub
        intent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND
                | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
        final BroadcastOptions bOptions = mUserController.getTemporaryAppAllowlistBroadcastOptions(
                reason);
        broadcastIntentLocked(null, null, null, intent, null, null, 0, null, null,
                new String[]{android.Manifest.permission.RECEIVE_BOOT_COMPLETED},
                null, null, AppOpsManager.OP_NONE,
                bOptions.toBundle(), true,
                null, true,
                false, MY_PID, SYSTEM_UID,
                SYSTEM_UID, MY_PID, app.userId);
    }