Merge "ServiceManager APIs for Remote Key Provisioning mainline module."

This commit is contained in:
Vikram Gaur
2022-11-14 20:45:49 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -348,6 +348,7 @@ package android.os {
} }
public final class ServiceManager { public final class ServiceManager {
method @NonNull public static String[] getDeclaredInstances(@NonNull String);
method public static boolean isDeclared(@NonNull String); method public static boolean isDeclared(@NonNull String);
method @Nullable public static android.os.IBinder waitForDeclaredService(@NonNull String); method @Nullable public static android.os.IBinder waitForDeclaredService(@NonNull String);
} }

View File

@@ -258,12 +258,14 @@ public final class ServiceManager {
* waitForService should always be able to return the service. * waitForService should always be able to return the service.
* @hide * @hide
*/ */
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
@NonNull
public static String[] getDeclaredInstances(@NonNull String iface) { public static String[] getDeclaredInstances(@NonNull String iface) {
try { try {
return getIServiceManager().getDeclaredInstances(iface); return getIServiceManager().getDeclaredInstances(iface);
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "error in getDeclaredInstances", e); Log.e(TAG, "error in getDeclaredInstances", e);
return null; throw e.rethrowFromSystemServer();
} }
} }