Game Driver: Allow user to apply prerelease driver for all apps

Currently the global opt-in is only available to Game Driver. This change has
added an option to let developers to opt-in all apps to use prerelease driver.
GameDriverEnableForAllAppsPreferenceController is then refactored from
SwitchPreference to ListPreference to support this change.

Bug: 134881329
Test: make RunSettingsRoboTests ROBOTEST_FILTER=GameDriver
Change-Id: I6dcb3a22a4033a576605d42aa80b09db088d4aa2
This commit is contained in:
Yiwei Zhang
2019-06-10 19:06:51 -07:00
parent 240760c570
commit 687906f2f9
5 changed files with 115 additions and 38 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.development.gamedriver;
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.android.settings.development.gamedriver.GameDriverEnableForAllAppsPreferenceController.GAME_DRIVER_PRERELEASE_ALL_APPS;
import android.content.ContentResolver;
import android.content.Context;
@@ -83,7 +84,8 @@ public class GameDriverGlobalSwitchBarController
mContentResolver, Settings.Global.GAME_DRIVER_ALL_APPS, GAME_DRIVER_DEFAULT);
if (isChecked
&& (gameDriver == GAME_DRIVER_DEFAULT || gameDriver == GAME_DRIVER_ALL_APPS)) {
&& (gameDriver == GAME_DRIVER_DEFAULT || gameDriver == GAME_DRIVER_ALL_APPS
|| gameDriver == GAME_DRIVER_PRERELEASE_ALL_APPS)) {
return true;
}