diff --git a/res/layout/accessibility_shortcut_secondary_action.xml b/res/layout/accessibility_shortcut_secondary_action.xml
index 84c8e6b..a114f05 100644
--- a/res/layout/accessibility_shortcut_secondary_action.xml
+++ b/res/layout/accessibility_shortcut_secondary_action.xml
@@ -29,28 +29,23 @@
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:gravity="start|center_vertical"
-        android:focusable="true"
-        android:clickable="true"
-        android:background="?android:attr/selectableItemBackground">
+        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
 
         <FrameLayout
+            android:id="@+id/icon_frame"
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginEnd="16dp"
+            android:layout_height="wrap_content"
             android:minWidth="56dp"
-            android:orientation="horizontal"
-            android:focusable="false"
-            android:clickable="false">
+            android:paddingEnd="12dp"
+            android:paddingTop="16dp"
+            android:paddingBottom="4dp">
 
-            <CheckBox
-                android:id="@+id/checkbox"
+            <ImageView
+                android:id="@android:id/icon"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:focusable="false"
-                android:clickable="false"
-                android:background="@null"/>
-
+                android:layout_height="wrap_content" />
+            
         </FrameLayout>
 
         <RelativeLayout
@@ -94,9 +89,8 @@
         android:id="@android:id/widget_frame"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        android:contentDescription="@string/accessibility_shortcut_settings"
         android:gravity="end|center_vertical"
         android:minWidth="58dp"
         android:orientation="vertical" />
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/preference_widget_settings.xml b/res/layout/preference_widget_settings.xml
deleted file mode 100644
index 73c6875..0000000
--- a/res/layout/preference_widget_settings.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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
-  -->
-
-<!-- Layout used by ShortcutPreference. This is inflated inside android.R.layout.preference. -->
-<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/settings_button"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_gravity="center"
-    android:background="?android:attr/selectableItemBackground"
-    android:scaleType="center"
-    android:src="@drawable/ic_mode_edit"
-    android:contentDescription="@string/settings_button" />
diff --git a/src/com/android/settings/accessibility/InvisibleToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/InvisibleToggleAccessibilityServicePreferenceFragment.java
index 93064c5..beeabd5 100644
--- a/src/com/android/settings/accessibility/InvisibleToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/InvisibleToggleAccessibilityServicePreferenceFragment.java
@@ -32,7 +32,7 @@
  * {@link AccessibilityServiceInfo#FLAG_REQUEST_ACCESSIBILITY_BUTTON} is set.
  */
 public class InvisibleToggleAccessibilityServicePreferenceFragment extends
-        ToggleAccessibilityServicePreferenceFragment implements ShortcutPreference.OnClickListener{
+        ToggleAccessibilityServicePreferenceFragment implements ShortcutPreference.OnClickCallback {
 
     @Override
     protected void onInstallSwitchPreferenceToggleSwitch() {
@@ -47,10 +47,10 @@
      * accessibility service when shortcutPreference is unchecked.
      */
     @Override
-    public void onCheckboxClicked(ShortcutPreference preference) {
-        super.onCheckboxClicked(preference);
+    public void onToggleClicked(ShortcutPreference preference) {
+        super.onToggleClicked(preference);
         boolean enabled = getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED)
-                && preference.getChecked();
+                && preference.isChecked();
 
         AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName, enabled);
     }
@@ -61,8 +61,8 @@
      * Enables accessibility service when user clicks permission allow button.
      */
     @Override
-    void onDialogButtonFromShortcutClicked(View view) {
-        super.onDialogButtonFromShortcutClicked(view);
+    void onDialogButtonFromShortcutToggleClicked(View view) {
+        super.onDialogButtonFromShortcutToggleClicked(view);
         if (view.getId() == R.id.permission_enable_allow_button) {
             AccessibilityUtils.setAccessibilityServiceState(getContext(), mComponentName,
                     true);
diff --git a/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java
index 2739b6b..1803874 100644
--- a/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/LegacyAccessibilityServicePreferenceFragment.java
@@ -43,7 +43,7 @@
         final CharSequence hardwareTitle = getPrefContext().getText(
                 R.string.accessibility_shortcut_edit_dialog_title_hardware);
         mShortcutPreference.setSummary(hardwareTitle);
-        mShortcutPreference.setSettingsVisibility(View.GONE);
+        mShortcutPreference.setSettingsEditable(false);
 
         setAllowedPreferredShortcutType(UserShortcutType.HARDWARE);
     }
diff --git a/src/com/android/settings/accessibility/ShortcutPreference.java b/src/com/android/settings/accessibility/ShortcutPreference.java
index 00b63b6..82ab506 100644
--- a/src/com/android/settings/accessibility/ShortcutPreference.java
+++ b/src/com/android/settings/accessibility/ShortcutPreference.java
@@ -18,9 +18,11 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
+import android.util.TypedValue;
+import android.view.MotionEvent;
 import android.view.View;
-import android.widget.CheckBox;
 import android.widget.LinearLayout;
+import android.widget.Switch;
 
 import androidx.preference.Preference;
 import androidx.preference.PreferenceViewHolder;
@@ -34,77 +36,84 @@
 public class ShortcutPreference extends Preference {
 
     /**
-     * Interface definition for a callback to be invoked when the checkbox or settings has been
+     * Interface definition for a callback to be invoked when the toggle or settings has been
      * clicked.
      */
-    public interface OnClickListener {
-        /**
-         * Called when the checkbox in ShortcutPreference has been clicked.
-         *
-         * @param preference The clicked preference
-         */
-        void onCheckboxClicked(ShortcutPreference preference);
+    public interface OnClickCallback {
         /**
          * Called when the settings view has been clicked.
          *
          * @param preference The clicked preference
          */
         void onSettingsClicked(ShortcutPreference preference);
-    }
-    private OnClickListener mListener = null;
 
-    private static final float DISABLED_ALPHA = 0.77f;
-    private static final float ENABLED_ALPHA = 1.0f;
-    private int mSettingsVisibility = View.VISIBLE;
-    private boolean mAutoEnabledSettings;
+        /**
+         * Called when the toggle in ShortcutPreference has been clicked.
+         *
+         * @param preference The clicked preference
+         */
+        void onToggleClicked(ShortcutPreference preference);
+    }
+
+    private OnClickCallback mClickCallback = null;
     private boolean mChecked = false;
+    private boolean mSettingsEditable = true;
 
     ShortcutPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
-        init();
+        setLayoutResource(R.layout.accessibility_shortcut_secondary_action);
+        setWidgetLayoutResource(R.layout.preference_widget_master_switch);
+        setIconSpaceReserved(true);
+        setSelectable(false);
     }
 
     @Override
     public void onBindViewHolder(PreferenceViewHolder holder) {
         super.onBindViewHolder(holder);
 
+        final TypedValue outValue = new TypedValue();
+        getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,
+                outValue, true);
+
         final LinearLayout mainFrame = holder.itemView.findViewById(R.id.main_frame);
         if (mainFrame != null) {
-            mainFrame.setOnClickListener(view -> callOnCheckboxClicked());
+            mainFrame.setOnClickListener(view -> callOnSettingsClicked());
+            mainFrame.setClickable(mSettingsEditable);
+            mainFrame.setFocusable(mSettingsEditable);
+            mainFrame.setBackgroundResource(
+                    mSettingsEditable ? outValue.resourceId : /* Remove background */ 0);
         }
 
-        final CheckBox checkBox = holder.itemView.findViewById(R.id.checkbox);
-        if (checkBox != null) {
-            checkBox.setChecked(mChecked);
-        }
-
-
-        final View settings = holder.itemView.findViewById(android.R.id.widget_frame);
-        if (settings != null) {
-            settings.setOnClickListener(view -> callOnSettingsClicked());
-            settings.setEnabled(mAutoEnabledSettings ? mChecked : /* enabled */ true);
-
-            float alpha;
-            if (mAutoEnabledSettings) {
-                alpha = mChecked ? ENABLED_ALPHA : DISABLED_ALPHA;
-            } else {
-                alpha = ENABLED_ALPHA;
-            }
-
-            settings.setAlpha(alpha);
-            settings.setVisibility(mSettingsVisibility);
+        Switch switchWidget = holder.itemView.findViewById(R.id.switchWidget);
+        if (switchWidget != null) {
+            // Consumes move events to ignore drag actions.
+            switchWidget.setOnTouchListener((v, event) -> {
+                return event.getActionMasked() == MotionEvent.ACTION_MOVE;
+            });
+            switchWidget.setContentDescription(
+                    getContext().getText(R.string.accessibility_shortcut_settings));
+            switchWidget.setChecked(mChecked);
+            switchWidget.setOnClickListener(view -> callOnToggleClicked());
+            switchWidget.setClickable(mSettingsEditable);
+            switchWidget.setFocusable(mSettingsEditable);
+            switchWidget.setBackgroundResource(
+                    mSettingsEditable ? outValue.resourceId : /* Remove background */ 0);
         }
 
         final View divider = holder.itemView.findViewById(R.id.divider);
         if (divider != null) {
-            divider.setVisibility(mSettingsVisibility);
+            divider.setVisibility(mSettingsEditable ? View.VISIBLE : View.GONE);
         }
+
+        holder.itemView.setOnClickListener(view -> callOnToggleClicked());
+        holder.itemView.setClickable(!mSettingsEditable);
+        holder.itemView.setFocusable(!mSettingsEditable);
     }
 
     /**
-     * Sets the shortcut checkbox according to checked value.
+     * Sets the shortcut toggle according to checked value.
      *
-     * @param checked the state value of shortcut checkbox
+     * @param checked the state value of shortcut toggle
      */
     public void setChecked(boolean checked) {
         if (mChecked != checked) {
@@ -114,72 +123,50 @@
     }
 
     /**
-     * Gets the checked value of shortcut checkbox.
+     * Gets the checked value of shortcut toggle.
      *
-     * @return the checked value of shortcut checkbox
+     * @return the checked value of shortcut toggle
      */
-    public boolean getChecked() {
+    public boolean isChecked() {
         return mChecked;
     }
 
     /**
-     * Automatically/Manually enable settings according to checkbox click status.
-     *
-     * Automatically enable settings means settings view enabled when checkbox is clicked, and
-     * disabled when checkbox is not clicked.
-     * Manually enable settings means settings view always enabled.
-     *
-     * @param autoEnabled True will automatically enable settings, false will let settings view
-     *                    always enabled.
+     * Sets the editable state of Settings view. If the view cannot edited, it makes the settings
+     * and toggle be not touchable. The main ui handles touch event directly by {@link #onClick}.
      */
-    public void setAutoEnabledSettings(boolean autoEnabled) {
-        if (mAutoEnabledSettings != autoEnabled) {
-            mAutoEnabledSettings = autoEnabled;
+    public void setSettingsEditable(boolean enabled) {
+        if (mSettingsEditable != enabled) {
+            mSettingsEditable = enabled;
+            // Disable whole component to let each child component can be addressed.
+            setSelectable(!mSettingsEditable);
             notifyChanged();
         }
     }
 
-    /**
-     * Sets the visibility state of Settings view.
-     *
-     * @param visibility one of {@link View#VISIBLE}, {@link View#INVISIBLE}, or {@link View#GONE}.
-     */
-    public void setSettingsVisibility(@View.Visibility int visibility) {
-        if (mSettingsVisibility != visibility) {
-            mSettingsVisibility = visibility;
-            notifyChanged();
-        }
+    public boolean isSettingsEditable() {
+        return mSettingsEditable;
     }
 
     /**
      * Sets the callback to be invoked when this preference is clicked by the user.
      *
-     * @param listener the callback to be invoked
+     * @param callback the callback to be invoked
      */
-    public void setOnClickListener(OnClickListener listener) {
-        mListener = listener;
-    }
-
-    private void init() {
-        setLayoutResource(R.layout.accessibility_shortcut_secondary_action);
-        setWidgetLayoutResource(R.layout.preference_widget_settings);
-        setIconSpaceReserved(false);
-        mAutoEnabledSettings = true;
-
-        // Disable whole component to let each child component can be addressed.
-        setSelectable(false);
+    public void setOnClickCallback(OnClickCallback callback) {
+        mClickCallback = callback;
     }
 
     private void callOnSettingsClicked() {
-        if (mListener != null) {
-            mListener.onSettingsClicked(this);
+        if (mClickCallback != null) {
+            mClickCallback.onSettingsClicked(this);
         }
     }
 
-    private void callOnCheckboxClicked() {
+    private void callOnToggleClicked() {
         setChecked(!mChecked);
-        if (mListener != null) {
-            mListener.onCheckboxClicked(this);
+        if (mClickCallback != null) {
+            mClickCallback.onToggleClicked(this);
         }
     }
 }
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index df97607..d61be67 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -134,6 +134,16 @@
                                 this::onDialogButtonFromEnableToggleClicked);
                 break;
             }
+            case DialogEnums.ENABLE_WARNING_FROM_SHORTCUT_TOGGLE: {
+                final AccessibilityServiceInfo info = getAccessibilityServiceInfo();
+                if (info == null) {
+                    return null;
+                }
+                mDialog = AccessibilityServiceWarning
+                        .createCapabilitiesDialog(getPrefContext(), info,
+                                this::onDialogButtonFromShortcutToggleClicked);
+                break;
+            }
             case DialogEnums.ENABLE_WARNING_FROM_SHORTCUT: {
                 final AccessibilityServiceInfo info = getAccessibilityServiceInfo();
                 if (info == null) {
@@ -176,6 +186,7 @@
         switch (dialogId) {
             case DialogEnums.ENABLE_WARNING_FROM_TOGGLE:
             case DialogEnums.ENABLE_WARNING_FROM_SHORTCUT:
+            case DialogEnums.ENABLE_WARNING_FROM_SHORTCUT_TOGGLE:
                 return SettingsEnums.DIALOG_ACCESSIBILITY_SERVICE_ENABLE;
             case DialogEnums.DISABLE_WARNING_FROM_TOGGLE:
                 return SettingsEnums.DIALOG_ACCESSIBILITY_SERVICE_DISABLE;
@@ -283,12 +294,12 @@
     }
 
     @Override
-    public void onCheckboxClicked(ShortcutPreference preference) {
+    public void onToggleClicked(ShortcutPreference preference) {
         final int shortcutTypes = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
-        if (preference.getChecked()) {
-            if (!getArguments().getBoolean(AccessibilitySettings.EXTRA_CHECKED)) {
+        if (preference.isChecked()) {
+            if (!mToggleServiceDividerSwitchPreference.isChecked()) {
                 preference.setChecked(false);
-                showPopupDialog(DialogEnums.ENABLE_WARNING_FROM_SHORTCUT);
+                showPopupDialog(DialogEnums.ENABLE_WARNING_FROM_SHORTCUT_TOGGLE);
             } else {
                 AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes,
                         mComponentName);
@@ -296,14 +307,17 @@
         } else {
             AccessibilityUtil.optOutAllValuesFromSettings(getPrefContext(), shortcutTypes,
                     mComponentName);
-            getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED, false);
         }
+        mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
     }
 
     @Override
     public void onSettingsClicked(ShortcutPreference preference) {
         super.onSettingsClicked(preference);
-        showPopupDialog(DialogEnums.EDIT_SHORTCUT);
+        final boolean isServiceOnOrShortcutAdded = mShortcutPreference.isChecked()
+                || mToggleServiceDividerSwitchPreference.isChecked();
+        showPopupDialog(isServiceOnOrShortcutAdded ? DialogEnums.EDIT_SHORTCUT
+                : DialogEnums.ENABLE_WARNING_FROM_SHORTCUT);
     }
 
     @Override
@@ -385,6 +399,32 @@
         mDialog.dismiss();
     }
 
+    void onDialogButtonFromShortcutToggleClicked(View view) {
+        final int viewId = view.getId();
+        if (viewId == R.id.permission_enable_allow_button) {
+            onAllowButtonFromShortcutToggleClicked();
+        } else if (viewId == R.id.permission_enable_deny_button) {
+            onDenyButtonFromShortcutToggleClicked();
+        } else {
+            throw new IllegalArgumentException("Unexpected view id");
+        }
+    }
+
+    private void onAllowButtonFromShortcutToggleClicked() {
+        mShortcutPreference.setChecked(true);
+
+        final int shortcutTypes = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
+        AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes, mComponentName);
+
+        mDialog.dismiss();
+    }
+
+    private void onDenyButtonFromShortcutToggleClicked() {
+        mShortcutPreference.setChecked(false);
+
+        mDialog.dismiss();
+    }
+
     void onDialogButtonFromShortcutClicked(View view) {
         final int viewId = view.getId();
         if (viewId == R.id.permission_enable_allow_button) {
@@ -397,17 +437,13 @@
     }
 
     private void onAllowButtonFromShortcutClicked() {
-        mShortcutPreference.setChecked(true);
-
-        final int shortcutTypes = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
-        AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes, mComponentName);
+        mIsDialogShown.set(false);
+        showPopupDialog(DialogEnums.EDIT_SHORTCUT);
 
         mDialog.dismiss();
     }
 
     private void onDenyButtonFromShortcutClicked() {
-        mShortcutPreference.setChecked(false);
-
         mDialog.dismiss();
     }
 
@@ -417,7 +453,7 @@
             mToggleServiceDividerSwitchPreference.setChecked(false);
             getArguments().putBoolean(AccessibilitySettings.EXTRA_CHECKED,
                     /* disableService */ false);
-            if (!mShortcutPreference.getChecked()) {
+            if (!mShortcutPreference.isChecked()) {
                 showPopupDialog(DialogEnums.ENABLE_WARNING_FROM_TOGGLE);
             } else {
                 handleConfirmServiceEnabled(/* confirmed= */ true);
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 838a758..0b8353e 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -69,7 +69,7 @@
  * and dialog management.
  */
 public abstract class ToggleFeaturePreferenceFragment extends SettingsPreferenceFragment
-        implements ShortcutPreference.OnClickListener {
+        implements ShortcutPreference.OnClickCallback {
 
     protected DividerSwitchPreference mToggleServiceDividerSwitchPreference;
     protected ShortcutPreference mShortcutPreference;
@@ -277,33 +277,38 @@
          */
         int ENABLE_WARNING_FROM_TOGGLE = 1002;
 
-
         /** OPEN: Settings > Accessibility > Downloaded toggle service > Shortcut checkbox. */
         int ENABLE_WARNING_FROM_SHORTCUT = 1003;
 
         /**
+         * OPEN: Settings > Accessibility > Downloaded toggle service > Shortcut checkbox
+         * toggle.
+         */
+        int ENABLE_WARNING_FROM_SHORTCUT_TOGGLE = 1004;
+
+        /**
          * OPEN: Settings > Accessibility > Downloaded toggle service > Toggle use service to
          * disable service.
          */
-        int DISABLE_WARNING_FROM_TOGGLE = 1004;
+        int DISABLE_WARNING_FROM_TOGGLE = 1005;
 
         /**
          * OPEN: Settings > Accessibility > Magnification > Toggle user service in button
          * navigation.
          */
-        int ACCESSIBILITY_BUTTON_TUTORIAL = 1005;
+        int ACCESSIBILITY_BUTTON_TUTORIAL = 1006;
 
         /**
          * OPEN: Settings > Accessibility > Magnification > Toggle user service in gesture
          * navigation.
          */
-        int GESTURE_NAVIGATION_TUTORIAL = 1006;
+        int GESTURE_NAVIGATION_TUTORIAL = 1007;
 
         /**
          * OPEN: Settings > Accessibility > Downloaded toggle service > Toggle user service > Show
          * launch tutorial.
          */
-        int LAUNCH_ACCESSIBILITY_TUTORIAL = 1007;
+        int LAUNCH_ACCESSIBILITY_TUTORIAL = 1008;
     }
 
     @Override
@@ -516,7 +521,15 @@
         SharedPreferenceUtils.setUserShortcutType(context, info);
     }
 
-    private String getShortcutTypeSummary(Context context) {
+    protected CharSequence getShortcutTypeSummary(Context context) {
+        if (!mShortcutPreference.isSettingsEditable()) {
+            return context.getText(R.string.accessibility_shortcut_edit_dialog_title_hardware);
+        }
+
+        if (!mShortcutPreference.isChecked()) {
+            return context.getText(R.string.switch_off_text);
+        }
+
         final int shortcutType = getUserShortcutType(context, UserShortcutType.SOFTWARE);
         int resId = R.string.accessibility_shortcut_edit_summary_software;
         if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
@@ -569,12 +582,13 @@
         }
 
         updateUserShortcutType(/* saveChanges= */ true);
-        if (mShortcutPreference.getChecked()) {
+        if (mShortcutPreference.isChecked()) {
             AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), mUserShortcutType,
                     mComponentName);
             AccessibilityUtil.optOutAllValuesFromSettings(getPrefContext(), ~mUserShortcutType,
                     mComponentName);
         }
+        mShortcutPreference.setChecked(true);
         mShortcutPreference.setSummary(
                 getShortcutTypeSummary(getPrefContext()));
     }
@@ -606,7 +620,7 @@
         mShortcutPreference = new ShortcutPreference(getPrefContext(), null);
         mShortcutPreference.setPersistent(false);
         mShortcutPreference.setKey(getShortcutPreferenceKey());
-        mShortcutPreference.setOnClickListener(this);
+        mShortcutPreference.setOnClickCallback(this);
 
         final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
         mShortcutPreference.setTitle(title);
@@ -629,19 +643,20 @@
     }
 
     @Override
-    public void onCheckboxClicked(ShortcutPreference preference) {
+    public void onToggleClicked(ShortcutPreference preference) {
         if (mComponentName == null) {
             return;
         }
 
         final int shortcutTypes = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
-        if (preference.getChecked()) {
+        if (preference.isChecked()) {
             AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes,
                     mComponentName);
         } else {
             AccessibilityUtil.optOutAllValuesFromSettings(getPrefContext(), shortcutTypes,
                     mComponentName);
         }
+        mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
     }
 
     @Override
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index e31feaa..6716234 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -330,7 +330,12 @@
         SharedPreferenceUtils.setUserShortcutType(context, info);
     }
 
-    private String getShortcutTypeSummary(Context context) {
+    @Override
+    protected CharSequence getShortcutTypeSummary(Context context) {
+        if (!mShortcutPreference.isChecked()) {
+            return context.getText(R.string.switch_off_text);
+        }
+
         final int shortcutType = getUserShortcutType(context, UserShortcutType.DEFAULT);
         int resId = R.string.accessibility_shortcut_edit_summary_software;
         if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
@@ -381,10 +386,11 @@
 
     private void callOnAlertDialogCheckboxClicked(DialogInterface dialog, int which) {
         updateUserShortcutType(/* saveChanges= */ true);
-        if (mShortcutPreference.getChecked()) {
+        if (mShortcutPreference.isChecked()) {
             optInAllMagnificationValuesToSettings(getPrefContext(), mUserShortcutType);
             optOutAllMagnificationValuesFromSettings(getPrefContext(), ~mUserShortcutType);
         }
+        mShortcutPreference.setChecked(true);
         mShortcutPreference.setSummary(
                 getShortcutTypeSummary(getPrefContext()));
     }
@@ -442,13 +448,14 @@
     }
 
     @Override
-    public void onCheckboxClicked(ShortcutPreference preference) {
+    public void onToggleClicked(ShortcutPreference preference) {
         final int shortcutTypes = getUserShortcutType(getPrefContext(), UserShortcutType.SOFTWARE);
-        if (preference.getChecked()) {
+        if (preference.isChecked()) {
             optInAllMagnificationValuesToSettings(getPrefContext(), shortcutTypes);
         } else {
             optOutAllMagnificationValuesFromSettings(getPrefContext(), shortcutTypes);
         }
+        mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
     }
 
     @Override
@@ -473,7 +480,7 @@
         mShortcutPreference.setPersistent(false);
         mShortcutPreference.setKey(KEY_SHORTCUT_PREFERENCE);
         mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
-        mShortcutPreference.setOnClickListener(this);
+        mShortcutPreference.setOnClickCallback(this);
 
         final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
         mShortcutPreference.setTitle(title);
diff --git a/tests/robotests/src/com/android/settings/accessibility/ShortcutPreferenceTest.java b/tests/robotests/src/com/android/settings/accessibility/ShortcutPreferenceTest.java
index f3522a9..597e94e 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ShortcutPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ShortcutPreferenceTest.java
@@ -44,10 +44,10 @@
     private PreferenceViewHolder mPreferenceViewHolder;
     private String mResult;
 
-    private ShortcutPreference.OnClickListener mListener =
-            new ShortcutPreference.OnClickListener() {
+    private ShortcutPreference.OnClickCallback mListener =
+            new ShortcutPreference.OnClickCallback() {
                 @Override
-                public void onCheckboxClicked(ShortcutPreference preference) {
+                public void onToggleClicked(ShortcutPreference preference) {
                     mResult = CHECKBOX_CLICKED;
                 }
 
@@ -71,19 +71,19 @@
     @Test
     public void clickLinearLayout_checkboxClicked() {
         mShortcutPreference.onBindViewHolder(mPreferenceViewHolder);
-        mShortcutPreference.setOnClickListener(mListener);
+        mShortcutPreference.setOnClickCallback(mListener);
 
         LinearLayout mainFrame = mPreferenceViewHolder.itemView.findViewById(R.id.main_frame);
         mainFrame.performClick();
 
         assertThat(mResult).isEqualTo(CHECKBOX_CLICKED);
-        assertThat(mShortcutPreference.getChecked()).isTrue();
+        assertThat(mShortcutPreference.isChecked()).isTrue();
     }
 
     @Test
     public void clickSettings_settingsClicked() {
         mShortcutPreference.onBindViewHolder(mPreferenceViewHolder);
-        mShortcutPreference.setOnClickListener(mListener);
+        mShortcutPreference.setOnClickCallback(mListener);
 
         View settings = mPreferenceViewHolder.itemView.findViewById(android.R.id.widget_frame);
         settings.performClick();
@@ -95,6 +95,6 @@
     public void setCheckedTrue_getCheckedIsTrue() {
         mShortcutPreference.setChecked(true);
 
-        assertThat(mShortcutPreference.getChecked()).isEqualTo(true);
+        assertThat(mShortcutPreference.isChecked()).isEqualTo(true);
     }
 }
