when user turns on swap WiFi visibility, ensure that WiFi is on
This commit is contained in:
parent
570b532bd6
commit
444ecd024b
@ -497,7 +497,7 @@ public class SwapService extends Service {
|
|||||||
|
|
||||||
appsToSwap.addAll(deserializePackages(swapPreferences.getString(KEY_APPS_TO_SWAP, "")));
|
appsToSwap.addAll(deserializePackages(swapPreferences.getString(KEY_APPS_TO_SWAP, "")));
|
||||||
bluetoothSwap = BluetoothSwap.create(this);
|
bluetoothSwap = BluetoothSwap.create(this);
|
||||||
wifiSwap = new WifiSwap(this);
|
wifiSwap = new WifiSwap(this, wifiManager);
|
||||||
|
|
||||||
Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);
|
Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package org.fdroid.fdroid.localrepo.type;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
@ -31,10 +32,12 @@ public class WifiSwap extends SwapType {
|
|||||||
private Handler webServerThreadHandler;
|
private Handler webServerThreadHandler;
|
||||||
private LocalHTTPD localHttpd;
|
private LocalHTTPD localHttpd;
|
||||||
private final BonjourBroadcast bonjourBroadcast;
|
private final BonjourBroadcast bonjourBroadcast;
|
||||||
|
private final WifiManager wifiManager;
|
||||||
|
|
||||||
public WifiSwap(Context context) {
|
public WifiSwap(Context context, WifiManager wifiManager) {
|
||||||
super(context);
|
super(context);
|
||||||
bonjourBroadcast = new BonjourBroadcast(context);
|
bonjourBroadcast = new BonjourBroadcast(context);
|
||||||
|
this.wifiManager = wifiManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getBroadcastAction() {
|
protected String getBroadcastAction() {
|
||||||
@ -47,6 +50,8 @@ public class WifiSwap extends SwapType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
|
wifiManager.setWifiEnabled(true);
|
||||||
|
|
||||||
Utils.debugLog(TAG, "Preparing swap webserver.");
|
Utils.debugLog(TAG, "Preparing swap webserver.");
|
||||||
sendBroadcast(SwapService.EXTRA_STARTING);
|
sendBroadcast(SwapService.EXTRA_STARTING);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user