summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/java/com/android/server/WifiService.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index 064d47f..59846b9 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -405,7 +405,14 @@ public class WifiService extends IWifiManager.Stub {
}
mWifiStateMachine.setWifiEnabled(enable);
+
+ /*
+ * Caller might not have WRITE_SECURE_SETTINGS,
+ * only CHANGE_WIFI_STATE is enforced
+ */
+ long ident = Binder.clearCallingIdentity();
persistWifiEnabled(enable);
+ Binder.restoreCallingIdentity(ident);
if (enable) {
if (!mIsReceiverRegistered) {
@@ -451,7 +458,13 @@ public class WifiService extends IWifiManager.Stub {
wifiConfig.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);
wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE);
}
+ /*
+ * Caller might not have WRITE_SECURE_SETTINGS,
+ * only CHANGE_WIFI_STATE is enforced
+ */
+ long ident = Binder.clearCallingIdentity();
setWifiApConfiguration(wifiConfig);
+ Binder.restoreCallingIdentity(ident);
}
mWifiStateMachine.setWifiApEnabled(wifiConfig, enabled);