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

Commit fa2d37a0 authored by Austin Borger's avatar Austin Borger Committed by Automerger Merge Worker
Browse files

Merge "GameManagerService: Use the default UidObserver implementation." into...

Merge "GameManagerService: Use the default UidObserver implementation." into udc-dev am: 84ee359a am: 352f2558

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22366506



Change-Id: I1563b1b75e598c1b8737c35015e3bf8ad9782130
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 52927b71 352f2558
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2371,10 +2371,10 @@ HSPLcom/android/server/am/UserController;->unsafeConvertIncomingUser(I)I
HSPLcom/android/server/am/UserController;->updateStartedUserArrayLU()V
HSPLcom/android/server/am/UserState;-><init>(Landroid/os/UserHandle;)V
HSPLcom/android/server/app/GameManagerService$LocalService;->getResolutionScalingFactor(Ljava/lang/String;I)F
HSPLcom/android/server/app/GameManagerService$UidObserver$$ExternalSyntheticLambda0;-><init>(Lcom/android/server/app/GameManagerService$UidObserver;I)V
HSPLcom/android/server/app/GameManagerService$UidObserver$$ExternalSyntheticLambda0;->test(Ljava/lang/Object;)Z
HSPLcom/android/server/app/GameManagerService$UidObserver;->disableGameMode(I)V+]Ljava/util/Set;Ljava/util/HashSet;]Landroid/os/PowerManagerInternal;Lcom/android/server/power/PowerManagerService$LocalService;
HSPLcom/android/server/app/GameManagerService$UidObserver;->onUidStateChanged(IIJI)V+]Lcom/android/server/app/GameManagerService$UidObserver;Lcom/android/server/app/GameManagerService$UidObserver;]Ljava/util/stream/Stream;Ljava/util/stream/ReferencePipeline$Head;]Landroid/content/Context;Landroid/app/ContextImpl;]Landroid/content/pm/PackageManager;Landroid/app/ApplicationPackageManager;]Landroid/os/PowerManagerInternal;Lcom/android/server/power/PowerManagerService$LocalService;]Ljava/util/Set;Ljava/util/HashSet;
HSPLcom/android/server/app/GameManagerService$MyUidObserver$$ExternalSyntheticLambda0;-><init>(Lcom/android/server/app/GameManagerService$MyUidObserver;I)V
HSPLcom/android/server/app/GameManagerService$MyUidObserver$$ExternalSyntheticLambda0;->test(Ljava/lang/Object;)Z
HSPLcom/android/server/app/GameManagerService$MyUidObserver;->disableGameMode(I)V+]Ljava/util/Set;Ljava/util/HashSet;]Landroid/os/PowerManagerInternal;Lcom/android/server/power/PowerManagerService$LocalService;
HSPLcom/android/server/app/GameManagerService$MyUidObserver;->onUidStateChanged(IIJI)V+]Lcom/android/server/app/GameManagerService$MyUidObserver;Lcom/android/server/app/GameManagerService$MyUidObserver;]Ljava/util/stream/Stream;Ljava/util/stream/ReferencePipeline$Head;]Landroid/content/Context;Landroid/app/ContextImpl;]Landroid/content/pm/PackageManager;Landroid/app/ApplicationPackageManager;]Landroid/os/PowerManagerInternal;Lcom/android/server/power/PowerManagerService$LocalService;]Ljava/util/Set;Ljava/util/HashSet;
HSPLcom/android/server/app/GameManagerService;->-$$Nest$fgetmContext(Lcom/android/server/app/GameManagerService;)Landroid/content/Context;
HSPLcom/android/server/app/GameManagerService;->-$$Nest$fgetmForegroundGameUids(Lcom/android/server/app/GameManagerService;)Ljava/util/Set;
HSPLcom/android/server/app/GameManagerService;->-$$Nest$fgetmUidObserverLock(Lcom/android/server/app/GameManagerService;)Ljava/lang/Object;
+4 −16
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ import android.app.GameModeInfo;
import android.app.GameState;
import android.app.IGameManagerService;
import android.app.IGameModeListener;
import android.app.IUidObserver;
import android.app.StatsManager;
import android.app.UidObserver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -169,7 +169,7 @@ public final class GameManagerService extends IGameManagerService.Stub {
    private final Object mUidObserverLock = new Object();
    @VisibleForTesting
    @Nullable
    final UidObserver mUidObserver;
    final MyUidObserver mUidObserver;
    @GuardedBy("mUidObserverLock")
    private final Set<Integer> mForegroundGameUids = new HashSet<>();

@@ -209,7 +209,7 @@ public final class GameManagerService extends IGameManagerService.Stub {
        } else {
            mGameServiceController = null;
        }
        mUidObserver = new UidObserver();
        mUidObserver = new MyUidObserver();
        try {
            ActivityManager.getService().registerUidObserver(mUidObserver,
                    ActivityManager.UID_OBSERVER_PROCSTATE | ActivityManager.UID_OBSERVER_GONE,
@@ -2143,10 +2143,7 @@ public final class GameManagerService extends IGameManagerService.Stub {
     */
    private static native void nativeSetOverrideFrameRate(int uid, float frameRate);

    final class UidObserver extends IUidObserver.Stub {
        @Override
        public void onUidIdle(int uid, boolean disabled) {}

    final class MyUidObserver extends UidObserver {
        @Override
        public void onUidGone(int uid, boolean disabled) {
            synchronized (mUidObserverLock) {
@@ -2154,9 +2151,6 @@ public final class GameManagerService extends IGameManagerService.Stub {
            }
        }

        @Override
        public void onUidActive(int uid) {}

        @Override
        public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
            synchronized (mUidObserverLock) {
@@ -2197,11 +2191,5 @@ public final class GameManagerService extends IGameManagerService.Stub {
                mPowerManagerInternal.setPowerMode(Mode.GAME, false);
            }
        }

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

        @Override
        public void onUidProcAdjChanged(int uid) {}
    }
}