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

Commit 198936ce authored by Luke Huang's avatar Luke Huang Committed by android-build-merger
Browse files

Merge "Clatd-related commands porting"

am: 3b9ae0ae

Change-Id: If2f81d6444b44855e390abe71bb3355246107827
parents 293800c9 3b9ae0ae
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -371,11 +371,6 @@ interface INetworkManagementService
     */
    void stopClatd(String interfaceName);

    /**
     * Determine whether the clatd (464xlat) service has been started on the given interface.
     */
    boolean isClatdStarted(String interfaceName);

    /**
     * Start listening for mobile activity state changes.
     */
+6 −21
Original line number Diff line number Diff line
@@ -2303,9 +2303,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);

        try {
            mConnector.execute("clatd", "start", interfaceName);
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
            mNetdService.clatdStart(interfaceName);
        } catch (RemoteException | ServiceSpecificException e) {
            throw new IllegalStateException(e);
        }
    }

@@ -2314,25 +2314,10 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);

        try {
            mConnector.execute("clatd", "stop", interfaceName);
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }
    }

    @Override
    public boolean isClatdStarted(String interfaceName) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);

        final NativeDaemonEvent event;
        try {
            event = mConnector.execute("clatd", "status", interfaceName);
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
            mNetdService.clatdStop(interfaceName);
        } catch (RemoteException | ServiceSpecificException e) {
            throw new IllegalStateException(e);
        }

        event.checkCode(ClatdStatusResult);
        return event.getMessage().endsWith("started");
    }

    @Override