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

Commit 8ead2f0c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use IBase instead of IBinder for IServiceManager."

parents 41f14f47 bae1b55a
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@

#include <JNIHelp.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <android/hidl/base/1.0/IBase.h>
#include <android/hidl/base/1.0/IHwBase.h>
#include <android_runtime/AndroidRuntime.h>
#include <hidl/ServiceManagement.h>
#include <hidl/Status.h>
@@ -239,11 +241,11 @@ static void JHwBinder_native_registerService(
    using android::hidl::manager::V1_0::IServiceManager;

    sp<hardware::IBinder> binder = JHwBinder::GetNativeContext(env, thiz);

    sp<hidl::base::V1_0::IBase> base = hidl::base::V1_0::IHwBase::asInterface(binder);
    bool ok = hardware::defaultServiceManager()->add(
                interfaceChain,
                serviceName,
                binder);
                base);

    env->ReleaseStringUTFChars(serviceNameObj, serviceName);
    serviceName = NULL;
@@ -289,8 +291,10 @@ static jobject JHwBinder_native_getService(
    hardware::defaultServiceManager()->get(
            ifaceName,
            serviceName,
            [&service](sp<hardware::IBinder> out) {
                service = out;
            [&service](sp<hidl::base::V1_0::IBase> out) {
                service = hardware::toBinder<
                        hidl::base::V1_0::IBase, hidl::base::V1_0::IHwBase
                    >(out);
            });

    env->ReleaseStringUTFChars(ifaceNameObj, ifaceName);