diff options
author | Roshan Pius <rpius@google.com> | 2019-08-13 11:23:28 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-08-13 22:40:42 +0000 |
commit | b46e815669ba3f376f7dda2a24479f84bad0b4a8 (patch) | |
tree | f4d3b4b6da4c3228ee886f7dcd295fd516e71428 /service | |
parent | ece7e1bb352a57ed82124173449b7d5b6d479e8e (diff) |
WifiServiceImpl: Allow setWifiEnabled for system apps
This allows system apps to toggle wifi on/off during emergency calls to get
user's location for example.
Bug: 138091278
Test: atest com.android.server.wifi
Change-Id: I095f9755c60034064e467dedcdb16b33dc63d9eb
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 66b9b276a..b2abdd2b6 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -875,7 +875,8 @@ public class WifiServiceImpl extends BaseWifiService { } boolean isPrivileged = isPrivileged(Binder.getCallingPid(), Binder.getCallingUid()); if (!isPrivileged && !isDeviceOrProfileOwner(Binder.getCallingUid()) - && !mWifiPermissionsUtil.isTargetSdkLessThan(packageName, Build.VERSION_CODES.Q)) { + && !mWifiPermissionsUtil.isTargetSdkLessThan(packageName, Build.VERSION_CODES.Q) + && !isSystem(packageName)) { mLog.info("setWifiEnabled not allowed for uid=%") .c(Binder.getCallingUid()).flush(); return false; |