Merge "Send ConnDiags event before revalidating network in CS."
This commit is contained in:
commit
a4e39ee58a
1 changed files with 7 additions and 2 deletions
|
|
@ -4315,9 +4315,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||||
enforceInternetPermission();
|
enforceInternetPermission();
|
||||||
final int uid = Binder.getCallingUid();
|
final int uid = Binder.getCallingUid();
|
||||||
final int connectivityInfo = encodeBool(hasConnectivity);
|
final int connectivityInfo = encodeBool(hasConnectivity);
|
||||||
mHandler.sendMessage(
|
|
||||||
mHandler.obtainMessage(EVENT_REVALIDATE_NETWORK, uid, connectivityInfo, network));
|
|
||||||
|
|
||||||
|
// Handle ConnectivityDiagnostics event before attempting to revalidate the network. This
|
||||||
|
// forces an ordering of ConnectivityDiagnostics events in the case where hasConnectivity
|
||||||
|
// does not match the known connectivity of the network - this causes NetworkMonitor to
|
||||||
|
// revalidate the network and generate a ConnectivityDiagnostics ConnectivityReport event.
|
||||||
final NetworkAgentInfo nai;
|
final NetworkAgentInfo nai;
|
||||||
if (network == null) {
|
if (network == null) {
|
||||||
nai = getDefaultNetwork();
|
nai = getDefaultNetwork();
|
||||||
|
|
@ -4330,6 +4332,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||||
ConnectivityDiagnosticsHandler.EVENT_NETWORK_CONNECTIVITY_REPORTED,
|
ConnectivityDiagnosticsHandler.EVENT_NETWORK_CONNECTIVITY_REPORTED,
|
||||||
connectivityInfo, 0, nai));
|
connectivityInfo, 0, nai));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mHandler.sendMessage(
|
||||||
|
mHandler.obtainMessage(EVENT_REVALIDATE_NETWORK, uid, connectivityInfo, network));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleReportNetworkConnectivity(
|
private void handleReportNetworkConnectivity(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue