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
This commit is contained in:
Nathan Harold
2017-07-17 14:01:53 -07:00
parent 8086539071
commit 12accd0d1b

View File

@@ -402,17 +402,14 @@ public class IpSecService extends IIpSecService.Stub {
private void connectNativeNetdService() { private void connectNativeNetdService() {
// Avoid blocking the system server to do this // Avoid blocking the system server to do this
Thread t = new Thread() {
new Thread( @Override
new Runnable() { public void run() {
@Override synchronized (IpSecService.this) {
public void run() { NetdService.get(NETD_FETCH_TIMEOUT);
synchronized (IpSecService.this) { }
NetdService.get(NETD_FETCH_TIMEOUT); }
} }.start();
}
});
t.run();
} }
INetd getNetdInstance() throws RemoteException { INetd getNetdInstance() throws RemoteException {