From 12accd0d1b5e6ba21524e48ca2c505b8993e7a9d Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Mon, 17 Jul 2017 14:01:53 -0700 Subject: [PATCH] Launch NetD in a different thread Calling run() launches in the current thread; we want to call start() to launch in a separate thread to unblock system initialization. Bug: none Test: compilation Change-Id: Ia85059100add6a44a5e3262500b00ba8ca21e125 --- .../java/com/android/server/IpSecService.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/services/core/java/com/android/server/IpSecService.java b/services/core/java/com/android/server/IpSecService.java index ec275cc6f7..bd3a8509f7 100644 --- a/services/core/java/com/android/server/IpSecService.java +++ b/services/core/java/com/android/server/IpSecService.java @@ -402,17 +402,14 @@ public class IpSecService extends IIpSecService.Stub { private void connectNativeNetdService() { // Avoid blocking the system server to do this - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - synchronized (IpSecService.this) { - NetdService.get(NETD_FETCH_TIMEOUT); - } - } - }); - t.run(); + new Thread() { + @Override + public void run() { + synchronized (IpSecService.this) { + NetdService.get(NETD_FETCH_TIMEOUT); + } + } + }.start(); } INetd getNetdInstance() throws RemoteException {