Loading services/core/java/com/android/server/am/ActivityManagerService.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -17880,6 +17880,13 @@ public class ActivityManagerService extends IActivityManager.Stub mCoreSettingsObserver.onChange(true); mCoreSettingsObserver.onChange(true); } } /** * Reset the dropbox rate limiter */ void resetDropboxRateLimiter() { mDropboxRateLimiter.reset(); } /** /** * Kill processes for the user with id userId and that depend on the package named packageName * Kill processes for the user with id userId and that depend on the package named packageName */ */ services/core/java/com/android/server/am/ActivityManagerShellCommand.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -363,6 +363,8 @@ final class ActivityManagerShellCommand extends ShellCommand { return runGetBgRestrictionLevel(pw); return runGetBgRestrictionLevel(pw); case "observe-foreground-process": case "observe-foreground-process": return runGetCurrentForegroundProcess(pw, mInternal, mTaskInterface); return runGetCurrentForegroundProcess(pw, mInternal, mTaskInterface); case "reset-dropbox-rate-limiter": return runResetDropboxRateLimiter(); default: default: return handleDefaultCommands(cmd); return handleDefaultCommands(cmd); } } Loading Loading @@ -3577,6 +3579,11 @@ final class ActivityManagerShellCommand extends ShellCommand { return 0; return 0; } } int runResetDropboxRateLimiter() throws RemoteException { mInternal.resetDropboxRateLimiter(); return 0; } private Resources getResources(PrintWriter pw) throws RemoteException { private Resources getResources(PrintWriter pw) throws RemoteException { // system resources does not contain all the device configuration, construct it manually. // system resources does not contain all the device configuration, construct it manually. Configuration config = mInterface.getConfiguration(); Configuration config = mInterface.getConfiguration(); Loading services/core/java/com/android/server/am/DropboxRateLimiter.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.server.am; import android.os.SystemClock; import android.os.SystemClock; import android.text.format.DateUtils; import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.ArrayMap; import android.util.Slog; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; /** Rate limiter for adding errors into dropbox. */ /** Rate limiter for adding errors into dropbox. */ public class DropboxRateLimiter { public class DropboxRateLimiter { private static final String TAG = "DropboxRateLimiter"; // After RATE_LIMIT_ALLOWED_ENTRIES have been collected (for a single breakdown of // After RATE_LIMIT_ALLOWED_ENTRIES have been collected (for a single breakdown of // process/eventType) further entries will be rejected until RATE_LIMIT_BUFFER_DURATION has // process/eventType) further entries will be rejected until RATE_LIMIT_BUFFER_DURATION has // elapsed, after which the current count for this breakdown will be reset. // elapsed, after which the current count for this breakdown will be reset. Loading Loading @@ -105,6 +107,15 @@ public class DropboxRateLimiter { mLastMapCleanUp = now; mLastMapCleanUp = now; } } /** Resets the rate limiter memory. */ void reset() { synchronized (mErrorClusterRecords) { mErrorClusterRecords.clear(); } mLastMapCleanUp = 0L; Slog.i(TAG, "Rate limiter reset."); } String errorKey(String eventType, String processName) { String errorKey(String eventType, String processName) { return eventType + processName; return eventType + processName; } } Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -17880,6 +17880,13 @@ public class ActivityManagerService extends IActivityManager.Stub mCoreSettingsObserver.onChange(true); mCoreSettingsObserver.onChange(true); } } /** * Reset the dropbox rate limiter */ void resetDropboxRateLimiter() { mDropboxRateLimiter.reset(); } /** /** * Kill processes for the user with id userId and that depend on the package named packageName * Kill processes for the user with id userId and that depend on the package named packageName */ */
services/core/java/com/android/server/am/ActivityManagerShellCommand.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -363,6 +363,8 @@ final class ActivityManagerShellCommand extends ShellCommand { return runGetBgRestrictionLevel(pw); return runGetBgRestrictionLevel(pw); case "observe-foreground-process": case "observe-foreground-process": return runGetCurrentForegroundProcess(pw, mInternal, mTaskInterface); return runGetCurrentForegroundProcess(pw, mInternal, mTaskInterface); case "reset-dropbox-rate-limiter": return runResetDropboxRateLimiter(); default: default: return handleDefaultCommands(cmd); return handleDefaultCommands(cmd); } } Loading Loading @@ -3577,6 +3579,11 @@ final class ActivityManagerShellCommand extends ShellCommand { return 0; return 0; } } int runResetDropboxRateLimiter() throws RemoteException { mInternal.resetDropboxRateLimiter(); return 0; } private Resources getResources(PrintWriter pw) throws RemoteException { private Resources getResources(PrintWriter pw) throws RemoteException { // system resources does not contain all the device configuration, construct it manually. // system resources does not contain all the device configuration, construct it manually. Configuration config = mInterface.getConfiguration(); Configuration config = mInterface.getConfiguration(); Loading
services/core/java/com/android/server/am/DropboxRateLimiter.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -19,11 +19,13 @@ package com.android.server.am; import android.os.SystemClock; import android.os.SystemClock; import android.text.format.DateUtils; import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.ArrayMap; import android.util.Slog; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; /** Rate limiter for adding errors into dropbox. */ /** Rate limiter for adding errors into dropbox. */ public class DropboxRateLimiter { public class DropboxRateLimiter { private static final String TAG = "DropboxRateLimiter"; // After RATE_LIMIT_ALLOWED_ENTRIES have been collected (for a single breakdown of // After RATE_LIMIT_ALLOWED_ENTRIES have been collected (for a single breakdown of // process/eventType) further entries will be rejected until RATE_LIMIT_BUFFER_DURATION has // process/eventType) further entries will be rejected until RATE_LIMIT_BUFFER_DURATION has // elapsed, after which the current count for this breakdown will be reset. // elapsed, after which the current count for this breakdown will be reset. Loading Loading @@ -105,6 +107,15 @@ public class DropboxRateLimiter { mLastMapCleanUp = now; mLastMapCleanUp = now; } } /** Resets the rate limiter memory. */ void reset() { synchronized (mErrorClusterRecords) { mErrorClusterRecords.clear(); } mLastMapCleanUp = 0L; Slog.i(TAG, "Rate limiter reset."); } String errorKey(String eventType, String processName) { String errorKey(String eventType, String processName) { return eventType + processName; return eventType + processName; } } Loading