| Index: net/android/network_change_notifier_android.cc
|
| diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
|
| index b765c859119c7ba06484756667ee1bab80e574ed..6dce66981fbd921bc2d1bedbae3e26b73becd735 100644
|
| --- a/net/android/network_change_notifier_android.cc
|
| +++ b/net/android/network_change_notifier_android.cc
|
| @@ -85,11 +85,26 @@ bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
|
|
|
| NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
|
| NetworkChangeNotifierDelegateAndroid* delegate)
|
| - : delegate_(delegate) {
|
| + : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()),
|
| + delegate_(delegate) {
|
| SetConnectionType(NetworkChangeNotifier::CONNECTION_UNKNOWN);
|
| delegate_->AddObserver(this);
|
| }
|
|
|
| +// static
|
| +NetworkChangeNotifier::NetworkChangeCalculatorParams
|
| +NetworkChangeNotifierAndroid::NetworkChangeCalculatorParamsAndroid() {
|
| + NetworkChangeCalculatorParams params;
|
| + // IPAddressChanged is produced immediately prior to ConnectionTypeChanged
|
| + // so delay IPAddressChanged so they get merged with the following
|
| + // ConnectionTypeChanged signal.
|
| + params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
|
| + params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
|
| + params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
|
| + params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
|
| + return params;
|
| +}
|
| +
|
| void NetworkChangeNotifierAndroid::SetConnectionType(
|
| ConnectionType new_connection_type) {
|
| base::AutoLock auto_lock(connection_type_lock_);
|
|
|