diff options
author | 2023-03-30 18:41:36 -0700 | |
---|---|---|
committer | 2023-04-03 17:01:40 -0700 | |
commit | 35d65d6d5f01b70497a7769255739b201fb45fbd (patch) | |
tree | 2d29e8a94014d3de78faac57853ac682932350b5 | |
parent | db283b2fea64762064477d93fe1a656bfbaed3b9 (diff) |
HintManagerService: 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.
Bug: 274486653
Test: Presubmit, smoke test on cuttlefish.
Change-Id: I0ba59aefae0ad51386333767317d3b4e9ff93456
-rw-r--r-- | services/art-profile | 18 | ||||
-rw-r--r-- | services/core/java/com/android/server/power/hint/HintManagerService.java | 24 |
2 files changed, 13 insertions, 29 deletions
diff --git a/services/art-profile b/services/art-profile index 64c7f3d249c7..26a9c3b1737c 100644 --- a/services/art-profile +++ b/services/art-profile @@ -9213,7 +9213,7 @@ HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;-><init>(Lco HPLcom/android/server/power/hint/HintManagerService$AppHintSession;->close()V HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;->reportActualWorkDuration([J[J)V+]Lcom/android/server/power/hint/HintManagerService$NativeWrapper;Lcom/android/server/power/hint/HintManagerService$NativeWrapper;]Lcom/android/server/power/hint/HintManagerService$AppHintSession;Lcom/android/server/power/hint/HintManagerService$AppHintSession; HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;->sendHint(I)V+]Lcom/android/server/power/hint/HintManagerService$NativeWrapper;Lcom/android/server/power/hint/HintManagerService$NativeWrapper;]Lcom/android/server/power/hint/HintManagerService$AppHintSession;Lcom/android/server/power/hint/HintManagerService$AppHintSession; -HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;->updateHintAllowed()Z+]Lcom/android/server/power/hint/HintManagerService$UidObserver;Lcom/android/server/power/hint/HintManagerService$UidObserver;]Lcom/android/server/power/hint/HintManagerService$AppHintSession;Lcom/android/server/power/hint/HintManagerService$AppHintSession; +HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;->updateHintAllowed()Z+]Lcom/android/server/power/hint/HintManagerService$MyUidObserver;Lcom/android/server/power/hint/HintManagerService$MyUidObserver;]Lcom/android/server/power/hint/HintManagerService$AppHintSession;Lcom/android/server/power/hint/HintManagerService$AppHintSession; HSPLcom/android/server/power/hint/HintManagerService$AppHintSession;->updateTargetWorkDuration(J)V HSPLcom/android/server/power/hint/HintManagerService$BinderService;-><init>(Lcom/android/server/power/hint/HintManagerService;)V HSPLcom/android/server/power/hint/HintManagerService$BinderService;->createHintSession(Landroid/os/IBinder;[IJ)Landroid/os/IHintSession; @@ -9224,13 +9224,13 @@ HSPLcom/android/server/power/hint/HintManagerService$NativeWrapper;->halGetHintS HSPLcom/android/server/power/hint/HintManagerService$NativeWrapper;->halInit()V HSPLcom/android/server/power/hint/HintManagerService$NativeWrapper;->halReportActualWorkDuration(J[J[J)V HSPLcom/android/server/power/hint/HintManagerService$NativeWrapper;->halSendHint(JI)V -HSPLcom/android/server/power/hint/HintManagerService$UidObserver$$ExternalSyntheticLambda1;-><init>(Lcom/android/server/power/hint/HintManagerService$UidObserver;II)V -HSPLcom/android/server/power/hint/HintManagerService$UidObserver$$ExternalSyntheticLambda1;->run()V -HSPLcom/android/server/power/hint/HintManagerService$UidObserver;->$r8$lambda$ej6eMAvAGZXPb5YUxpIPNazvUW4(Lcom/android/server/power/hint/HintManagerService$UidObserver;II)V -HSPLcom/android/server/power/hint/HintManagerService$UidObserver;-><init>(Lcom/android/server/power/hint/HintManagerService;)V -HSPLcom/android/server/power/hint/HintManagerService$UidObserver;->isUidForeground(I)Z+]Ljava/lang/Integer;Ljava/lang/Integer;]Landroid/util/SparseArray;Landroid/util/SparseArray; -HSPLcom/android/server/power/hint/HintManagerService$UidObserver;->lambda$onUidStateChanged$1(II)V+]Landroid/util/ArrayMap;Landroid/util/ArrayMap;]Landroid/util/SparseArray;Landroid/util/SparseArray;]Ljava/util/Collection;Landroid/util/MapCollections$ValuesCollection;]Landroid/util/ArraySet;Landroid/util/ArraySet;]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator; -HSPLcom/android/server/power/hint/HintManagerService$UidObserver;->onUidStateChanged(IIJI)V+]Landroid/os/Handler;Landroid/os/Handler; +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver$$ExternalSyntheticLambda1;-><init>(Lcom/android/server/power/hint/HintManagerService$MyUidObserver;II)V +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver$$ExternalSyntheticLambda1;->run()V +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver;->$r8$lambda$ej6eMAvAGZXPb5YUxpIPNazvUW4(Lcom/android/server/power/hint/HintManagerService$MyUidObserver;II)V +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver;-><init>(Lcom/android/server/power/hint/HintManagerService;)V +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver;->isUidForeground(I)Z+]Ljava/lang/Integer;Ljava/lang/Integer;]Landroid/util/SparseArray;Landroid/util/SparseArray; +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver;->lambda$onUidStateChanged$1(II)V+]Landroid/util/ArrayMap;Landroid/util/ArrayMap;]Landroid/util/SparseArray;Landroid/util/SparseArray;]Ljava/util/Collection;Landroid/util/MapCollections$ValuesCollection;]Landroid/util/ArraySet;Landroid/util/ArraySet;]Ljava/util/Iterator;Landroid/util/MapCollections$ArrayIterator; +HSPLcom/android/server/power/hint/HintManagerService$MyUidObserver;->onUidStateChanged(IIJI)V+]Landroid/os/Handler;Landroid/os/Handler; HSPLcom/android/server/power/hint/HintManagerService;->-$$Nest$fgetmActiveSessions(Lcom/android/server/power/hint/HintManagerService;)Landroid/util/ArrayMap; HSPLcom/android/server/power/hint/HintManagerService;->-$$Nest$fgetmLock(Lcom/android/server/power/hint/HintManagerService;)Ljava/lang/Object; HSPLcom/android/server/power/hint/HintManagerService;->-$$Nest$fgetmNativeWrapper(Lcom/android/server/power/hint/HintManagerService;)Lcom/android/server/power/hint/HintManagerService$NativeWrapper; @@ -13493,7 +13493,7 @@ Lcom/android/server/power/batterysaver/BatterySavingStats; Lcom/android/server/power/hint/HintManagerService$BinderService; Lcom/android/server/power/hint/HintManagerService$Injector; Lcom/android/server/power/hint/HintManagerService$NativeWrapper; -Lcom/android/server/power/hint/HintManagerService$UidObserver; +Lcom/android/server/power/hint/HintManagerService$MyUidObserver; Lcom/android/server/power/hint/HintManagerService; Lcom/android/server/power/stats/BatteryExternalStatsWorker$$ExternalSyntheticLambda0; Lcom/android/server/power/stats/BatteryExternalStatsWorker$$ExternalSyntheticLambda3; diff --git a/services/core/java/com/android/server/power/hint/HintManagerService.java b/services/core/java/com/android/server/power/hint/HintManagerService.java index 1a22b8904579..1a91d252c431 100644 --- a/services/core/java/com/android/server/power/hint/HintManagerService.java +++ b/services/core/java/com/android/server/power/hint/HintManagerService.java @@ -19,8 +19,8 @@ package com.android.server.power.hint; import android.annotation.NonNull; import android.app.ActivityManager; import android.app.ActivityManagerInternal; -import android.app.IUidObserver; import android.app.StatsManager; +import android.app.UidObserver; import android.content.Context; import android.os.Binder; import android.os.IBinder; @@ -69,7 +69,7 @@ public final class HintManagerService extends SystemService { /** Lock to protect HAL handles and listen list. */ private final Object mLock = new Object(); - @VisibleForTesting final UidObserver mUidObserver; + @VisibleForTesting final MyUidObserver mUidObserver; private final NativeWrapper mNativeWrapper; @@ -94,7 +94,7 @@ public final class HintManagerService extends SystemService { mNativeWrapper = injector.createNativeWrapper(); mNativeWrapper.halInit(); mHintSessionPreferredRate = mNativeWrapper.halGetHintSessionPreferredRate(); - mUidObserver = new UidObserver(); + mUidObserver = new MyUidObserver(); mAmInternal = Objects.requireNonNull( LocalServices.getService(ActivityManagerInternal.class)); } @@ -246,7 +246,7 @@ public final class HintManagerService extends SystemService { } @VisibleForTesting - final class UidObserver extends IUidObserver.Stub { + final class MyUidObserver extends UidObserver { private final SparseArray<Integer> mProcStatesCache = new SparseArray<>(); public boolean isUidForeground(int uid) { @@ -276,14 +276,6 @@ public final class HintManagerService extends SystemService { }); } - @Override - public void onUidActive(int uid) { - } - - @Override - public void onUidIdle(int uid, boolean disabled) { - } - /** * The IUidObserver callback is called from the system_server, so it'll be a direct function * call from ActivityManagerService. Do not do heavy logic here. @@ -305,14 +297,6 @@ public final class HintManagerService extends SystemService { } }); } - - @Override - public void onUidCachedChanged(int uid, boolean cached) { - } - - @Override - public void onUidProcAdjChanged(int uid) { - } } @VisibleForTesting |