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
This commit is contained in:
Jing Ji
2022-06-10 00:09:22 -07:00
parent 8dc0bab75e
commit 88ea049cf3

View File

@@ -153,7 +153,7 @@ final class PersistentDataStore {
@VisibleForTesting
PersistentDataStore(Injector injector) {
this(injector, BackgroundThread.getHandler());
this(injector, new Handler(BackgroundThread.getHandler().getLooper()));
}
@VisibleForTesting