mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Factor network management code out of plugins.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package org.briarproject.bramble.api.network;
|
||||
|
||||
public interface NetworkManager {
|
||||
|
||||
NetworkStatus getNetworkStatus();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.briarproject.bramble.api.network;
|
||||
|
||||
public class NetworkStatus {
|
||||
|
||||
private final boolean connected, wifi;
|
||||
|
||||
public NetworkStatus(boolean connected, boolean wifi) {
|
||||
this.connected = connected;
|
||||
this.wifi = wifi;
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
return connected;
|
||||
}
|
||||
|
||||
public boolean isWifi() {
|
||||
return wifi;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.briarproject.bramble.api.network.event;
|
||||
|
||||
import org.briarproject.bramble.api.event.Event;
|
||||
import org.briarproject.bramble.api.network.NetworkStatus;
|
||||
|
||||
public class NetworkStatusEvent extends Event {
|
||||
|
||||
private final NetworkStatus status;
|
||||
|
||||
public NetworkStatusEvent(NetworkStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public NetworkStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user