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

Commit ddeaa31b authored by Erik Kline's avatar Erik Kline Committed by android-build-merger
Browse files

Merge "change NMS removeNetwork to netd binder variant" am: e61ee419

am: b73571b9

Change-Id: I6de7f38c7081e14d817cc7aad44cb5b6a978328b
parents 7d5e542d b73571b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2472,6 +2472,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
    private void handleRemoveNetworkRequest(final NetworkRequestInfo nri) {
        nri.unlinkDeathRecipient();
        mNetworkRequests.remove(nri.request);

        synchronized (mUidToNetworkRequestCount) {
            int requests = mUidToNetworkRequestCount.get(nri.mUid, 0);
            if (requests < 1) {
@@ -2484,6 +2485,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                mUidToNetworkRequestCount.put(nri.mUid, requests - 1);
            }
        }

        mNetworkRequestInfoLogs.log("RELEASE " + nri);
        if (nri.request.isRequest()) {
            boolean wasKept = false;
+8 −4
Original line number Diff line number Diff line
@@ -2508,12 +2508,16 @@ public class NetworkManagementService extends INetworkManagementService.Stub

    @Override
    public void removeNetwork(int netId) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        mContext.enforceCallingOrSelfPermission(NETWORK_STACK, TAG);

        try {
            mConnector.execute("network", "destroy", netId);
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
            mNetdService.networkDestroy(netId);
        } catch (ServiceSpecificException e) {
            Log.w(TAG, "removeNetwork(" + netId + "): ", e);
            throw e;
        } catch (RemoteException e) {
            Log.w(TAG, "removeNetwork(" + netId + "): ", e);
            throw e.rethrowAsRuntimeException();
        }
    }