Allow ANGLE developer option toggle UI enabled if ANGLE is enabled.
Previously the ANGLE developer option toggle UI was disabled by default and a user would need to use adb command to set the debug property to true to enable it, and every reboot would reset the debug property to false again and hence disable the toggle UI again. However, since ANGLE is still in experiment, we would like to make sure it's not easy to enable but easy to disable. This patch keeps ANGLE toggle UI enabled when ANGLE is enabled so that users can easily disable. Once ANGLE is disabled, if the debug property is not set to true, the toggle UI will remain disabled. Bug: b/293503000 Test: atest -c GraphicsDriverEnableAngleAsSystemDriverControllerJUnitTest Test: atest SettingsRoboTests:GraphicsDriverEnableAngleAsSystemDriverControllerTest Change-Id: I2e63431cd0d8cf4712fc278646627fbf34a2b542
This commit is contained in:
@@ -170,9 +170,10 @@ public class GraphicsDriverEnableAngleAsSystemDriverController
|
||||
((SwitchPreference) mPreference).setChecked(false);
|
||||
}
|
||||
|
||||
// Regardless of whether ANGLE is enabled, disable the developer option UI
|
||||
// as long as UI is not enabled via debug property.
|
||||
if (!isAngleDeveloperOptionEnabled()) {
|
||||
// Disable the developer option toggle UI if ANGLE is disabled, this means next time the
|
||||
// debug property needs to be set to true again to enable ANGLE. If ANGLE is enabled, don't
|
||||
// disable the developer option toggle UI so that it can be turned off easily.
|
||||
if (!isAngleDeveloperOptionEnabled() && !((SwitchPreference) mPreference).isChecked()) {
|
||||
mPreference.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user