Merge "Fix LocalOnlyHotspotReservation double stop of local hotspot."

This commit is contained in:
Roshan Pius
2019-08-27 17:06:55 +00:00
committed by Gerrit Code Review

View File

@@ -2563,6 +2563,7 @@ public class WifiManager {
private final CloseGuard mCloseGuard = CloseGuard.get();
private final WifiConfiguration mConfig;
private boolean mClosed = false;
/** @hide */
@VisibleForTesting
@@ -2578,8 +2579,13 @@ public class WifiManager {
@Override
public void close() {
try {
stopLocalOnlyHotspot();
mCloseGuard.close();
synchronized (mLock) {
if (!mClosed) {
mClosed = true;
stopLocalOnlyHotspot();
mCloseGuard.close();
}
}
} catch (Exception e) {
Log.e(TAG, "Failed to stop Local Only Hotspot.");
}