diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-10-03 12:13:20 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2011-10-03 12:13:20 -0700 |
commit | 31b92e28a577f2f36f30b8a95147155fec038e30 (patch) | |
tree | 3e5d743580459153b6e1f5c82e3f990910457451 /services/java/com | |
parent | ce0a7ade96ddbdcb342e0b382e9d3ea43962cafd (diff) | |
download | frameworks_base-31b92e28a577f2f36f30b8a95147155fec038e30.zip frameworks_base-31b92e28a577f2f36f30b8a95147155fec038e30.tar.gz frameworks_base-31b92e28a577f2f36f30b8a95147155fec038e30.tar.bz2 |
Remember wifi disable due to airplane
Add the wifi disabled due to airplane mode as a seperate settings so
that wifi is restored after a reboot when airplane mode is turned off
Bug: 5365718
Change-Id: I36a9694bbcacd5bb5f89498e4adc47c81e611da6
Diffstat (limited to 'services/java/com')
-rw-r--r-- | services/java/com/android/server/WifiService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 883fc71..660681b 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -149,6 +149,8 @@ public class WifiService extends IWifiManager.Stub { private static final int WIFI_ENABLED = 1; /* Wifi enabled while in airplane mode */ private static final int WIFI_ENABLED_AIRPLANE_OVERRIDE = 2; + /* Wifi disabled due to airplane mode on */ + private static final int WIFI_DISABLED_AIRPLANE_ON = 3; private AtomicInteger mWifiState = new AtomicInteger(WIFI_DISABLED); private AtomicBoolean mAirplaneModeOn = new AtomicBoolean(false); @@ -478,14 +480,19 @@ public class WifiService extends IWifiManager.Stub { private void persistWifiEnabled(boolean enabled) { final ContentResolver cr = mContext.getContentResolver(); + boolean airplane = mAirplaneModeOn.get() && isAirplaneToggleable(); if (enabled) { - if (isAirplaneModeOn() && isAirplaneToggleable()) { + if (airplane) { mWifiState.set(WIFI_ENABLED_AIRPLANE_OVERRIDE); } else { mWifiState.set(WIFI_ENABLED); } } else { - mWifiState.set(WIFI_DISABLED); + if (airplane) { + mWifiState.set(WIFI_DISABLED_AIRPLANE_ON); + } else { + mWifiState.set(WIFI_DISABLED); + } } Settings.Secure.putInt(cr, Settings.Secure.WIFI_ON, mWifiState.get()); } |