| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/cronet/android/network_change_notifier_initer.h" |
| 6 |
| 7 #include <jni.h> |
| 8 |
| 9 #include "jni/NetworkChangeNotifierIniter_jni.h" |
| 10 #include "net/android/network_change_notifier_factory_android.h" |
| 11 #include "net/base/network_change_notifier.h" |
| 12 |
| 13 namespace cronet { |
| 14 |
| 15 void NetworkChangeNotifierInit( |
| 16 JNIEnv* env, |
| 17 const base::android::JavaParamRef<jclass>& jcaller) { |
| 18 net::NetworkChangeNotifier::SetFactory( |
| 19 new net::NetworkChangeNotifierFactoryAndroid()); |
| 20 net::NetworkChangeNotifier::Create(); |
| 21 } |
| 22 |
| 23 void NetworkChangeNotifierInit() { |
| 24 JNIEnv* env = base::android::AttachCurrentThread(); |
| 25 Java_NetworkChangeNotifierIniter_init(env); |
| 26 } |
| 27 |
| 28 // Explicitly register static JNI functions. |
| 29 bool NetworkChangeNotifierIniterRegisterJni(JNIEnv* env) { |
| 30 return RegisterNativesImpl(env); |
| 31 } |
| 32 |
| 33 } // namespace cronet |
| OLD | NEW |