mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 15:40:59 +01:00
Refactoring
This commit is contained in:
@@ -75,6 +75,9 @@ public class ConnectionHelper {
|
||||
private Boolean suitable = null;
|
||||
private Boolean unmetered = null;
|
||||
private Boolean roaming = null;
|
||||
private actionType action = actionType.NONE;
|
||||
|
||||
public enum actionType {NONE, AVAILABLE, CHANGED, LOST}
|
||||
|
||||
boolean isConnected() {
|
||||
return (connected != null && connected);
|
||||
@@ -163,6 +166,12 @@ public class ConnectionHelper {
|
||||
return state;
|
||||
}
|
||||
|
||||
static NetworkState getNetworkState(Context context, NetworkState.actionType action) {
|
||||
NetworkState state = getNetworkState(context);
|
||||
state.action = action;
|
||||
return state;
|
||||
}
|
||||
|
||||
private static Boolean isMetered(Context context) {
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
if (cm == null)
|
||||
|
||||
Reference in New Issue
Block a user