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

Commit 92b14470 authored by Anthony Stange's avatar Anthony Stange
Browse files

Add methods needed for CHRE HAL to use IContextHubWrapper

Bug: 166846988
Test: Load onto device and verify HAL 1.2 works as it did previously
Change-Id: I5281362178901a841ad2cf6bb839fe9f9a863a56
parent a926597f
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -64,6 +64,11 @@ class IContextHubCallbackWrapperBase : public VirtualLightRefBase {
    virtual Return<void> handleAppAbort(uint64_t appId, uint32_t abortCode) = 0;

    virtual Return<void> handleAppsInfo(hidl_vec<V1_2::HubAppInfo> appInfo) = 0;

    virtual Return<bool> linkToDeath(const sp<hidl_death_recipient>& recipient,
                                     uint64_t cookie) = 0;

    virtual Return<bool> unlinkToDeath(const sp<hidl_death_recipient>& recipient) = 0;
};

template <typename T>
@@ -92,6 +97,14 @@ class ContextHubCallbackWrapper : public IContextHubCallbackWrapperBase {
        return mCallback->handleAppsInfo(convertToOldAppInfo(appInfo));
    }

    Return<bool> linkToDeath(const sp<hidl_death_recipient>& recipient, uint64_t cookie) override {
        return mCallback->linkToDeath(recipient, cookie);
    }

    Return<bool> unlinkToDeath(const sp<hidl_death_recipient>& recipient) override {
        return mCallback->unlinkToDeath(recipient);
    }

  protected:
    sp<T> mCallback;
};