summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-08-13 11:23:28 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-23 03:40:10 +0000
commit32a993fb54905edc9d14ef6768856089a805e556 (patch)
tree8edfadbf0065b743008c2f57c35dc02756e87164 /service
parentd0488bb459312e3ba198490b7df7c80996b712d1 (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 Merged-In: I095f9755c60034064e467dedcdb16b33dc63d9eb (cherry-picked from b46e815669ba3f376f7dda2a24479f84bad0b4a8) (cherry picked from commit 949a9784e43720aaf3710589565ef5d8e22e20ab) Change-Id: I57f11cb4545e6d6845504171ab37b737f0d1ec29 (cherry picked from commit d8d7cbce404a262e453ce7d5beb2706410fa9734)
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java3
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 6bb36b3b9..a4639924b 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
- && !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;