diff options
author | Christopher Tate <ctate@google.com> | 2012-09-14 17:24:28 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2012-09-14 17:57:35 -0700 |
commit | 6f5a9a96523ecf97a9828a410dd1226df47ec4e6 (patch) | |
tree | 5c62cd082f05f811d996c6794ac8b4a850fb70c2 /services | |
parent | 4f49d9450fe919868f9a9a9a44db59ca2497150c (diff) | |
download | frameworks_base-6f5a9a96523ecf97a9828a410dd1226df47ec4e6.zip frameworks_base-6f5a9a96523ecf97a9828a410dd1226df47ec4e6.tar.gz frameworks_base-6f5a9a96523ecf97a9828a410dd1226df47ec4e6.tar.bz2 |
Fix default population of wifi settings
Various wifi settings that are explicitly defaulted did not get their
default code properly converted to refer to the correct settings
database table.
A collection of moved-to-Global settings that had not yet been
marked @deprecated in the Secure.* namespace are now so marked.
Also updated the namespace used to refer to wifi settings from the
Wifi Service. These changes are cosmetic, but they do eliminate a
number of runtime log messages.
Bug 7153671
Change-Id: I9e5b6464d025cfb480ef97373996e38e82f90593
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/WifiService.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 7ed4f8a..5c3af79 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -133,8 +133,8 @@ public class WifiService extends IWifiManager.Stub { private static final int POLL_TRAFFIC_STATS_INTERVAL_MSECS = 1000; /** - * See {@link Settings.Secure#WIFI_IDLE_MS}. This is the default value if a - * Settings.Secure value is not present. This timeout value is chosen as + * See {@link Settings.Global#WIFI_IDLE_MS}. This is the default value if a + * Settings.Global value is not present. This timeout value is chosen as * the approximate point at which the battery drain caused by Wi-Fi * being enabled but not active exceeds the battery drain caused by * re-establishing a connection to the mobile data network. @@ -431,8 +431,8 @@ public class WifiService extends IWifiManager.Stub { mWifiStateMachineHandler = new WifiStateMachineHandler(wifiThread.getLooper()); // Setting is in seconds - NOTIFICATION_REPEAT_DELAY_MS = Settings.Secure.getInt(context.getContentResolver(), - Settings.Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 900) * 1000l; + NOTIFICATION_REPEAT_DELAY_MS = Settings.Global.getInt(context.getContentResolver(), + Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 900) * 1000l; mNotificationEnabledSettingObserver = new NotificationEnabledSettingObserver(new Handler()); mNotificationEnabledSettingObserver.register(); } @@ -502,9 +502,9 @@ public class WifiService extends IWifiManager.Stub { final ContentResolver cr = mContext.getContentResolver(); int wifiSavedState = 0; try { - wifiSavedState = Settings.Secure.getInt(cr, Settings.Secure.WIFI_SAVED_STATE); + wifiSavedState = Settings.Global.getInt(cr, Settings.Global.WIFI_SAVED_STATE); if(wifiSavedState == 1) - Settings.Secure.putInt(cr, Settings.Secure.WIFI_SAVED_STATE, 0); + Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 0); } catch (Settings.SettingNotFoundException e) { ; } @@ -514,9 +514,9 @@ public class WifiService extends IWifiManager.Stub { private int getPersistedWifiState() { final ContentResolver cr = mContext.getContentResolver(); try { - return Settings.Secure.getInt(cr, Settings.Secure.WIFI_ON); + return Settings.Global.getInt(cr, Settings.Global.WIFI_ON); } catch (Settings.SettingNotFoundException e) { - Settings.Secure.putInt(cr, Settings.Secure.WIFI_ON, WIFI_DISABLED); + Settings.Global.putInt(cr, Settings.Global.WIFI_ON, WIFI_DISABLED); return WIFI_DISABLED; } } @@ -564,7 +564,7 @@ public class WifiService extends IWifiManager.Stub { private void persistWifiState(int state) { final ContentResolver cr = mContext.getContentResolver(); mPersistWifiState.set(state); - Settings.Secure.putInt(cr, Settings.Secure.WIFI_ON, state); + Settings.Global.putInt(cr, Settings.Global.WIFI_ON, state); } /** @@ -996,11 +996,11 @@ public class WifiService extends IWifiManager.Stub { String action = intent.getAction(); long idleMillis = - Settings.Secure.getLong(mContext.getContentResolver(), - Settings.Secure.WIFI_IDLE_MS, DEFAULT_IDLE_MS); + Settings.Global.getLong(mContext.getContentResolver(), + Settings.Global.WIFI_IDLE_MS, DEFAULT_IDLE_MS); int stayAwakeConditions = - Settings.System.getInt(mContext.getContentResolver(), - Settings.System.STAY_ON_WHILE_PLUGGED_IN, 0); + Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0); if (action.equals(Intent.ACTION_SCREEN_ON)) { if (DBG) { Slog.d(TAG, "ACTION_SCREEN_ON"); @@ -1779,8 +1779,8 @@ public class WifiService extends IWifiManager.Stub { public void register() { ContentResolver cr = mContext.getContentResolver(); - cr.registerContentObserver(Settings.Secure.getUriFor( - Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON), true, this); + cr.registerContentObserver(Settings.Global.getUriFor( + Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON), true, this); mNotificationEnabled = getValue(); } @@ -1793,8 +1793,8 @@ public class WifiService extends IWifiManager.Stub { } private boolean getValue() { - return Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 1) == 1; + return Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 1) == 1; } } |