Fix refresh in Gestures, not reflecting the changes after

toggling on/off one-handed mode

1) Remove disabling on swipe down notification.
2) Update to align asset with One-Handed mode temporarily.
3) Change some states when toggle on/off and align with
One-Handed mode.
4) Set temporary asset style to "centerInside" to avoid image
corrupted problem when device rotate.
5) Add new string on Swipe down notification toggle switch.

Bug: 177679988
Bug: 181970213

Test: manual verified on Settings > System > Gesture page
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures.OneHandedSettingsTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures
      .OneHandedAppTapsExitPreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures
      .OneHandedEnablePreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures
      .OneHandedTimeoutPreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures.OneHandedSettingsUtilsTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures.SwipeBottomToNotificationPreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings.gestures.SwipeBottomToNotificationSettingsTest"

Change-Id: Ifd2346a7694323d21eb424891987c8317847e7c5
This commit is contained in:
Jason Chang
2021-03-12 17:26:42 +08:00
parent 59aa4f9cb1
commit 858bda81f1
12 changed files with 85 additions and 84 deletions

View File

@@ -21,7 +21,7 @@
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleType="centerCrop" android:scaleType="centerInside"
android:cropToPadding="true" android:cropToPadding="true"
android:src="@drawable/one_handed_guideline" android:src="@drawable/one_handed_guideline"
android:contentDescription="@null" /> android:contentDescription="@null" />

View File

@@ -11280,8 +11280,8 @@
<!-- Title text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=60]--> <!-- Title text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=60]-->
<string name="swipe_bottom_to_notifications_title">Swipe for notifications</string> <string name="swipe_bottom_to_notifications_title">Swipe for notifications</string>
<!-- Summary text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=80]--> <!-- Summary text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=NONE]-->
<string name="swipe_bottom_to_notifications_summary">Swipe down on the bottom edge of the screen to show your notifications</string> <string name="swipe_bottom_to_notifications_summary">Swipe down on the bottom edge of the screen to show your notifications.\nYou can\'t use one-handed mode when this feature is turned on.</string>
<!-- Preference and settings suggestion title text for one handed [CHAR LIMIT=60] --> <!-- Preference and settings suggestion title text for one handed [CHAR LIMIT=60] -->
<string name="one_handed_title">One-Handed mode</string> <string name="one_handed_title">One-Handed mode</string>

View File

@@ -20,11 +20,13 @@
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/swipe_bottom_to_notifications_title"> android:title="@string/swipe_bottom_to_notifications_title">
<com.android.settings.widget.VideoPreference <com.android.settingslib.widget.LayoutPreference
android:title="@string/swipe_bottom_to_notifications_title" android:key="one_handed_header"
settings:animation="@raw/gesture_fingerprint_swipe" android:layout="@layout/one_handed_header"
settings:preview="@drawable/gesture_fingerprint_swipe" android:persistent="false"
settings:controller="com.android.settings.widget.VideoPreferenceController"/> android:selectable="false"
settings:allowDividerBelow="false"
settings:searchable="false"/>
<SwitchPreference <SwitchPreference
android:key="gesture_swipe_bottom_to_notification" android:key="gesture_swipe_bottom_to_notification"

View File

@@ -17,7 +17,6 @@
package com.android.settings.gestures; package com.android.settings.gestures;
import android.content.Context; import android.content.Context;
import android.os.SystemProperties;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.BasePreferenceController; import com.android.settings.core.BasePreferenceController;
@@ -28,15 +27,13 @@ import com.android.settings.core.TogglePreferenceController;
**/ **/
public class OneHandedEnablePreferenceController extends TogglePreferenceController { public class OneHandedEnablePreferenceController extends TogglePreferenceController {
static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";
public OneHandedEnablePreferenceController(Context context, String key) { public OneHandedEnablePreferenceController(Context context, String key) {
super(context, key); super(context, key);
} }
@Override @Override
public int getAvailabilityStatus() { public int getAvailabilityStatus() {
return SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false) return OneHandedSettingsUtils.isSupportOneHandedMode()
? BasePreferenceController.AVAILABLE ? BasePreferenceController.AVAILABLE
: BasePreferenceController.UNSUPPORTED_ON_DEVICE; : BasePreferenceController.UNSUPPORTED_ON_DEVICE;
} }
@@ -45,6 +42,7 @@ public class OneHandedEnablePreferenceController extends TogglePreferenceControl
public boolean setChecked(boolean isChecked) { public boolean setChecked(boolean isChecked) {
OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext, OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext,
isChecked); isChecked);
OneHandedSettingsUtils.setSwipeDownNotificationEnabled(mContext, !isChecked);
return true; return true;
} }

View File

@@ -18,7 +18,6 @@ package com.android.settings.gestures;
import android.app.settings.SettingsEnums; import android.app.settings.SettingsEnums;
import android.content.Context; import android.content.Context;
import android.os.SystemProperties;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment; import com.android.settings.dashboard.DashboardFragment;
@@ -52,8 +51,7 @@ public class OneHandedSettings extends DashboardFragment {
new BaseSearchIndexProvider(R.xml.one_handed_settings) { new BaseSearchIndexProvider(R.xml.one_handed_settings) {
@Override @Override
protected boolean isPageSearchEnabled(Context context) { protected boolean isPageSearchEnabled(Context context) {
return SystemProperties.getBoolean( return OneHandedSettingsUtils.isSupportOneHandedMode();
OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, false);
} }
}; };
} }

View File

@@ -22,6 +22,7 @@ import android.database.ContentObserver;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.SystemProperties;
import android.provider.Settings; import android.provider.Settings;
/** /**
@@ -29,6 +30,8 @@ import android.provider.Settings;
*/ */
public class OneHandedSettingsUtils { public class OneHandedSettingsUtils {
static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";
public enum OneHandedTimeout { public enum OneHandedTimeout {
NEVER(0), SHORT(4), MEDIUM(8), LONG(12); NEVER(0), SHORT(4), MEDIUM(8), LONG(12);
@@ -51,6 +54,13 @@ public class OneHandedSettingsUtils {
mSettingsObserver = new SettingsObserver(new Handler(Looper.getMainLooper())); mSettingsObserver = new SettingsObserver(new Handler(Looper.getMainLooper()));
} }
/**
* Get One-Handed mode support flag.
*/
public static boolean isSupportOneHandedMode() {
return SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false);
}
/** /**
* Get one-handed mode enable or disable flag from Settings provider. * Get one-handed mode enable or disable flag from Settings provider.
* *
@@ -118,6 +128,28 @@ public class OneHandedSettingsUtils {
Settings.Secure.ONE_HANDED_MODE_TIMEOUT, timeout); Settings.Secure.ONE_HANDED_MODE_TIMEOUT, timeout);
} }
/**
* Get Swipe-down-notification enable or disable flag from Settings provider.
*
* @param context App context
* @return enable or disable Swipe-down-notification flag.
*/
public static boolean isSwipeDownNotificationEnabled(Context context) {
return Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0) == 1;
}
/**
* Set Swipe-down-notification enable or disable flag to Settings provider.
*
* @param context App context
* @param enable enable or disable Swipe-down-notification.
*/
public static void setSwipeDownNotificationEnabled(Context context, boolean enable) {
Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, enable ? 1 : 0);
}
/** /**
* Register callback for observing Settings.Secure.ONE_HANDED_MODE_ENABLED state. * Register callback for observing Settings.Secure.ONE_HANDED_MODE_ENABLED state.
* @param callback for state changes * @param callback for state changes

View File

@@ -16,14 +16,8 @@
package com.android.settings.gestures; package com.android.settings.gestures;
import static android.provider.Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED;
import static com.android.settings.gestures.OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE;
import android.content.Context; import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController; import com.android.settings.core.TogglePreferenceController;
@@ -33,32 +27,20 @@ import com.android.settings.core.TogglePreferenceController;
**/ **/
public class SwipeBottomToNotificationPreferenceController extends TogglePreferenceController { public class SwipeBottomToNotificationPreferenceController extends TogglePreferenceController {
private static final int ON = 1;
private static final int OFF = 0;
private static final String PREF_KEY = "gesture_swipe_bottom_to_notification"; private static final String PREF_KEY = "gesture_swipe_bottom_to_notification";
public SwipeBottomToNotificationPreferenceController(Context context, String key) { public SwipeBottomToNotificationPreferenceController(Context context, String key) {
super(context, key); super(context, key);
} }
/** Indicates whether the gesture is available or not. */
public static boolean isGestureAvailable(Context context) {
// Disable the gesture once One-Handed mode gesture enabled.
if (SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false)) {
return !OneHandedSettingsUtils.isOneHandedModeEnabled(context);
}
return true;
}
@Override @Override
public int getAvailabilityStatus() { public int getAvailabilityStatus() {
return isGestureAvailable(mContext) ? AVAILABLE : DISABLED_DEPENDENT_SETTING; return OneHandedSettingsUtils.isSupportOneHandedMode() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
} }
@Override @Override
public boolean isSliceable() { public boolean isSliceable() {
return TextUtils.equals(getPreferenceKey(), PREF_KEY); return true;
} }
@Override @Override
@@ -68,15 +50,16 @@ public class SwipeBottomToNotificationPreferenceController extends TogglePrefere
@Override @Override
public boolean setChecked(boolean isChecked) { public boolean setChecked(boolean isChecked) {
Settings.Secure.putInt(mContext.getContentResolver(), if (isChecked) {
SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, isChecked ? ON : OFF); OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext, false);
}
OneHandedSettingsUtils.setSwipeDownNotificationEnabled(mContext, isChecked);
return true; return true;
} }
@Override @Override
public boolean isChecked() { public boolean isChecked() {
return Settings.Secure.getInt(mContext.getContentResolver(), return OneHandedSettingsUtils.isSwipeDownNotificationEnabled(mContext);
SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, OFF) == ON;
} }
@Override @Override

View File

@@ -50,8 +50,10 @@ public class SwipeBottomToNotificationSettings extends DashboardFragment {
@Override @Override
protected boolean isPageSearchEnabled(Context context) { protected boolean isPageSearchEnabled(Context context) {
return SwipeBottomToNotificationPreferenceController if (!OneHandedSettingsUtils.isSupportOneHandedMode()) {
.isGestureAvailable(context); return false;
}
return !OneHandedSettingsUtils.isOneHandedModeEnabled(context);
} }
}; };
} }

View File

@@ -51,14 +51,16 @@ public class OneHandedEnablePreferenceControllerTest {
public void setChecked_setBoolean_checkIsTrueOrFalse() { public void setChecked_setBoolean_checkIsTrueOrFalse() {
mController.setChecked(false); mController.setChecked(false);
assertThat(OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)).isFalse(); assertThat(OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)).isFalse();
assertThat(OneHandedSettingsUtils.isSwipeDownNotificationEnabled(mContext)).isTrue();
mController.setChecked(true); mController.setChecked(true);
assertThat(OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)).isTrue(); assertThat(OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)).isTrue();
assertThat(OneHandedSettingsUtils.isSwipeDownNotificationEnabled(mContext)).isFalse();
} }
@Test @Test
public void getAvailabilityStatus_setSupportOneHandedModeProperty_shouldAvailable() { public void getAvailabilityStatus_setSupportOneHandedModeProperty_shouldAvailable() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
assertThat(mController.getAvailabilityStatus()) assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.AVAILABLE); .isEqualTo(BasePreferenceController.AVAILABLE);
@@ -66,7 +68,7 @@ public class OneHandedEnablePreferenceControllerTest {
@Test @Test
public void getAvailabilityStatus_unsetSupportOneHandedModeProperty_shouldUnsupported() { public void getAvailabilityStatus_unsetSupportOneHandedModeProperty_shouldUnsupported() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "false");
assertThat(mController.getAvailabilityStatus()) assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.UNSUPPORTED_ON_DEVICE); .isEqualTo(BasePreferenceController.UNSUPPORTED_ON_DEVICE);

View File

@@ -55,7 +55,7 @@ public class OneHandedSettingsTest {
@Test @Test
public void isPageSearchEnabled_setSupportOneHandedModeProperty_shouldReturnTrue() { public void isPageSearchEnabled_setSupportOneHandedModeProperty_shouldReturnTrue() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
final Object obj = ReflectionHelpers.callInstanceMethod( final Object obj = ReflectionHelpers.callInstanceMethod(
OneHandedSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled", OneHandedSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled",
@@ -66,7 +66,7 @@ public class OneHandedSettingsTest {
@Test @Test
public void isPageSearchEnabled_unsetSupportOneHandedModeProperty_shouldReturnFalse() { public void isPageSearchEnabled_unsetSupportOneHandedModeProperty_shouldReturnFalse() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "false");
final Object obj = ReflectionHelpers.callInstanceMethod( final Object obj = ReflectionHelpers.callInstanceMethod(
OneHandedSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled", OneHandedSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled",

View File

@@ -16,10 +16,7 @@
package com.android.settings.gestures; package com.android.settings.gestures;
import static android.provider.Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED;
import static com.android.settings.core.BasePreferenceController.AVAILABLE; import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
@@ -28,6 +25,7 @@ import android.os.SystemProperties;
import android.provider.Settings; import android.provider.Settings;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@@ -57,43 +55,32 @@ public class SwipeBottomToNotificationPreferenceControllerTest {
public void setChecked_toggledOn_enablesSwipeBottomToNotification() { public void setChecked_toggledOn_enablesSwipeBottomToNotification() {
mController.setChecked(true); mController.setChecked(true);
assertThat(Settings.Secure.getInt(mContext.getContentResolver(), assertThat(OneHandedSettingsUtils.isSwipeDownNotificationEnabled(mContext)).isTrue();
SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0)).isEqualTo(1); assertThat(OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)).isFalse();
} }
@Test @Test
public void setChecked_toggledOff_disablesSwipeBottomToNotification() { public void setChecked_toggledOff_disablesSwipeBottomToNotification() {
mController.setChecked(false); mController.setChecked(false);
assertThat(Settings.Secure.getInt(mContext.getContentResolver(), assertThat(OneHandedSettingsUtils.isSwipeDownNotificationEnabled(mContext)).isFalse();
SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED, 0)).isEqualTo(0);
} }
@Test @Test
public void getAvailabilityStatus_oneHandedUnsupported_returnsAvailable() { public void getAvailabilityStatus_oneHandedUnsupported_returnsUnsupport() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "false");
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BasePreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test
public void getAvailabilityStatus_oneHandedSupported_returnsAvailable() {
SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
} }
@Test
public void getAvailabilityStatus_oneHandedDisabled_returnsAvailable() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true");
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ONE_HANDED_MODE_ENABLED, 0);
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
@Test
public void getAvailabilityStatus_oneHandedEnabled_returnsDisabled() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true");
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.ONE_HANDED_MODE_ENABLED, 1);
assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
}
@Test @Test
public void getSummary_gestureEnabled_returnsOnSummary() { public void getSummary_gestureEnabled_returnsOnSummary() {
mController.setChecked(true); mController.setChecked(true);
@@ -111,8 +98,8 @@ public class SwipeBottomToNotificationPreferenceControllerTest {
} }
@Test @Test
public void getDefaultConfig_returnsOffState() { public void isChecked_getDefaultConfig_returnFalse() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "false");
Settings.Secure.resetToDefaults(mContext.getContentResolver(), Settings.Secure.resetToDefaults(mContext.getContentResolver(),
Settings.Secure.ONE_HANDED_MODE_ENABLED); Settings.Secure.ONE_HANDED_MODE_ENABLED);

View File

@@ -21,7 +21,6 @@ import static com.google.common.truth.Truth.assertThat;
import android.content.Context; import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.provider.SearchIndexableResource; import android.provider.SearchIndexableResource;
import android.provider.Settings;
import com.android.settings.R; import com.android.settings.R;
@@ -64,22 +63,21 @@ public class SwipeBottomToNotificationSettingsTest {
} }
@Test @Test
public void isPageSearchEnabled_oneHandedUnsupported_shouldReturnTrue() { public void isPageSearchEnabled_oneHandedUnsupported_shouldReturnFalse() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "false");
final Object obj = ReflectionHelpers.callInstanceMethod( final Object obj = ReflectionHelpers.callInstanceMethod(
SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled", SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled",
ReflectionHelpers.ClassParameter.from(Context.class, mContext)); ReflectionHelpers.ClassParameter.from(Context.class, mContext));
final boolean isEnabled = (Boolean) obj; final boolean isEnabled = (Boolean) obj;
assertThat(isEnabled).isTrue(); assertThat(isEnabled).isFalse();
} }
@Test @Test
public void isPageSearchEnabled_oneHandedDisabled_shouldReturnTrue() { public void isPageSearchEnabled_oneHandedDisabled_shouldReturnTrue() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
Settings.Secure.putInt(mContext.getContentResolver(), OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext, false);
Settings.Secure.ONE_HANDED_MODE_ENABLED, 0);
final Object obj = ReflectionHelpers.callInstanceMethod( final Object obj = ReflectionHelpers.callInstanceMethod(
SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled", SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled",
@@ -91,9 +89,8 @@ public class SwipeBottomToNotificationSettingsTest {
@Test @Test
public void isPageSearchEnabled_oneHandedEnabled_shouldReturnFalse() { public void isPageSearchEnabled_oneHandedEnabled_shouldReturnFalse() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true"); SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
Settings.Secure.putInt(mContext.getContentResolver(), OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext, true);
Settings.Secure.ONE_HANDED_MODE_ENABLED, 1);
final Object obj = ReflectionHelpers.callInstanceMethod( final Object obj = ReflectionHelpers.callInstanceMethod(
SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled", SwipeBottomToNotificationSettings.SEARCH_INDEX_DATA_PROVIDER, "isPageSearchEnabled",