mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 12:03:09 -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.
|
||||
{
|
||||
startService(ACTION_TURN_OFF_AFTER_O);
|
||||
|
@ -1,18 +1,19 @@
|
||||
package org.kiwix.kiwixmobile.webserver;
|
||||
|
||||
import android.net.wifi.WifiConfiguration;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public interface ZimHostCallbacks {
|
||||
|
||||
void onServerStarted(String ip);
|
||||
void onServerStarted(@NonNull String ip);
|
||||
|
||||
void onServerStopped();
|
||||
|
||||
void onServerFailedToStart();
|
||||
|
||||
void onHotspotTurnedOn(WifiConfiguration wifiConfiguration);
|
||||
void onHotspotTurnedOn(@NonNull WifiConfiguration wifiConfiguration);
|
||||
|
||||
void onHotspotFailedToStart();
|
||||
|
||||
void onHotspotStateReceived(Boolean state);
|
||||
void onHotspotStateReceived(@NonNull Boolean state);
|
||||
}
|
||||
|
@ -18,13 +18,12 @@ import org.kiwix.kiwixmobile.webserver.ZimHostCallbacks;
|
||||
|
||||
public class WifiHotspotManager {
|
||||
private final WifiManager wifiManager;
|
||||
private final Context context;
|
||||
WifiManager.LocalOnlyHotspotReservation hotspotReservation;
|
||||
private static final String TAG = "WifiHotspotManager";
|
||||
|
||||
public WifiHotspotManager(@NonNull Context context) {
|
||||
this.context = context;
|
||||
wifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
|
||||
wifiManager =
|
||||
(WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
}
|
||||
|
||||
//Workaround to turn on hotspot for Oreo versions
|
||||
|
Loading…
x
Reference in New Issue
Block a user