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

Commit 359e3fd0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Check AServiceManager_isDeclared before AServiceManager_getService" am:...

Merge "Check AServiceManager_isDeclared before AServiceManager_getService" am: fa58ead2 am: 6929fc9f

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2623413



Change-Id: Ic925bdb16517c002c89f902a03b52a6ea230130b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 61116c8b 6929fc9f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -63,9 +63,13 @@ constexpr const char gatekeeperServiceName[] = "android.hardware.gatekeeper.IGat

GateKeeperProxy::GateKeeperProxy() {
    clear_state_if_needed_done = false;
    hw_device = IGatekeeper::getService();
    ::ndk::SpAIBinder ks2Binder(AServiceManager_getService(gatekeeperServiceName));
    if (AServiceManager_isDeclared(gatekeeperServiceName)) {
        ::ndk::SpAIBinder ks2Binder(AServiceManager_waitForService(gatekeeperServiceName));
        aidl_hw_device = AidlIGatekeeper::fromBinder(ks2Binder);
    }
    if (!aidl_hw_device) {
        hw_device = IGatekeeper::getService();
    }
    is_running_gsi = android::base::GetBoolProperty(android::gsi::kGsiBootedProp, false);

    if (!aidl_hw_device && !hw_device) {