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

Commit fedf8069 authored by Alice Wang's avatar Alice Wang Committed by Automerger Merge Worker
Browse files

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

Merge "[java] Restore ServiceManager#checkService() to return IBinder" into main am: 4109b479 am: c4e25aeb

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



Change-Id: Ice0fd085db90e7743b17f0916404e5403612de2a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c191e9a7 c4e25aeb
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)