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

Commit 6774f72a authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Don't send BOOT_COMPLETED to app in restricted backup mode" into main

parents 31f4b099 a2e386b3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -4772,7 +4772,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (!mConstants.mEnableWaitForFinishAttachApplication) {
                finishAttachApplicationInner(startSeq, callingUid, pid);
            }
            maybeSendBootCompletedLocked(app);
            maybeSendBootCompletedLocked(app, isRestrictedBackupMode);
        } catch (Exception e) {
            // We need kill the process group here. (b/148588589)
            Slog.wtf(TAG, "Exception thrown during bind of " + app, e);
@@ -5017,7 +5017,7 @@ public class ActivityManagerService extends IActivityManager.Stub
     * Send LOCKED_BOOT_COMPLETED and BOOT_COMPLETED to the package explicitly when unstopped,
     * or when the package first starts in private space
     */
    private void maybeSendBootCompletedLocked(ProcessRecord app) {
    private void maybeSendBootCompletedLocked(ProcessRecord app, boolean isRestrictedBackupMode) {
        boolean sendBroadcast = false;
        if (android.os.Flags.allowPrivateProfile()
                && android.multiuser.Flags.enablePrivateSpaceFeatures()) {
@@ -5043,6 +5043,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                    RESTRICTION_REASON_USAGE, "unknown", RESTRICTION_SOURCE_USER, 0L);
        }
        // Don't send BOOT_COMPLETED if currently in restricted backup mode
        if (isRestrictedBackupMode) return;
        if (!sendBroadcast) {
            if (!android.content.pm.Flags.stayStopped()) return;
            // Nothing to do if it wasn't previously stopped