Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: net/android/network_change_notifier_android.cc

Issue 9147026: API for connection type (Ethernet/WIFI/WWAN ...) in NetworkChangeNotifier. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Review comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/network_change_notifier_android.cc
diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
index e1cea06c7698825d843aebd63c7279279f80dd32..d810a33568c5b050ea221a9957a44dbb2fb04291 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -31,13 +31,17 @@ void NetworkChangeNotifier::CreateJavaObject(JNIEnv* env) {
}
void NetworkChangeNotifier::NotifyObservers(JNIEnv* env, jobject obj) {
- NotifyObserversOfOnlineStateChange();
+ NotifyObserversOfConnectionTypeChange();
}
-bool NetworkChangeNotifier::IsCurrentlyOffline() const {
+net::NetworkChangeNotifier::ConnectionType
+ NetworkChangeNotifier::GetCurrentConnectionType() const {
JNIEnv* env = base::android::AttachCurrentThread();
- return !Java_NetworkChangeNotifier_isConnected(
- env, java_network_change_notifier_.obj());
+ // TODO(droger): Return something more detailed than CONNECTION_UNKNOWN.
+ return Java_NetworkChangeNotifier_isConnected(
+ env, java_network_change_notifier_.obj()) ?
+ net::NetworkChangeNotifier::CONNECTION_UNKNOWN :
+ net::NetworkChangeNotifier::CONNECTION_NONE;
}
// static

Powered by Google App Engine
This is Rietveld 408576698