PackageManager: Use the default UidObserver implementation.
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. Bug: 274486653 Test: Presubmit, smoke test on cuttlefish. Change-Id: I38cd2bb726faf2695bde5336f6d2b7b8b28ad107
This commit is contained in:
@@ -27,6 +27,7 @@ import android.app.ActivityManagerInternal;
|
||||
import android.app.AppGlobals;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.IUriGrantsManager;
|
||||
import android.app.UidObserver;
|
||||
import android.app.UriGrantsManager;
|
||||
import android.app.role.OnRoleHoldersChangedListener;
|
||||
import android.app.role.RoleManager;
|
||||
@@ -590,7 +591,7 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
final private IUidObserver mUidObserver = new IUidObserver.Stub() {
|
||||
final private IUidObserver mUidObserver = new UidObserver() {
|
||||
@Override
|
||||
public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
|
||||
injectPostToHandler(() -> handleOnUidStateChanged(uid, procState));
|
||||
@@ -601,20 +602,6 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
injectPostToHandler(() ->
|
||||
handleOnUidStateChanged(uid, ActivityManager.PROCESS_STATE_NONEXISTENT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidActive(int uid) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidIdle(int uid, boolean disabled) {
|
||||
}
|
||||
|
||||
@Override public void onUidCachedChanged(int uid, boolean cached) {
|
||||
}
|
||||
|
||||
@Override public void onUidProcAdjChanged(int uid) {
|
||||
}
|
||||
};
|
||||
|
||||
void handleOnUidStateChanged(int uid, int procState) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.app.ActivityManagerInternal;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.UidObserver;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -168,7 +169,7 @@ public class OneTimePermissionUserManager {
|
||||
|
||||
private final Object mInnerLock = new Object();
|
||||
private final Object mToken = new Object();
|
||||
private final IUidObserver.Stub mObserver = new IUidObserver.Stub() {
|
||||
private final IUidObserver mObserver = new UidObserver() {
|
||||
@Override
|
||||
public void onUidGone(int uid, boolean disabled) {
|
||||
if (uid == mUid) {
|
||||
@@ -188,15 +189,6 @@ public class OneTimePermissionUserManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onUidActive(int uid) {
|
||||
}
|
||||
public void onUidIdle(int uid, boolean disabled) {
|
||||
}
|
||||
public void onUidProcAdjChanged(int uid) {
|
||||
}
|
||||
public void onUidCachedChanged(int uid, boolean cached) {
|
||||
}
|
||||
};
|
||||
|
||||
private PackageInactivityListener(int uid, @NonNull String packageName, long timeout,
|
||||
|
||||
Reference in New Issue
Block a user