mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 12:42:56 -04:00
Remove context from WebServerHelper constructor
This commit is contained in:
parent
0f0d8cb721
commit
f528e9da44
@ -1,6 +1,5 @@
|
|||||||
package org.kiwix.kiwixmobile.webserver;
|
package org.kiwix.kiwixmobile.webserver;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -20,15 +19,14 @@ import org.kiwix.kiwixlib.JNIKiwixServer;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class WebServerHelper {
|
public class WebServerHelper {
|
||||||
private Context context;
|
|
||||||
public static boolean isServerStarted;
|
public static boolean isServerStarted;
|
||||||
private static int port;
|
private static int port;
|
||||||
private JNIKiwixLibrary kiwixLibrary = new JNIKiwixLibrary();
|
private JNIKiwixLibrary kiwixLibrary = new JNIKiwixLibrary();
|
||||||
private JNIKiwixServer kiwixServer = new JNIKiwixServer(kiwixLibrary);
|
private JNIKiwixServer kiwixServer = new JNIKiwixServer(kiwixLibrary);
|
||||||
private static final String TAG = "WebServerHelper";
|
private static final String TAG = "WebServerHelper";
|
||||||
|
|
||||||
public WebServerHelper(@NonNull Context context) {
|
public WebServerHelper() {
|
||||||
this.context = context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean startServerHelper(@NonNull ServerStateListener stateListener,
|
public boolean startServerHelper(@NonNull ServerStateListener stateListener,
|
||||||
|
@ -64,7 +64,7 @@ public class HotspotService extends Service {
|
|||||||
|
|
||||||
registerReceiver(stopReceiver, new IntentFilter(ACTION_STOP));
|
registerReceiver(stopReceiver, new IntentFilter(ACTION_STOP));
|
||||||
|
|
||||||
webServerHelper = new WebServerHelper(this);
|
webServerHelper = new WebServerHelper();
|
||||||
|
|
||||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user