DescriptionProvide NetworkChangeNotifierAndroid with the actual initial connection type.
The Android NetworkChangeNotifier is initialized with connection_type =
CONNECTION_UNKNOWN.
This means that the result returned by NetworkChangeNotifier::IsOffline() is
inaccurate until the first network change happens.
This can happen for the whole initialization path if the user starts Chrome
after he explicitly disabled WiFi and 3G.
This CL updates NetworkChangeNotifier.java to support multiple native
observers. This can happen in case NetworkChangeNotifierDelegateAndroid is
instantiated multiple times (e.g. when multiple factories are instantiated).
Still on the Java side, NetworkChangeNotifier.java was also changed to fetch
the actual connection type as soon as the auto-detector (interacting with the
Android platform) is enabled.
On the native side, NetworkChangeNotifierDelegateAndroid now fetches at
construction time the current connection type from the Java side singleton
through a direct JNI function call (possible since the delegate is constructed
on the JNI thread).
NetworkChangeNotifierAndroid::GetCurrentConnectionType() is now a simple
wrapper around the delegate's GetCurrentConnectionType() method (which is
thread-safe).
BUG=166883
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175138
Patch Set 1 #Patch Set 2 : Make NCNA fetch the connection type through NCNDA #
Total comments: 1
Patch Set 3 : Try another approach #
Total comments: 3
Patch Set 4 : Final approach based on patch set #2 #
Total comments: 15
Patch Set 5 : Address Dan's comments #
Total comments: 8
Patch Set 6 : Address Ryan's comments #
Total comments: 8
Patch Set 7 : Address Ryan's comments + fix Java comment #Messages
Total messages: 22 (0 generated)
|