summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-05-20 21:55:53 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-20 21:55:53 +0000
commit2e04caf24c6aea008fc945fb5c1a1ca18d6adee2 (patch)
tree617995228571522fbb06539dcb6c14b8065df853 /service
parent0ff45ee2c0016ae616a70b56d2957eb55427bcc3 (diff)
parent6bd16f20d6e69021b9d7652cd6551dfe14e07a46 (diff)
Merge "WifiServiceImpl: implement stopLOHS" into oc-dev am: 85c2015666
am: 6bd16f20d6 Change-Id: If9550c9f7672cb9a509feaf81f9bd8fda3de1a8f
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 ac35df708..1c9f364f7 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -1121,6 +1121,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();
@@ -1135,7 +1136,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 =
@@ -1190,10 +1191,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
}
/**