Don't require WAKE_LOCK permission to enable wifi
The process for starting wifi was using a wakelock around a message-pass and this was causing
an exception for meer mortals (who don't have WAKE_LOCK permission).
bug: 1750535
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 63bef54..cc1b697 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -295,7 +295,11 @@
if (mWifiHandler == null) return false;
synchronized (mWifiHandler) {
+ // caller may not have WAKE_LOCK permission - it's not required here
+ long ident = Binder.clearCallingIdentity();
sWakeLock.acquire();
+ Binder.restoreCallingIdentity(ident);
+
mLastEnableUid = Binder.getCallingUid();
// set a flag if the user is enabling Wifi while in airplane mode
mAirplaneModeOverwridden = (enable && isAirplaneModeOn() && isAirplaneToggleable());