summaryrefslogtreecommitdiff
path: root/service-t/src
diff options
context:
space:
mode:
authorXiao Ma <xiaom@google.com>2021-12-16 02:38:40 +0000
committerXiao Ma <xiaom@google.com>2021-12-16 04:31:27 +0000
commit300abdb2a8099a2d24a9882dafb15a7e5199e87d (patch)
tree7bb83ef0c05f68fa75a6fc2a2e05fc65b905b676 /service-t/src
parent2fc1c08cb57fb188f76e744d0f43a3e1b54fa0e2 (diff)
Remove NetdService usage from EthernetTracker.
Ethernet service related files are going to be moved into Connectivity module. So, NetdService won't be visible to EthernetTracker since it's a hidden class. Alternatively, get the INetd instance from system service instead. Bug: 210586283 Test: atest FrameworksNetTests Test: atest EthernetServiceTests Change-Id: Iea021ac25cbe4b8836fdab2cd6b4bd3ead5bf725
Diffstat (limited to 'service-t/src')
-rw-r--r--service-t/src/com/android/server/ethernet/EthernetTracker.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java
index 86aefbcff2..beb950cb9d 100644
--- a/service-t/src/com/android/server/ethernet/EthernetTracker.java
+++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java
@@ -40,7 +40,6 @@ import android.os.ServiceManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
-import android.net.util.NetdService;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.IndentingPrintWriter;
@@ -124,7 +123,9 @@ final class EthernetTracker {
// The services we use.
IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE);
mNMService = INetworkManagementService.Stub.asInterface(b);
- mNetd = Objects.requireNonNull(NetdService.getInstance(), "could not get netd instance");
+ mNetd = INetd.Stub.asInterface(
+ (IBinder) context.getSystemService(Context.NETD_SERVICE));
+ Objects.requireNonNull(mNetd, "could not get netd instance");
// Interface match regex.
updateIfaceMatchRegexp();