diff options
| author | 2023-04-03 18:15:10 -0700 | |
|---|---|---|
| committer | 2023-04-03 18:17:43 -0700 | |
| commit | 16d79846915af88a3d447fd5052ec36d239930aa (patch) | |
| tree | f52703d19b13cebc732d5dffae73ab8477845482 | |
| parent | 6f09a27ae68366600e69453c2971e15b09ae7072 (diff) | |
ActivityManager: Use the default UidObserver implementation (2).
A class which overrides IUidObserver.Stub with empty callback
implementations was added in change
I2ff1e868586861e4dcd6586ad22139ba84eaf39c to simplify BroadcastQueue
interface complexity. Using this default implementation will mean less
churn when new callbacks are added to IUidObserver, or existing callback
method signatures are changed.
These callbacks do not need a "throws RemoteException" modifier, so that
has been removed, as these can't be marked as override because the
UidObserver class doesn't have them.
Bug: 274486653
Test: Presubmit, smoke test on cuttlefish.
Change-Id: I2b5548f7ce1f93cff863821153fd4d3b00c5eff4
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerShellCommand.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 350ac3bd4360..e080a80e1c37 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -59,12 +59,12 @@ import android.app.IActivityManager; import android.app.IActivityTaskManager; import android.app.IProcessObserver; import android.app.IStopUserCallback; -import android.app.IUidObserver; import android.app.IUserSwitchObserver; import android.app.KeyguardManager; import android.app.ProcessStateEnum; import android.app.ProfilerInfo; import android.app.RemoteServiceException.CrashedByAdbException; +import android.app.UidObserver; import android.app.UserSwitchObserver; import android.app.WaitResult; import android.app.usage.AppStandbyInfo; @@ -1858,7 +1858,7 @@ final class ActivityManagerShellCommand extends ShellCommand { return 0; } - static final class MyUidObserver extends IUidObserver.Stub + static final class MyUidObserver extends UidObserver implements ActivityManagerService.OomAdjObserver { final IActivityManager mInterface; final ActivityManagerService mInternal; @@ -1883,8 +1883,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) - throws RemoteException { + public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { @@ -1903,7 +1902,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidGone(int uid, boolean disabled) throws RemoteException { + public void onUidGone(int uid, boolean disabled) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { @@ -1921,7 +1920,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidActive(int uid) throws RemoteException { + public void onUidActive(int uid) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { @@ -1935,7 +1934,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidIdle(int uid, boolean disabled) throws RemoteException { + public void onUidIdle(int uid, boolean disabled) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { @@ -1953,7 +1952,7 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidCachedChanged(int uid, boolean cached) throws RemoteException { + public void onUidCachedChanged(int uid, boolean cached) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { @@ -1967,10 +1966,6 @@ final class ActivityManagerShellCommand extends ShellCommand { } @Override - public void onUidProcAdjChanged(int uid) throws RemoteException { - } - - @Override public void onOomAdjMessage(String msg) { synchronized (this) { final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); |