Add global boolean value to observe network status

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-08-12 13:51:17 +02:00
parent e0776d8c37
commit cb7c47ea54
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -207,6 +207,7 @@ public class MainApp extends Application implements HasAndroidInjector {
private static AppComponent appComponent;
private final NetworkChangeReceiver networkChangeReceiver = new NetworkChangeReceiver();
private static boolean isNetworkAvailable = false;
/**
* Temporary hack
@ -236,8 +237,13 @@ public class MainApp extends Application implements HasAndroidInjector {
registerReceiver(networkChangeReceiver, filter);
}
public static void setIsNetworkAvailable(boolean isNetworkAvailable) {
public static void setIsNetworkAvailable(boolean value) {
// TODO start pending operations if isNetworkAvailable
isNetworkAvailable = value;
}
public static boolean isNetworkAvailable() {
return isNetworkAvailable;
}
private String getAppProcessName() {