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

Commit 4109b479 authored by Alice Wang's avatar Alice Wang Committed by Gerrit Code Review
Browse files

Merge "[java] Restore ServiceManager#checkService() to return IBinder" into main

parents 3b463ca4 9f78536d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ public final class ServiceManager {
                return service;
            } else {
                return Binder.allowBlocking(
                        getIServiceManager().checkService(name).getServiceWithMetadata().service);
                        getIServiceManager().checkService2(name).getServiceWithMetadata().service);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "error in checkService", e);
+11 −4
Original line number Diff line number Diff line
@@ -62,16 +62,23 @@ class ServiceManagerProxy implements IServiceManager {
    @UnsupportedAppUsage
    public IBinder getService(String name) throws RemoteException {
        // Same as checkService (old versions of servicemanager had both methods).
        return checkService(name).getServiceWithMetadata().service;
        return checkService2(name).getServiceWithMetadata().service;
    }

    public Service getService2(String name) throws RemoteException {
        // Same as checkService (old versions of servicemanager had both methods).
        return checkService(name);
        return checkService2(name);
    }

    public Service checkService(String name) throws RemoteException {
        return mServiceManager.checkService(name);
    // TODO(b/355394904): This function has been deprecated, please use checkService2 instead.
    @UnsupportedAppUsage
    public IBinder checkService(String name) throws RemoteException {
        // Same as checkService (old versions of servicemanager had both methods).
        return checkService2(name).getServiceWithMetadata().service;
    }

    public Service checkService2(String name) throws RemoteException {
        return mServiceManager.checkService2(name);
    }

    public void addService(String name, IBinder service, boolean allowIsolated, int dumpPriority)