summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jing Ji <jji@google.com> 2022-06-10 00:09:22 -0700
committer Jing Ji <jji@google.com> 2022-06-10 00:09:22 -0700
commit88ea049cf338953f5f57da9ca986119a96e44f46 (patch)
tree9705e2893a51dad2dfb60431cb06acf5768b054e
parent8dc0bab75eb2d2a24df328fa4ab57d8e6e821940 (diff)
Create its own Handler instance for persisting display brightness
The BackgroundThread.sHandler is shared among the system_server, removing the messages from it would break other part of the system. Create its own handler instance when saving brightness into persistent data store. Bug: 235173102 Test: atest PersistentDataStoreTest Test: dumpsys activity -a && check the content providers Change-Id: I6345ec84ef7d01301234541e4415cafb0ad2075b
-rw-r--r--services/core/java/com/android/server/display/PersistentDataStore.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/display/PersistentDataStore.java b/services/core/java/com/android/server/display/PersistentDataStore.java
index 59daee9ea2ff..b9a0738d15c4 100644
--- a/services/core/java/com/android/server/display/PersistentDataStore.java
+++ b/services/core/java/com/android/server/display/PersistentDataStore.java
@@ -153,7 +153,7 @@ final class PersistentDataStore {
@VisibleForTesting
PersistentDataStore(Injector injector) {
- this(injector, BackgroundThread.getHandler());
+ this(injector, new Handler(BackgroundThread.getHandler().getLooper()));
}
@VisibleForTesting