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

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

Merge "Send ConnDiags event before revalidating network in CS." into rvc-dev...

Merge "Send ConnDiags event before revalidating network in CS." into rvc-dev am: 874dec6b am: 3d813a9f

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

Change-Id: Ifcca965cd921bbb7be88f26fcb40786e9665dd3f
parents acf24f7b 3d813a9f
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -4323,9 +4323,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();
@@ -4338,6 +4340,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(