diff --git a/res/layout/dialog_back_gesture_sensitivity.xml b/res/layout/dialog_back_gesture_sensitivity.xml
new file mode 100644
index 0000000..37ef771
--- /dev/null
+++ b/res/layout/dialog_back_gesture_sensitivity.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 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
+  -->
+
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="12dp">
+
+    <SeekBar
+        android:id="@+id/back_sensitivity_seekbar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:min="0"
+        android:max="3"
+        style="@android:style/Widget.Material.SeekBar.Discrete"
+        android:theme="@*android:style/ThemeOverlay.DeviceDefault.Accent" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_marginTop="2dp"
+        android:layout_marginBottom="8dp">
+
+        <TextView android:id="@+id/low_tick"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  android:layout_weight="1"
+                  android:layout_marginBottom="2dp"
+                  android:layout_marginStart="12dp"
+                  android:gravity="start"
+                  android:text="@string/low_label"
+                  android:textAppearance="?android:attr/textAppearance"
+                  android:singleLine="true"
+                  android:ellipsize="marquee" />
+
+        <TextView android:id="@+id/high_tick"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content"
+                  android:layout_weight="1"
+                  android:layout_marginBottom="2dp"
+                  android:layout_marginEnd="12dp"
+                  android:gravity="end"
+                  android:text="@string/high_label"
+                  android:textAppearance="?android:attr/textAppearance"
+                  android:singleLine="true"
+                  android:ellipsize="marquee" />
+
+    </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index fbf1a24..f31a266 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -411,4 +411,7 @@
 
     <!-- Maximum height for SliceView, override on slices/view/src/main/res/values/dimens.xml -->
     <dimen name="abc_slice_large_height">480dp</dimen>
+
+    <!-- System navigation settings illustration height -->
+    <dimen name="system_navigation_illustration_height">320dp</dimen>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e35c5c4..937d9c1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -10235,6 +10235,17 @@
     <!-- Content description for the Information icon [CHAR LIMIT=30] -->
     <string name="information_label">Information</string>
 
+    <!-- Label on the left side of sensitivity adjustment slider [CHAR LIMIT=30] -->
+    <string name="low_label">Low</string>
+    <!-- Label on the right side of sensitivity adjustment slider [CHAR LIMIT=30] -->
+    <string name="high_label">High</string>
+
+    <!-- Message for the dialog that explains how increasing sensitivity can affect gestures along the edges. [CHAR LIMIT=NONE] -->
+    <string name="back_sensitivity_dialog_message">\nHigher sensitivity may conflict with any app gestures along the edges of the screen.</string>
+
+    <!-- Title for the dialog that is shown to adjust the back sensitivity [CHAR LIMIT=60] -->
+    <string name="back_sensitivity_dialog_title">Back Sensitivity</string>
+
     <!-- Preference and settings suggestion title text for ambient display double tap (phone) [CHAR LIMIT=60]-->
     <string name="ambient_display_title" product="default">Double-tap to check phone</string>
     <!-- Preference and settings suggestion title text for ambient display double tap (tablet) [CHAR LIMIT=60]-->
diff --git a/src/com/android/settings/gestures/GestureNavigationBackSensitivityDialog.java b/src/com/android/settings/gestures/GestureNavigationBackSensitivityDialog.java
new file mode 100644
index 0000000..164705b
--- /dev/null
+++ b/src/com/android/settings/gestures/GestureNavigationBackSensitivityDialog.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2019 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.app.AlertDialog;
+import android.app.Dialog;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.om.IOverlayManager;
+import android.os.Bundle;
+import android.os.ServiceManager;
+import android.view.View;
+import android.widget.SeekBar;
+
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+
+/**
+ * Dialog to set the back gesture's sensitivity in Gesture navigation mode.
+ */
+public class GestureNavigationBackSensitivityDialog extends InstrumentedDialogFragment {
+    private static final String TAG = "GestureNavigationBackSensitivityDialog";
+    private static final String KEY_BACK_SENSITIVITY = "back_sensitivity";
+
+    public static void show(SystemNavigationGestureSettings parent, int sensitivity) {
+        if (!parent.isAdded()) {
+            return;
+        }
+
+        final GestureNavigationBackSensitivityDialog dialog =
+                new GestureNavigationBackSensitivityDialog();
+        final Bundle bundle = new Bundle();
+        bundle.putInt(KEY_BACK_SENSITIVITY, sensitivity);
+        dialog.setArguments(bundle);
+        dialog.setTargetFragment(parent, 0);
+        dialog.show(parent.getFragmentManager(), TAG);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        // TODO(135211145): Use a separate metrics category for this dialog.
+        return SettingsEnums.SETTINGS_GESTURE_SWIPE_UP;
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        final View view = getActivity().getLayoutInflater().inflate(
+                R.layout.dialog_back_gesture_sensitivity, null);
+        final SeekBar seekBar = view.findViewById(R.id.back_sensitivity_seekbar);
+        seekBar.setProgress(getArguments().getInt(KEY_BACK_SENSITIVITY));
+        return new AlertDialog.Builder(getContext())
+                .setTitle(R.string.back_sensitivity_dialog_title)
+                .setMessage(R.string.back_sensitivity_dialog_message)
+                .setView(view)
+                .setPositiveButton(R.string.okay, (dialog, which) -> {
+                    int sensitivity = seekBar.getProgress();
+                    getArguments().putInt(KEY_BACK_SENSITIVITY, sensitivity);
+                    SystemNavigationGestureSettings.setBackSensitivity(getActivity(),
+                            getOverlayManager(), sensitivity);
+                })
+                .create();
+    }
+
+    private IOverlayManager getOverlayManager() {
+        return IOverlayManager.Stub.asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE));
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/gestures/GestureNavigationNotAvailableDialog.java b/src/com/android/settings/gestures/GestureNavigationNotAvailableDialog.java
new file mode 100644
index 0000000..e69db27
--- /dev/null
+++ b/src/com/android/settings/gestures/GestureNavigationNotAvailableDialog.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2019 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.app.AlertDialog;
+import android.app.Dialog;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.os.Bundle;
+
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+
+/**
+ * Dialog to notify user that gesture navigation is not available because of unsupported launcher.
+ */
+public class GestureNavigationNotAvailableDialog extends InstrumentedDialogFragment {
+    private static final String TAG = "GestureNavigationNotAvailableDialog";
+
+    public static void show(SystemNavigationGestureSettings parent) {
+        if (!parent.isAdded()) {
+            return;
+        }
+
+        final GestureNavigationNotAvailableDialog dialog =
+                new GestureNavigationNotAvailableDialog();
+        dialog.setTargetFragment(parent, 0);
+        dialog.show(parent.getFragmentManager(), TAG);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        // TODO(135211145): Use a separate metrics category for this dialog.
+        return SettingsEnums.SETTINGS_GESTURE_SWIPE_UP;
+    }
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        final Context context = getActivity();
+        final String defaultHomeAppName = SystemNavigationPreferenceController
+                .getDefaultHomeAppName(context);
+        final String message = getString(R.string.gesture_not_supported_dialog_message,
+                defaultHomeAppName);
+        return new AlertDialog.Builder(context)
+                .setMessage(message)
+                .setPositiveButton(R.string.okay, null)
+                .create();
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
index 28b76b2..b3d090d 100644
--- a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
+++ b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
@@ -23,14 +23,15 @@
 
 import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_GONE;
 import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_INFO;
+import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_SETTING;
 
-import android.app.AlertDialog;
 import android.accessibilityservice.AccessibilityServiceInfo;
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.om.IOverlayManager;
+import android.content.om.OverlayInfo;
 import android.graphics.drawable.Drawable;
 import android.os.RemoteException;
 import android.os.ServiceManager;
@@ -65,6 +66,11 @@
     private static final String TAG = "SystemNavigationGesture";
 
     @VisibleForTesting
+    static final String SHARED_PREFERENCES_NAME = "system_navigation_settings_preferences";
+    @VisibleForTesting
+    static final String PREFS_BACK_SENSITIVITY_KEY = "system_navigation_back_sensitivity";
+
+    @VisibleForTesting
     static final String KEY_SYSTEM_NAV_3BUTTONS = "system_nav_3buttons";
     @VisibleForTesting
     static final String KEY_SYSTEM_NAV_2BUTTONS = "system_nav_2buttons";
@@ -74,6 +80,25 @@
     public static final String PREF_KEY_SUGGESTION_COMPLETE =
             "pref_system_navigation_suggestion_complete";
 
+    @VisibleForTesting
+    static final String NAV_BAR_MODE_GESTURAL_OVERLAY_NARROW_BACK
+            = "com.android.internal.systemui.navbar.gestural_narrow_back";
+    @VisibleForTesting
+    static final String NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK
+            = "com.android.internal.systemui.navbar.gestural_wide_back";
+    @VisibleForTesting
+    static final String NAV_BAR_MODE_GESTURAL_OVERLAY_EXTRA_WIDE_BACK
+            = "com.android.internal.systemui.navbar.gestural_extra_wide_back";
+    @VisibleForTesting
+    static final String[] BACK_GESTURE_INSET_OVERLAYS = {
+            NAV_BAR_MODE_GESTURAL_OVERLAY_NARROW_BACK,
+            NAV_BAR_MODE_GESTURAL_OVERLAY,
+            NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK,
+            NAV_BAR_MODE_GESTURAL_OVERLAY_EXTRA_WIDE_BACK
+    };
+    @VisibleForTesting
+    static int BACK_GESTURE_INSET_DEFAULT_OVERLAY = 1;
+
     private IOverlayManager mOverlayManager;
 
     private VideoPreference mVideoPreference;
@@ -91,6 +116,9 @@
 
         mVideoPreference = new VideoPreference(context);
         setIllustrationVideo(mVideoPreference, getDefaultKey());
+        mVideoPreference.setHeight( /* Illustration height in dp */
+                getResources().getDimension(R.dimen.system_navigation_illustration_height)
+                        / getResources().getDisplayMetrics().density);
     }
 
     @Override
@@ -99,11 +127,6 @@
     }
 
     @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.system_navigation_gesture_settings;
-    }
-
-    @Override
     public void updateCandidates() {
         final String defaultKey = getDefaultKey();
         final String systemDefaultKey = getSystemDefaultKey();
@@ -126,6 +149,39 @@
     }
 
     @Override
+    public void bindPreferenceExtra(RadioButtonPreference pref,
+            String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {
+        if (!(info instanceof NavModeCandidateInfo)
+                || !(pref instanceof RadioButtonPreferenceWithExtraWidget)) {
+            return;
+        }
+
+        pref.setSummary(((NavModeCandidateInfo) info).loadSummary());
+
+        RadioButtonPreferenceWithExtraWidget p = (RadioButtonPreferenceWithExtraWidget) pref;
+        if (info.getKey() == KEY_SYSTEM_NAV_GESTURAL) {
+            if (SystemNavigationPreferenceController.isGestureNavSupportedByDefaultLauncher(
+                    getContext())) {
+                p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_SETTING);
+                p.setExtraWidgetOnClickListener((v) -> GestureNavigationBackSensitivityDialog
+                        .show(this, getBackSensitivity(getContext(), mOverlayManager)));
+            } else {
+                p.setEnabled(false);
+                p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_INFO);
+                p.setExtraWidgetOnClickListener((v) ->
+                        GestureNavigationNotAvailableDialog.show(this));
+            }
+        } else {
+            p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_GONE);
+        }
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.system_navigation_gesture_settings;
+    }
+
+    @Override
     protected List<? extends CandidateInfo> getCandidates() {
         final Context c = getContext();
         List<NavModeCandidateInfo> candidates = new ArrayList<>();
@@ -169,7 +225,7 @@
             return false;
         }
 
-        setCurrentSystemNavigationMode(mOverlayManager, key);
+        setCurrentSystemNavigationMode(c, mOverlayManager, key);
         setIllustrationVideo(mVideoPreference, key);
         if (TextUtils.equals(KEY_SYSTEM_NAV_GESTURAL, key) && (
                 isAnyServiceSupportAccessibilityButton() || isNavBarMagnificationEnabled())) {
@@ -181,6 +237,37 @@
     }
 
     @VisibleForTesting
+    static void setBackSensitivity(Context context, IOverlayManager overlayManager,
+            int sensitivity) {
+        if (sensitivity < 0 || sensitivity >= BACK_GESTURE_INSET_OVERLAYS.length) {
+            throw new IllegalArgumentException("Sensitivity out of range.");
+        }
+
+        // Store the sensitivity level, to be able to restore when user returns to Gesture Nav mode
+        context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE).edit()
+                .putInt(PREFS_BACK_SENSITIVITY_KEY, sensitivity).apply();
+        if (getCurrentSystemNavigationMode(context) == KEY_SYSTEM_NAV_GESTURAL) {
+            setNavBarInteractionMode(overlayManager, BACK_GESTURE_INSET_OVERLAYS[sensitivity]);
+        }
+    }
+
+    @VisibleForTesting
+    static int getBackSensitivity(Context context, IOverlayManager overlayManager) {
+        for (int i = 0; i < BACK_GESTURE_INSET_OVERLAYS.length; i++) {
+            OverlayInfo info = null;
+            try {
+                info = overlayManager.getOverlayInfo(BACK_GESTURE_INSET_OVERLAYS[i], USER_CURRENT);
+            } catch (RemoteException e) { /* Do nothing */ }
+            if (info != null && info.isEnabled()) {
+                return i;
+            }
+        }
+        // If Gesture nav is not selected, read the value from shared preferences.
+        return context.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE)
+                .getInt(PREFS_BACK_SENSITIVITY_KEY, BACK_GESTURE_INSET_DEFAULT_OVERLAY);
+    }
+
+    @VisibleForTesting
     static String getCurrentSystemNavigationMode(Context context) {
         if (SystemNavigationPreferenceController.isEdgeToEdgeEnabled(context)) {
             return KEY_SYSTEM_NAV_GESTURAL;
@@ -192,10 +279,12 @@
     }
 
     @VisibleForTesting
-    static void setCurrentSystemNavigationMode(IOverlayManager overlayManager, String key) {
+    static void setCurrentSystemNavigationMode(Context context, IOverlayManager overlayManager,
+            String key) {
         switch (key) {
             case KEY_SYSTEM_NAV_GESTURAL:
-                setNavBarInteractionMode(overlayManager, NAV_BAR_MODE_GESTURAL_OVERLAY);
+                int sensitivity = getBackSensitivity(context, overlayManager);
+                setNavBarInteractionMode(overlayManager, BACK_GESTURE_INSET_OVERLAYS[sensitivity]);
                 break;
             case KEY_SYSTEM_NAV_2BUTTONS:
                 setNavBarInteractionMode(overlayManager, NAV_BAR_MODE_2BUTTON_OVERLAY);
@@ -206,10 +295,8 @@
         }
     }
 
-    /**
-     * Enables the specified overlay package.
-     */
-    static void setNavBarInteractionMode(IOverlayManager overlayManager, String overlayPackage) {
+    private static void setNavBarInteractionMode(IOverlayManager overlayManager,
+            String overlayPackage) {
         try {
             overlayManager.setEnabledExclusiveInCategory(overlayPackage, USER_CURRENT);
         } catch (RemoteException e) {
@@ -217,7 +304,7 @@
         }
     }
 
-    static void setIllustrationVideo(VideoPreference videoPref, String systemNavKey) {
+    private static void setIllustrationVideo(VideoPreference videoPref, String systemNavKey) {
         videoPref.setVideo(0, 0);
         switch (systemNavKey) {
             case KEY_SYSTEM_NAV_GESTURAL:
@@ -233,41 +320,6 @@
         }
     }
 
-    @Override
-    public void bindPreferenceExtra(RadioButtonPreference pref,
-            String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {
-        if (!(info instanceof NavModeCandidateInfo)
-                || !(pref instanceof RadioButtonPreferenceWithExtraWidget)) {
-            return;
-        }
-
-        pref.setSummary(((NavModeCandidateInfo) info).loadSummary());
-
-        RadioButtonPreferenceWithExtraWidget p = (RadioButtonPreferenceWithExtraWidget) pref;
-        if (info.getKey() == KEY_SYSTEM_NAV_GESTURAL
-                && !SystemNavigationPreferenceController.isGestureNavSupportedByDefaultLauncher(
-                        getContext())) {
-            p.setEnabled(false);
-            p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_INFO);
-            p.setExtraWidgetOnClickListener((v) -> {
-                showGestureNavDisabledDialog();
-            });
-        } else {
-            p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_GONE);
-        }
-    }
-
-    private void showGestureNavDisabledDialog() {
-        final String defaultHomeAppName = SystemNavigationPreferenceController
-                .getDefaultHomeAppName(getContext());
-        final String message = getString(R.string.gesture_not_supported_dialog_message,
-                defaultHomeAppName);
-        AlertDialog d = new AlertDialog.Builder(getContext())
-                .setMessage(message)
-                .setPositiveButton(R.string.okay, null)
-                .show();
-    }
-
     private boolean isAnyServiceSupportAccessibilityButton() {
         final AccessibilityManager ams = (AccessibilityManager) getContext().getSystemService(
                 Context.ACCESSIBILITY_SERVICE);
diff --git a/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidget.java b/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidget.java
index 6a47ce5..19fd923 100644
--- a/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidget.java
+++ b/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidget.java
@@ -27,6 +27,7 @@
 public class RadioButtonPreferenceWithExtraWidget extends RadioButtonPreference {
     public static final int EXTRA_WIDGET_VISIBILITY_GONE = 0;
     public static final int EXTRA_WIDGET_VISIBILITY_INFO = 1;
+    public static final int EXTRA_WIDGET_VISIBILITY_SETTING = 2;
 
     private View mExtraWidgetDivider;
     private ImageView mExtraWidget;
@@ -66,6 +67,15 @@
             mExtraWidget.setClickable(true);
             mExtraWidget.setVisibility(View.VISIBLE);
             mExtraWidgetDivider.setVisibility(View.VISIBLE);
+            if (mExtraWidgetVisibility == EXTRA_WIDGET_VISIBILITY_INFO) {
+                mExtraWidget.setImageResource(R.drawable.ic_settings_about);
+                mExtraWidget.setContentDescription(
+                        getContext().getResources().getText(R.string.information_label));
+            } else if (mExtraWidgetVisibility == EXTRA_WIDGET_VISIBILITY_SETTING) {
+                mExtraWidget.setImageResource(R.drawable.ic_settings_accent);
+                mExtraWidget.setContentDescription(
+                        getContext().getResources().getText(R.string.settings_label));
+            }
         }
     }
 
diff --git a/tests/robotests/src/com/android/settings/gestures/SystemNavigationGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/SystemNavigationGestureSettingsTest.java
index 1f3a758..24cb9ed 100644
--- a/tests/robotests/src/com/android/settings/gestures/SystemNavigationGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SystemNavigationGestureSettingsTest.java
@@ -24,21 +24,30 @@
 import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
 import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY;
 
+import static com.android.settings.gestures.SystemNavigationGestureSettings.BACK_GESTURE_INSET_DEFAULT_OVERLAY;
+import static com.android.settings.gestures.SystemNavigationGestureSettings.BACK_GESTURE_INSET_OVERLAYS;
 import static com.android.settings.gestures.SystemNavigationGestureSettings.KEY_SYSTEM_NAV_2BUTTONS;
 import static com.android.settings.gestures.SystemNavigationGestureSettings.KEY_SYSTEM_NAV_3BUTTONS;
 import static com.android.settings.gestures.SystemNavigationGestureSettings.KEY_SYSTEM_NAV_GESTURAL;
+import static com.android.settings.gestures.SystemNavigationGestureSettings.NAV_BAR_MODE_GESTURAL_OVERLAY_EXTRA_WIDE_BACK;
+import static com.android.settings.gestures.SystemNavigationGestureSettings.NAV_BAR_MODE_GESTURAL_OVERLAY_NARROW_BACK;
+import static com.android.settings.gestures.SystemNavigationGestureSettings.NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK;
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.Mockito.mock;
+import static junit.framework.Assert.assertEquals;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import android.content.Context;
 import android.content.om.IOverlayManager;
-import android.os.ServiceManager;
+import android.content.om.OverlayInfo;
 import android.provider.SearchIndexableResource;
-import android.text.TextUtils;
 
 import com.android.internal.R;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
@@ -46,6 +55,8 @@
 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;
 import org.robolectric.annotation.Config;
@@ -57,17 +68,25 @@
 public class SystemNavigationGestureSettingsTest {
 
     private Context mContext;
-
-    private IOverlayManager mOverlayManager;
-
     private SystemNavigationGestureSettings mSettings;
 
-    @Before
-    public void setUp() {
-        mContext = RuntimeEnvironment.application;
-        mOverlayManager = mock(IOverlayManager.class);
+    @Mock
+    private IOverlayManager mOverlayManager;
+    @Mock
+    private OverlayInfo mOverlayInfoEnabled;
+    @Mock
+    private OverlayInfo mOverlayInfoDisabled;
 
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = RuntimeEnvironment.application;
         mSettings = new SystemNavigationGestureSettings();
+
+        when(mOverlayInfoDisabled.isEnabled()).thenReturn(false);
+        when(mOverlayInfoEnabled.isEnabled()).thenReturn(true);
+        when(mOverlayManager.getOverlayInfo(any(), anyInt())).thenReturn(mOverlayInfoDisabled);
     }
 
     @Test
@@ -82,34 +101,111 @@
 
     @Test
     public void testGetCurrentSystemNavigationMode() {
-        SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode,
-                NAV_BAR_MODE_GESTURAL);
-        assertThat(TextUtils.equals(mSettings.getCurrentSystemNavigationMode(mContext),
-                KEY_SYSTEM_NAV_GESTURAL)).isTrue();
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL);
+        assertEquals(KEY_SYSTEM_NAV_GESTURAL, mSettings.getCurrentSystemNavigationMode(mContext));
 
-        SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode,
-                NAV_BAR_MODE_3BUTTON);
-        assertThat(TextUtils.equals(mSettings.getCurrentSystemNavigationMode(mContext),
-                KEY_SYSTEM_NAV_3BUTTONS)).isTrue();
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON);
+        assertEquals(KEY_SYSTEM_NAV_3BUTTONS, mSettings.getCurrentSystemNavigationMode(mContext));
 
-        SettingsShadowResources.overrideResource(R.integer.config_navBarInteractionMode,
-                NAV_BAR_MODE_2BUTTON);
-        assertThat(TextUtils.equals(mSettings.getCurrentSystemNavigationMode(mContext),
-                KEY_SYSTEM_NAV_2BUTTONS)).isTrue();
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_2BUTTON);
+        assertEquals(KEY_SYSTEM_NAV_2BUTTONS, mSettings.getCurrentSystemNavigationMode(mContext));
     }
 
     @Test
     public void testSetCurrentSystemNavigationMode() throws Exception {
-        mSettings.setCurrentSystemNavigationMode(mOverlayManager, KEY_SYSTEM_NAV_GESTURAL);
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 0);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_GESTURAL);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_NARROW_BACK, USER_CURRENT);
+
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 1);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_GESTURAL);
         verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
                 NAV_BAR_MODE_GESTURAL_OVERLAY, USER_CURRENT);
 
-        mSettings.setCurrentSystemNavigationMode(mOverlayManager, KEY_SYSTEM_NAV_2BUTTONS);
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 2);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_GESTURAL);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK, USER_CURRENT);
+
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 3);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_GESTURAL);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_EXTRA_WIDE_BACK, USER_CURRENT);
+
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_2BUTTONS);
         verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
                 NAV_BAR_MODE_2BUTTON_OVERLAY, USER_CURRENT);
 
-        mSettings.setCurrentSystemNavigationMode(mOverlayManager, KEY_SYSTEM_NAV_3BUTTONS);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_3BUTTONS);
         verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
                 NAV_BAR_MODE_3BUTTON_OVERLAY, USER_CURRENT);
     }
+
+    @Test
+    public void testSetCurrentSystemNavigationMode_backSensitivityValuePersists() throws Exception {
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON);
+
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 2);
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_3BUTTONS);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_3BUTTON_OVERLAY, USER_CURRENT);
+
+        // Return to Gesture navigation, without setting the sensitivity value.
+        mSettings.setCurrentSystemNavigationMode(mContext, mOverlayManager,
+                KEY_SYSTEM_NAV_GESTURAL);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK, USER_CURRENT);
+    }
+
+    @Test
+    public void testGetBackSensitivity_default() {
+        assertEquals(BACK_GESTURE_INSET_DEFAULT_OVERLAY,
+                mSettings.getBackSensitivity(mContext, mOverlayManager));
+    }
+
+    @Test
+    public void testBackSensitivitySetterAndGetter_currentNavModeNotGestural() throws Exception {
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_3BUTTON);
+
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 3);
+        assertEquals(3, mSettings.getBackSensitivity(mContext, mOverlayManager));
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 2);
+        assertEquals(2, mSettings.getBackSensitivity(mContext, mOverlayManager));
+
+        verify(mOverlayManager, never()).setEnabledExclusiveInCategory(any(), anyInt());
+    }
+
+    @Test
+    public void testBackSensitivitySetterAndGetter_currentNavModeIsGestural() throws Exception {
+        SettingsShadowResources.overrideResource(
+                R.integer.config_navBarInteractionMode, NAV_BAR_MODE_GESTURAL);
+
+        when(mOverlayManager.getOverlayInfo(BACK_GESTURE_INSET_OVERLAYS[3], USER_CURRENT))
+                .thenReturn(mOverlayInfoEnabled);
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 3);
+        assertEquals(3, mSettings.getBackSensitivity(mContext, mOverlayManager));
+
+        when(mOverlayManager.getOverlayInfo(BACK_GESTURE_INSET_OVERLAYS[2], USER_CURRENT))
+                .thenReturn(mOverlayInfoEnabled);
+        mSettings.setBackSensitivity(mContext, mOverlayManager, 2);
+        assertEquals(2, mSettings.getBackSensitivity(mContext, mOverlayManager));
+
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_WIDE_BACK, USER_CURRENT);
+        verify(mOverlayManager, times(1)).setEnabledExclusiveInCategory(
+                NAV_BAR_MODE_GESTURAL_OVERLAY_EXTRA_WIDE_BACK, USER_CURRENT);
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidgetTest.java b/tests/robotests/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidgetTest.java
index b84b3bb..2e2d786 100644
--- a/tests/robotests/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidgetTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RadioButtonPreferenceWithExtraWidgetTest.java
@@ -18,6 +18,7 @@
 
 import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_GONE;
 import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_INFO;
+import static com.android.settings.widget.RadioButtonPreferenceWithExtraWidget.EXTRA_WIDGET_VISIBILITY_SETTING;
 
 import static com.google.common.truth.Truth.assertThat;
 
@@ -104,6 +105,18 @@
         assertEquals(View.VISIBLE, mExtraWidget.getVisibility());
         assertEquals(View.VISIBLE, mExtraWidgetDivider.getVisibility());
         assertThat(mExtraWidget.isClickable()).isTrue();
+        assertEquals(mContext.getResources().getText(R.string.information_label),
+                mExtraWidget.getContentDescription());
+    }
+
+    @Test
+    public void testSetExtraWidgetVisibility_setting() {
+        mPreference.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_SETTING);
+        assertEquals(View.VISIBLE, mExtraWidget.getVisibility());
+        assertEquals(View.VISIBLE, mExtraWidgetDivider.getVisibility());
+        assertThat(mExtraWidget.isClickable()).isTrue();
+        assertEquals(mContext.getResources().getText(R.string.settings_label),
+                mExtraWidget.getContentDescription());
     }
 
     @Test
