UsageStatsService: 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: Ia6eec806b0f36837e8b058828f6bb05f2981b05c
This commit is contained in:
@@ -46,6 +46,7 @@ import android.app.ActivityManager.ProcessState;
|
||||
import android.app.AppOpsManager;
|
||||
import android.app.IUidObserver;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.UidObserver;
|
||||
import android.app.admin.DevicePolicyManagerInternal;
|
||||
import android.app.usage.AppLaunchEstimateInfo;
|
||||
import android.app.usage.AppStandbyInfo;
|
||||
@@ -592,33 +593,17 @@ public class UsageStatsService extends SystemService implements
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
mHandler.obtainMessage(MSG_UID_STATE_CHANGED, uid, procState).sendToTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidIdle(int uid, boolean disabled) {
|
||||
// Ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidGone(int uid, boolean disabled) {
|
||||
onUidStateChanged(uid, ActivityManager.PROCESS_STATE_NONEXISTENT, 0,
|
||||
ActivityManager.PROCESS_CAPABILITY_NONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUidActive(int uid) {
|
||||
// Ignored
|
||||
}
|
||||
|
||||
@Override public void onUidCachedChanged(int uid, boolean cached) {
|
||||
}
|
||||
|
||||
@Override public void onUidProcAdjChanged(int uid) {
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user