Rename oreoEnabled to isHotspotEnabled

This commit is contained in:
Adeel Zafar 2019-08-12 17:38:11 +05:00
parent a8b013735e
commit 2604fc9dbd

View File

@ -19,7 +19,7 @@ public class WifiHotspotManager {
private WifiManager wifiManager; private WifiManager wifiManager;
Context context; Context context;
WifiManager.LocalOnlyHotspotReservation hotspotReservation; WifiManager.LocalOnlyHotspotReservation hotspotReservation;
boolean oreoenabled; boolean isHotspotEnabled;
WifiConfiguration currentConfig; WifiConfiguration currentConfig;
private static final String TAG = "WifiHotspotManager"; private static final String TAG = "WifiHotspotManager";
@ -31,7 +31,7 @@ public class WifiHotspotManager {
//Workaround to turn on hotspot for Oreo versions //Workaround to turn on hotspot for Oreo versions
@RequiresApi(api = Build.VERSION_CODES.O) @RequiresApi(api = Build.VERSION_CODES.O)
public void turnOnHotspot(ServerStateListener serverStateListener) { public void turnOnHotspot(ServerStateListener serverStateListener) {
if (!oreoenabled) { if (!isHotspotEnabled) {
wifiManager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback() { wifiManager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback() {
@Override @Override
@ -47,7 +47,7 @@ public class WifiHotspotManager {
serverStateListener.hotspotTurnedOn(currentConfig); serverStateListener.hotspotTurnedOn(currentConfig);
oreoenabled = true; isHotspotEnabled = true;
} }
@Override @Override
@ -73,7 +73,7 @@ public class WifiHotspotManager {
if (hotspotReservation != null) { if (hotspotReservation != null) {
hotspotReservation.close(); hotspotReservation.close();
hotspotReservation = null; hotspotReservation = null;
oreoenabled = false; isHotspotEnabled = false;
Log.v(TAG, "Turned off hotspot"); Log.v(TAG, "Turned off hotspot");
} }
} }