From a62d0498c15de1b6a39bbf401520f293de32699e Mon Sep 17 00:00:00 2001 From: Luke Huang Date: Fri, 27 Jul 2018 20:08:21 +0800 Subject: [PATCH] Idletimer-related commands porting Test: runtest frameworks-net passes Test: manual testing of idletimer works Change-Id: I63e20aa3861e613b0970be30a70d0972d7e33d8c --- .../android/server/NetworkManagementService.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java index 6d6fd84dafaa4..379140258f304 100644 --- a/services/core/java/com/android/server/NetworkManagementService.java +++ b/services/core/java/com/android/server/NetworkManagementService.java @@ -1490,10 +1490,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub } try { - mConnector.execute("idletimer", "add", iface, Integer.toString(timeout), - Integer.toString(type)); - } catch (NativeDaemonConnectorException e) { - throw e.rethrowAsParcelableException(); + mNetdService.idletimerAddInterface(iface, timeout, Integer.toString(type)); + } catch (RemoteException | ServiceSpecificException e) { + throw new IllegalStateException(e); } mActiveIdleTimers.put(iface, new IdleTimerParams(timeout, type)); @@ -1524,10 +1523,10 @@ public class NetworkManagementService extends INetworkManagementService.Stub } try { - mConnector.execute("idletimer", "remove", iface, - Integer.toString(params.timeout), Integer.toString(params.type)); - } catch (NativeDaemonConnectorException e) { - throw e.rethrowAsParcelableException(); + mNetdService.idletimerRemoveInterface(iface, + params.timeout, Integer.toString(params.type)); + } catch (RemoteException | ServiceSpecificException e) { + throw new IllegalStateException(e); } mActiveIdleTimers.remove(iface); mDaemonHandler.post(new Runnable() {