Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45fa49d4 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Automerger Merge Worker
Browse files

Merge "Send ConnDiags event before revalidating network in CS." am: 104fd5cc

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350662

Change-Id: Ie3108f4cc45083523f6f0cda67dad1f13568f296
parents f8d07f7d 104fd5cc
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4315,9 +4315,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
        enforceInternetPermission();
        final int uid = Binder.getCallingUid();
        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;
        if (network == null) {
            nai = getDefaultNetwork();
@@ -4330,6 +4332,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
                            ConnectivityDiagnosticsHandler.EVENT_NETWORK_CONNECTIVITY_REPORTED,
                            connectivityInfo, 0, nai));
        }

        mHandler.sendMessage(
                mHandler.obtainMessage(EVENT_REVALIDATE_NETWORK, uid, connectivityInfo, network));
    }

    private void handleReportNetworkConnectivity(