Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4acdea4c authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444b am: b1b83036...

Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444b am: b1b83036 am: 7ceee368 am: f5f4344d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518

Change-Id: I6a8cebfe4e97f916b9411979b6bb2d5099882557
parents 0be82d4f f5f4344d
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -234,6 +234,21 @@ public final class ServiceManager {
        }
        }
    }
    }


    /**
     * Returns the list of declared instances for an interface.
     *
     * @return true if the service is declared somewhere (eg. VINTF manifest) and
     * waitForService should always be able to return the service.
     */
    public static String[] getDeclaredInstances(@NonNull String iface) {
        try {
            return getIServiceManager().getDeclaredInstances(iface);
        } catch (RemoteException e) {
            Log.e(TAG, "error in getDeclaredInstances", e);
            return null;
        }
    }

    /**
    /**
     * Returns the specified service from the service manager.
     * Returns the specified service from the service manager.
     *
     *
+4 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,10 @@ class ServiceManagerProxy implements IServiceManager {
        return mServiceManager.isDeclared(name);
        return mServiceManager.isDeclared(name);
    }
    }


    public String[] getDeclaredInstances(String iface) throws RemoteException {
        return mServiceManager.getDeclaredInstances(iface);
    }

    public void registerClientCallback(String name, IBinder service, IClientCallback cb)
    public void registerClientCallback(String name, IBinder service, IClientCallback cb)
            throws RemoteException {
            throws RemoteException {
        throw new RemoteException();
        throw new RemoteException();