Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1131b842 authored by Austin Borger's avatar Austin Borger
Browse files

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
parent f27ce984
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.ActivityManagerInternal;
import android.app.AppGlobals;
import android.app.AppGlobals;
import android.app.IUidObserver;
import android.app.IUidObserver;
import android.app.UidObserver;
import android.app.compat.CompatChanges;
import android.app.compat.CompatChanges;
import android.app.job.IJobScheduler;
import android.app.job.IJobScheduler;
import android.app.job.IUserVisibleJobObserver;
import android.app.job.IUserVisibleJobObserver;
@@ -1250,7 +1251,7 @@ public class JobSchedulerService extends com.android.server.SystemService
        return pkg;
        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,
        @Override public void onUidStateChanged(int uid, int procState, long procStateSeq,
                int capability) {
                int capability) {
            final SomeArgs args = SomeArgs.obtain();
            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();
            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();
            mHandler.obtainMessage(MSG_UID_ACTIVE, uid, 0).sendToTarget();
        }
        }


        @Override public void onUidIdle(int uid, boolean disabled) {
        @Override public void onUidIdle(int uid, boolean disabled) {
            mHandler.obtainMessage(MSG_UID_IDLE, uid, disabled ? 1 : 0).sendToTarget();
            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() {
    public Context getTestableContext() {