mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 12:42:56 -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;
|
private final Context context;
|
||||||
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
|
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
|
||||||
boolean isHotspotEnabled;
|
boolean isHotspotEnabled;
|
||||||
WifiConfiguration currentConfig;
|
|
||||||
private static final String TAG = "WifiHotspotManager";
|
private static final String TAG = "WifiHotspotManager";
|
||||||
|
|
||||||
public WifiHotspotManager(@NonNull Context context) {
|
public WifiHotspotManager(@NonNull Context context) {
|
||||||
@ -37,13 +36,11 @@ public class WifiHotspotManager {
|
|||||||
@Override
|
@Override
|
||||||
public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) {
|
public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) {
|
||||||
super.onStarted(reservation);
|
super.onStarted(reservation);
|
||||||
|
WifiConfiguration currentConfig;
|
||||||
hotspotReservation = reservation;
|
hotspotReservation = reservation;
|
||||||
currentConfig = hotspotReservation.getWifiConfiguration();
|
currentConfig = hotspotReservation.getWifiConfiguration();
|
||||||
|
|
||||||
Log.v(TAG, "THE PASSWORD IS: "
|
printCurrentConfig(currentConfig);
|
||||||
+ currentConfig.preSharedKey
|
|
||||||
+ " \n SSID is : "
|
|
||||||
+ currentConfig.SSID);
|
|
||||||
|
|
||||||
zimHostCallbacks.onHotspotTurnedOn(currentConfig);
|
zimHostCallbacks.onHotspotTurnedOn(currentConfig);
|
||||||
|
|
||||||
@ -86,4 +83,11 @@ public class WifiHotspotManager {
|
|||||||
public boolean checkHotspotState() {
|
public boolean checkHotspotState() {
|
||||||
return hotspotReservation != null;
|
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