Merge "Fix LocalOnlyHotspotReservation double stop of local hotspot." into qt-qpr1-dev

This commit is contained in:
TreeHugger Robot
2019-11-08 06:11:19 +00:00
committed by Android (Google) Code Review

View File

@@ -3215,6 +3215,7 @@ public class WifiManager {
private final CloseGuard mCloseGuard = CloseGuard.get();
private final WifiConfiguration mConfig;
private boolean mClosed = false;
/** @hide */
@VisibleForTesting
@@ -3230,8 +3231,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.");
}