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

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

Merge "Ensure all calls to getCallingUid use the version in mDeps." am:...

Merge "Ensure all calls to getCallingUid use the version in mDeps." am: d610e433 am: 3559535c am: ee70e4d9 am: 8aa7d663

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

Change-Id: I95c1f5cbba42105fbd82d5826cab3725088b404a
parents 99e25aa0 8aa7d663
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1781,7 +1781,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
        }

        // No need to check mLockdownEnabled. If it's true, getVpnUnderlyingNetworks returns null.
        final Network[] networks = getVpnUnderlyingNetworks(Binder.getCallingUid());
        final Network[] networks = getVpnUnderlyingNetworks(mDeps.getCallingUid());
        if (null != networks) {
            for (final Network network : networks) {
                final NetworkCapabilities nc = getNetworkCapabilitiesInternal(network);
@@ -3660,7 +3660,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                log("Replacing " + existingRequest.mRequests.get(0) + " with "
                        + nri.mRequests.get(0) + " because their intents matched.");
            }
            handleReleaseNetworkRequest(existingRequest.mRequests.get(0), getCallingUid(),
            handleReleaseNetworkRequest(existingRequest.mRequests.get(0), mDeps.getCallingUid(),
                    /* callOnUnavailable */ false);
        }
        handleRegisterNetworkRequest(nri);
@@ -5749,14 +5749,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
    private void releasePendingNetworkRequestWithDelay(PendingIntent operation) {
        mHandler.sendMessageDelayed(
                mHandler.obtainMessage(EVENT_RELEASE_NETWORK_REQUEST_WITH_INTENT,
                getCallingUid(), 0, operation), mReleasePendingIntentDelayMs);
                mDeps.getCallingUid(), 0, operation), mReleasePendingIntentDelayMs);
    }

    @Override
    public void releasePendingNetworkRequest(PendingIntent operation) {
        Objects.requireNonNull(operation, "PendingIntent cannot be null.");
        mHandler.sendMessage(mHandler.obtainMessage(EVENT_RELEASE_NETWORK_REQUEST_WITH_INTENT,
                getCallingUid(), 0, operation));
                mDeps.getCallingUid(), 0, operation));
    }

    // In order to implement the compatibility measure for pre-M apps that call
@@ -5853,7 +5853,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
    public void releaseNetworkRequest(NetworkRequest networkRequest) {
        ensureNetworkRequestHasType(networkRequest);
        mHandler.sendMessage(mHandler.obtainMessage(
                EVENT_RELEASE_NETWORK_REQUEST, getCallingUid(), 0, networkRequest));
                EVENT_RELEASE_NETWORK_REQUEST, mDeps.getCallingUid(), 0, networkRequest));
    }

    private void handleRegisterNetworkProvider(NetworkProviderInfo npi) {
@@ -8331,7 +8331,7 @@ public class ConnectivityService extends IConnectivityManager.Stub

        final NetworkAgentInfo vpn = getVpnForUid(uid);
        if (vpn == null || getVpnType(vpn) != VpnManager.TYPE_VPN_SERVICE
                || vpn.networkCapabilities.getOwnerUid() != Binder.getCallingUid()) {
                || vpn.networkCapabilities.getOwnerUid() != mDeps.getCallingUid()) {
            return INVALID_UID;
        }