Return "not implemented" error from BindSocketToNetwork properly.

Previously, was only checking the Android SDK version. But it also needs
to check for the presence of the connectivity manager service.

BUG=webrtc:7026

Review-Url: https://codereview.webrtc.org/2697943002
Cr-Commit-Position: refs/heads/master@{#16631}
This commit is contained in:
deadbeef
2017-02-15 11:49:31 -08:00
committed by Commit bot
parent 9c6ded1bb2
commit 43be94725f
3 changed files with 21 additions and 6 deletions

View File

@ -114,6 +114,12 @@ public class NetworkMonitor {
nativeNetworkObservers.remove(nativeObserver);
}
// Called by the native code to determine if network binding is supported
// on this platform.
private boolean networkBindingSupported() {
return autoDetector != null && autoDetector.supportNetworkCallback();
}
// Called by the native code to get the Android SDK version.
private static int androidSdkInt() {
return Build.VERSION.SDK_INT;

View File

@ -469,6 +469,10 @@ public class NetworkMonitorAutoDetect extends BroadcastReceiver {
}
}
public boolean supportNetworkCallback() {
return connectivityManagerDelegate.supportNetworkCallback();
}
/**
* Allows overriding the ConnectivityManagerDelegate for tests.
*/