Loading quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java +1 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading src/com/android/launcher3/LauncherAppState.java +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class LauncherAppState { mNotificationSettingsChangedListener = this::onNotificationSettingsChanged; mSettingsCache.register(NOTIFICATION_BADGING_URI, mNotificationSettingsChangedListener); mSettingsCache.dispatchOnChange(NOTIFICATION_BADGING_URI); onNotificationSettingsChanged(mSettingsCache.getValue(NOTIFICATION_BADGING_URI)); } public LauncherAppState(Context context, @Nullable String iconCacheFileName) { Loading src/com/android/launcher3/notification/NotificationListener.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.launcher3.notification; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import android.annotation.TargetApi; import android.app.Notification; Loading @@ -37,8 +37,8 @@ import androidx.annotation.AnyThread; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.SettingsCache; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -213,7 +213,7 @@ public class NotificationListener extends NotificationListenerService { mNotificationSettingsChangedListener = this::onNotificationSettingsChanged; mSettingsCache.register(NOTIFICATION_BADGING_URI, mNotificationSettingsChangedListener); mSettingsCache.dispatchOnChange(NOTIFICATION_BADGING_URI); onNotificationSettingsChanged(mSettingsCache.getValue(NOTIFICATION_BADGING_URI)); onNotificationFullRefresh(); } Loading src/com/android/launcher3/settings/NotificationDotsPreference.java +34 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.launcher3.settings; import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY; import static com.android.launcher3.settings.SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import android.app.AlertDialog; import android.app.Dialog; Loading @@ -24,6 +26,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.ContentObserver; import android.os.Bundle; import android.provider.Settings; import android.util.AttributeSet; Loading @@ -49,6 +52,14 @@ public class NotificationDotsPreference extends Preference /** Hidden field Settings.Secure.ENABLED_NOTIFICATION_LISTENERS */ private static final String NOTIFICATION_ENABLED_LISTENERS = "enabled_notification_listeners"; private final ContentObserver mListenerListObserver = new ContentObserver(MAIN_EXECUTOR.getHandler()) { @Override public void onChange(boolean selfChange) { updateUI(); } }; public NotificationDotsPreference( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); Loading @@ -66,6 +77,29 @@ public class NotificationDotsPreference extends Preference super(context); } @Override public void onAttached() { super.onAttached(); SettingsCache.INSTANCE.get(getContext()).register(NOTIFICATION_BADGING_URI, this); getContext().getContentResolver().registerContentObserver( Settings.Secure.getUriFor(NOTIFICATION_ENABLED_LISTENERS), false, mListenerListObserver); updateUI(); } private void updateUI() { onSettingsChanged(SettingsCache.INSTANCE.get(getContext()) .getValue(NOTIFICATION_BADGING_URI)); } @Override public void onDetached() { super.onDetached(); SettingsCache.INSTANCE.get(getContext()).unregister(NOTIFICATION_BADGING_URI, this); getContext().getContentResolver().unregisterContentObserver(mListenerListObserver); } private void setWidgetFrameVisible(boolean isVisible) { if (mWidgetFrameVisible != isVisible) { mWidgetFrameVisible = isVisible; Loading Loading
quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading
quickstep/src/com/android/quickstep/logging/SettingsChangeLogger.java +1 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
src/com/android/launcher3/LauncherAppState.java +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class LauncherAppState { mNotificationSettingsChangedListener = this::onNotificationSettingsChanged; mSettingsCache.register(NOTIFICATION_BADGING_URI, mNotificationSettingsChangedListener); mSettingsCache.dispatchOnChange(NOTIFICATION_BADGING_URI); onNotificationSettingsChanged(mSettingsCache.getValue(NOTIFICATION_BADGING_URI)); } public LauncherAppState(Context context, @Nullable String iconCacheFileName) { Loading
src/com/android/launcher3/notification/NotificationListener.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.launcher3.notification; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import android.annotation.TargetApi; import android.app.Notification; Loading @@ -37,8 +37,8 @@ import androidx.annotation.AnyThread; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import com.android.launcher3.util.SettingsCache; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.SettingsCache; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -213,7 +213,7 @@ public class NotificationListener extends NotificationListenerService { mNotificationSettingsChangedListener = this::onNotificationSettingsChanged; mSettingsCache.register(NOTIFICATION_BADGING_URI, mNotificationSettingsChangedListener); mSettingsCache.dispatchOnChange(NOTIFICATION_BADGING_URI); onNotificationSettingsChanged(mSettingsCache.getValue(NOTIFICATION_BADGING_URI)); onNotificationFullRefresh(); } Loading
src/com/android/launcher3/settings/NotificationDotsPreference.java +34 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.launcher3.settings; import static com.android.launcher3.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY; import static com.android.launcher3.settings.SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.SettingsCache.NOTIFICATION_BADGING_URI; import android.app.AlertDialog; import android.app.Dialog; Loading @@ -24,6 +26,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.ContentObserver; import android.os.Bundle; import android.provider.Settings; import android.util.AttributeSet; Loading @@ -49,6 +52,14 @@ public class NotificationDotsPreference extends Preference /** Hidden field Settings.Secure.ENABLED_NOTIFICATION_LISTENERS */ private static final String NOTIFICATION_ENABLED_LISTENERS = "enabled_notification_listeners"; private final ContentObserver mListenerListObserver = new ContentObserver(MAIN_EXECUTOR.getHandler()) { @Override public void onChange(boolean selfChange) { updateUI(); } }; public NotificationDotsPreference( Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); Loading @@ -66,6 +77,29 @@ public class NotificationDotsPreference extends Preference super(context); } @Override public void onAttached() { super.onAttached(); SettingsCache.INSTANCE.get(getContext()).register(NOTIFICATION_BADGING_URI, this); getContext().getContentResolver().registerContentObserver( Settings.Secure.getUriFor(NOTIFICATION_ENABLED_LISTENERS), false, mListenerListObserver); updateUI(); } private void updateUI() { onSettingsChanged(SettingsCache.INSTANCE.get(getContext()) .getValue(NOTIFICATION_BADGING_URI)); } @Override public void onDetached() { super.onDetached(); SettingsCache.INSTANCE.get(getContext()).unregister(NOTIFICATION_BADGING_URI, this); getContext().getContentResolver().unregisterContentObserver(mListenerListObserver); } private void setWidgetFrameVisible(boolean isVisible) { if (mWidgetFrameVisible != isVisible) { mWidgetFrameVisible = isVisible; Loading