summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-05-22 17:04:31 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-22 17:04:31 +0000
commit1244b39da5cdf42266ab7da3848007f8e781e923 (patch)
treec26692bd806a6cadd86f2617eab9dfb28013fc64 /service
parent3a0eab454bb4596be85dcdad32501a248ec1baff (diff)
parentf9b25d48b7cadff8cb8eead96114f8b6725cc800 (diff)
Merge "WifiServiceImpl: add packageName to startLOHS call" into oc-dev
am: f9b25d48b7 Change-Id: I63d5b193f833521b3461ba9063e6ab8396b5d2c2
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index aa1316d4e..51ade7234 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1117,6 +1117,7 @@ public class WifiServiceImpl extends IWifiManager.Stub {
*
* @param messenger Messenger to send messages to the corresponding WifiManager.
* @param binder IBinder instance to allow cleanup if the app dies
+ * @param packageName String name of the calling package
*
* @return int return code for attempt to start LocalOnlyHotspot.
*
@@ -1126,15 +1127,14 @@ public class WifiServiceImpl extends IWifiManager.Stub {
* have an outstanding request.
*/
@Override
- public int startLocalOnlyHotspot(Messenger messenger, IBinder binder) {
+ public int startLocalOnlyHotspot(Messenger messenger, IBinder binder, String packageName) {
// first check if the caller has permission to start a local only hotspot
// need to check for WIFI_STATE_CHANGE and location permission
final int uid = Binder.getCallingUid();
final int pid = Binder.getCallingPid();
- final String pkgName = mContext.getOpPackageName();
enforceChangePermission();
- enforceLocationPermission(pkgName, uid);
+ enforceLocationPermission(packageName, uid);
// also need to verify that Locations services are enabled.
if (mSettingsStore.getLocationModeSetting(mContext) == Settings.Secure.LOCATION_MODE_OFF) {
throw new SecurityException("Location mode is not enabled.");