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

Commit 97f5f43c authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am f2f37781: am e8334254: am 4f35e169: am 4475e7df: am ea2c4033: Mark...

am f2f37781: am e8334254: am 4f35e169: am 4475e7df: am ea2c4033: Mark persistent apps as such when the ProcessRecord is created

* commit 'f2f37781':
  Mark persistent apps as such when the ProcessRecord is created
parents 6b832a06 f2f37781
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -375,6 +375,10 @@ public final class ActivityManagerService extends ActivityManagerNative
    // Delay in notifying task stack change listeners (in millis)
    static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 1000;
    // Necessary ApplicationInfo flags to mark an app as persistent
    private static final int PERSISTENT_MASK =
            ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PERSISTENT;
    /** All system services */
    SystemServiceManager mSystemServiceManager;
@@ -9843,10 +9847,10 @@ public final class ActivityManagerService extends ActivityManagerNative
        String proc = customProcess != null ? customProcess : info.processName;
        BatteryStatsImpl.Uid.Proc ps = null;
        BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics();
        final int userId = UserHandle.getUserId(info.uid);
        int uid = info.uid;
        if (isolated) {
            if (isolatedUid == 0) {
                int userId = UserHandle.getUserId(uid);
                int stepsLeft = Process.LAST_ISOLATED_UID - Process.FIRST_ISOLATED_UID + 1;
                while (true) {
                    if (mNextIsolatedProcessUid < Process.FIRST_ISOLATED_UID
@@ -9870,7 +9874,13 @@ public final class ActivityManagerService extends ActivityManagerNative
                uid = isolatedUid;
            }
        }
        return new ProcessRecord(stats, info, proc, uid);
        final ProcessRecord r = new ProcessRecord(stats, info, proc, uid);
        if (!mBooted && !mBooting
                && userId == UserHandle.USER_OWNER
                && (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
            r.persistent = true;
        }
        return r;
    }
    final ProcessRecord addAppLocked(ApplicationInfo info, boolean isolated,
@@ -9902,8 +9912,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    + info.packageName + ": " + e);
        }
        if ((info.flags&(ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PERSISTENT))
                == (ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PERSISTENT)) {
        if ((info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
            app.persistent = true;
            app.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
        }