diff options
author | Sohani Rao <sohanirao@google.com> | 2016-11-10 22:51:04 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-11-10 22:51:04 +0000 |
commit | ce95b349a740fab4dfdb242ae30c3288bd6c9efe (patch) | |
tree | 9e0a3a3de588c9e0926117829980750378d955e0 /service | |
parent | 1c16ca526d9789fa432da75c35a70c7c70f6f02c (diff) | |
parent | 573654d47ace707f0cae2a50462dce05feef30d0 (diff) |
Merge "Trace permissions check to access scan results"
am: 573654d47a
Change-Id: I3322dd795836c041f5e1812a1c36359e75a3ecd1
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/util/WifiPermissionsUtil.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/util/WifiPermissionsUtil.java b/service/java/com/android/server/wifi/util/WifiPermissionsUtil.java index 110e9575e..827afb42e 100644 --- a/service/java/com/android/server/wifi/util/WifiPermissionsUtil.java +++ b/service/java/com/android/server/wifi/util/WifiPermissionsUtil.java @@ -24,6 +24,8 @@ import android.content.pm.UserInfo; import android.os.UserManager; import android.provider.Settings; +import com.android.server.wifi.WifiInjector; +import com.android.server.wifi.WifiLog; import com.android.server.wifi.WifiSettingsStore; import java.util.List; @@ -39,6 +41,7 @@ public class WifiPermissionsUtil { private final AppOpsManager mAppOps; private final UserManager mUserManager; private final WifiSettingsStore mSettingsStore; + private WifiLog mLog; public WifiPermissionsUtil(WifiPermissionsWrapper wifiPermissionsWrapper, Context context, WifiSettingsStore settingsStore, UserManager userManager) { @@ -47,6 +50,7 @@ public class WifiPermissionsUtil { mUserManager = userManager; mAppOps = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE); mSettingsStore = settingsStore; + mLog = WifiInjector.getInstance().makeLog(TAG); } /** @@ -74,15 +78,18 @@ public class WifiPermissionsUtil { // If neither caller or app has location access, there is no need to check // any other permissions. Deny access to scan results. if (!canCallingUidAccessLocation && !canAppPackageUseLocation) { + mLog.tC("Denied: no location permission"); return false; } // Check if Wifi Scan request is an operation allowed for this App. if (!isScanAllowedbyApps(pkgName, uid)) { + mLog.tC("Denied: app wifi scan not allowed"); return false; } // If the User or profile is current, permission is granted // Otherwise, uid must have INTERACT_ACROSS_USERS_FULL permission. if (!isCurrentProfile(uid) && !checkInteractAcrossUsersFull(uid)) { + mLog.tC("Denied: Profile not permitted"); return false; } return true; |