Loading core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -329,6 +329,9 @@ public abstract class ActivityManagerInternal { /** Returns true if the given uid is the app in the foreground. */ public abstract boolean isAppForeground(int uid); /** Returns true if the given uid is currently marked 'bad' */ public abstract boolean isAppBad(ApplicationInfo info); /** Remove pending backup for the given userId. */ public abstract void clearPendingBackup(int userId); Loading services/core/java/com/android/server/am/ActivityManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -5492,6 +5492,12 @@ public class ActivityManagerService extends IActivityManager.Stub } } private boolean isAppBad(ApplicationInfo info) { synchronized (this) { return mAppErrors.isBadProcessLocked(info); } } // NOTE: this is an internal method used by the OnShellCommand implementation only and should // be guarded by permission checking. int getUidState(int uid) { Loading Loading @@ -18077,6 +18083,11 @@ public class ActivityManagerService extends IActivityManager.Stub return ActivityManagerService.this.isAppForeground(uid); } @Override public boolean isAppBad(ApplicationInfo info) { return ActivityManagerService.this.isAppBad(info); } @Override public void clearPendingBackup(int userId) { ActivityManagerService.this.clearPendingBackup(userId); services/core/java/com/android/server/job/JobSchedulerService.java +17 −8 Original line number Diff line number Diff line Loading @@ -2494,24 +2494,33 @@ public class JobSchedulerService extends com.android.server.SystemService } } // The expensive check last: validate that the defined package+service is // The expensive check: validate that the defined package+service is // still present & viable. final boolean componentPresent; final ServiceInfo service; try { componentPresent = (AppGlobals.getPackageManager().getServiceInfo( service = AppGlobals.getPackageManager().getServiceInfo( job.getServiceComponent(), PackageManager.MATCH_DEBUG_TRIAGED_MISSING, job.getUserId()) != null); job.getUserId()); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } if (service == null) { if (DEBUG) { Slog.v(TAG, "isReadyToBeExecutedLocked: " + job.toShortString() + " componentPresent=" + componentPresent); + " component not present"); } return false; } // Everything else checked out so far, so this is the final yes/no check return componentPresent; final boolean appIsBad = mActivityManagerInternal.isAppBad(service.applicationInfo); if (DEBUG) { if (appIsBad) { Slog.i(TAG, "App is bad for " + job.toShortString() + " so not runnable"); } } return !appIsBad; } private void evaluateControllerStatesLocked(final JobStatus job) { Loading Loading
core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -329,6 +329,9 @@ public abstract class ActivityManagerInternal { /** Returns true if the given uid is the app in the foreground. */ public abstract boolean isAppForeground(int uid); /** Returns true if the given uid is currently marked 'bad' */ public abstract boolean isAppBad(ApplicationInfo info); /** Remove pending backup for the given userId. */ public abstract void clearPendingBackup(int userId); Loading
services/core/java/com/android/server/am/ActivityManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -5492,6 +5492,12 @@ public class ActivityManagerService extends IActivityManager.Stub } } private boolean isAppBad(ApplicationInfo info) { synchronized (this) { return mAppErrors.isBadProcessLocked(info); } } // NOTE: this is an internal method used by the OnShellCommand implementation only and should // be guarded by permission checking. int getUidState(int uid) { Loading Loading @@ -18077,6 +18083,11 @@ public class ActivityManagerService extends IActivityManager.Stub return ActivityManagerService.this.isAppForeground(uid); } @Override public boolean isAppBad(ApplicationInfo info) { return ActivityManagerService.this.isAppBad(info); } @Override public void clearPendingBackup(int userId) { ActivityManagerService.this.clearPendingBackup(userId);
services/core/java/com/android/server/job/JobSchedulerService.java +17 −8 Original line number Diff line number Diff line Loading @@ -2494,24 +2494,33 @@ public class JobSchedulerService extends com.android.server.SystemService } } // The expensive check last: validate that the defined package+service is // The expensive check: validate that the defined package+service is // still present & viable. final boolean componentPresent; final ServiceInfo service; try { componentPresent = (AppGlobals.getPackageManager().getServiceInfo( service = AppGlobals.getPackageManager().getServiceInfo( job.getServiceComponent(), PackageManager.MATCH_DEBUG_TRIAGED_MISSING, job.getUserId()) != null); job.getUserId()); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } if (service == null) { if (DEBUG) { Slog.v(TAG, "isReadyToBeExecutedLocked: " + job.toShortString() + " componentPresent=" + componentPresent); + " component not present"); } return false; } // Everything else checked out so far, so this is the final yes/no check return componentPresent; final boolean appIsBad = mActivityManagerInternal.isAppBad(service.applicationInfo); if (DEBUG) { if (appIsBad) { Slog.i(TAG, "App is bad for " + job.toShortString() + " so not runnable"); } } return !appIsBad; } private void evaluateControllerStatesLocked(final JobStatus job) { Loading