From 68c549b0814a3129c97ed9c67a005d18601dbe17 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 29 Jul 2019 11:08:36 -0700 Subject: WifiService: Allow DO/PO apps to toggle wifi Allow DO/PO apps to toggle wifi even if they target Q SDK. Bug: 136487810 Test: atest com.android.server.wifi.WifiServiceImplTest Change-Id: If59dd4485a6265077f50800c0089a0dd9d61c2f0 --- service/java/com/android/server/wifi/WifiServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index b25a84593..66b9b276a 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -874,7 +874,7 @@ public class WifiServiceImpl extends BaseWifiService { return false; } boolean isPrivileged = isPrivileged(Binder.getCallingPid(), Binder.getCallingUid()); - if (!isPrivileged + if (!isPrivileged && !isDeviceOrProfileOwner(Binder.getCallingUid()) && !mWifiPermissionsUtil.isTargetSdkLessThan(packageName, Build.VERSION_CODES.Q)) { mLog.info("setWifiEnabled not allowed for uid=%") .c(Binder.getCallingUid()).flush(); -- cgit v1.2.3