webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Classes | |
interface | NetworkObserver |
Static Public Member Functions | |
static NetworkMonitor | init (Context context) |
static boolean | isInitialized () |
static NetworkMonitor | getInstance () |
static void | setAutoDetectConnectivityState (boolean shouldAutoDetect) |
static void | addNetworkObserver (NetworkObserver observer) |
static void | removeNetworkObserver (NetworkObserver observer) |
static boolean | isOnline () |
static NetworkMonitorAutoDetect | getAutoDetectorForTest () |
Borrowed from Chromium's src/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
Triggers updates to the underlying network state from OS networking events.
WARNING: This class is not thread-safe.
|
inlinestatic |
Adds an observer for any connection type changes.
|
inlinestatic |
|
inlinestatic |
Returns the singleton instance.
|
inlinestatic |
Initializes the singleton once. Called from the native code.
|
inlinestatic |
|
inlinestatic |
Checks if there currently is connectivity.
|
inlinestatic |
Removes an observer for any connection type changes.
|
inlinestatic |
Enables auto detection of the current network state based on notifications from the system. Note that passing true here requires the embedding app have the platform ACCESS_NETWORK_STATE permission.
shouldAutoDetect | true if the NetworkMonitor should listen for system changes in network connectivity. |