com.mobiledgex.matchingengine.NetworkManager Class Reference

Inherits SubscriptionManager.OnSubscriptionsChangedListener.

Public Member Functions

boolean isNetworkSwitchingEnabled ()
 
synchronized void setNetworkSwitchingEnabled (boolean networkSwitchingEnabled)
 
synchronized void onSubscriptionsChanged () throws SecurityException
 
void setTimeout (long timeoutInMilliseconds)
 
long getTimeout ()
 
long getNetworkActiveTimeoutMilliseconds ()
 
void setNetworkActiveTimeoutMilliseconds (long networkActiveTimeoutMilliseconds)
 
NetworkRequest getCellularNetworkRequest ()
 
NetworkRequest getWifiNetworkRequest ()
 
NetworkRequest getBluetoothNetworkRequest ()
 
NetworkRequest getEthernetNetworkRequest ()
 
NetworkRequest getWiFiAwareNetworkRequest ()
 
Network getActiveNetwork ()
 
void setDefaulNetwork (NetworkRequest defaultNetworkRequest)
 
void resetNetworkToDefault () throws InterruptedException, ExecutionException
 
boolean isSSLEnabled ()
 
synchronized List< SubscriptionInfo > getActiveSubscriptionInfoList (boolean clone) throws SecurityException
 
boolean isAllowSwitchIfNoSubscriberInfo ()
 
synchronized void setAllowSwitchIfNoSubscriberInfo (boolean allowSwitchIfNoSubscriberInfo)
 
boolean isNetworkInternetCellularDataCapable (Network network)
 
boolean isCurrentNetworkInternetCellularDataCapable ()
 
synchronized void requestCellularNetwork (ConnectivityManager.NetworkCallback networkCallback)
 
synchronized Network getCellularNetworkBlocking (boolean bindProcess) throws InterruptedException, ExecutionException
 
synchronized Network getCellularNetworkOrWifiBlocking (boolean bindProcess, String currentMccMnc) throws InterruptedException, ExecutionException
 
synchronized Network switchToCellularInternetNetworkBlocking () throws InterruptedException, ExecutionException
 
synchronized Future< Network > switchToCellularInternetNetworkFuture ()
 
synchronized Network switchToNetworkBlocking (NetworkRequest networkRequest, boolean bindProcess) throws InterruptedException, ExecutionException, TimeoutException
 
synchronized void switchToNetwork (NetworkRequest networkRequest, final ConnectivityManager.NetworkCallback networkCallback)
 

Static Public Member Functions

static NetworkManager getInstance (ConnectivityManager connectivityManager, SubscriptionManager subscriptionManager)
 
static NetworkManager getInstance (ConnectivityManager connectivityManager, SubscriptionManager subscriptionManager, ExecutorService executorService)
 

Static Public Attributes

static final String TAG = "NetworkManager"
 
static NetworkManager mNetworkManager
 

Detailed Description

NetworkManager handles Network Interface and Network connectivity utilities

Member Function Documentation

◆ getActiveNetwork()

Network com.mobiledgex.matchingengine.NetworkManager.getActiveNetwork ( )

Returns the current active network, independent of what the NetworkManager is doing.

◆ onSubscriptionsChanged()

synchronized void com.mobiledgex.matchingengine.NetworkManager.onSubscriptionsChanged ( ) throws SecurityException

Listener that gets the current SubscriptionInfo list.

throws security exception if the revocable READ_PHONE_STATE (or hasCarrierPrivilages) is missing.

Exceptions
SecurityException

◆ requestCellularNetwork()

synchronized void com.mobiledgex.matchingengine.NetworkManager.requestCellularNetwork ( ConnectivityManager.NetworkCallback  networkCallback)

Wrapper function to get, if possible, to a Cellular Data Network connection. This isn't instant. Callback interface.

◆ resetNetworkToDefault()

void com.mobiledgex.matchingengine.NetworkManager.resetNetworkToDefault ( ) throws InterruptedException, ExecutionException

Reset process level default network.

◆ setDefaulNetwork()

void com.mobiledgex.matchingengine.NetworkManager.setDefaulNetwork ( NetworkRequest  defaultNetworkRequest)

Sets the request for the default network to reset to. It does not modify the network.

◆ switchToCellularInternetNetworkBlocking()

synchronized Network com.mobiledgex.matchingengine.NetworkManager.switchToCellularInternetNetworkBlocking ( ) throws InterruptedException, ExecutionException

Switch entire process to a Cellular network type. This is a synchronous call.

◆ switchToCellularInternetNetworkFuture()

synchronized Future< Network > com.mobiledgex.matchingengine.NetworkManager.switchToCellularInternetNetworkFuture ( )

Switch to a particular network type. Returns a Future.

◆ switchToNetwork()

synchronized void com.mobiledgex.matchingengine.NetworkManager.switchToNetwork ( NetworkRequest  networkRequest,
final ConnectivityManager.NetworkCallback  networkCallback 
)

Switch entire process to a network using Callbacks. The callback onAvailable(Network) will notify availability.

Parameters
networkRequest(NetworkRequest)
networkCallback(ConnectivityManager.NetworkCallback)

◆ switchToNetworkBlocking()

synchronized Network com.mobiledgex.matchingengine.NetworkManager.switchToNetworkBlocking ( NetworkRequest  networkRequest,
boolean  bindProcess 
) throws InterruptedException, ExecutionException, TimeoutException

Switch to a particular network type in a blocking fashion for synchronous execution blocks.