Save display persistent data store

Fixes the fact that brightnesses weren't saved over reboots since it was previously save very infrequently.
Save persistent data store when device locks or sleeps.

Bug: 185440868

Test: manual
Change-Id: I5ddf142787f2f71d19ab37777dcea9eac1084d21
This commit is contained in:
Fiona Campbell
2021-04-29 16:47:35 +01:00
parent 77f40a59bf
commit 304e35e30d

View File

@@ -1282,6 +1282,7 @@ public final class DisplayManagerService extends SystemService {
// this point.
sendDisplayEventLocked(displayId, DisplayManagerGlobal.EVENT_DISPLAY_CHANGED);
scheduleTraversalLocked(false);
mPersistentDataStore.saveIfNeeded();
}
private void handleLogicalDisplayFrameRateOverridesChangedLocked(
@@ -2884,6 +2885,7 @@ public final class DisplayManagerService extends SystemService {
if (dpc != null) {
dpc.putScreenBrightnessSetting(brightness);
}
mPersistentDataStore.saveIfNeeded();
}
} finally {
Binder.restoreCallingIdentity(token);