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

Commit 8d39f189 authored by Chiachang Wang's avatar Chiachang Wang
Browse files

Replace hidden NMS API for setting MTU

Replace the hidden NMS setMtu API with calling INetd directly
for incoming ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Test: manually connect and disconnect network
Change-Id: I6a51d8033b3354824d4cfb953c2bbe3055d00102
parent ffa7b2f1
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -116,11 +116,6 @@ interface INetworkManagementService
     */
    void removeRoute(int netId, in RouteInfo route);

    /**
     * Set the specified MTU size
     */
    void setMtu(String iface, int mtu);

    /**
     * Shuts down the service
     */
+3 −3
Original line number Diff line number Diff line
@@ -2437,9 +2437,9 @@ public class ConnectivityService extends IConnectivityManager.Stub

        try {
            if (VDBG || DDBG) log("Setting MTU size: " + iface + ", " + mtu);
            mNMS.setMtu(iface, mtu);
        } catch (Exception e) {
            Slog.e(TAG, "exception in setMtu()" + e);
            mNetd.interfaceSetMtu(iface, mtu);
        } catch (RemoteException | ServiceSpecificException e) {
            Slog.e(TAG, "exception in interfaceSetMtu()" + e);
        }
    }

+0 −11
Original line number Diff line number Diff line
@@ -944,17 +944,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
        return list;
    }

    @Override
    public void setMtu(String iface, int mtu) {
        NetworkStack.checkNetworkStackPermission(mContext);

        try {
            mNetdService.interfaceSetMtu(iface, mtu);
        } catch (RemoteException | ServiceSpecificException e) {
            throw new IllegalStateException(e);
        }
    }

    @Override
    public void shutdown() {
        // TODO: remove from aidl if nobody calls externally