Loading core/java/android/app/ActivityManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,10 @@ public class ActivityManager { private static final RateLimitingCache<List<RunningAppProcessInfo>> mRunningProcessesCache = new RateLimitingCache<>(10, 4); /** Rate-Limiting Cache that allows no more than 200 calls to the service per second. */ private static final RateLimitingCache<List<ProcessErrorStateInfo>> mErrorProcessesCache = new RateLimitingCache<>(10, 2); /** * Map of callbacks that have registered for {@link UidFrozenStateChanged} events. * Will be called when a Uid has become frozen or unfrozen. Loading Loading @@ -3685,6 +3689,16 @@ public class ActivityManager { * specified. */ public List<ProcessErrorStateInfo> getProcessesInErrorState() { if (Flags.rateLimitGetProcessesInErrorState()) { return mErrorProcessesCache.get(() -> { return getProcessesInErrorStateInternal(); }); } else { return getProcessesInErrorStateInternal(); } } private List<ProcessErrorStateInfo> getProcessesInErrorStateInternal() { try { return getService().getProcessesInErrorState(); } catch (RemoteException e) { Loading core/java/android/app/activity_manager.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -93,3 +93,14 @@ flag { } } flag { namespace: "backstage_power" name: "rate_limit_get_processes_in_error_state" description: "Rate limit calls to getProcessesInErrorState using a cache" is_fixed_read_only: true bug: "361146083" metadata { purpose: PURPOSE_BUGFIX } } Loading
core/java/android/app/ActivityManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -233,6 +233,10 @@ public class ActivityManager { private static final RateLimitingCache<List<RunningAppProcessInfo>> mRunningProcessesCache = new RateLimitingCache<>(10, 4); /** Rate-Limiting Cache that allows no more than 200 calls to the service per second. */ private static final RateLimitingCache<List<ProcessErrorStateInfo>> mErrorProcessesCache = new RateLimitingCache<>(10, 2); /** * Map of callbacks that have registered for {@link UidFrozenStateChanged} events. * Will be called when a Uid has become frozen or unfrozen. Loading Loading @@ -3685,6 +3689,16 @@ public class ActivityManager { * specified. */ public List<ProcessErrorStateInfo> getProcessesInErrorState() { if (Flags.rateLimitGetProcessesInErrorState()) { return mErrorProcessesCache.get(() -> { return getProcessesInErrorStateInternal(); }); } else { return getProcessesInErrorStateInternal(); } } private List<ProcessErrorStateInfo> getProcessesInErrorStateInternal() { try { return getService().getProcessesInErrorState(); } catch (RemoteException e) { Loading
core/java/android/app/activity_manager.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -93,3 +93,14 @@ flag { } } flag { namespace: "backstage_power" name: "rate_limit_get_processes_in_error_state" description: "Rate limit calls to getProcessesInErrorState using a cache" is_fixed_read_only: true bug: "361146083" metadata { purpose: PURPOSE_BUGFIX } }