diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4f67a35..5d4487c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -10440,6 +10440,13 @@
         <item>@string/graphics_driver_app_preference_system</item>
     </string-array>
 
+    <!-- Debugging developer settings: enable angle as system driver? [CHAR LIMIT=50] -->
+    <string name="enable_angle_as_system_driver">Enable ANGLE</string>
+    <!-- Debugging developer settings: enable angle as system driver summary [CHAR LIMIT=NONE] -->
+    <string name="enable_angle_as_system_driver_summary">Enable ANGLE as system OpenGL ES driver</string>
+    <!--Dialog body text used to explain a reboot is required after changing ANGLE as system GLES driver setting-->
+    <string name="reboot_dialog_enable_angle_as_system_driver">A reboot is required to change the system OpenGL ES driver</string>
+
     <!-- Title for App Compatibility Changes dashboard where developers can configure per-app overrides for compatibility changes [CHAR LIMIT=50] -->
     <string name="platform_compat_dashboard_title">App Compatibility Changes</string>
     <!-- Summary for App Compatibility Changes dashboard [CHAR LIMIT=NONE] -->
diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml
index b5ce57e..eb17fbf 100644
--- a/res/xml/development_settings.xml
+++ b/res/xml/development_settings.xml
@@ -243,6 +243,11 @@
             android:title="@string/enable_gpu_debug_layers"
             android:summary="@string/enable_gpu_debug_layers_summary" />
 
+        <SwitchPreference
+            android:key="enable_angle_as_system_driver"
+            android:title="@string/enable_angle_as_system_driver"
+            android:summary="@string/enable_angle_as_system_driver_summary" />
+
         <Preference
             android:key="graphics_driver_dashboard"
             android:title="@string/graphics_driver_dashboard_title"
diff --git a/src/com/android/settings/development/DesktopModePreferenceController.java b/src/com/android/settings/development/DesktopModePreferenceController.java
index 912809c..0e257f6 100644
--- a/src/com/android/settings/development/DesktopModePreferenceController.java
+++ b/src/com/android/settings/development/DesktopModePreferenceController.java
@@ -19,7 +19,6 @@
 import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
 
 import android.content.Context;
-import android.content.Intent;
 import android.os.Build;
 import android.provider.Settings;
 
@@ -83,12 +82,6 @@
         ((SwitchPreference) mPreference).setChecked(false);
     }
 
-    @Override
-    public void onRebootConfirmed() {
-        final Intent intent = new Intent(Intent.ACTION_REBOOT);
-        mContext.startActivity(intent);
-    }
-
     @VisibleForTesting
     String getBuildType() {
         return Build.TYPE;
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 194a13a..f8ce975 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -66,6 +66,7 @@
 import com.android.settings.development.bluetooth.BluetoothHDAudioPreferenceController;
 import com.android.settings.development.bluetooth.BluetoothQualityDialogPreferenceController;
 import com.android.settings.development.bluetooth.BluetoothSampleRateDialogPreferenceController;
+import com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController;
 import com.android.settings.development.qstile.DevelopmentTiles;
 import com.android.settings.development.storage.SharedDataPreferenceController;
 import com.android.settings.overlay.FeatureFactory;
@@ -640,6 +641,7 @@
         controllers.add(new SelectDebugAppPreferenceController(context, fragment));
         controllers.add(new WaitForDebuggerPreferenceController(context));
         controllers.add(new EnableGpuDebugLayersPreferenceController(context));
+        controllers.add(new GraphicsDriverEnableAngleAsSystemDriverController(context, fragment));
         controllers.add(new ForcePeakRefreshRatePreferenceController(context));
         controllers.add(new EnableVerboseVendorLoggingPreferenceController(context));
         controllers.add(new VerifyAppsOverUsbPreferenceController(context));
diff --git a/src/com/android/settings/development/FreeformWindowsPreferenceController.java b/src/com/android/settings/development/FreeformWindowsPreferenceController.java
index 47b6485..8bb2b1c 100644
--- a/src/com/android/settings/development/FreeformWindowsPreferenceController.java
+++ b/src/com/android/settings/development/FreeformWindowsPreferenceController.java
@@ -17,7 +17,6 @@
 package com.android.settings.development;
 
 import android.content.Context;
-import android.content.Intent;
 import android.os.Build;
 import android.provider.Settings;
 
@@ -81,12 +80,6 @@
         ((SwitchPreference) mPreference).setChecked(false);
     }
 
-    @Override
-    public void onRebootConfirmed() {
-        final Intent intent = new Intent(Intent.ACTION_REBOOT);
-        mContext.startActivity(intent);
-    }
-
     @VisibleForTesting
     String getBuildType() {
         return Build.TYPE;
diff --git a/src/com/android/settings/development/RebootConfirmationDialogFragment.java b/src/com/android/settings/development/RebootConfirmationDialogFragment.java
index 84409d1..2fa0747 100644
--- a/src/com/android/settings/development/RebootConfirmationDialogFragment.java
+++ b/src/com/android/settings/development/RebootConfirmationDialogFragment.java
@@ -37,22 +37,33 @@
     private static final String TAG = "FreeformPrefRebootDlg";
 
     private final int mMessageId;
+    private final int mCancelButtonId;
     private final RebootConfirmationDialogHost mHost;
 
     /**
      * Show an instance of this dialog.
      */
     public static void show(Fragment fragment, int messageId, RebootConfirmationDialogHost host) {
+        show(fragment, messageId, R.string.reboot_dialog_reboot_later, host);
+    }
+
+    /**
+     * Show an instance of this dialog with cancel button string set as cancelButtonId
+     */
+    public static void show(Fragment fragment, int messageId,
+            int cancelButtonId, RebootConfirmationDialogHost host) {
         final FragmentManager manager = fragment.getActivity().getSupportFragmentManager();
         if (manager.findFragmentByTag(TAG) == null) {
             final RebootConfirmationDialogFragment dialog =
-                    new RebootConfirmationDialogFragment(messageId, host);
+                    new RebootConfirmationDialogFragment(messageId, cancelButtonId, host);
             dialog.show(manager, TAG);
         }
     }
 
-    private RebootConfirmationDialogFragment(int messageId, RebootConfirmationDialogHost host) {
+    private RebootConfirmationDialogFragment(int messageId,
+            int cancelButtonId, RebootConfirmationDialogHost host) {
         mMessageId = messageId;
+        mCancelButtonId = cancelButtonId;
         mHost = host;
     }
 
@@ -66,12 +77,16 @@
         return new AlertDialog.Builder(getActivity())
                 .setMessage(mMessageId)
                 .setPositiveButton(R.string.reboot_dialog_reboot_now, this)
-                .setNegativeButton(R.string.reboot_dialog_reboot_later, null)
+                .setNegativeButton(mCancelButtonId, this)
                 .create();
     }
 
     @Override
     public void onClick(DialogInterface dialog, int which) {
-        mHost.onRebootConfirmed();
+        if (which == DialogInterface.BUTTON_POSITIVE) {
+            mHost.onRebootConfirmed(getContext());
+        } else {
+            mHost.onRebootCancelled();
+        }
     }
 }
diff --git a/src/com/android/settings/development/RebootConfirmationDialogHost.java b/src/com/android/settings/development/RebootConfirmationDialogHost.java
index 6eb9f2f..65ffbed 100644
--- a/src/com/android/settings/development/RebootConfirmationDialogHost.java
+++ b/src/com/android/settings/development/RebootConfirmationDialogHost.java
@@ -16,13 +16,26 @@
 
 package com.android.settings.development;
 
+import android.content.Context;
+import android.content.Intent;
+
 /**
  * Host of {@link RebootConfirmationDialogFragment} that provides callback when user
  * interacts with the UI.
  */
 public interface RebootConfirmationDialogHost {
     /**
-     * Called when user made a decision on whether to reboot the device.
+     * Called when user made a decision to reboot the device.
      */
-    void onRebootConfirmed();
+    default void onRebootConfirmed(Context context) {
+        // user presses button "Reboot now", reboot the device
+        final Intent intent = new Intent(Intent.ACTION_REBOOT);
+        context.startActivity(intent);
+    }
+
+    /**
+     * Called when user made a decision to cancel the reboot
+     * Default to do nothing
+     */
+    default void onRebootCancelled() {}
 }
diff --git a/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java b/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java
new file mode 100644
index 0000000..b9f3413
--- /dev/null
+++ b/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverController.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2023 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.development.graphicsdriver;
+
+import android.content.Context;
+import android.os.GraphicsEnvironment;
+import android.os.SystemProperties;
+import android.text.TextUtils;
+import android.util.Log;
+
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+import androidx.preference.SwitchPreference;
+
+import com.android.settings.R;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.development.DevelopmentSettingsDashboardFragment;
+import com.android.settings.development.RebootConfirmationDialogFragment;
+import com.android.settings.development.RebootConfirmationDialogHost;
+import com.android.settingslib.development.DeveloperOptionsPreferenceController;
+
+/**
+ * Controller to handle the events when user toggles this developer option switch: Enable ANGLE
+ */
+public class GraphicsDriverEnableAngleAsSystemDriverController
+        extends DeveloperOptionsPreferenceController
+        implements Preference.OnPreferenceChangeListener,
+                PreferenceControllerMixin,
+                RebootConfirmationDialogHost {
+
+    private static final String TAG = "GraphicsEnableAngleCtrl";
+
+    private static final String ENABLE_ANELE_AS_SYSTEM_DRIVER_KEY = "enable_angle_as_system_driver";
+
+    private final DevelopmentSettingsDashboardFragment mFragment;
+
+    @VisibleForTesting
+    static final String PROPERTY_RO_GFX_ANGLE_SUPPORTED = "ro.gfx.angle.supported";
+
+    @VisibleForTesting
+    static final String PROPERTY_PERSISTENT_GRAPHICS_EGL = "persist.graphics.egl";
+
+    @VisibleForTesting
+    static final String ANGLE_DRIVER_SUFFIX = "angle";
+
+
+    public GraphicsDriverEnableAngleAsSystemDriverController(
+            Context context, DevelopmentSettingsDashboardFragment fragment) {
+        super(context);
+        mFragment = fragment;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return ENABLE_ANELE_AS_SYSTEM_DRIVER_KEY;
+    }
+
+    @Override
+    public boolean onPreferenceChange(Preference preference, Object newValue) {
+        final boolean enableAngleAsSystemDriver = (Boolean) newValue;
+        // set "persist.graphics.egl" to "angle" if enableAngleAsSystemDriver is true
+        // set "persist.graphics.egl" to "" if enableAngleAsSystemDriver is false
+        GraphicsEnvironment.getInstance().toggleAngleAsSystemDriver(enableAngleAsSystemDriver);
+        // pop up a window asking user to reboot to make the new "persist.graphics.egl" take effect
+        RebootConfirmationDialogFragment.show(
+                mFragment, R.string.reboot_dialog_enable_angle_as_system_driver,
+                R.string.cancel, this);
+        return true;
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        // set switch on if "persist.graphics.egl" is "angle" and angle is built in /vendor
+        // set switch off otherwise.
+        final String currentGlesDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
+        final boolean isAngle = TextUtils.equals(ANGLE_DRIVER_SUFFIX, currentGlesDriver);
+        final boolean isAngleSupported =
+                TextUtils.equals(SystemProperties.get(PROPERTY_RO_GFX_ANGLE_SUPPORTED), "true");
+        ((SwitchPreference) mPreference).setChecked(isAngle && isAngleSupported);
+        ((SwitchPreference) mPreference).setEnabled(isAngleSupported);
+    }
+
+    @Override
+    protected void onDeveloperOptionsSwitchEnabled() {
+        // only enable the switch if ro.gfx.angle.supported is true
+        // we use ro.gfx.angle.supported to indicate if ANGLE libs are installed under /vendor
+        final boolean isAngleSupported =
+                TextUtils.equals(SystemProperties.get(PROPERTY_RO_GFX_ANGLE_SUPPORTED), "true");
+        ((SwitchPreference) mPreference).setEnabled(isAngleSupported);
+    }
+
+    @Override
+    protected void onDeveloperOptionsSwitchDisabled() {
+        // 1) set the persist.graphics.egl empty string
+        GraphicsEnvironment.getInstance().toggleAngleAsSystemDriver(false);
+        // 2) reset the switch
+        ((SwitchPreference) mPreference).setChecked(false);
+        // 3) disable switch
+        ((SwitchPreference) mPreference).setEnabled(false);
+    }
+
+    @Override
+    public void onRebootCancelled() {
+        // if user presses button "Cancel", do not reboot the device, and toggles switch back
+        final String currentGlesDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
+        if (TextUtils.equals(ANGLE_DRIVER_SUFFIX, currentGlesDriver)) {
+            // if persist.graphics.egl = "angle", set the property value back to ""
+            GraphicsEnvironment.getInstance().toggleAngleAsSystemDriver(false);
+            // toggle switch off
+            ((SwitchPreference) mPreference).setChecked(false);
+            return;
+        }
+
+        if (TextUtils.isEmpty(currentGlesDriver)) {
+            // if persist.graphicx.egl = "", set the persist.graphics.egl back to "angle"
+            GraphicsEnvironment.getInstance().toggleAngleAsSystemDriver(true);
+            // toggle switch on
+            ((SwitchPreference) mPreference).setChecked(true);
+            return;
+        }
+
+        // if persist.graphics.egl holds values other than the above two, log error message
+        Log.e(TAG, "Invalid persist.graphics.egl property value");
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java b/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java
new file mode 100644
index 0000000..314f8c3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/development/graphicsdriver/GraphicsDriverEnableAngleAsSystemDriverControllerTest.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2023 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.development.graphicsdriver;
+
+import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.ANGLE_DRIVER_SUFFIX;
+import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_PERSISTENT_GRAPHICS_EGL;
+import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableAngleAsSystemDriverController.PROPERTY_RO_GFX_ANGLE_SUPPORTED;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.os.SystemProperties;
+
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
+import com.android.settings.development.DevelopmentSettingsDashboardFragment;
+import com.android.settings.development.RebootConfirmationDialogFragment;
+
+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.shadows.ShadowSystemProperties;
+
+@RunWith(RobolectricTestRunner.class)
+public class GraphicsDriverEnableAngleAsSystemDriverControllerTest {
+    private static final String TAG = "GraphicsDriverEnableAngleAsSystemDriverControllerTest";
+    @Mock private PreferenceScreen mScreen;
+    @Mock private SwitchPreference mPreference;
+    @Mock private DevelopmentSettingsDashboardFragment mFragment;
+    @Mock private FragmentActivity mActivity;
+    @Mock private FragmentManager mFragmentManager;
+    @Mock private FragmentTransaction mTransaction;
+
+    private GraphicsDriverEnableAngleAsSystemDriverController mController;
+
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        doReturn(mTransaction).when(mFragmentManager).beginTransaction();
+        doReturn(mFragmentManager).when(mActivity).getSupportFragmentManager();
+        doReturn(mActivity).when(mFragment).getActivity();
+        mController = new GraphicsDriverEnableAngleAsSystemDriverController(mContext, mFragment);
+        when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+        mController.displayPreference(mScreen);
+    }
+
+    @Test
+    public void onPreferenceChange_switchOn_shouldEnableAngleAsSystemDriver() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "true");
+        // since GraphicsEnvironment is mocked in Robolectric test environment,
+        // we will override the system property persist.graphics.egl as if it is changed by
+        // mGraphicsEnvironment.toggleAngleAsSystemDriver(true).
+        // TODO: b/270994705 yuxinhu:
+        // add test coverage to test mGraphicsEnvironment.toggleAngleAsSystemDriver()
+        // works properly on Android devices / emulators.
+        ShadowSystemProperties.override(PROPERTY_PERSISTENT_GRAPHICS_EGL, ANGLE_DRIVER_SUFFIX);
+        mController.onPreferenceChange(mPreference, true);
+        final String systemEGLDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
+        assertThat(systemEGLDriver).isEqualTo(ANGLE_DRIVER_SUFFIX); // empty
+        verify(mTransaction).add(any(RebootConfirmationDialogFragment.class), any());
+    }
+
+    @Test
+    public void onPreferenceChange_switchOff_shouldDisableAngleAsSystemDriver() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "true");
+        // since GraphicsEnvironment is mocked in Robolectric test environment,
+        // we will override the system property persist.graphics.egl as if it is changed by
+        // mGraphicsEnvironment.toggleAngleAsSystemDriver(false).
+        // TODO: b/270994705 yuxinhu:
+        // add test coverage to test mGraphicsEnvironment.toggleAngleAsSystemDriver()
+        // works properly on Android devices / emulators.
+        ShadowSystemProperties.override(PROPERTY_PERSISTENT_GRAPHICS_EGL, "");
+        mController.onPreferenceChange(mPreference, false);
+        final String systemEGLDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
+        assertThat(systemEGLDriver).isEqualTo("");
+        verify(mTransaction).add(any(RebootConfirmationDialogFragment.class), any());
+    }
+
+    @Test
+    public void updateState_angleNotSupported_preferenceShouldNotBeChecked() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "");
+        mController.updateState(mPreference);
+        verify(mPreference).setChecked(false);
+    }
+
+    @Test
+    public void updateState_angleNotSupported_preferenceShouldNotBeEnabled() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "");
+        mController.updateState(mPreference);
+        verify(mPreference).setEnabled(false);
+    }
+
+    @Test
+    public void updateState_angleSupported_angleUsed_preferenceShouldBeChecked() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "true");
+        // TODO: b/270994705 yuxinhu:
+        // add test coverage to test mGraphicsEnvironment.toggleAngleAsSystemDriver()
+        // works properly on Android devices / emulators.
+        ShadowSystemProperties.override(PROPERTY_PERSISTENT_GRAPHICS_EGL, ANGLE_DRIVER_SUFFIX);
+        mController.updateState(mPreference);
+        verify(mPreference).setChecked(true); //false
+    }
+
+    @Test
+    public void updateState_angleSupported_angleNotUsed_preferenceShouldNotBeChecked() {
+        ShadowSystemProperties.override(PROPERTY_RO_GFX_ANGLE_SUPPORTED, "true");
+        // TODO: b/270994705 yuxinhu:
+        // add test coverage to test mGraphicsEnvironment.toggleAngleAsSystemDriver(false)
+        // works properly on Android devices / emulators.
+        ShadowSystemProperties.override(PROPERTY_PERSISTENT_GRAPHICS_EGL, "");
+        mController.updateState(mPreference);
+        verify(mPreference).setChecked(false);
+    }
+
+    @Test
+    public void onDeveloperOptionSwitchDisabled_shouldDisableAngleAsSystemDriver() {
+        mController.onDeveloperOptionsSwitchDisabled();
+        final String systemEGLDriver = SystemProperties.get(PROPERTY_PERSISTENT_GRAPHICS_EGL);
+        assertThat(systemEGLDriver).isEqualTo("");
+    }
+
+    @Test
+    public void onDeveloperOptionSwitchDisabled_preferenceShouldNotBeChecked() {
+        mController.onDeveloperOptionsSwitchDisabled();
+        verify(mPreference).setChecked(false);
+    }
+
+    @Test
+    public void onDeveloperOptionsSwitchDisabled_preferenceShouldNotBeEnabled() {
+        mController.onDeveloperOptionsSwitchDisabled();
+        verify(mPreference).setEnabled(false);
+    }
+}
