Merge "Adding a new config and Setting for WiFi Wakeup." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b569eedf37
@@ -8314,6 +8314,17 @@ public final class Settings {
|
||||
@SystemApi
|
||||
public static final String WIFI_WAKEUP_ENABLED = "wifi_wakeup_enabled";
|
||||
|
||||
/**
|
||||
* Value to specify if Wi-Fi Wakeup is available.
|
||||
*
|
||||
* Wi-Fi Wakeup will only operate if it's available
|
||||
* and {@link #WIFI_WAKEUP_ENABLED} is true.
|
||||
*
|
||||
* Type: int (0 for false, 1 for true)
|
||||
* @hide
|
||||
*/
|
||||
public static final String WIFI_WAKEUP_AVAILABLE = "wifi_wakeup_available";
|
||||
|
||||
/**
|
||||
* Value to specify whether network quality scores and badging should be shown in the UI.
|
||||
*
|
||||
|
||||
@@ -393,6 +393,12 @@
|
||||
<!-- Activity name to enable wifi tethering after provisioning app succeeds -->
|
||||
<string translatable="false" name="config_wifi_tether_enable">com.android.settings/.TetherService</string>
|
||||
|
||||
<!-- Controls the WiFi wakeup feature.
|
||||
0 = Not available.
|
||||
1 = Available.
|
||||
-->
|
||||
<integer translatable="false" name="config_wifi_wakeup_available">0</integer>
|
||||
|
||||
<!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
|
||||
<!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
|
||||
<!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
|
||||
|
||||
@@ -2085,6 +2085,7 @@
|
||||
<java-symbol type="string" name="config_mobile_hotspot_provision_response" />
|
||||
<java-symbol type="integer" name="config_mobile_hotspot_provision_check_period" />
|
||||
<java-symbol type="string" name="config_wifi_tether_enable" />
|
||||
<java-symbol type="integer" name="config_wifi_wakeup_available" />
|
||||
<java-symbol type="bool" name="config_intrusiveNotificationLed" />
|
||||
<java-symbol type="dimen" name="preference_fragment_padding_bottom" />
|
||||
<java-symbol type="dimen" name="preference_fragment_padding_side" />
|
||||
|
||||
@@ -2899,7 +2899,7 @@ public class SettingsProvider extends ContentProvider {
|
||||
}
|
||||
|
||||
private final class UpgradeController {
|
||||
private static final int SETTINGS_VERSION = 144;
|
||||
private static final int SETTINGS_VERSION = 145;
|
||||
|
||||
private final int mUserId;
|
||||
|
||||
@@ -3481,6 +3481,25 @@ public class SettingsProvider extends ContentProvider {
|
||||
currentVersion = 144;
|
||||
}
|
||||
|
||||
if (currentVersion == 144) {
|
||||
// Version 145: Set the default value for WIFI_WAKEUP_AVAILABLE.
|
||||
if (userId == UserHandle.USER_SYSTEM) {
|
||||
final SettingsState globalSettings = getGlobalSettingsLocked();
|
||||
final Setting currentSetting = globalSettings.getSettingLocked(
|
||||
Settings.Global.WIFI_WAKEUP_AVAILABLE);
|
||||
if (currentSetting.isNull()) {
|
||||
final int defaultValue = getContext().getResources().getInteger(
|
||||
com.android.internal.R.integer.config_wifi_wakeup_available);
|
||||
globalSettings.insertSettingLocked(
|
||||
Settings.Global.WIFI_WAKEUP_AVAILABLE,
|
||||
String.valueOf(defaultValue),
|
||||
null, true, SettingsState.SYSTEM_PACKAGE_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
currentVersion = 145;
|
||||
}
|
||||
|
||||
// vXXX: Add new settings above this point.
|
||||
|
||||
if (currentVersion != newVersion) {
|
||||
|
||||
Reference in New Issue
Block a user