summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-05-12 16:04:49 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-12 16:04:49 +0000
commit181e6134025aa82c94ae5e4931981b535d4e956a (patch)
tree3ef3d3adc4e7c12402076ea8318b000c6a25cf5c /service
parent1824dda8eeaec6038cb6c9af39c0b188cce605ad (diff)
parent728bf64cfc9881eeb06cbe8745b1a356db980abe (diff)
Merge "WifiServiceImpl: add objects to track LOHSrequests" into oc-dev
am: 728bf64cfc Change-Id: Ic09089d007dda0ad6662a5ad15b1675e5837f622
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index fb3961432..ba82c1d1c 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -87,6 +87,7 @@ import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.PhoneConstants;
@@ -113,6 +114,7 @@ import java.security.cert.PKIXParameters;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
@@ -192,6 +194,11 @@ public class WifiServiceImpl extends IWifiManager.Stub {
private final ConcurrentHashMap<String, Integer> mIfaceIpModes;
+ @GuardedBy("mLocalOnlyHotspotRequests")
+ private final HashMap<Integer, LocalOnlyHotspotRequestInfo> mLocalOnlyHotspotRequests;
+ @GuardedBy("mLocalOnlyHotspotRequests")
+ private WifiConfiguration mLocalOnlyHotspotConfig = null;
+
/**
* Handles client connections
*/
@@ -384,6 +391,7 @@ public class WifiServiceImpl extends IWifiManager.Stub {
updateBackgroundThrottleInterval();
updateBackgroundThrottlingWhitelist();
mIfaceIpModes = new ConcurrentHashMap<>();
+ mLocalOnlyHotspotRequests = new HashMap<>();
enableVerboseLoggingInternal(getVerboseLoggingLevel());
}
@@ -825,6 +833,10 @@ public class WifiServiceImpl extends IWifiManager.Stub {
return startSoftApInternal(wifiConfig, STATE_TETHERED);
}
+ /**
+ * Internal method to start softap mode. Callers of this method should have already checked
+ * proper permissions beyond the NetworkStack permission.
+ */
private boolean startSoftApInternal(WifiConfiguration wifiConfig, int mode) {
mLog.trace("startSoftApInternal uid=% mode=%")
.c(Binder.getCallingUid()).c(mode).flush();
@@ -864,6 +876,11 @@ public class WifiServiceImpl extends IWifiManager.Stub {
private boolean stopSoftApInternal() {
mLog.trace("stopSoftApInternal uid=%").c(Binder.getCallingUid()).flush();
+ // we have an allowed caller - clear local only hotspot if it was enabled
+ synchronized (mLocalOnlyHotspotRequests) {
+ mLocalOnlyHotspotRequests.clear();
+ mLocalOnlyHotspotConfig = null;
+ }
mWifiController.sendMessage(CMD_SET_AP, 0, 0);
return true;
}