Guard swipe to notification gesture with system settings preference

Bug: 154080211
Test: make and install, check the gesture works as expectedly

Change-Id: Ibd6bbd595d2fba5d68e66eb54e4a7fec160b9bf8
(cherry picked from commit 779efaca91)
This commit is contained in:
Winson Chung committed 2020-07-21 09:59:44 -07:00
1 parent fc6c42107d
commit fbb8c69a56
3 files changed
+41 -16

No files matched your search

@@ -31,6 +31,9 @@ public class SecureSettingsObserver extends ContentObserver {
public static final String NOTIFICATION_BADGING = "notification_badging";
/** Hidden field Settings.Secure.ONE_HANDED_MODE_ENABLED */
public static final String ONE_HANDED_ENABLED = "one_handed_mode_enabled";
/** Hidden field Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED */
public static final String ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED =
"swipe_bottom_to_notification_enabled";
private final ContentResolver mResolver;
private final String mKeySetting;
@@ -87,4 +90,15 @@ public class SecureSettingsObserver extends ContentObserver {
return new SecureSettingsObserver(
context.getContentResolver(), listener, ONE_HANDED_ENABLED, 1);
}
/**
* Constructs settings observer for {@link #ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED}
* preference.
*/
public static SecureSettingsObserver newSwipeToNotificationSettingsObserver(Context context,
OnChangeListener listener) {
return new SecureSettingsObserver(
context.getContentResolver(), listener,
ONE_HANDED_SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 1);
}
}