implement ConnectivityManager using GNetworkMonitor

This commit is contained in:
Julian Winkler
2024-03-17 18:36:48 +01:00
parent 14217e8724
commit b14549e639
5 changed files with 93 additions and 9 deletions

View File

@@ -10,15 +10,21 @@ public class NetworkInfo {
UNKNOWN
}
private State state = State.DISCONNECTED;
public NetworkInfo(boolean available) {
state = available ? State.CONNECTED : State.DISCONNECTED;
}
public NetworkInfo.State getState() {
return State.DISCONNECTED;
return state;
}
public int getType() {
return 0x8; // where did you even get a NetworkInfo object... there is no network
return 0x8; // TYPE_DUMMY
}
public boolean isConnected() {
return true;
return state == State.CONNECTED;
}
}