Package com.telnyx.webrtc.lib
Class NetworkMonitorAutoDetect
java.lang.Object
android.content.BroadcastReceiver
com.telnyx.webrtc.lib.NetworkMonitorAutoDetect
- All Implemented Interfaces:
NetworkChangeDetector
Borrowed from Chromium's
src/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
Used by the NetworkMonitor to listen to platform changes in connectivity. Note that use of this class requires that the app have the platform ACCESS_NETWORK_STATE permission.
-
Nested Class Summary
Nested classes/interfaces inherited from class android.content.BroadcastReceiver
BroadcastReceiver.PendingResult
Nested classes/interfaces inherited from interface com.telnyx.webrtc.lib.NetworkChangeDetector
NetworkChangeDetector.ConnectionType, NetworkChangeDetector.IPAddress, NetworkChangeDetector.NetworkInformation, NetworkChangeDetector.Observer
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkMonitorAutoDetect
(NetworkChangeDetector.Observer observer, Context context) Constructs a NetworkMonitorAutoDetect. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
getConnectionType
(com.telnyx.webrtc.lib.NetworkMonitorAutoDetect.NetworkState networkState) com.telnyx.webrtc.lib.NetworkMonitorAutoDetect.NetworkState
long
Returns NetID of device's current default connected network used for communication.void
static void
setIncludeWifiDirect
(boolean enable) Enables WifiDirectManager.boolean
Methods inherited from class android.content.BroadcastReceiver
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, getSentFromPackage, getSentFromUid, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
-
Constructor Details
-
NetworkMonitorAutoDetect
Constructs a NetworkMonitorAutoDetect. Should only be called on UI thread.
-
-
Method Details
-
setIncludeWifiDirect
public static void setIncludeWifiDirect(boolean enable) Enables WifiDirectManager. -
supportNetworkCallback
public boolean supportNetworkCallback()- Specified by:
supportNetworkCallback
in interfaceNetworkChangeDetector
-
getActiveNetworkList
- Specified by:
getActiveNetworkList
in interfaceNetworkChangeDetector
-
destroy
public void destroy()- Specified by:
destroy
in interfaceNetworkChangeDetector
-
getCurrentNetworkState
public com.telnyx.webrtc.lib.NetworkMonitorAutoDetect.NetworkState getCurrentNetworkState() -
getDefaultNetId
public long getDefaultNetId()Returns NetID of device's current default connected network used for communication. Only implemented on Lollipop and newer releases, returns INVALID_NET_ID when not implemented. -
getConnectionType
public static NetworkChangeDetector.ConnectionType getConnectionType(com.telnyx.webrtc.lib.NetworkMonitorAutoDetect.NetworkState networkState) -
getCurrentConnectionType
- Specified by:
getCurrentConnectionType
in interfaceNetworkChangeDetector
-
onReceive
- Specified by:
onReceive
in classBroadcastReceiver
-