diff options
author | xshu <xshu@google.com> | 2018-04-20 15:37:44 -0700 |
---|---|---|
committer | xshu <xshu@google.com> | 2018-04-23 10:59:51 -0700 |
commit | 6e4c4f47eaf509d4c0a8a1af39b4b5f3c84a9098 (patch) | |
tree | 0a6d820ad2af2154dbe961825bfaceabcba8ffa6 /service | |
parent | d5faea1644d2360f5c776cb833f2123e1c082f35 (diff) |
Make NETWORK_SETTINGS trump CHANGE_WIFI_STATE
NETWORK_SETTINGS is a more powerful permission. If a caller has
NETWORK_SETTINGS than we no longer should check if it has
CHANGE_WIFI_STATE.
Bug: 78228349
Test: compile, unit test
manual test:
flash to device
go to settings -> apps & notifications -> special app access -> Wi-Fi
control
top right corner -> show system
Change permission for every item to "Not allowed"
Restart phone
Observe a successful boot
Change-Id: Ie5543c745aa1f6851eef8d04408c5691dcc54fb0
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 5d4df7df5..1a5e0e27d 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -725,6 +725,9 @@ public class WifiServiceImpl extends IWifiManager.Stub { */ @CheckResult private int enforceChangePermission(String callingPackage) { + if (checkNetworkSettingsPermission(Binder.getCallingPid(), Binder.getCallingUid())) { + return MODE_ALLOWED; + } mContext.enforceCallingOrSelfPermission(android.Manifest.permission.CHANGE_WIFI_STATE, "WifiService"); |