From fc7fbdb8ae620e320ad21d53a0fcf90c42cf8638 Mon Sep 17 00:00:00 2001 From: Jason Chang Date: Fri, 11 Dec 2020 00:28:57 +0800 Subject: [PATCH] Fix swipe for notification default should be on instead of off Set default "ON" when we can not get SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED value. Bug: 175084985 Test: manual check Settings > System > Gesture > Swipe for notifications Test: manual check it is disabled after One-handed mode toggled on Test: make RunSettingsRoboTests ROBOTEST_FILTER=\ "SwipeBottomToNotificationSettingsTest" Test: make RunSettingsRoboTests ROBOTEST_FILTER=\ "SwipeBottomToNotificationPreferenceControllerTest" Change-Id: I176ba1c0e18c5ed7d1582d380db6ec190b6e1dec --- .../SwipeBottomToNotificationPreferenceController.java | 2 +- .../SwipeBottomToNotificationPreferenceControllerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceController.java b/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceController.java index 5eba5394388..04a32de6bd8 100644 --- a/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceController.java +++ b/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceController.java @@ -76,7 +76,7 @@ public class SwipeBottomToNotificationPreferenceController extends TogglePrefere @Override public boolean isChecked() { return Settings.Secure.getInt(mContext.getContentResolver(), - SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, OFF) == ON; + SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, ON) == ON; } @Override diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceControllerTest.java index db51dffcec0..a1c0c8f5396 100644 --- a/tests/robotests/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/gestures/SwipeBottomToNotificationPreferenceControllerTest.java @@ -58,7 +58,7 @@ public class SwipeBottomToNotificationPreferenceControllerTest { mController.setChecked(true); assertThat(Settings.Secure.getInt(mContext.getContentResolver(), - SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0)).isEqualTo(1); + SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 1)).isEqualTo(1); } @Test @@ -66,7 +66,7 @@ public class SwipeBottomToNotificationPreferenceControllerTest { mController.setChecked(false); assertThat(Settings.Secure.getInt(mContext.getContentResolver(), - SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0)).isEqualTo(0); + SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 1)).isEqualTo(0); } @Test