diff --git a/res/values/strings.xml b/res/values/strings.xml
index ff3d03cb2d5..b9ff512639b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9982,27 +9982,27 @@
show both names, with the directory name wrapped in parenthesis -->
%1$s (%2$s)
-
- Game Update Package Preferences
-
- Modify Game Update Package settings
-
+
+ Game Driver Preferences
+
+ Modify Game Driver settings
+
When Game Driver is turned on, you can pick to use the updated graphics driver for Apps installed on the device.
-
- Enable for all apps
-
- Select Graphics Driver
-
- Default
-
- Game Update Package
-
- System Graphics Driver
-
-
- - @string/gup_app_preference_default
- - @string/gup_app_preference_gup
- - @string/gup_app_preference_system
+
+ Enable for all apps
+
+ Select Graphics Driver
+
+ Default
+
+ Game Driver
+
+ System Graphics Driver
+
+
+ - @string/game_driver_app_preference_default
+ - @string/game_driver_app_preference_game_driver
+ - @string/game_driver_app_preference_system
diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml
index b1044bb1e1c..cde55433ab1 100644
--- a/res/xml/development_settings.xml
+++ b/res/xml/development_settings.xml
@@ -198,10 +198,10 @@
android:summary="@string/enable_gpu_debug_layers_summary" />
+ android:key="game_driver_dashboard"
+ android:title="@string/game_driver_dashboard_title"
+ android:summary="@string/game_driver_dashboard_summary"
+ android:fragment="com.android.settings.development.gamedriver.GameDriverDashboard" />
diff --git a/res/xml/gup_settings.xml b/res/xml/game_driver_settings.xml
similarity index 63%
rename from res/xml/gup_settings.xml
rename to res/xml/game_driver_settings.xml
index 8b09bd27ed2..a04724a786f 100644
--- a/res/xml/gup_settings.xml
+++ b/res/xml/game_driver_settings.xml
@@ -18,26 +18,26 @@
+ android:key="game_driver_settings"
+ android:title="@string/game_driver_dashboard_title">
+ android:key="game_driver_all_apps_preference"
+ android:title="@string/game_driver_all_apps_preference_title"
+ settings:controller="com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController">
+ android:key="game_driver_category"
+ android:title="@string/game_driver_app_preference_title"
+ settings:controller="com.android.settings.development.gamedriver.GameDriverAppPreferenceController">
+ settings:controller="com.android.settings.development.gamedriver.GameDriverFooterPreferenceController">
diff --git a/src/com/android/settings/development/gup/GupPreferenceController.java b/src/com/android/settings/development/gamedriver/GameDriverAppPreferenceController.java
similarity index 84%
rename from src/com/android/settings/development/gup/GupPreferenceController.java
rename to src/com/android/settings/development/gamedriver/GameDriverAppPreferenceController.java
index 8fed52cc638..659310c2580 100644
--- a/src/com/android/settings/development/gup/GupPreferenceController.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverAppPreferenceController.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
import android.content.ContentResolver;
import android.content.Context;
@@ -53,16 +53,17 @@ import java.util.Set;
/**
* Controller of all the per App based list preferences.
*/
-public class GupPreferenceController extends BasePreferenceController
+public class GameDriverAppPreferenceController extends BasePreferenceController
implements Preference.OnPreferenceChangeListener,
GameDriverContentObserver.OnGameDriverContentChangedListener, LifecycleObserver,
OnStart, OnStop {
+
private final Context mContext;
private final ContentResolver mContentResolver;
private final CharSequence[] mEntryList;
private final String mPreferenceTitle;
private final String mPreferenceDefault;
- private final String mPreferenceGup;
+ private final String mPreferenceGameDriver;
private final String mPreferenceSystem;
@VisibleForTesting
GameDriverContentObserver mGameDriverContentObserver;
@@ -73,7 +74,7 @@ public class GupPreferenceController extends BasePreferenceController
private PreferenceGroup mPreferenceGroup;
- public GupPreferenceController(Context context, String key) {
+ public GameDriverAppPreferenceController(Context context, String key) {
super(context, key);
mContext = context;
@@ -82,28 +83,29 @@ public class GupPreferenceController extends BasePreferenceController
new GameDriverContentObserver(new Handler(Looper.getMainLooper()), this);
final Resources resources = context.getResources();
- mEntryList = resources.getStringArray(R.array.gup_app_preference_values);
- mPreferenceTitle = resources.getString(R.string.gup_app_preference_title);
- mPreferenceDefault = resources.getString(R.string.gup_app_preference_default);
- mPreferenceGup = resources.getString(R.string.gup_app_preference_gup);
- mPreferenceSystem = resources.getString(R.string.gup_app_preference_system);
+ mEntryList = resources.getStringArray(R.array.game_driver_app_preference_values);
+ mPreferenceTitle = resources.getString(R.string.game_driver_app_preference_title);
+ mPreferenceDefault = resources.getString(R.string.game_driver_app_preference_default);
+ mPreferenceGameDriver =
+ resources.getString(R.string.game_driver_app_preference_game_driver);
+ mPreferenceSystem = resources.getString(R.string.game_driver_app_preference_system);
// TODO: Move this task to background if there's potential ANR/Jank.
// Update the UI when all the app infos are ready.
mAppInfos = getAppInfos(context);
mDevOptInApps =
- getGlobalSettingsString(mContentResolver, Settings.Global.GUP_DEV_OPT_IN_APPS);
+ getGlobalSettingsString(mContentResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS);
mDevOptOutApps =
- getGlobalSettingsString(mContentResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS);
+ getGlobalSettingsString(mContentResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS);
}
@Override
public int getAvailabilityStatus() {
return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)
- && (Settings.Global.getInt(
- mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- != GUP_OFF)
+ && (Settings.Global.getInt(mContentResolver,
+ Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ != GAME_DRIVER_OFF)
? AVAILABLE
: CONDITIONALLY_UNAVAILABLE;
}
@@ -154,7 +156,7 @@ public class GupPreferenceController extends BasePreferenceController
if (value.equals(mPreferenceSystem)) {
mDevOptInApps.remove(packageName);
mDevOptOutApps.add(packageName);
- } else if (value.equals(mPreferenceGup)) {
+ } else if (value.equals(mPreferenceGameDriver)) {
mDevOptInApps.add(packageName);
mDevOptOutApps.remove(packageName);
} else {
@@ -165,10 +167,10 @@ public class GupPreferenceController extends BasePreferenceController
listPref.setSummary(value);
// Push the updated Sets for opt-in and opt-out apps to
- // corresponding Settings.Global.GUP_DEV_OPT_(IN|OUT)_APPS
- Settings.Global.putString(mContentResolver, Settings.Global.GUP_DEV_OPT_IN_APPS,
+ // corresponding Settings.Global.GAME_DRIVER_OPT_(IN|OUT)_APPS
+ Settings.Global.putString(mContentResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS,
String.join(",", mDevOptInApps));
- Settings.Global.putString(mContentResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS,
+ Settings.Global.putString(mContentResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS,
String.join(",", mDevOptOutApps));
return true;
@@ -238,13 +240,13 @@ public class GupPreferenceController extends BasePreferenceController
listPreference.setEntryValues(mEntryList);
// Initialize preference default and summary with the opt in/out choices
- // from Settings.Global.GUP_DEV_OPT_(IN|OUT)_APPS
+ // from Settings.Global.GAME_DRIVER_OPT_(IN|OUT)_APPS
if (mDevOptOutApps.contains(packageName)) {
listPreference.setValue(mPreferenceSystem);
listPreference.setSummary(mPreferenceSystem);
} else if (mDevOptInApps.contains(packageName)) {
- listPreference.setValue(mPreferenceGup);
- listPreference.setSummary(mPreferenceGup);
+ listPreference.setValue(mPreferenceGameDriver);
+ listPreference.setSummary(mPreferenceGameDriver);
} else {
listPreference.setValue(mPreferenceDefault);
listPreference.setSummary(mPreferenceDefault);
diff --git a/src/com/android/settings/development/gup/GameDriverContentObserver.java b/src/com/android/settings/development/gamedriver/GameDriverContentObserver.java
similarity index 91%
rename from src/com/android/settings/development/gup/GameDriverContentObserver.java
rename to src/com/android/settings/development/gamedriver/GameDriverContentObserver.java
index 92602134c0f..e31e04640b3 100644
--- a/src/com/android/settings/development/gup/GameDriverContentObserver.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverContentObserver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import android.content.ContentResolver;
import android.database.ContentObserver;
@@ -27,6 +27,7 @@ import androidx.annotation.VisibleForTesting;
* Helper class to observe Game Driver settings global change.
*/
public class GameDriverContentObserver extends ContentObserver {
+
interface OnGameDriverContentChangedListener {
void onGameDriverContentChanged();
}
@@ -47,7 +48,7 @@ public class GameDriverContentObserver extends ContentObserver {
public void register(ContentResolver contentResolver) {
contentResolver.registerContentObserver(
- Settings.Global.getUriFor(Settings.Global.GUP_DEV_ALL_APPS), false, this);
+ Settings.Global.getUriFor(Settings.Global.GAME_DRIVER_ALL_APPS), false, this);
}
public void unregister(ContentResolver contentResolver) {
diff --git a/src/com/android/settings/development/gup/GupDashboard.java b/src/com/android/settings/development/gamedriver/GameDriverDashboard.java
similarity index 77%
rename from src/com/android/settings/development/gup/GupDashboard.java
rename to src/com/android/settings/development/gamedriver/GameDriverDashboard.java
index 392de47bd73..b79af719996 100644
--- a/src/com/android/settings/development/gup/GupDashboard.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverDashboard.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import android.content.Context;
import android.os.Bundle;
@@ -31,12 +31,13 @@ import java.util.List;
/**
* Dashboard for Game Driver preferences.
*/
-public class GupDashboard extends DashboardFragment {
- private static final String TAG = "GupDashboard";
+public class GameDriverDashboard extends DashboardFragment {
+
+ private static final String TAG = "GameDriverDashboard";
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GUP_DASHBOARD;
+ return MetricsProto.MetricsEvent.SETTINGS_GAME_DRIVER_DASHBOARD;
}
@Override
@@ -46,7 +47,7 @@ public class GupDashboard extends DashboardFragment {
@Override
protected int getPreferenceScreenResId() {
- return R.xml.gup_settings;
+ return R.xml.game_driver_settings;
}
@Override
@@ -60,8 +61,9 @@ public class GupDashboard extends DashboardFragment {
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
- final GupGlobalSwitchBarController switchBarController =
- new GupGlobalSwitchBarController(activity, new SwitchBarController(switchBar));
+ final GameDriverGlobalSwitchBarController switchBarController =
+ new GameDriverGlobalSwitchBarController(
+ activity, new SwitchBarController(switchBar));
getLifecycle().addObserver(switchBarController);
switchBar.show();
}
diff --git a/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java b/src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceController.java
similarity index 77%
rename from src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java
rename to src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceController.java
index b71e9f334eb..1afe5d6f4d6 100644
--- a/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceController.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import android.content.ContentResolver;
import android.content.Context;
@@ -36,13 +36,14 @@ import com.android.settingslib.development.DevelopmentSettingsEnabler;
/**
* Controller of global switch to enable Game Driver for all Apps.
*/
-public class GupEnableForAllAppsPreferenceController extends BasePreferenceController
+public class GameDriverEnableForAllAppsPreferenceController extends BasePreferenceController
implements Preference.OnPreferenceChangeListener,
GameDriverContentObserver.OnGameDriverContentChangedListener, LifecycleObserver,
OnStart, OnStop {
- public static final int GUP_DEFAULT = 0;
- public static final int GUP_ALL_APPS = 1;
- public static final int GUP_OFF = 2;
+
+ public static final int GAME_DRIVER_DEFAULT = 0;
+ public static final int GAME_DRIVER_ALL_APPS = 1;
+ public static final int GAME_DRIVER_OFF = 2;
private final Context mContext;
private final ContentResolver mContentResolver;
@@ -51,7 +52,7 @@ public class GupEnableForAllAppsPreferenceController extends BasePreferenceContr
private SwitchPreference mPreference;
- public GupEnableForAllAppsPreferenceController(Context context, String key) {
+ public GameDriverEnableForAllAppsPreferenceController(Context context, String key) {
super(context, key);
mContext = context;
mContentResolver = context.getContentResolver();
@@ -62,9 +63,9 @@ public class GupEnableForAllAppsPreferenceController extends BasePreferenceContr
@Override
public int getAvailabilityStatus() {
return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)
- && (Settings.Global.getInt(
- mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- != GUP_OFF)
+ && (Settings.Global.getInt(mContentResolver,
+ Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ != GAME_DRIVER_OFF)
? AVAILABLE
: CONDITIONALLY_UNAVAILABLE;
}
@@ -89,15 +90,16 @@ public class GupEnableForAllAppsPreferenceController extends BasePreferenceContr
public void updateState(Preference preference) {
final SwitchPreference switchPreference = (SwitchPreference) preference;
switchPreference.setVisible(isAvailable());
- switchPreference.setChecked(Settings.Global.getInt(mContentResolver,
- Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- == GUP_ALL_APPS);
+ switchPreference.setChecked(
+ Settings.Global.getInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ == GAME_DRIVER_ALL_APPS);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- Settings.Global.putInt(mContentResolver, Settings.Global.GUP_DEV_ALL_APPS,
- (boolean) newValue ? GUP_ALL_APPS : GUP_DEFAULT);
+ Settings.Global.putInt(mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS,
+ (boolean) newValue ? GAME_DRIVER_ALL_APPS : GAME_DRIVER_DEFAULT);
return true;
}
diff --git a/src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java b/src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceController.java
similarity index 86%
rename from src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java
rename to src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceController.java
index 332c1597cf8..bacbf95fa3b 100644
--- a/src/com/android/settings/development/gup/GameDriverFooterPreferenceController.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceController.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
import android.content.ContentResolver;
import android.content.Context;
@@ -41,6 +41,7 @@ import com.android.settingslib.widget.FooterPreference;
public class GameDriverFooterPreferenceController extends BasePreferenceController
implements GameDriverContentObserver.OnGameDriverContentChangedListener, LifecycleObserver,
OnStart, OnStop {
+
private final ContentResolver mContentResolver;
@VisibleForTesting
GameDriverContentObserver mGameDriverContentObserver;
@@ -57,8 +58,8 @@ public class GameDriverFooterPreferenceController extends BasePreferenceControll
@Override
public int getAvailabilityStatus() {
return Settings.Global.getInt(
- mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- == GUP_OFF
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ == GAME_DRIVER_OFF
? AVAILABLE
: CONDITIONALLY_UNAVAILABLE;
}
diff --git a/src/com/android/settings/development/gup/GupGlobalSwitchBarController.java b/src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarController.java
similarity index 64%
rename from src/com/android/settings/development/gup/GupGlobalSwitchBarController.java
rename to src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarController.java
index c6bdf9dd332..125d95b4cf6 100644
--- a/src/com/android/settings/development/gup/GupGlobalSwitchBarController.java
+++ b/src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarController.java
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_ALL_APPS;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_ALL_APPS;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
import android.content.ContentResolver;
import android.content.Context;
@@ -37,10 +37,11 @@ import com.android.settingslib.development.DevelopmentSettingsEnabler;
/**
* Controller of global switch bar used to fully turn off Game Driver.
*/
-public class GupGlobalSwitchBarController
+public class GameDriverGlobalSwitchBarController
implements SwitchWidgetController.OnSwitchChangeListener,
GameDriverContentObserver.OnGameDriverContentChangedListener, LifecycleObserver,
OnStart, OnStop {
+
private final Context mContext;
private final ContentResolver mContentResolver;
@VisibleForTesting
@@ -48,7 +49,8 @@ public class GupGlobalSwitchBarController
@VisibleForTesting
GameDriverContentObserver mGameDriverContentObserver;
- GupGlobalSwitchBarController(Context context, SwitchWidgetController switchWidgetController) {
+ GameDriverGlobalSwitchBarController(
+ Context context, SwitchWidgetController switchWidgetController) {
mContext = context;
mContentResolver = context.getContentResolver();
mGameDriverContentObserver =
@@ -56,9 +58,10 @@ public class GupGlobalSwitchBarController
mSwitchWidgetController = switchWidgetController;
mSwitchWidgetController.setEnabled(
DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context));
- mSwitchWidgetController.setChecked(Settings.Global.getInt(mContentResolver,
- Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- != GUP_OFF);
+ mSwitchWidgetController.setChecked(
+ Settings.Global.getInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ != GAME_DRIVER_OFF);
mSwitchWidgetController.setListener(this);
}
@@ -77,13 +80,16 @@ public class GupGlobalSwitchBarController
@Override
public boolean onSwitchToggled(boolean isChecked) {
if (!isChecked) {
- Settings.Global.putInt(mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_OFF);
+ Settings.Global.putInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_OFF);
return true;
}
- if (Settings.Global.getInt(mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- != GUP_ALL_APPS) {
- Settings.Global.putInt(mContentResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ if (Settings.Global.getInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ != GAME_DRIVER_ALL_APPS) {
+ Settings.Global.putInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
}
return true;
@@ -91,8 +97,9 @@ public class GupGlobalSwitchBarController
@Override
public void onGameDriverContentChanged() {
- mSwitchWidgetController.setChecked(Settings.Global.getInt(mContentResolver,
- Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
- != GUP_OFF);
+ mSwitchWidgetController.setChecked(
+ Settings.Global.getInt(
+ mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT)
+ != GAME_DRIVER_OFF);
}
}
diff --git a/tests/robotests/assets/grandfather_not_implementing_index_provider b/tests/robotests/assets/grandfather_not_implementing_index_provider
index 2c515d7a825..ffdaca8bda6 100644
--- a/tests/robotests/assets/grandfather_not_implementing_index_provider
+++ b/tests/robotests/assets/grandfather_not_implementing_index_provider
@@ -6,7 +6,7 @@ com.android.settings.accounts.AccountDetailDashboardFragment
com.android.settings.fuelgauge.PowerUsageAnomalyDetails
com.android.settings.fuelgauge.AdvancedPowerUsageDetail
com.android.settings.development.featureflags.FeatureFlagsDashboard
-com.android.settings.development.gup.GupDashboard
+com.android.settings.development.gamedriver.GameDriverDashboard
com.android.settings.development.qstile.DevelopmentTileConfigFragment
com.android.settings.deviceinfo.StorageProfileFragment
com.android.settings.notification.ChannelNotificationSettings
diff --git a/tests/robotests/src/com/android/settings/development/gup/GupPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverAppPreferenceControllerTest.java
similarity index 88%
rename from tests/robotests/src/com/android/settings/development/gup/GupPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverAppPreferenceControllerTest.java
index 8055c94ae3f..5906cbc74f2 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GupPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverAppPreferenceControllerTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import static com.android.settings.testutils.ApplicationTestUtils.buildInfo;
import static com.google.common.truth.Truth.assertThat;
@@ -48,9 +48,10 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
-public class GupPreferenceControllerTest {
+public class GameDriverAppPreferenceControllerTest {
+
private static final int DEFAULT = 0;
- private static final int GUP = 1;
+ private static final int GAME_DRIVER = 1;
private static final int SYSTEM = 2;
private static final String TEST_APP_NAME = "testApp";
private static final String TEST_PKG_NAME = "testPkg";
@@ -71,7 +72,7 @@ public class GupPreferenceControllerTest {
private PreferenceGroup mGroup;
private PreferenceManager mPreferenceManager;
private ContentResolver mResolver;
- private GupPreferenceController mController;
+ private GameDriverAppPreferenceController mController;
private CharSequence[] mValueList;
private String mDialogTitle;
@@ -80,8 +81,9 @@ public class GupPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mResolver = mContext.getContentResolver();
- mValueList = mContext.getResources().getStringArray(R.array.gup_app_preference_values);
- mDialogTitle = mContext.getResources().getString(R.string.gup_app_preference_title);
+ mValueList =
+ mContext.getResources().getStringArray(R.array.game_driver_app_preference_values);
+ mDialogTitle = mContext.getResources().getString(R.string.game_driver_app_preference_title);
}
@Test
@@ -130,7 +132,7 @@ public class GupPreferenceControllerTest {
}
@Test
- public void createPreference_configGup_shouldSetGupAttributes() {
+ public void createPreference_configGAME_DRIVER_shouldSetGameDriverAttributes() {
loadConfig(TEST_PKG_NAME, "");
final ListPreference preference =
mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
@@ -140,9 +142,9 @@ public class GupPreferenceControllerTest {
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
assertThat(preference.getEntries()).isEqualTo(mValueList);
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
- assertThat(preference.getEntry()).isEqualTo(mValueList[GUP]);
- assertThat(preference.getValue()).isEqualTo(mValueList[GUP]);
- assertThat(preference.getSummary()).isEqualTo(mValueList[GUP]);
+ assertThat(preference.getEntry()).isEqualTo(mValueList[GAME_DRIVER]);
+ assertThat(preference.getValue()).isEqualTo(mValueList[GAME_DRIVER]);
+ assertThat(preference.getSummary()).isEqualTo(mValueList[GAME_DRIVER]);
}
@Test
@@ -171,25 +173,25 @@ public class GupPreferenceControllerTest {
assertThat(preference.getEntry()).isEqualTo(mValueList[DEFAULT]);
assertThat(preference.getValue()).isEqualTo(mValueList[DEFAULT]);
assertThat(preference.getSummary()).isEqualTo(mValueList[DEFAULT]);
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_IN_APPS))
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS))
.isEqualTo("");
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS))
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS))
.isEqualTo("");
}
@Test
- public void onPreferenceChange_selectGup_shouldUpdateAttributesAndSettingsGlobal() {
+ public void onPreferenceChange_selectGAME_DRIVER_shouldUpdateAttributesAndSettingsGlobal() {
loadDefaultConfig();
final ListPreference preference =
mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
- mController.onPreferenceChange(preference, mValueList[GUP]);
+ mController.onPreferenceChange(preference, mValueList[GAME_DRIVER]);
- assertThat(preference.getEntry()).isEqualTo(mValueList[GUP]);
- assertThat(preference.getValue()).isEqualTo(mValueList[GUP]);
- assertThat(preference.getSummary()).isEqualTo(mValueList[GUP]);
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_IN_APPS))
+ assertThat(preference.getEntry()).isEqualTo(mValueList[GAME_DRIVER]);
+ assertThat(preference.getValue()).isEqualTo(mValueList[GAME_DRIVER]);
+ assertThat(preference.getSummary()).isEqualTo(mValueList[GAME_DRIVER]);
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS))
.isEqualTo(TEST_PKG_NAME);
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS))
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS))
.isEqualTo("");
}
@@ -203,9 +205,9 @@ public class GupPreferenceControllerTest {
assertThat(preference.getEntry()).isEqualTo(mValueList[SYSTEM]);
assertThat(preference.getValue()).isEqualTo(mValueList[SYSTEM]);
assertThat(preference.getSummary()).isEqualTo(mValueList[SYSTEM]);
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_IN_APPS))
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS))
.isEqualTo("");
- assertThat(Settings.Global.getString(mResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS))
+ assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS))
.isEqualTo(TEST_PKG_NAME);
}
@@ -227,10 +229,10 @@ public class GupPreferenceControllerTest {
private void loadDefaultConfig() { loadConfig("", ""); }
private void loadConfig(String optIn, String optOut) {
- Settings.Global.putString(mResolver, Settings.Global.GUP_DEV_OPT_IN_APPS, optIn);
- Settings.Global.putString(mResolver, Settings.Global.GUP_DEV_OPT_OUT_APPS, optOut);
+ Settings.Global.putString(mResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS, optIn);
+ Settings.Global.putString(mResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS, optOut);
- mController = new GupPreferenceController(mContext, "testKey");
+ mController = new GameDriverAppPreferenceController(mContext, "testKey");
mGroup = spy(new PreferenceCategory(mContext));
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
when(mGroup.getContext()).thenReturn(mContext);
diff --git a/tests/robotests/src/com/android/settings/development/gup/GameDriverContentObserverTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverContentObserverTest.java
similarity index 93%
rename from tests/robotests/src/com/android/settings/development/gup/GameDriverContentObserverTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverContentObserverTest.java
index 6939ac9e2de..caaf896f5fc 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GameDriverContentObserverTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverContentObserverTest.java
@@ -14,13 +14,14 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import android.content.ContentResolver;
import android.provider.Settings;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,6 +32,7 @@ import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
public class GameDriverContentObserverTest {
+
@Mock
private ContentResolver mResolver;
@Mock
@@ -57,7 +59,7 @@ public class GameDriverContentObserverTest {
mGameDriverContentObserver.register(mResolver);
verify(mResolver).registerContentObserver(
- Settings.Global.getUriFor(Settings.Global.GUP_DEV_ALL_APPS), false,
+ Settings.Global.getUriFor(Settings.Global.GAME_DRIVER_ALL_APPS), false,
mGameDriverContentObserver);
}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GupDashboardTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverDashboardTest.java
similarity index 69%
rename from tests/robotests/src/com/android/settings/development/gup/GupDashboardTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverDashboardTest.java
index 17278ef08ea..29e74148544 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GupDashboardTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverDashboardTest.java
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import static com.google.common.truth.Truth.assertThat;
import com.android.internal.logging.nano.MetricsProto;
+
import com.android.settings.R;
import org.junit.Before;
@@ -27,12 +28,13 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@RunWith(RobolectricTestRunner.class)
-public class GupDashboardTest {
- private GupDashboard mDashboard;
+public class GameDriverDashboardTest {
+
+ private GameDriverDashboard mDashboard;
@Before
public void setUp() {
- mDashboard = new GupDashboard();
+ mDashboard = new GameDriverDashboard();
}
@Test
@@ -41,14 +43,13 @@ public class GupDashboardTest {
}
@Test
- public void getMetricesCategory_shouldReturnGupDashboard() {
+ public void getMetricesCategory_shouldReturnGameDriverDashboard() {
assertThat(mDashboard.getMetricsCategory())
- .isEqualTo(MetricsProto.MetricsEvent.SETTINGS_GUP_DASHBOARD);
+ .isEqualTo(MetricsProto.MetricsEvent.SETTINGS_GAME_DRIVER_DASHBOARD);
}
@Test
- public void getPreferenceScreen_shouldReturnGupSettings() {
- assertThat(mDashboard.getPreferenceScreenResId())
- .isEqualTo(R.xml.gup_settings);
+ public void getPreferenceScreen_shouldReturnGameDriverSettings() {
+ assertThat(mDashboard.getPreferenceScreenResId()).isEqualTo(R.xml.game_driver_settings);
}
}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceControllerTest.java
similarity index 69%
rename from tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceControllerTest.java
index cd8c7108106..4ee702c5ff0 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverEnableForAllAppsPreferenceControllerTest.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_ALL_APPS;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_ALL_APPS;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.atLeastOnce;
@@ -40,7 +40,8 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
-public class GupEnableForAllAppsPreferenceControllerTest {
+public class GameDriverEnableForAllAppsPreferenceControllerTest {
+
@Mock
private PreferenceScreen mScreen;
@Mock
@@ -50,14 +51,14 @@ public class GupEnableForAllAppsPreferenceControllerTest {
private Context mContext;
private ContentResolver mResolver;
- private GupEnableForAllAppsPreferenceController mController;
+ private GameDriverEnableForAllAppsPreferenceController mController;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
mResolver = mContext.getContentResolver();
- mController = new GupEnableForAllAppsPreferenceController(mContext, "testKey");
+ mController = new GameDriverEnableForAllAppsPreferenceController(mContext, "testKey");
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mController.displayPreference(mScreen);
@@ -66,7 +67,8 @@ public class GupEnableForAllAppsPreferenceControllerTest {
@Test
public void displayPreference_shouldAddSwitchPreference() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
mController.updateState(mPreference);
verify(mPreference).setChecked(false);
@@ -90,19 +92,23 @@ public class GupEnableForAllAppsPreferenceControllerTest {
@Test
public void onPreferenceChange_check_shouldUpdateSettingsGlobal() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
mController.onPreferenceChange(mPreference, true);
- assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
- .isEqualTo(GUP_ALL_APPS);
+ assertThat(Settings.Global.getInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT))
+ .isEqualTo(GAME_DRIVER_ALL_APPS);
}
@Test
public void onPreferenceChange_uncheck_shouldUpdateSettingsGlobal() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_ALL_APPS);
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_ALL_APPS);
mController.onPreferenceChange(mPreference, false);
- assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
- .isEqualTo(GUP_DEFAULT);
+ assertThat(Settings.Global.getInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT))
+ .isEqualTo(GAME_DRIVER_DEFAULT);
}
}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceControllerTest.java
similarity index 82%
rename from tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceControllerTest.java
index 17ddbda90a4..19676ed8b6a 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GameDriverFooterPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceControllerTest.java
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_ALL_APPS;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_ALL_APPS;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.spy;
@@ -45,6 +45,7 @@ import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
public class GameDriverFooterPreferenceControllerTest {
+
@Mock
private PreferenceScreen mScreen;
@Mock
@@ -67,21 +68,23 @@ public class GameDriverFooterPreferenceControllerTest {
@Test
public void getAvailabilityStatus_gameDriverOff_availableUnsearchable() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_OFF);
+ Settings.Global.putInt(mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_OFF);
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
@Test
public void getAvailabilityStatus_gameDriverDefault_conditionallyUnavailable() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
}
@Test
public void getAvailabilityStatus_gameDriverAllApps_conditionallyUnavailable() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_ALL_APPS);
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_ALL_APPS);
assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GupGlobalSwitchBarControllerTest.java b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarControllerTest.java
similarity index 54%
rename from tests/robotests/src/com/android/settings/development/gup/GupGlobalSwitchBarControllerTest.java
rename to tests/robotests/src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarControllerTest.java
index 0d3ed481fc8..f0a302f2fb5 100644
--- a/tests/robotests/src/com/android/settings/development/gup/GupGlobalSwitchBarControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/gamedriver/GameDriverGlobalSwitchBarControllerTest.java
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.android.settings.development.gup;
+package com.android.settings.development.gamedriver;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
-import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_OFF;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_DEFAULT;
+import static com.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_OFF;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.verify;
@@ -39,7 +39,8 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
-public class GupGlobalSwitchBarControllerTest {
+public class GameDriverGlobalSwitchBarControllerTest {
+
@Mock
private SwitchBar mSwitchBar;
@Mock
@@ -49,7 +50,7 @@ public class GupGlobalSwitchBarControllerTest {
private Context mContext;
private ContentResolver mResolver;
- private GupGlobalSwitchBarController mController;
+ private GameDriverGlobalSwitchBarController mController;
@Before
public void setUp() {
@@ -59,27 +60,28 @@ public class GupGlobalSwitchBarControllerTest {
}
@Test
- public void constructor_gupOn_shouldCheckSwitchBar() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ public void constructor_gameDriverOn_shouldCheckSwitchBar() {
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
verify(mSwitchBar).setChecked(true);
}
@Test
- public void constructor_gupOff_shouldUncheckSwitchBar() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_OFF);
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ public void constructor_gameDriverOff_shouldUncheckSwitchBar() {
+ Settings.Global.putInt(mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_OFF);
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
verify(mSwitchBar).setChecked(false);
}
@Test
public void onStart_shouldStartListeningAndRegister() {
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
mController.mSwitchWidgetController = mSwitchWidgetController;
mController.mGameDriverContentObserver = mGameDriverContentObserver;
mController.onStart();
@@ -90,8 +92,8 @@ public class GupGlobalSwitchBarControllerTest {
@Test
public void onStop_shouldStopListeningAndUnregister() {
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
mController.mSwitchWidgetController = mSwitchWidgetController;
mController.mGameDriverContentObserver = mGameDriverContentObserver;
mController.onStop();
@@ -101,24 +103,27 @@ public class GupGlobalSwitchBarControllerTest {
}
@Test
- public void onSwitchToggled_checked_shouldTurnOnGup() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_OFF);
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ public void onSwitchToggled_checked_shouldTurnOnGameDriver() {
+ Settings.Global.putInt(mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_OFF);
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
mController.onSwitchToggled(true);
- assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
- .isEqualTo(GUP_DEFAULT);
+ assertThat(Settings.Global.getInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT))
+ .isEqualTo(GAME_DRIVER_DEFAULT);
}
@Test
- public void onSwitchToggled_unchecked_shouldTurnOffGup() {
- Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
- mController =
- new GupGlobalSwitchBarController(mContext, new SwitchBarController(mSwitchBar));
+ public void onSwitchToggled_unchecked_shouldTurnOffGameDriver() {
+ Settings.Global.putInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
+ mController = new GameDriverGlobalSwitchBarController(
+ mContext, new SwitchBarController(mSwitchBar));
mController.onSwitchToggled(false);
- assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
- .isEqualTo(GUP_OFF);
+ assertThat(Settings.Global.getInt(
+ mResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT))
+ .isEqualTo(GAME_DRIVER_OFF);
}
}