From 2fbb412b284043196a16543916c906e88f29f46c Mon Sep 17 00:00:00 2001 From: markchien Date: Tue, 14 Jan 2020 18:25:33 +0800 Subject: [PATCH] Use Context#getSystemService to get network stack binder Bug: 143195885 Test: -build, flash, boot -atest TetheringTests Change-Id: Ic5fabeae27677344d691449c31ad9337c0e6d92c --- .../server/connectivity/tethering/TetheringService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java index e4e4a09060..99130d20e6 100644 --- a/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java +++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java @@ -42,7 +42,6 @@ import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; import android.os.ResultReceiver; -import android.os.ServiceManager; import android.os.SystemProperties; import android.os.UserManager; import android.provider.Settings; @@ -363,7 +362,7 @@ public class TetheringService extends Service { IBinder connector; try { final long before = System.currentTimeMillis(); - while ((connector = ServiceManager.getService( + while ((connector = (IBinder) mContext.getSystemService( Context.NETWORK_STACK_SERVICE)) == null) { if (System.currentTimeMillis() - before > NETWORKSTACK_TIMEOUT_MS) { Log.wtf(TAG, "Timeout, fail to get INetworkStackConnector");