Refactor wifiConfiguration in WifiHotspotManager

This commit is contained in:
Adeel Zafar 2019-08-16 21:48:20 +05:00
parent 883abbcef9
commit df0a5e6eb1

View File

@ -21,7 +21,6 @@ public class WifiHotspotManager {
private final Context context;
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
boolean isHotspotEnabled;
WifiConfiguration currentConfig;
private static final String TAG = "WifiHotspotManager";
public WifiHotspotManager(@NonNull Context context) {
@ -37,13 +36,11 @@ public class WifiHotspotManager {
@Override
public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) {
super.onStarted(reservation);
WifiConfiguration currentConfig;
hotspotReservation = reservation;
currentConfig = hotspotReservation.getWifiConfiguration();
Log.v(TAG, "THE PASSWORD IS: "
+ currentConfig.preSharedKey
+ " \n SSID is : "
+ currentConfig.SSID);
printCurrentConfig(currentConfig);
zimHostCallbacks.onHotspotTurnedOn(currentConfig);
@ -86,4 +83,11 @@ public class WifiHotspotManager {
public boolean checkHotspotState() {
return hotspotReservation != null;
}
void printCurrentConfig(WifiConfiguration wifiConfiguration) {
Log.v(TAG, "THE PASSWORD IS: "
+ wifiConfiguration.preSharedKey
+ " \n SSID is : "
+ wifiConfiguration.SSID);
}
}