Merge "JobSchedulerService: Use the default UidObserver implementation." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6bc8bd008d
@@ -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