mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 03:54:18 -04:00
Refactor wifiConfiguration in WifiHotspotManager
This commit is contained in:
parent
883abbcef9
commit
df0a5e6eb1
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user