JobSchedulerService: 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: Ib9d209cbe33dacae50d873c463cd1798c7746a99
This commit is contained in:
Austin Borger
2023-04-03 16:21:27 -07:00
parent f27ce9842d
commit 1131b8420b

View File

@@ -33,6 +33,7 @@ import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.AppGlobals;
import android.app.IUidObserver;
import android.app.UidObserver;
import android.app.compat.CompatChanges;
import android.app.job.IJobScheduler;
import android.app.job.IUserVisibleJobObserver;
@@ -1250,7 +1251,7 @@ public class JobSchedulerService extends com.android.server.SystemService
return pkg;
}
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) {
final SomeArgs args = SomeArgs.obtain();
@@ -1264,19 +1265,13 @@ public class JobSchedulerService extends com.android.server.SystemService
mHandler.obtainMessage(MSG_UID_GONE, uid, disabled ? 1 : 0).sendToTarget();
}
@Override public void onUidActive(int uid) throws RemoteException {
@Override public void onUidActive(int uid) {
mHandler.obtainMessage(MSG_UID_ACTIVE, uid, 0).sendToTarget();
}
@Override public void onUidIdle(int uid, boolean disabled) {
mHandler.obtainMessage(MSG_UID_IDLE, uid, disabled ? 1 : 0).sendToTarget();
}
@Override public void onUidCachedChanged(int uid, boolean cached) {
}
@Override public void onUidProcAdjChanged(int uid) {
}
};
public Context getTestableContext() {