Merge "Clatd-related commands porting" am: 3b9ae0ae48

am: 198936ce60

Change-Id: I6c094b45dd4535b9bfc3438d8f376a3c0b320d48
This commit is contained in:
Luke Huang
2018-08-15 00:56:39 -07:00
committed by android-build-merger
2 changed files with 6 additions and 26 deletions

View File

@@ -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.
*/

View File

@@ -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,27 +2314,12 @@ public class NetworkManagementService extends INetworkManagementService.Stub
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
try {
mConnector.execute("clatd", "stop", interfaceName);
} catch (NativeDaemonConnectorException e) {
throw e.rethrowAsParcelableException();
mNetdService.clatdStop(interfaceName);
} catch (RemoteException | ServiceSpecificException e) {
throw new IllegalStateException(e);
}
}
@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();
}
event.checkCode(ClatdStatusResult);
return event.getMessage().endsWith("started");
}
@Override
public void registerNetworkActivityListener(INetworkActivityListener listener) {
mNetworkActivityListeners.register(listener);