JobSchedulerService: 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: Ib2d8543b7f5a9acd3dcc8a36bc70915967283860
This commit is contained in:
@@ -22,7 +22,7 @@ import android.app.ActivityManagerInternal.AppBackgroundRestrictionListener;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.AppOpsManager.PackageOps;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.UidObserver;
|
||||
import android.app.usage.UsageStatsManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -716,11 +716,7 @@ public class AppStateTrackerImpl implements AppStateTracker {
|
||||
return true;
|
||||
}
|
||||
|
||||
private final class UidObserver extends IUidObserver.Stub {
|
||||
@Override
|
||||
public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
|
||||
}
|
||||
|
||||
private final class UidObserver extends android.app.UidObserver {
|
||||
@Override
|
||||
public void onUidActive(int uid) {
|
||||
mHandler.onUidActive(uid);
|
||||
@@ -740,10 +736,6 @@ public class AppStateTrackerImpl implements AppStateTracker {
|
||||
public void onUidCachedChanged(int uid, boolean cached) {
|
||||
mHandler.onUidCachedChanged(uid, cached);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidProcAdjChanged(int uid) {
|
||||
}
|
||||
}
|
||||
|
||||
private final class AppOpsWatcher extends IAppOpsCallback.Stub {
|
||||
|
||||
@@ -35,7 +35,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.UidObserver;
|
||||
import android.app.usage.UsageEvents;
|
||||
import android.app.usage.UsageStatsManagerInternal;
|
||||
import android.app.usage.UsageStatsManagerInternal.UsageEventListener;
|
||||
@@ -382,31 +382,11 @@ public final class QuotaController extends StateController {
|
||||
}
|
||||
};
|
||||
|
||||
private class QcUidObserver extends IUidObserver.Stub {
|
||||
private class QcUidObserver extends UidObserver {
|
||||
@Override
|
||||
public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
|
||||
mHandler.obtainMessage(MSG_UID_PROCESS_STATE_CHANGED, uid, procState).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidGone(int uid, boolean disabled) {
|
||||
}
|
||||
|
||||
@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) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.UidObserver;
|
||||
import android.os.RemoteException;
|
||||
import android.util.IndentingPrintWriter;
|
||||
import android.util.Slog;
|
||||
@@ -61,7 +62,7 @@ class ProcessStateModifier extends Modifier {
|
||||
@GuardedBy("mLock")
|
||||
private final SparseIntArray mUidProcStateBucketCache = new SparseIntArray();
|
||||
|
||||
private final IUidObserver mUidObserver = new IUidObserver.Stub() {
|
||||
private final IUidObserver mUidObserver = new UidObserver() {
|
||||
@Override
|
||||
public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
|
||||
final int newBucket = getProcStateBucket(procState);
|
||||
@@ -85,22 +86,6 @@ class ProcessStateModifier extends Modifier {
|
||||
notifyStateChangedLocked(uid);
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
}
|
||||
};
|
||||
|
||||
ProcessStateModifier(@NonNull InternalResourceService irs) {
|
||||
|
||||
Reference in New Issue
Block a user