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

Commit 6f09a27a authored by Austin Borger's avatar Austin Borger
Browse files

PinnerService: 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.

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: I39d5da65a3e5eff6cea00709dacee3d4b3c6075d
parent 1131b842
Loading
Loading
Loading
Loading
+4 −21
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.IActivityManager;
import android.app.IUidObserver;
import android.app.SearchManager;
import android.app.UidObserver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -360,35 +360,18 @@ public final class PinnerService extends SystemService {

    private void registerUidListener() {
        try {
            mAm.registerUidObserver(new IUidObserver.Stub() {
            mAm.registerUidObserver(new UidObserver() {
                @Override
                public void onUidGone(int uid, boolean disabled) throws RemoteException {
                public void onUidGone(int uid, boolean disabled) {
                    mPinnerHandler.sendMessage(PooledLambda.obtainMessage(
                            PinnerService::handleUidGone, PinnerService.this, uid));
                }

                @Override
                public void onUidActive(int uid) throws RemoteException {
                public void onUidActive(int uid)  {
                    mPinnerHandler.sendMessage(PooledLambda.obtainMessage(
                            PinnerService::handleUidActive, PinnerService.this, uid));
                }

                @Override
                public void onUidIdle(int uid, boolean disabled) throws RemoteException {
                }

                @Override
                public void onUidStateChanged(int uid, int procState, long procStateSeq,
                        int capability) throws RemoteException {
                }

                @Override
                public void onUidCachedChanged(int uid, boolean cached) throws RemoteException {
                }

                @Override
                public void onUidProcAdjChanged(int uid) throws RemoteException {
                }
            }, UID_OBSERVER_GONE | UID_OBSERVER_ACTIVE, 0, null);
        } catch (RemoteException e) {
            Slog.e(TAG, "Failed to register uid observer", e);