summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-03-23 20:22:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-23 20:22:27 +0000
commit26b510e6306c9776e7a9fde5f800c9c58bc075d6 (patch)
treed97bcb6cd7705ad331d0ccaf926c56eec21c7558 /service
parent4990cf1ecd9df8da76ea60b56c414ff3271b30ce (diff)
parent3a86cc60b6cd3a5eb7b4982ba98f7e71ad45915e (diff)
Merge "hotspot2: allow Process.WIFI_UID to modify Passpoint networks"
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 48dfc2fd1..eaa6a107a 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -34,6 +34,7 @@ import android.net.wifi.WifiEnterpriseConfig;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiScanner;
+import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -613,6 +614,14 @@ public class WifiConfigManager {
* @param ignoreLockdown Ignore the configuration lockdown checks for connection attempts.
*/
private boolean canModifyNetwork(WifiConfiguration config, int uid, boolean ignoreLockdown) {
+ // Passpoint configurations are generated and managed by PasspointManager. They can be
+ // added by either PasspointNetworkEvaluator (for auto connection) or Settings app
+ // (for manual connection), and need to be removed once the connection is completed.
+ // Since it is "owned" by us, so always allow us to modify them.
+ if (config.isPasspoint() && uid == Process.WIFI_UID) {
+ return true;
+ }
+
final DevicePolicyManagerInternal dpmi = LocalServices.getService(
DevicePolicyManagerInternal.class);