diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiServiceImpl.java | 17 |
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; } |