summaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 11d0259e1..cc5824e67 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -508,13 +508,14 @@ public final class WifiServiceImpl extends IWifiManager.Stub {
if (mBatchedScanSupported == false) return new ArrayList<BatchedScanResult>();
int uid = Binder.getCallingUid();
int userId = UserHandle.getCallingUserId();
+ boolean hasInteractUsersFull = checkInteractAcrossUsersFull();
long ident = Binder.clearCallingIdentity();
try {
if (mAppOps.noteOp(AppOpsManager.OP_WIFI_SCAN, uid, callingPackage)
!= AppOpsManager.MODE_ALLOWED) {
return new ArrayList<BatchedScanResult>();
}
- if (!isCurrentProfile(userId)) {
+ if (!isCurrentProfile(userId) && !hasInteractUsersFull) {
return new ArrayList<BatchedScanResult>();
}
return mWifiStateMachine.syncGetBatchedScanResultsList();
@@ -974,13 +975,14 @@ public final class WifiServiceImpl extends IWifiManager.Stub {
enforceAccessPermission();
int userId = UserHandle.getCallingUserId();
int uid = Binder.getCallingUid();
+ boolean hasInteractUsersFull = checkInteractAcrossUsersFull();
long ident = Binder.clearCallingIdentity();
try {
if (mAppOps.noteOp(AppOpsManager.OP_WIFI_SCAN, uid, callingPackage)
!= AppOpsManager.MODE_ALLOWED) {
return new ArrayList<ScanResult>();
}
- if (!isCurrentProfile(userId)) {
+ if (!isCurrentProfile(userId) && !hasInteractUsersFull) {
return new ArrayList<ScanResult>();
}
return mWifiStateMachine.syncGetScanResultsList();
@@ -990,6 +992,15 @@ public final class WifiServiceImpl extends IWifiManager.Stub {
}
/**
+ * Returns true if the caller holds INTERACT_ACROSS_USERS_FULL.
+ */
+ private boolean checkInteractAcrossUsersFull() {
+ return mContext.checkCallingOrSelfPermission(
+ android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
+ == PackageManager.PERMISSION_GRANTED;
+ }
+
+ /**
* Returns true if the calling user is the current one or a profile of the
* current user..
*/