summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-05-20 21:48:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-05-20 21:48:36 +0000
commit85c2015666f37e7ea2df69ef9962de0b6ccc7cf8 (patch)
tree999c9333cbc736f3d91b5a31ab58d4c80e1c0cc2 /service
parent70df7749fe3dc574c1ef7713d48b51afc79787fb (diff)
parenta2cbd2429606052cf6f2306c54f8c590d7a55174 (diff)
Merge "WifiServiceImpl: implement stopLOHS" into oc-dev
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index 4e8bbd9c2..703294ee5 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1125,6 +1125,7 @@ public class WifiServiceImpl extends IWifiManager.Stub {
// 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();
@@ -1139,7 +1140,7 @@ public class WifiServiceImpl extends IWifiManager.Stub {
return LocalOnlyHotspotCallback.ERROR_TETHERING_DISALLOWED;
}
- mLog.trace("startLocalOnlyHotspot uid=%").c(uid).flush();
+ mLog.trace("startLocalOnlyHotspot uid=% pid=%").c(uid).c(pid).flush();
// check current mode to see if we can start localOnlyHotspot
boolean apDisabled =
@@ -1194,10 +1195,19 @@ public class WifiServiceImpl extends IWifiManager.Stub {
// first check if the caller has permission to stop a local only hotspot
enforceChangePermission();
final int uid = Binder.getCallingUid();
+ final int pid = Binder.getCallingPid();
- mLog.trace("stopLocalOnlyHotspot uid=%").c(uid).flush();
+ mLog.trace("stopLocalOnlyHotspot uid=% pid=%").c(uid).c(pid).flush();
- throw new UnsupportedOperationException("LocalOnlyHotspot is still in development");
+ synchronized (mLocalOnlyHotspotRequests) {
+ // was the caller already registered? check request tracker - return false if not
+ LocalOnlyHotspotRequestInfo requestInfo = mLocalOnlyHotspotRequests.get(pid);
+ if (requestInfo == null) {
+ return;
+ }
+ requestInfo.unlinkDeathRecipient();
+ unregisterCallingAppAndStopLocalOnlyHotspot(requestInfo);
+ } // end synchronized
}
/**