From fe1ce1e047a170d26b2b10bc8f7a2a5878793823 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Tue, 7 Jan 2020 11:44:14 +0900 Subject: Add NETWORK_STACK_SERVICE to SystemServiceRegistry The service is already registered in ServiceManager. It needs to be accessible from SystemServiceRegistry so that other mainline modules can communicate with it. Bug: 147255753 Test: Dependent CLs using the service Change-Id: I940c62064466c3b3b8d2a195b810e90eaade7e6c Merged-In: I940c62064466c3b3b8d2a195b810e90eaade7e6c --- core/java/android/app/SystemServiceRegistry.java | 8 ++++++++ core/java/android/content/Context.java | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'core/java/android') diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 82df702eb7e5..88976e182e6d 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -341,6 +341,14 @@ final class SystemServiceRegistry { } }); + registerService(Context.NETWORK_STACK_SERVICE, IBinder.class, + new StaticServiceFetcher() { + @Override + public IBinder createService() { + return ServiceManager.getService(Context.NETWORK_STACK_SERVICE); + } + }); + registerService(Context.TETHERING_SERVICE, TetheringManager.class, new CachedServiceFetcher() { @Override diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 0228b10b66c7..f2f905126715 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3851,10 +3851,12 @@ public abstract class Context { /** * Use with {@link android.os.ServiceManager.getService()} to retrieve a - * {@link NetworkStackClient} IBinder for communicating with the network stack + * {@link INetworkStackConnector} IBinder for communicating with the network stack * @hide * @see NetworkStackClient */ + @SystemApi + @TestApi public static final String NETWORK_STACK_SERVICE = "network_stack"; /** -- cgit v1.2.3