mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Add global boolean value to observe network status
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
e0776d8c37
commit
cb7c47ea54
1 changed files with 7 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue