Change AndroidNetworkMonitor::NotifyConnectionTypeChanged to use Invoke
This is consistent with other Notify methods in this class, which handle callbacks from java using blocking invokes to the network thread. This eliminates the use of the deprecated AsyncInvoker class. Bug: webrtc:12339 Change-Id: Ib2d19b37b8f669df5b97e89d720f6eb6fc9e5517 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209181 Reviewed-by: Taylor <deadbeef@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33398}
This commit is contained in:
@ -524,7 +524,7 @@ AndroidNetworkMonitorFactory::CreateNetworkMonitor() {
|
||||
void AndroidNetworkMonitor::NotifyConnectionTypeChanged(
|
||||
JNIEnv* env,
|
||||
const JavaRef<jobject>& j_caller) {
|
||||
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, network_thread_, [this] {
|
||||
network_thread_->Invoke<void>(RTC_FROM_HERE, [this] {
|
||||
RTC_LOG(LS_INFO)
|
||||
<< "Android network monitor detected connection type change.";
|
||||
SignalNetworksChanged();
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
#include "rtc_base/async_invoker.h"
|
||||
#include "rtc_base/network_monitor.h"
|
||||
#include "rtc_base/network_monitor_factory.h"
|
||||
#include "rtc_base/thread.h"
|
||||
@ -117,7 +116,7 @@ class AndroidNetworkMonitor : public rtc::NetworkMonitorInterface,
|
||||
const int android_sdk_int_;
|
||||
ScopedJavaGlobalRef<jobject> j_application_context_;
|
||||
ScopedJavaGlobalRef<jobject> j_network_monitor_;
|
||||
rtc::Thread* network_thread_;
|
||||
rtc::Thread* const network_thread_;
|
||||
bool started_ RTC_GUARDED_BY(network_thread_) = false;
|
||||
std::map<std::string, rtc::AdapterType> adapter_type_by_name_
|
||||
RTC_GUARDED_BY(network_thread_);
|
||||
@ -132,7 +131,6 @@ class AndroidNetworkMonitor : public rtc::NetworkMonitorInterface,
|
||||
bool find_network_handle_without_ipv6_temporary_part_
|
||||
RTC_GUARDED_BY(network_thread_) = false;
|
||||
bool surface_cellular_types_ RTC_GUARDED_BY(network_thread_) = false;
|
||||
rtc::AsyncInvoker invoker_;
|
||||
};
|
||||
|
||||
class AndroidNetworkMonitorFactory : public rtc::NetworkMonitorFactory {
|
||||
|
Reference in New Issue
Block a user