Move Android network monitor to separate target/directory.
Not sure why it was lumped in with base in the first place. But now that it's not set via a static method, it makes less sense. Bug: webrtc:9883 Change-Id: Ia46834865fa485c9949a01fec10cecba465246ba Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180741 Commit-Queue: Taylor <deadbeef@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31852}
This commit is contained in:
committed by
Commit Bot
parent
702dcb6bc3
commit
ebf31b346b
31
sdk/android/native_api/network_monitor/network_monitor.cc
Normal file
31
sdk/android/native_api/network_monitor/network_monitor.cc
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "sdk/android/native_api/network_monitor/network_monitor.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "sdk/android/src/jni/android_network_monitor.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<rtc::NetworkMonitorFactory> CreateAndroidNetworkMonitorFactory(
|
||||
JNIEnv* env,
|
||||
jobject application_context) {
|
||||
return std::make_unique<jni::AndroidNetworkMonitorFactory>(
|
||||
env, JavaParamRef<jobject>(application_context));
|
||||
}
|
||||
|
||||
std::unique_ptr<rtc::NetworkMonitorFactory>
|
||||
CreateAndroidNetworkMonitorFactory() {
|
||||
return std::make_unique<jni::AndroidNetworkMonitorFactory>();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
36
sdk/android/native_api/network_monitor/network_monitor.h
Normal file
36
sdk/android/native_api/network_monitor/network_monitor.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef SDK_ANDROID_NATIVE_API_NETWORK_MONITOR_NETWORK_MONITOR_H_
|
||||
#define SDK_ANDROID_NATIVE_API_NETWORK_MONITOR_NETWORK_MONITOR_H_
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "rtc_base/network_monitor_factory.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Creates an Android-specific network monitor, which is capable of detecting
|
||||
// network changes as soon as they occur, requesting a cellular interface
|
||||
// (dependent on permissions), and binding sockets to network interfaces (more
|
||||
// reliable than binding to IP addresses on Android).
|
||||
std::unique_ptr<rtc::NetworkMonitorFactory> CreateAndroidNetworkMonitorFactory(
|
||||
JNIEnv* env,
|
||||
jobject application_context);
|
||||
|
||||
// Deprecated. Pass in application context instead.
|
||||
std::unique_ptr<rtc::NetworkMonitorFactory>
|
||||
CreateAndroidNetworkMonitorFactory();
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_ANDROID_NATIVE_API_NETWORK_MONITOR_NETWORK_MONITOR_H_
|
||||
Reference in New Issue
Block a user