Rename game driver to updatable driver.
Game driver is considered a production name. We should use the term updatable driver instead of the production name. Bug: b/164449016 Test: make RunSettingsRoboTests ROBOTEST_FILTER=GraphicsDriver Change-Id: I2237dfb22ecd94bc2475249b1460796ac1693d81
This commit is contained in:
@@ -16,10 +16,10 @@
|
||||
|
||||
package com.android.settings.development.graphicsdriver;
|
||||
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.GAME_DRIVER_ALL_APPS;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.GAME_DRIVER_PRERELEASE_ALL_APPS;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.UPDATABLE_DRIVER_DEFAULT;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.UPDATABLE_DRIVER_OFF;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.UPDATABLE_DRIVER_PRERELEASE_ALL_APPS;
|
||||
import static com.android.settings.development.graphicsdriver.GraphicsDriverEnableForAllAppsPreferenceController.UPDATABLE_DRIVER_PRODUCTION_ALL_APPS;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
@@ -36,7 +36,7 @@ import com.android.settingslib.core.lifecycle.events.OnStop;
|
||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||
|
||||
/**
|
||||
* Controller of global switch bar used to fully turn off Game Driver.
|
||||
* Controller of global switch bar used to fully turn off updatable driver.
|
||||
*/
|
||||
public class GraphicsDriverGlobalSwitchBarController
|
||||
implements SwitchWidgetController.OnSwitchChangeListener,
|
||||
@@ -61,8 +61,9 @@ public class GraphicsDriverGlobalSwitchBarController
|
||||
DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context));
|
||||
mSwitchWidgetController.setChecked(
|
||||
Settings.Global.getInt(
|
||||
mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
|
||||
!= GAME_DRIVER_OFF);
|
||||
mContentResolver, Settings.Global.UPDATABLE_DRIVER_ALL_APPS,
|
||||
UPDATABLE_DRIVER_DEFAULT)
|
||||
!= UPDATABLE_DRIVER_OFF);
|
||||
mSwitchWidgetController.setListener(this);
|
||||
}
|
||||
|
||||
@@ -81,21 +82,22 @@ public class GraphicsDriverGlobalSwitchBarController
|
||||
@Override
|
||||
public boolean onSwitchToggled(boolean isChecked) {
|
||||
final int graphicsDriverGlobalOption = Settings.Global.getInt(
|
||||
mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
|
||||
mContentResolver, Settings.Global.UPDATABLE_DRIVER_ALL_APPS,
|
||||
UPDATABLE_DRIVER_DEFAULT);
|
||||
|
||||
if (isChecked
|
||||
&& (graphicsDriverGlobalOption == GAME_DRIVER_DEFAULT
|
||||
|| graphicsDriverGlobalOption == GAME_DRIVER_ALL_APPS
|
||||
|| graphicsDriverGlobalOption == GAME_DRIVER_PRERELEASE_ALL_APPS)) {
|
||||
&& (graphicsDriverGlobalOption == UPDATABLE_DRIVER_DEFAULT
|
||||
|| graphicsDriverGlobalOption == UPDATABLE_DRIVER_PRODUCTION_ALL_APPS
|
||||
|| graphicsDriverGlobalOption == UPDATABLE_DRIVER_PRERELEASE_ALL_APPS)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!isChecked && graphicsDriverGlobalOption == GAME_DRIVER_OFF) {
|
||||
if (!isChecked && graphicsDriverGlobalOption == UPDATABLE_DRIVER_OFF) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Settings.Global.putInt(mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS,
|
||||
isChecked ? GAME_DRIVER_DEFAULT : GAME_DRIVER_OFF);
|
||||
Settings.Global.putInt(mContentResolver, Settings.Global.UPDATABLE_DRIVER_ALL_APPS,
|
||||
isChecked ? UPDATABLE_DRIVER_DEFAULT : UPDATABLE_DRIVER_OFF);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -104,7 +106,8 @@ public class GraphicsDriverGlobalSwitchBarController
|
||||
public void onGraphicsDriverContentChanged() {
|
||||
mSwitchWidgetController.setChecked(
|
||||
Settings.Global.getInt(
|
||||
mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
|
||||
!= GAME_DRIVER_OFF);
|
||||
mContentResolver, Settings.Global.UPDATABLE_DRIVER_ALL_APPS,
|
||||
UPDATABLE_DRIVER_DEFAULT)
|
||||
!= UPDATABLE_DRIVER_OFF);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user