From 88ea049cf338953f5f57da9ca986119a96e44f46 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Fri, 10 Jun 2022 00:09:22 -0700 Subject: 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 --- services/core/java/com/android/server/display/PersistentDataStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3-59-g8ed1b