mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Resolve Java warnings
This commit is contained in:
parent
0fe29eff35
commit
4b21258442
@ -505,7 +505,7 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onHotspotStateReceived(@Nullable Boolean isHotspotEnabled) {
|
@Override public void onHotspotStateReceived(@NonNull Boolean isHotspotEnabled) {
|
||||||
if (isHotspotEnabled) //if hotspot is already enabled, turn it off.
|
if (isHotspotEnabled) //if hotspot is already enabled, turn it off.
|
||||||
{
|
{
|
||||||
startService(ACTION_TURN_OFF_AFTER_O);
|
startService(ACTION_TURN_OFF_AFTER_O);
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
package org.kiwix.kiwixmobile.webserver;
|
package org.kiwix.kiwixmobile.webserver;
|
||||||
|
|
||||||
import android.net.wifi.WifiConfiguration;
|
import android.net.wifi.WifiConfiguration;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
public interface ZimHostCallbacks {
|
public interface ZimHostCallbacks {
|
||||||
|
|
||||||
void onServerStarted(String ip);
|
void onServerStarted(@NonNull String ip);
|
||||||
|
|
||||||
void onServerStopped();
|
void onServerStopped();
|
||||||
|
|
||||||
void onServerFailedToStart();
|
void onServerFailedToStart();
|
||||||
|
|
||||||
void onHotspotTurnedOn(WifiConfiguration wifiConfiguration);
|
void onHotspotTurnedOn(@NonNull WifiConfiguration wifiConfiguration);
|
||||||
|
|
||||||
void onHotspotFailedToStart();
|
void onHotspotFailedToStart();
|
||||||
|
|
||||||
void onHotspotStateReceived(Boolean state);
|
void onHotspotStateReceived(@NonNull Boolean state);
|
||||||
}
|
}
|
||||||
|
@ -18,13 +18,12 @@ import org.kiwix.kiwixmobile.webserver.ZimHostCallbacks;
|
|||||||
|
|
||||||
public class WifiHotspotManager {
|
public class WifiHotspotManager {
|
||||||
private final WifiManager wifiManager;
|
private final WifiManager wifiManager;
|
||||||
private final Context context;
|
|
||||||
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
|
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
|
||||||
private static final String TAG = "WifiHotspotManager";
|
private static final String TAG = "WifiHotspotManager";
|
||||||
|
|
||||||
public WifiHotspotManager(@NonNull Context context) {
|
public WifiHotspotManager(@NonNull Context context) {
|
||||||
this.context = context;
|
wifiManager =
|
||||||
wifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
|
(WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Workaround to turn on hotspot for Oreo versions
|
//Workaround to turn on hotspot for Oreo versions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user