diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 00577cd..3450665 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1575,14 +1575,6 @@
         <item>@string/rtt_settings_always_visible</item>
     </string-array>
 
-    <!-- Array of titles list for one-handed timeout options. [DO NOT TRANSLATE] -->
-    <string-array name="one_handed_timeout_title" translatable="false">
-        <item>@string/screensaver_settings_summary_never</item>
-        <item>@string/one_handed_timeout_short</item>
-        <item>@string/one_handed_timeout_medium</item>
-        <item>@string/one_handed_timeout_long</item>
-    </string-array>
-
     <!-- Values of list for one-handed timeout options. [DO NOT TRANSLATE] -->
     <string-array name="one_handed_timeout_values" translatable="false">
         <item>0</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4001099..32914b8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -11744,29 +11744,16 @@
     <!-- Preference and settings suggestion title text for ambient display double tap (device) [CHAR LIMIT=60]-->
     <string name="ambient_display_title" product="device">Double-tap to check device</string>
 
-    <!-- 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>
-    <!-- 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.\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] -->
     <string name="one_handed_title">One-handed mode</string>
     <!-- Preference Switch for enabling one handed [CHAR LIMIT=60] -->
     <string name="one_handed_mode_enabled">Use one-handed mode</string>
-    <!-- Preference Switch for app taps to exit one handed [CHAR LIMIT=60] -->
-    <string name="one_handed_app_taps_to_exit">Exit when switching apps</string>
-    <!-- Timeout(Never) title for one handed [CHAR LIMIT=60] -->
-    <string name="one_handed_timeout_title">Timeout</string>
-    <!-- Timeout(Short) title for one handed [CHAR LIMIT=60] -->
-    <string name="one_handed_timeout_short">4 seconds</string>
-    <!-- Timeout(Medium) title for one handed [CHAR LIMIT=60] -->
-    <string name="one_handed_timeout_medium">8 seconds</string>
-    <!-- Timeout(Long) title for one handed [CHAR LIMIT=60] -->
-    <string name="one_handed_timeout_long">12 seconds</string>
     <!-- Search keywords for "One-Handed" settings [CHAR_LIMIT=NONE] -->
     <string name="keywords_one_handed">reachability</string>
     <!-- Category title for one handed swipe down [CHAR_LIMIT=60] -->
     <string name="one_handed_mode_swipe_down_category">Swipe down to</string>
+    <!-- Category title for one handed use the shortcut [CHAR_LIMIT=60] -->
+    <string name="one_handed_mode_use_shortcut_category">Use the shortcut to</string>
     <!-- One-handed mode Intro Text [CHAR_LIMIT=NONE] -->
     <string name="one_handed_mode_intro_text">To use one handed mode, swipe down from the bottom edge of the screen. To use this feature, make sure gesture navigation is turned on in system navigation settings.</string>
     <!-- One-handed mode pull down screen into reach action title [CHAR_LIMIT=60] -->
diff --git a/res/xml/one_handed_settings.xml b/res/xml/one_handed_settings.xml
index 8893e1e..2f5c091 100644
--- a/res/xml/one_handed_settings.xml
+++ b/res/xml/one_handed_settings.xml
@@ -39,7 +39,8 @@
 
     <PreferenceCategory
         android:key="gesture_one_handed_mode_swipe_down"
-        android:title="@string/one_handed_mode_swipe_down_category">
+        android:title="@string/one_handed_mode_swipe_down_category"
+        settings:controller="com.android.settings.gestures.OneHandedPreferenceCategoryController">
 
         <com.android.settingslib.widget.RadioButtonPreference
             android:key="gesture_one_handed_action_pull_screen_down"
@@ -54,5 +55,4 @@
             settings:controller="com.android.settings.gestures.OneHandedActionShowNotificationPrefController"/>
 
     </PreferenceCategory>
-
 </PreferenceScreen>
diff --git a/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java b/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
index 84ea8b6..e17165b 100644
--- a/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
+++ b/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
@@ -92,7 +92,8 @@
         if (mPreference == null) {
             return;
         }
-        if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)) {
+        if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)
+                || uri.equals(OneHandedSettingsUtils.SHORTCUT_ENABLED_URI)) {
             mPreference.setEnabled(OneHandedSettingsUtils.canEnableController(mContext));
         } else if (uri.equals(OneHandedSettingsUtils.SHOW_NOTIFICATION_ENABLED_URI)) {
             updateState(mPreference);
diff --git a/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java b/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
index 5644299..9f56a14 100644
--- a/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
+++ b/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
@@ -92,7 +92,8 @@
         if (mPreference == null) {
             return;
         }
-        if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)) {
+        if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)
+                || uri.equals(OneHandedSettingsUtils.SHORTCUT_ENABLED_URI)) {
             mPreference.setEnabled(OneHandedSettingsUtils.canEnableController(mContext));
         } else if (uri.equals(OneHandedSettingsUtils.SHOW_NOTIFICATION_ENABLED_URI)) {
             updateState(mPreference);
diff --git a/src/com/android/settings/gestures/OneHandedEnablePreferenceController.java b/src/com/android/settings/gestures/OneHandedEnablePreferenceController.java
index bd8de9f..29004c8 100644
--- a/src/com/android/settings/gestures/OneHandedEnablePreferenceController.java
+++ b/src/com/android/settings/gestures/OneHandedEnablePreferenceController.java
@@ -17,7 +17,6 @@
 package com.android.settings.gestures;
 
 import android.content.Context;
-import android.provider.Settings;
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
@@ -27,8 +26,6 @@
  */
 public class OneHandedEnablePreferenceController extends BasePreferenceController {
 
-    private static final String ONE_HANDED_ENABLED = Settings.Secure.ONE_HANDED_MODE_ENABLED;
-
     public OneHandedEnablePreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
     }
@@ -44,5 +41,4 @@
                 OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)
                         ? R.string.gesture_setting_on : R.string.gesture_setting_off);
     }
-
 }
diff --git a/src/com/android/settings/gestures/OneHandedPreferenceCategoryController.java b/src/com/android/settings/gestures/OneHandedPreferenceCategoryController.java
new file mode 100644
index 0000000..9623299
--- /dev/null
+++ b/src/com/android/settings/gestures/OneHandedPreferenceCategoryController.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.gestures;
+
+import android.content.Context;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * Category Preference controller for One-handed mode category
+ */
+public class OneHandedPreferenceCategoryController extends BasePreferenceController {
+
+    private Preference mPreference;
+
+    public OneHandedPreferenceCategoryController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference = screen.findPreference(getPreferenceKey());
+        mPreference.setTitle(
+                OneHandedSettingsUtils.getNavigationBarMode(mContext) == 0 /* 3 button */
+                ? R.string.one_handed_mode_use_shortcut_category
+                : R.string.one_handed_mode_swipe_down_category);
+    }
+}
diff --git a/src/com/android/settings/gestures/OneHandedSettingsUtils.java b/src/com/android/settings/gestures/OneHandedSettingsUtils.java
index a931129..f058689 100644
--- a/src/com/android/settings/gestures/OneHandedSettingsUtils.java
+++ b/src/com/android/settings/gestures/OneHandedSettingsUtils.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.gestures;
 
+import static com.android.internal.accessibility.AccessibilityShortcutController.ONE_HANDED_COMPONENT_NAME;
+
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.ContentObserver;
@@ -33,6 +35,9 @@
  */
 public class OneHandedSettingsUtils {
 
+    static final String ONE_HANDED_MODE_TARGET_NAME =
+            ONE_HANDED_COMPONENT_NAME.getShortClassName();
+
     static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";
     static final int OFF = 0;
     static final int ON = 1;
@@ -40,6 +45,8 @@
             Settings.Secure.getUriFor(Settings.Secure.ONE_HANDED_MODE_ENABLED);
     static final Uri SHOW_NOTIFICATION_ENABLED_URI =
             Settings.Secure.getUriFor(Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED);
+    static final Uri SHORTCUT_ENABLED_URI =
+            Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
 
     public enum OneHandedTimeout {
         NEVER(0), SHORT(4), MEDIUM(8), LONG(12);
@@ -220,8 +227,30 @@
      * navigation settings.
      */
     public static boolean canEnableController(Context context) {
-        return (OneHandedSettingsUtils.isOneHandedModeEnabled(context)
-                && OneHandedSettingsUtils.getNavigationBarMode(context) != 0 /* 3-button mode */);
+        return ((OneHandedSettingsUtils.isOneHandedModeEnabled(context)
+                && getNavigationBarMode(context) != 0 /* 3-button */)
+                || getShortcutEnabled(context));
+    }
+
+    /**
+     * Queries one-handed mode shortcut enabled in settings or not.
+     *
+     * @return true if user enabled one-handed shortcut in settings, false otherwise.
+     */
+    public static boolean getShortcutEnabled(Context context) {
+        final String targets = Settings.Secure.getStringForUser(context.getContentResolver(),
+                Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, sCurrentUserId);
+        return targets != null ? targets.contains(ONE_HANDED_MODE_TARGET_NAME) : false;
+    }
+
+    /**
+     * This is a test only API for set Shortcut enabled or not.
+     */
+    @VisibleForTesting
+    public void setShortcutEnabled(Context context, boolean enabled) {
+        final String targetName = enabled ? ONE_HANDED_MODE_TARGET_NAME : "";
+        Settings.Secure.putStringForUser(context.getContentResolver(),
+                Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, targetName, sCurrentUserId);
     }
 
     /**
@@ -256,6 +285,7 @@
             final ContentResolver resolver = mContext.getContentResolver();
             resolver.registerContentObserver(ONE_HANDED_MODE_ENABLED_URI, true, this);
             resolver.registerContentObserver(SHOW_NOTIFICATION_ENABLED_URI, true, this);
+            resolver.registerContentObserver(SHORTCUT_ENABLED_URI, true, this);
         }
 
         @Override
diff --git a/tests/robotests/src/com/android/settings/gestures/OneHandedActionPullDownPrefControllerTest.java b/tests/robotests/src/com/android/settings/gestures/OneHandedActionPullDownPrefControllerTest.java
index 60398de..36938c2 100644
--- a/tests/robotests/src/com/android/settings/gestures/OneHandedActionPullDownPrefControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/OneHandedActionPullDownPrefControllerTest.java
@@ -105,4 +105,26 @@
         assertThat(mController.getAvailabilityStatus())
                 .isEqualTo(BasePreferenceController.DISABLED_DEPENDENT_SETTING);
     }
+
+    @Test
+    public void getAvailabilityStatus_setShortcutEnabled_shouldEnabled() {
+        SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
+        OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, false);
+        mUtils.setNavigationBarMode(mContext, "0" /* 3-button mode */);
+        mUtils.setShortcutEnabled(mContext, true);
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.AVAILABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_setShortcutDisabled_shouldDisabled() {
+        SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
+        OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, false);
+        mUtils.setNavigationBarMode(mContext, "0" /* 3-button mode */);
+        mUtils.setShortcutEnabled(mContext, false);
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.DISABLED_DEPENDENT_SETTING);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefControllerTest.java b/tests/robotests/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefControllerTest.java
index b56a4f7..a7afccd 100644
--- a/tests/robotests/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefControllerTest.java
@@ -104,4 +104,26 @@
         assertThat(mController.getAvailabilityStatus())
                 .isEqualTo(BasePreferenceController.DISABLED_DEPENDENT_SETTING);
     }
+
+    @Test
+    public void getAvailabilityStatus_setShortcutEnabled_shouldEnabled() {
+        SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
+        OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, false);
+        mUtils.setNavigationBarMode(mContext, "0" /* 3-button mode */);
+        mUtils.setShortcutEnabled(mContext, true);
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.AVAILABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_setShortcutDisabled_shouldDisabled() {
+        SystemProperties.set(OneHandedSettingsUtils.SUPPORT_ONE_HANDED_MODE, "true");
+        OneHandedSettingsUtils.setOneHandedModeEnabled(mContext, false);
+        mUtils.setNavigationBarMode(mContext, "0" /* 3-button mode */);
+        mUtils.setShortcutEnabled(mContext, false);
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.DISABLED_DEPENDENT_SETTING);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/gestures/OneHandedPreferenceCategoryControllerTest.java b/tests/robotests/src/com/android/settings/gestures/OneHandedPreferenceCategoryControllerTest.java
new file mode 100644
index 0000000..112e04a
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/OneHandedPreferenceCategoryControllerTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.gestures;
+
+import static junit.framework.TestCase.assertTrue;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.os.UserHandle;
+import android.text.TextUtils;
+
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class OneHandedPreferenceCategoryControllerTest {
+
+    private static final String KEY = "gesture_one_handed_mode_swipe_down";
+
+    private Context mContext;
+    private OneHandedSettingsUtils mUtils;
+    private OneHandedPreferenceCategoryController mController;
+    @Mock
+    private PreferenceCategory mPreference;
+    @Mock
+    private PreferenceScreen mScreen;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mUtils = new OneHandedSettingsUtils(mContext);
+        mController = new OneHandedPreferenceCategoryController(mContext, KEY);
+        OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
+        mPreference = new PreferenceCategory(mContext);
+        when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+    }
+
+    @Test
+    public void getTitle_set3ButtonMode_shouldReturnSetShortcutTo() {
+        mUtils.setNavigationBarMode(mContext, "0" /* 3 button */);
+        mController.displayPreference(mScreen);
+
+        assertTrue(TextUtils.equals(mPreference.getTitle(), mContext.getText(
+                R.string.one_handed_mode_use_shortcut_category)));
+    }
+
+    @Test
+    public void getTitle_setGestureMode_shouldReturnSwipeDownTo() {
+        mUtils.setNavigationBarMode(mContext, "2" /* fully gestural */);
+        mController.displayPreference(mScreen);
+
+        assertTrue(TextUtils.equals(mPreference.getTitle(), mContext.getText(
+                R.string.one_handed_mode_swipe_down_category)));
+    }
+}
