Merge "Renaming gesture"
diff --git a/res/drawable-nodpi/gesture_ambient_reach b/res/drawable-nodpi/gesture_ambient_wake_lock_screen
similarity index 100%
rename from res/drawable-nodpi/gesture_ambient_reach
rename to res/drawable-nodpi/gesture_ambient_wake_lock_screen
diff --git a/res/raw/gesture_ambient_reach.mp4 b/res/raw/gesture_ambient_wake_lock_screen.mp4
similarity index 100%
rename from res/raw/gesture_ambient_reach.mp4
rename to res/raw/gesture_ambient_wake_lock_screen.mp4
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0de3901f..413dc00 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9585,10 +9585,10 @@
     <!-- Summary text for ambient display (device) [CHAR LIMIT=NONE]-->
     <string name="ambient_display_pickup_summary" product="device">To check time, notifications, and other info, pick up your device.</string>
 
-    <!-- Preference and settings suggestion title text for reach gesture [CHAR LIMIT=60]-->
-    <string name="ambient_display_reach_title">Reach gesture</string>
+    <!-- Preference and settings suggestion title text for gesture that shows the lock screen [CHAR LIMIT=60]-->
+    <string name="ambient_display_wake_lock_screen_title">Wake lock screen gesture</string>
     <!-- Summary text for ambient display [CHAR LIMIT=NONE]-->
-    <string name="ambient_display_reach_summary" product="default"></string>
+    <string name="ambient_display_wake_lock_screen_summary" product="default"></string>
 
     <!-- Title text for swiping downwards on fingerprint sensor for notifications [CHAR LIMIT=80]-->
     <string name="fingerprint_swipe_for_notifications_title">Swipe fingerprint for notifications</string>
diff --git a/res/xml/gestures.xml b/res/xml/gestures.xml
index aa99446..211157c 100644
--- a/res/xml/gestures.xml
+++ b/res/xml/gestures.xml
@@ -28,10 +28,10 @@
         settings:controller="com.android.settings.gestures.AssistGestureSettingsPreferenceController" />
 
     <Preference
-        android:key="gesture_reach_summary"
-        android:title="@string/ambient_display_reach_title"
-        android:fragment="com.android.settings.gestures.ReachGestureSettings"
-        settings:controller="com.android.settings.gestures.ReachGesturePreferenceController" />
+        android:key="gesture_wake_lock_screen_summary"
+        android:title="@string/ambient_display_wake_lock_screen_title"
+        android:fragment="com.android.settings.gestures.WakeLockScreenGestureSettings"
+        settings:controller="com.android.settings.gestures.WakeLockScreenGesturePreferenceController" />
 
     <Preference
         android:key="gesture_swipe_down_fingerprint_input_summary"
diff --git a/res/xml/reach_gesture_settings.xml b/res/xml/wake_lock_screen_gesture_settings.xml
similarity index 62%
rename from res/xml/reach_gesture_settings.xml
rename to res/xml/wake_lock_screen_gesture_settings.xml
index e933e15..5491bb1 100644
--- a/res/xml/reach_gesture_settings.xml
+++ b/res/xml/wake_lock_screen_gesture_settings.xml
@@ -18,20 +18,20 @@
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:key="gesture_reach_screen"
-    android:title="@string/ambient_display_reach_title">
+    android:key="gesture_wake_lock_screen_screen"
+    android:title="@string/ambient_display_wake_lock_screen_title">
 
     <com.android.settings.widget.VideoPreference
-        android:key="gesture_reach_video"
-        app:animation="@raw/gesture_ambient_reach"
-        app:preview="@drawable/gesture_ambient_reach" />
+        android:key="gesture_wake_lock_screen_video"
+        app:animation="@raw/gesture_ambient_wake_lock_screen"
+        app:preview="@drawable/gesture_ambient_wake_lock_screen" />
 
     <SwitchPreference
-        android:key="gesture_reach"
-        android:title="@string/ambient_display_reach_title"
-        android:summary="@string/ambient_display_reach_summary"
+        android:key="gesture_wake_lock_screen"
+        android:title="@string/ambient_display_wake_lock_screen_title"
+        android:summary="@string/ambient_display_wake_lock_screen_summary"
         app:keywords="@string/keywords_gesture"
-        app:controller="com.android.settings.gestures.ReachGesturePreferenceController"
+        app:controller="com.android.settings.gestures.WakeLockScreenGesturePreferenceController"
         app:allowDividerAbove="true" />
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/gestures/ReachGesturePreferenceController.java b/src/com/android/settings/gestures/WakeLockScreenGesturePreferenceController.java
similarity index 69%
rename from src/com/android/settings/gestures/ReachGesturePreferenceController.java
rename to src/com/android/settings/gestures/WakeLockScreenGesturePreferenceController.java
index 6bfe4f3..1f1630e 100644
--- a/src/com/android/settings/gestures/ReachGesturePreferenceController.java
+++ b/src/com/android/settings/gestures/WakeLockScreenGesturePreferenceController.java
@@ -16,7 +16,7 @@
 
 package com.android.settings.gestures;
 
-import static android.provider.Settings.Secure.DOZE_REACH_GESTURE;
+import static android.provider.Settings.Secure.DOZE_WAKE_LOCK_SCREEN_GESTURE;
 
 import android.annotation.UserIdInt;
 import android.content.Context;
@@ -26,33 +26,34 @@
 
 import com.android.internal.hardware.AmbientDisplayConfiguration;
 
-public class ReachGesturePreferenceController extends GesturePreferenceController {
+public class WakeLockScreenGesturePreferenceController extends GesturePreferenceController {
 
     private static final int ON = 1;
     private static final int OFF = 0;
 
-    private static final String PREF_KEY_VIDEO = "gesture_reach_video";
-    private final String mReachUpPrefKey;
+    private static final String PREF_KEY_VIDEO = "gesture_wake_lock_screen_video";
+    private final String mWakeLockScreenPrefKey;
 
     private AmbientDisplayConfiguration mAmbientConfig;
     @UserIdInt
     private final int mUserId;
 
-    public ReachGesturePreferenceController(Context context, String key) {
+    public WakeLockScreenGesturePreferenceController(Context context, String key) {
         super(context, key);
         mUserId = UserHandle.myUserId();
-        mReachUpPrefKey = key;
+        mWakeLockScreenPrefKey = key;
     }
 
-    public ReachGesturePreferenceController setConfig(AmbientDisplayConfiguration config) {
+    public WakeLockScreenGesturePreferenceController
+        setConfig(AmbientDisplayConfiguration config) {
         mAmbientConfig = config;
         return this;
     }
 
     @Override
     public int getAvailabilityStatus() {
-        // No hardware support for Reach Gesture
-        if (!getAmbientConfig().reachGestureAvailable()) {
+        // No hardware support for this Gesture
+        if (!getAmbientConfig().wakeLockScreenGestureAvailable()) {
             return UNSUPPORTED_ON_DEVICE;
         }
 
@@ -61,7 +62,7 @@
 
     @Override
     public boolean isSliceable() {
-        return TextUtils.equals(getPreferenceKey(), "gesture_reach");
+        return TextUtils.equals(getPreferenceKey(), "gesture_wake_lock_screen");
     }
 
     @Override
@@ -71,17 +72,17 @@
 
     @Override
     public boolean isChecked() {
-        return getAmbientConfig().reachGestureEnabled(mUserId);
+        return getAmbientConfig().wakeLockScreenGestureEnabled(mUserId);
     }
 
     @Override
     public String getPreferenceKey() {
-        return mReachUpPrefKey;
+        return mWakeLockScreenPrefKey;
     }
 
     @Override
     public boolean setChecked(boolean isChecked) {
-        return Settings.Secure.putInt(mContext.getContentResolver(), DOZE_REACH_GESTURE,
+        return Settings.Secure.putInt(mContext.getContentResolver(), DOZE_WAKE_LOCK_SCREEN_GESTURE,
                 isChecked ? ON : OFF);
     }
 
diff --git a/src/com/android/settings/gestures/ReachGestureSettings.java b/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
similarity index 84%
rename from src/com/android/settings/gestures/ReachGestureSettings.java
rename to src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
index 3df9fcf..e6b7265 100644
--- a/src/com/android/settings/gestures/ReachGestureSettings.java
+++ b/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
@@ -33,12 +33,12 @@
 import java.util.List;
 
 @SearchIndexable
-public class ReachGestureSettings extends DashboardFragment {
+public class WakeLockScreenGestureSettings extends DashboardFragment {
 
-    private static final String TAG = "ReachGestureSettings";
+    private static final String TAG = "WakeLockScreenGestureSettings";
 
     public static final String PREF_KEY_SUGGESTION_COMPLETE =
-            "pref_reach_gesture_suggestion_complete";
+            "pref_wake_lock_screen_gesture_suggestion_complete";
 
     @Override
     public void onAttach(Context context) {
@@ -48,13 +48,13 @@
         SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
         prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
 
-        use(ReachGesturePreferenceController.class)
+        use(WakeLockScreenGesturePreferenceController.class)
             .setConfig(new AmbientDisplayConfiguration(context));
     }
 
     @Override
     public int getMetricsCategory() {
-        return MetricsProto.MetricsEvent.SETTINGS_GESTURE_REACH;
+        return MetricsProto.MetricsEvent.SETTINGS_GESTURE_WAKE_LOCK_SCREEN;
     }
 
     @Override
@@ -64,7 +64,7 @@
 
     @Override
     protected int getPreferenceScreenResId() {
-        return R.xml.reach_gesture_settings;
+        return R.xml.wake_lock_screen_gesture_settings;
     }
 
     public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
@@ -73,7 +73,7 @@
                 public List<SearchIndexableResource> getXmlResourcesToIndex(
                         Context context, boolean enabled) {
                     final SearchIndexableResource sir = new SearchIndexableResource(context);
-                    sir.xmlResId = R.xml.reach_gesture_settings;
+                    sir.xmlResId = R.xml.wake_lock_screen_gesture_settings;
                     return Arrays.asList(sir);
                 }
             };
diff --git a/tests/robotests/src/com/android/settings/gestures/ReachGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/WakeLockScreenGesturePreferenceControllerTest.java
similarity index 73%
rename from tests/robotests/src/com/android/settings/gestures/ReachGesturePreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/gestures/WakeLockScreenGesturePreferenceControllerTest.java
index 78e899c..c6249fb 100644
--- a/tests/robotests/src/com/android/settings/gestures/ReachGesturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/WakeLockScreenGesturePreferenceControllerTest.java
@@ -37,41 +37,41 @@
 import org.mockito.MockitoAnnotations;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-public class ReachGesturePreferenceControllerTest {
+public class WakeLockScreenGesturePreferenceControllerTest {
 
-    private static final String KEY_REACH = "gesture_reach";
+    private static final String KEY_WAKE_LOCK_SCREEN = "gesture_wake_lock_screen";
 
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private Context mContext;
     @Mock
     private AmbientDisplayConfiguration mAmbientDisplayConfiguration;
 
-    private ReachGesturePreferenceController mController;
+    private WakeLockScreenGesturePreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        mController = new ReachGesturePreferenceController(mContext, KEY_REACH);
+        mController = new WakeLockScreenGesturePreferenceController(mContext, KEY_WAKE_LOCK_SCREEN);
         mController.setConfig(mAmbientDisplayConfiguration);
     }
 
     @Test
     public void testIsChecked_configIsSet_shouldReturnTrue() {
         // Set the setting to be enabled.
-        when(mAmbientDisplayConfiguration.reachGestureEnabled(anyInt())).thenReturn(true);
+        when(mAmbientDisplayConfiguration.wakeLockScreenGestureEnabled(anyInt())).thenReturn(true);
         assertThat(mController.isChecked()).isTrue();
     }
 
     @Test
     public void testIsChecked_configIsNotSet_shouldReturnFalse() {
         // Set the setting to be disabled.
-        when(mAmbientDisplayConfiguration.reachGestureEnabled(anyInt())).thenReturn(false);
+        when(mAmbientDisplayConfiguration.wakeLockScreenGestureEnabled(anyInt())).thenReturn(false);
         assertThat(mController.isChecked()).isFalse();
     }
 
     @Test
     public void getAvailabilityStatus_gestureNotSupported_UNSUPPORTED_ON_DEVICE() {
-        when(mAmbientDisplayConfiguration.reachGestureAvailable()).thenReturn(false);
+        when(mAmbientDisplayConfiguration.wakeLockScreenGestureAvailable()).thenReturn(false);
         final int availabilityStatus = mController.getAvailabilityStatus();
 
         assertThat(availabilityStatus).isEqualTo(UNSUPPORTED_ON_DEVICE);
@@ -79,7 +79,7 @@
 
     @Test
     public void getAvailabilityStatus_gestureSupported_AVAILABLE() {
-        when(mAmbientDisplayConfiguration.reachGestureAvailable()).thenReturn(true);
+        when(mAmbientDisplayConfiguration.wakeLockScreenGestureAvailable()).thenReturn(true);
         final int availabilityStatus = mController.getAvailabilityStatus();
 
         assertThat(availabilityStatus).isEqualTo(AVAILABLE);
@@ -87,15 +87,15 @@
 
     @Test
     public void isSliceableCorrectKey_returnsTrue() {
-        final ReachGesturePreferenceController controller =
-                new ReachGesturePreferenceController(mContext, "gesture_reach");
+        final WakeLockScreenGesturePreferenceController controller =
+                new WakeLockScreenGesturePreferenceController(mContext, KEY_WAKE_LOCK_SCREEN);
         assertThat(controller.isSliceable()).isTrue();
     }
 
     @Test
     public void isSliceableIncorrectKey_returnsFalse() {
-        final ReachGesturePreferenceController controller =
-                new ReachGesturePreferenceController(mContext, "bad_key");
+        final WakeLockScreenGesturePreferenceController controller =
+                new WakeLockScreenGesturePreferenceController(mContext, "bad_key");
         assertThat(controller.isSliceable()).isFalse();
     }
 }
diff --git a/tests/robotests/src/com/android/settings/gestures/ReachGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/WakeLockScreenGestureSettingsTest.java
similarity index 84%
rename from tests/robotests/src/com/android/settings/gestures/ReachGestureSettingsTest.java
rename to tests/robotests/src/com/android/settings/gestures/WakeLockScreenGestureSettingsTest.java
index 9371c71..0cd777d 100644
--- a/tests/robotests/src/com/android/settings/gestures/ReachGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/WakeLockScreenGestureSettingsTest.java
@@ -30,19 +30,19 @@
 import java.util.List;
 
 @RunWith(SettingsRobolectricTestRunner.class)
-public class ReachGestureSettingsTest {
+public class WakeLockScreenGestureSettingsTest {
 
-    private ReachGestureSettings mSettings;
+    private WakeLockScreenGestureSettings mSettings;
 
     @Before
     public void setUp() {
-        mSettings = new ReachGestureSettings();
+        mSettings = new WakeLockScreenGestureSettings();
     }
 
     @Test
     public void testSearchIndexProvider_shouldIndexResource() {
         final List<SearchIndexableResource> indexRes =
-            ReachGestureSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+            WakeLockScreenGestureSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
                 RuntimeEnvironment.application, true /* enabled */);
 
         assertThat(indexRes).isNotNull();