From 60e3ba071d2b129906e92981d1615a46febd825a Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Fri, 2 Apr 2010 12:18:45 -0700 Subject: [PATCH] Dont start wifi if in airplane mode Now that wifi start is asynchronous at the time of bring up, make sure Wifi is not started if in airplane mode. Bug: 2567652 Change-Id: I947b7c8480029973bcbf028f6143aabbc88c9793 --- services/java/com/android/server/WifiService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 99cacdfb836ab..3bfb4c6516df8 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -263,10 +263,13 @@ public class WifiService extends IWifiManager.Stub { /** * Check if Wi-Fi needs to be enabled and start * if needed + * + * This function is used only at boot time */ public void startWifi() { /* Start if Wi-Fi is enabled or the saved state indicates Wi-Fi was on */ - boolean wifiEnabled = getPersistedWifiEnabled() || testAndClearWifiSavedState(); + boolean wifiEnabled = !isAirplaneModeOn() + && (getPersistedWifiEnabled() || testAndClearWifiSavedState()); Slog.i(TAG, "WifiService starting up with Wi-Fi " + (wifiEnabled ? "enabled" : "disabled")); setWifiEnabled(wifiEnabled);