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

Commit 86440c9a authored by Chalard Jean's avatar Chalard Jean Committed by Automerger Merge Worker
Browse files

Merge "Optimization when looking up requests for release" am: 29392ab0 am:...

Merge "Optimization when looking up requests for release" am: 29392ab0 am: 9576f318 am: 05530c38 am: f7a5da18

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icad3c7b7948c4c419580dfac721d1f5c2d4600fc
parents 12db9d39 f7a5da18
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3721,7 +3721,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
        // Looking up the app passed param request in mRequests isn't possible since it may return
        // null for a request managed by a per-app default. Therefore use getNriForAppRequest() to
        // do the lookup since that will also find per-app default managed requests.
        final NetworkRequestInfo nri = getNriForAppRequest(request);
        // Additionally, this lookup needs to be relatively fast (hence the lookup optimization)
        // to avoid potential race conditions when validating a package->uid mapping when sending
        // the callback on the very low-chance that an application shuts down prior to the callback
        // being sent.
        final NetworkRequestInfo nri = mNetworkRequests.get(request) != null
                ? mNetworkRequests.get(request) : getNriForAppRequest(request);

        if (nri != null) {
            if (Process.SYSTEM_UID != callingUid && Process.NETWORK_STACK_UID != callingUid