Loading services/core/java/com/android/server/am/ActiveServices.java +7 −8 Original line number Diff line number Diff line Loading @@ -422,13 +422,9 @@ public final class ActiveServices { } // If we're starting indirectly (e.g. from PendingIntent), figure out whether // we're launching into an app in a background state. final int uidState = mAm.getUidStateLocked(r.appInfo.uid); if (DEBUG_SERVICE) { Slog.v(TAG_SERVICE, "Uid state " + uidState + " indirect starting " + r.shortName); } final boolean bgLaunch = (uidState > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND); // we're launching into an app in a background state. This keys off of the same // idleness state tracking as e.g. O+ background service start policy. final boolean bgLaunch = !mAm.isUidActiveLocked(r.appInfo.uid); // If the app has strict background restrictions, we treat any bg service // start analogously to the legacy-app forced-restrictions case, regardless Loading Loading @@ -1197,10 +1193,13 @@ public final class ActiveServices { if (!ignoreForeground && appRestrictedAnyInBackground(r.appInfo.uid, r.packageName)) { ignoreForeground = true; Slog.w(TAG, "Service.startForeground() not allowed due to bg restriction: service " + r.shortName); // Back off of any foreground expectations around this service, since we've // just turned down its fg request. updateServiceForegroundLocked(r.app, false); ignoreForeground = true; } // Apps under strict background restrictions simply don't get to have foreground Loading services/core/java/com/android/server/am/ActivityManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -26626,8 +26626,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public boolean isUidActive(int uid) { synchronized (ActivityManagerService.this) { final UidRecord uidRec = mActiveUids.get(uid); return (uidRec != null) && !uidRec.idle; return isUidActiveLocked(uid); } } Loading
services/core/java/com/android/server/am/ActiveServices.java +7 −8 Original line number Diff line number Diff line Loading @@ -422,13 +422,9 @@ public final class ActiveServices { } // If we're starting indirectly (e.g. from PendingIntent), figure out whether // we're launching into an app in a background state. final int uidState = mAm.getUidStateLocked(r.appInfo.uid); if (DEBUG_SERVICE) { Slog.v(TAG_SERVICE, "Uid state " + uidState + " indirect starting " + r.shortName); } final boolean bgLaunch = (uidState > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND); // we're launching into an app in a background state. This keys off of the same // idleness state tracking as e.g. O+ background service start policy. final boolean bgLaunch = !mAm.isUidActiveLocked(r.appInfo.uid); // If the app has strict background restrictions, we treat any bg service // start analogously to the legacy-app forced-restrictions case, regardless Loading Loading @@ -1197,10 +1193,13 @@ public final class ActiveServices { if (!ignoreForeground && appRestrictedAnyInBackground(r.appInfo.uid, r.packageName)) { ignoreForeground = true; Slog.w(TAG, "Service.startForeground() not allowed due to bg restriction: service " + r.shortName); // Back off of any foreground expectations around this service, since we've // just turned down its fg request. updateServiceForegroundLocked(r.app, false); ignoreForeground = true; } // Apps under strict background restrictions simply don't get to have foreground Loading
services/core/java/com/android/server/am/ActivityManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -26626,8 +26626,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public boolean isUidActive(int uid) { synchronized (ActivityManagerService.this) { final UidRecord uidRec = mActiveUids.get(uid); return (uidRec != null) && !uidRec.idle; return isUidActiveLocked(uid); } }