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

Unified Diff: net/base/network_change_notifier.cc

Issue 1454313002: Adding platform support check for NetworkObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Fixed typo. Created 5 years, 1 month 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
« no previous file with comments | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index fb480e9705f2c418b32ca57a2e80888fd9c20aa0..33aaa9e7d87b68cbd2ba5ab8d37dfc7ffac0a461 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -801,6 +801,18 @@ NetworkChangeNotifier* NetworkChangeNotifier::CreateMock() {
return new MockNetworkChangeNotifier();
}
+bool NetworkChangeNotifier::IsNetworkObserverSupported() {
+#if defined(OS_ANDROID)
+ // Notifications for NetworkObserver only implemented for Android
+ // versions >= L.
+ if (base::android::BuildInfo::GetInstance()->sdk_int() >=
+ base::android::SDK_VERSION_LOLLIPOP) {
+ return true;
Ryan Hamilton 2015/11/19 02:19:04 FWIW, you can just do: return base::android::Buil
Jana 2015/11/19 03:25:19 Done.
+ }
+#endif
+ return false;
+}
+
void NetworkChangeNotifier::AddIPAddressObserver(IPAddressObserver* observer) {
if (g_network_change_notifier)
g_network_change_notifier->ip_address_observer_list_->AddObserver(observer);
« no previous file with comments | « net/base/network_change_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698