diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-08-23 19:49:51 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-23 19:49:51 +0000 |
| commit | 4cef59a768d22bcc1cc968b908e3d988decd1928 (patch) | |
| tree | 83db30f0411927c02f54e228b986e5a1f65169bc /core/java/android | |
| parent | ebf86adf3c29f546d33265dd8ae5e32569cbd4ca (diff) | |
| parent | 0ce930a02e44c8009db243cbd1ecf5a3e90a1484 (diff) | |
Merge "ServiceManager APIs for Wi-Fi mainline module" am: 0ce930a02e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1768620
Change-Id: I2591edfe683ccab7fd482c342dc88630a9561bb4
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/ServiceManager.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java index f7d7b21cb598..06a2c875cf4f 100644 --- a/core/java/android/os/ServiceManager.java +++ b/core/java/android/os/ServiceManager.java @@ -17,6 +17,8 @@ package android.os; import android.annotation.NonNull; +import android.annotation.Nullable; +import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; import android.util.ArrayMap; import android.util.Log; @@ -28,6 +30,7 @@ import com.android.internal.util.StatLogger; import java.util.Map; /** @hide */ +@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class ServiceManager { private static final String TAG = "ServiceManager"; private static final Object sLock = new Object(); @@ -98,10 +101,12 @@ public final class ServiceManager { int COUNT = GET_SERVICE + 1; } + /** @hide */ public static final StatLogger sStatLogger = new StatLogger(new String[] { "getService()", }); + /** @hide */ @UnsupportedAppUsage public ServiceManager() { } @@ -123,6 +128,7 @@ public final class ServiceManager { * * @param name the name of the service to get * @return a reference to the service, or <code>null</code> if the service doesn't exist + * @hide */ @UnsupportedAppUsage public static IBinder getService(String name) { @@ -160,6 +166,7 @@ public final class ServiceManager { * * @param name the name of the new service * @param service the service object + * @hide */ @UnsupportedAppUsage public static void addService(String name, IBinder service) { @@ -174,6 +181,7 @@ public final class ServiceManager { * @param service the service object * @param allowIsolated set to true to allow isolated sandboxed processes * to access this service + * @hide */ @UnsupportedAppUsage public static void addService(String name, IBinder service, boolean allowIsolated) { @@ -189,6 +197,7 @@ public final class ServiceManager { * @param allowIsolated set to true to allow isolated sandboxed processes * @param dumpPriority supported dump priority levels as a bitmask * to access this service + * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public static void addService(String name, IBinder service, boolean allowIsolated, @@ -203,6 +212,7 @@ public final class ServiceManager { /** * Retrieve an existing service called @a name from the * service manager. Non-blocking. + * @hide */ @UnsupportedAppUsage public static IBinder checkService(String name) { @@ -239,6 +249,7 @@ public final class ServiceManager { * * @return true if the service is declared somewhere (eg. VINTF manifest) and * waitForService should always be able to return the service. + * @hide */ public static String[] getDeclaredInstances(@NonNull String iface) { try { @@ -256,6 +267,7 @@ public final class ServiceManager { * will wait for it to be ready. * * @return {@code null} only if there are permission problems or fatal errors. + * @hide */ public static IBinder waitForService(@NonNull String name) { return Binder.allowBlocking(waitForServiceNative(name)); @@ -263,7 +275,6 @@ public final class ServiceManager { private static native IBinder waitForServiceNative(@NonNull String name); - /** * Returns the specified service from the service manager, if declared. * @@ -272,8 +283,10 @@ public final class ServiceManager { * * @return {@code null} if the service is not declared in the manifest, or if there are * permission problems, or if there are fatal errors. + * @hide */ - public static IBinder waitForDeclaredService(@NonNull String name) { + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + @Nullable public static IBinder waitForDeclaredService(@NonNull String name) { return isDeclared(name) ? waitForService(name) : null; } @@ -281,6 +294,7 @@ public final class ServiceManager { * Return a list of all currently running services. * @return an array of all currently running services, or <code>null</code> in * case of an exception + * @hide */ @UnsupportedAppUsage public static String[] listServices() { |
