summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorXiao Ma <xiaom@google.com>2022-01-24 07:45:37 +0000
committerXiao Ma <xiaom@google.com>2022-01-24 07:53:34 +0000
commit8c69de30e01f76413bb3e7d12a69a71b1e6dd309 (patch)
tree2f6ba0812b1908b600cb69c93be2d34c9f1867c4 /java
parent12033d9f4b874634ae3019d514ab8b484fb79592 (diff)
downloadethernet-8c69de30e01f76413bb3e7d12a69a71b1e6dd309.tar.gz
Replace the NetdService usage in the EthernetService.
Ethernet service related files are going to be moved into Connectivity module. NetdService won't be visible to EthernetService. Use asInterface to get the Netd service instead. Bug: 210586283 Test: m Change-Id: I3bf504cd947f74bf5830659915483fe5331ac9eb
Diffstat (limited to 'java')
-rw-r--r--java/com/android/server/ethernet/EthernetService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/com/android/server/ethernet/EthernetService.java b/java/com/android/server/ethernet/EthernetService.java
index 492a55a..e6fee9e 100644
--- a/java/com/android/server/ethernet/EthernetService.java
+++ b/java/com/android/server/ethernet/EthernetService.java
@@ -18,7 +18,6 @@ package com.android.server.ethernet;
import android.content.Context;
import android.net.INetd;
-import android.net.util.NetdService;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
@@ -41,11 +40,12 @@ public final class EthernetService extends SystemService {
final EthernetNetworkFactory factory = new EthernetNetworkFactory(handler, context);
mImpl = new EthernetServiceImpl(
context, handler,
- new EthernetTracker(context, handler, factory, getNetd()));
+ new EthernetTracker(context, handler, factory, getNetd(context)));
}
- private INetd getNetd() {
- final INetd netd = NetdService.getInstance();
+ private INetd getNetd(Context context) {
+ final INetd netd =
+ INetd.Stub.asInterface((IBinder) context.getSystemService(Context.NETD_SERVICE));
Objects.requireNonNull(netd, "could not get netd instance");
return netd;
}