Merge "Fixing notification dots settings not updated properly" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-01 20:14:34 +00:00
committed by Android (Google) Code Review
7 changed files with 51 additions and 53 deletions

View File

@@ -187,7 +187,7 @@ public class RecentsAnimationDeviceState implements
SettingsCache.OnChangeListener onChangeListener =
enabled -> mIsOneHandedModeEnabled = enabled;
settingsCache.register(oneHandedUri, onChangeListener);
settingsCache.dispatchOnChange(oneHandedUri);
mIsOneHandedModeEnabled = settingsCache.getValue(oneHandedUri);
runOnDestroy(() -> settingsCache.unregister(oneHandedUri, onChangeListener));
} else {
mIsOneHandedModeEnabled = false;
@@ -199,7 +199,7 @@ public class RecentsAnimationDeviceState implements
SettingsCache.OnChangeListener onChangeListener =
enabled -> mIsSwipeToNotificationEnabled = enabled;
settingsCache.register(swipeBottomNotificationUri, onChangeListener);
settingsCache.dispatchOnChange(swipeBottomNotificationUri);
mIsSwipeToNotificationEnabled = settingsCache.getValue(swipeBottomNotificationUri);
runOnDestroy(() -> settingsCache.unregister(swipeBottomNotificationUri, onChangeListener));
Uri setupCompleteUri = Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE);

View File

@@ -80,7 +80,7 @@ public class SettingsChangeLogger implements
SettingsCache mSettingsCache = SettingsCache.INSTANCE.get(context);
mSettingsCache.register(NOTIFICATION_BADGING_URI,
this::onNotificationDotsChanged);
mSettingsCache.dispatchOnChange(NOTIFICATION_BADGING_URI);
onNotificationDotsChanged(mSettingsCache.getValue(NOTIFICATION_BADGING_URI));
}
private static ArrayMap<String, LoggablePref> loadPrefKeys(Context context) {