1 /* 2 * Copyright 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef SDK_ANDROID_NATIVE_API_BASE_NETWORK_MONITOR_H_ 12 #define SDK_ANDROID_NATIVE_API_BASE_NETWORK_MONITOR_H_ 13 14 #include <jni.h> 15 16 #include <memory> 17 18 #include "rtc_base/network_monitor.h" 19 20 namespace webrtc { 21 22 // Creates an Android-specific network monitor, which is capable of detecting 23 // network changes as soon as they occur, requesting a cellular interface 24 // (dependent on permissions), and binding sockets to network interfaces (more 25 // reliable than binding to IP addresses on Android). 26 std::unique_ptr<rtc::NetworkMonitorFactory> CreateAndroidNetworkMonitorFactory( 27 JNIEnv* env, 28 jobject application_context); 29 30 // Deprecated. Pass in application context instead. 31 std::unique_ptr<rtc::NetworkMonitorFactory> 32 CreateAndroidNetworkMonitorFactory(); 33 34 } // namespace webrtc 35 36 #endif // SDK_ANDROID_NATIVE_API_BASE_NETWORK_MONITOR_H_ 37