| Index: net/android/network_change_notifier_delegate_android.cc
|
| diff --git a/net/android/network_change_notifier_delegate_android.cc b/net/android/network_change_notifier_delegate_android.cc
|
| index 73cfb9903f613977239a72e765020e0241a6c5b8..ffa0e16f10aff0dbfa446b9aefb6e3f72ec18ec7 100644
|
| --- a/net/android/network_change_notifier_delegate_android.cc
|
| +++ b/net/android/network_change_notifier_delegate_android.cc
|
| @@ -63,13 +63,6 @@ void NetworkChangeNotifierDelegateAndroid::JavaLongArrayToNetworkMap(
|
| }
|
| }
|
|
|
| -jdouble GetMaxBandwidthForConnectionSubtype(JNIEnv* env,
|
| - const JavaParamRef<jclass>& caller,
|
| - jint subtype) {
|
| - return NetworkChangeNotifierAndroid::GetMaxBandwidthForConnectionSubtype(
|
| - ConvertConnectionSubtype(subtype));
|
| -}
|
| -
|
| NetworkChangeNotifierDelegateAndroid::NetworkChangeNotifierDelegateAndroid()
|
| : observers_(new base::ObserverListThreadSafe<Observer>()) {
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| @@ -80,8 +73,8 @@ NetworkChangeNotifierDelegateAndroid::NetworkChangeNotifierDelegateAndroid()
|
| ConvertConnectionType(Java_NetworkChangeNotifier_getCurrentConnectionType(
|
| env, java_network_change_notifier_)));
|
| SetCurrentMaxBandwidth(
|
| - Java_NetworkChangeNotifier_getCurrentMaxBandwidthInMbps(
|
| - env, java_network_change_notifier_));
|
| + NetworkChangeNotifierAndroid::GetMaxBandwidthForConnectionSubtype(
|
| + GetCurrentConnectionSubtype()));
|
| SetCurrentDefaultNetwork(Java_NetworkChangeNotifier_getCurrentDefaultNetId(
|
| env, java_network_change_notifier_));
|
| NetworkMap network_map;
|
| @@ -189,9 +182,11 @@ jint NetworkChangeNotifierDelegateAndroid::GetConnectionType(JNIEnv*,
|
| void NetworkChangeNotifierDelegateAndroid::NotifyMaxBandwidthChanged(
|
| JNIEnv* env,
|
| const JavaParamRef<jobject>& obj,
|
| - jdouble new_max_bandwidth) {
|
| + jint subtype) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| -
|
| + double new_max_bandwidth =
|
| + NetworkChangeNotifierAndroid::GetMaxBandwidthForConnectionSubtype(
|
| + ConvertConnectionSubtype(subtype));
|
| SetCurrentMaxBandwidth(new_max_bandwidth);
|
| observers_->Notify(FROM_HERE, &Observer::OnMaxBandwidthChanged,
|
| new_max_bandwidth, GetCurrentConnectionType());
|
| @@ -361,10 +356,10 @@ void NetworkChangeNotifierDelegateAndroid::FakeDefaultNetwork(
|
| Java_NetworkChangeNotifier_fakeDefaultNetwork(env, network, type);
|
| }
|
|
|
| -void NetworkChangeNotifierDelegateAndroid::FakeMaxBandwidthChanged(
|
| - double max_bandwidth_mbps) {
|
| +void NetworkChangeNotifierDelegateAndroid::FakeConnectionSubtypeChanged(
|
| + ConnectionSubtype subtype) {
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| - Java_NetworkChangeNotifier_fakeMaxBandwidthChanged(env, max_bandwidth_mbps);
|
| + Java_NetworkChangeNotifier_fakeConnectionSubtypeChanged(env, subtype);
|
| }
|
|
|
| } // namespace net
|
|
|