diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7291fad..c5d000b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12882,4 +12882,7 @@
 
     <!-- Authority of the content provider that support methods restartPhoneProcess and restartRild. Will be overlaid by OEM.-->
     <string name="reset_telephony_stack_content_provider_authority" translatable="false"></string>
+
+    <!--Text for Stylus Pointer Icon preference -->
+    <string name="show_stylus_pointer_icon">Show pointer while hovering</string>
 </resources>
diff --git a/src/com/android/settings/connecteddevice/stylus/StylusDevicesController.java b/src/com/android/settings/connecteddevice/stylus/StylusDevicesController.java
index d8e8887..cd23103 100644
--- a/src/com/android/settings/connecteddevice/stylus/StylusDevicesController.java
+++ b/src/com/android/settings/connecteddevice/stylus/StylusDevicesController.java
@@ -24,6 +24,7 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
+import android.hardware.input.InputSettings;
 import android.os.Process;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -73,6 +74,8 @@
     static final String KEY_IGNORE_BUTTON = "ignore_button";
     @VisibleForTesting
     static final String KEY_DEFAULT_NOTES = "default_notes";
+    @VisibleForTesting
+    static final String KEY_SHOW_STYLUS_POINTER_ICON = "show_stylus_pointer_icon";
 
     private static final String TAG = "StylusDevicesController";
 
@@ -181,6 +184,26 @@
         return pref;
     }
 
+    @Nullable
+    private SwitchPreferenceCompat createShowStylusPointerIconPreference(
+            SwitchPreferenceCompat preference) {
+        if (!mContext.getResources()
+                .getBoolean(com.android.internal.R.bool.config_enableStylusPointerIcon)) {
+            // If the config is not enabled, no need to show the preference to user
+            return null;
+        }
+        SwitchPreferenceCompat pref = preference == null ? new SwitchPreferenceCompat(mContext)
+                : preference;
+        pref.setKey(KEY_SHOW_STYLUS_POINTER_ICON);
+        pref.setTitle(mContext.getString(R.string.show_stylus_pointer_icon));
+        pref.setIcon(R.drawable.ic_stylus);
+        pref.setOnPreferenceClickListener(this);
+        pref.setChecked(Settings.Secure.getInt(mContext.getContentResolver(),
+                Settings.Secure.STYLUS_POINTER_ICON_ENABLED,
+                InputSettings.DEFAULT_STYLUS_POINTER_ICON_ENABLED) == 1);
+        return pref;
+    }
+
     @Override
     public boolean onPreferenceClick(Preference preference) {
         String key = preference.getKey();
@@ -213,6 +236,11 @@
                         Secure.STYLUS_BUTTONS_ENABLED,
                         ((TwoStatePreference) preference).isChecked() ? 0 : 1);
                 break;
+            case KEY_SHOW_STYLUS_POINTER_ICON:
+                Settings.Secure.putInt(mContext.getContentResolver(),
+                        Secure.STYLUS_POINTER_ICON_ENABLED,
+                        ((SwitchPreferenceCompat) preference).isChecked() ? 1 : 0);
+                break;
         }
         return true;
     }
@@ -268,6 +296,13 @@
         if (buttonPref == null) {
             mPreferencesContainer.addPreference(createButtonPressPreference());
         }
+        SwitchPreferenceCompat currShowStylusPointerIconPref = mPreferencesContainer
+                .findPreference(KEY_SHOW_STYLUS_POINTER_ICON);
+        Preference showStylusPointerIconPref =
+                createShowStylusPointerIconPreference(currShowStylusPointerIconPref);
+        if (currShowStylusPointerIconPref == null && showStylusPointerIconPref != null) {
+            mPreferencesContainer.addPreference(showStylusPointerIconPref);
+        }
     }
 
     private boolean currentInputMethodSupportsHandwriting() {
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java
index a540d28..135be4b 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/stylus/StylusDevicesControllerTest.java
@@ -221,7 +221,7 @@
 
         showScreen(controller);
 
-        assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(3);
+        assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(4);
     }
 
     @Test
@@ -249,11 +249,12 @@
     @Test
     public void btStylusInputDevice_showsAllPreferences() {
         showScreen(mController);
+
         Preference defaultNotesPref = mPreferenceContainer.getPreference(0);
         Preference handwritingPref = mPreferenceContainer.getPreference(1);
         Preference buttonPref = mPreferenceContainer.getPreference(2);
+        Preference stylusPointerIconPref = mPreferenceContainer.getPreference(3);
 
-        assertThat(mPreferenceContainer.getPreferenceCount()).isEqualTo(3);
         assertThat(defaultNotesPref.getTitle().toString()).isEqualTo(
                 mContext.getString(R.string.stylus_default_notes_app));
         assertThat(defaultNotesPref.isVisible()).isTrue();
@@ -263,6 +264,9 @@
         assertThat(buttonPref.getTitle().toString()).isEqualTo(
                 mContext.getString(R.string.stylus_ignore_button));
         assertThat(buttonPref.isVisible()).isTrue();
+        assertThat(stylusPointerIconPref.getTitle().toString()).isEqualTo(
+                mContext.getString(R.string.show_stylus_pointer_icon));
+        assertThat(stylusPointerIconPref.isVisible()).isTrue();
     }
 
     @Test
@@ -551,6 +555,46 @@
                 Secure.STYLUS_BUTTONS_ENABLED, -1)).isEqualTo(1);
     }
 
+    @Test
+    public void stylusPointerIconPreference_checkedWhenFlagTrue() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.STYLUS_POINTER_ICON_ENABLED, 1);
+
+        showScreen(mController);
+        SwitchPreferenceCompat stylusPointerIconPref =
+                (SwitchPreferenceCompat) mPreferenceContainer.getPreference(3);
+
+        assertThat(stylusPointerIconPref.isChecked()).isEqualTo(true);
+    }
+
+    @Test
+    public void stylusPointerIconPreference_uncheckedWhenFlagFalse() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.STYLUS_POINTER_ICON_ENABLED, 0);
+
+        showScreen(mController);
+        SwitchPreferenceCompat stylusPointerIconPref =
+                (SwitchPreferenceCompat) mPreferenceContainer.getPreference(3);
+
+        assertThat(stylusPointerIconPref.isChecked()).isEqualTo(false);
+    }
+
+    @Test
+    public void stylusPointerIconPreference_updatesFlagOnClick() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.STYLUS_POINTER_ICON_ENABLED, 0);
+
+        showScreen(mController);
+        SwitchPreferenceCompat stylusPointerIconPref =
+                (SwitchPreferenceCompat) mPreferenceContainer.getPreference(3);
+
+        stylusPointerIconPref.performClick();
+
+        assertThat(stylusPointerIconPref.isChecked()).isEqualTo(true);
+        assertThat(Settings.Secure.getInt(mContext.getContentResolver(),
+                Secure.STYLUS_POINTER_ICON_ENABLED, -1)).isEqualTo(1);
+    }
+
     private void showScreen(StylusDevicesController controller) {
         controller.displayPreference(mScreen);
     }
