/* * Copyright (c) Hisilicon Technologies Co., Ltd.. 2019-2022. All rights reserved. * Description: Support hwdisplay hal adaptation interface * Author: Hisilicon * Created: 2022-12-28 */ #ifndef ANDROID_HARDWARE_HWDISPLAY_V2_0_HWDISPLAY_H #define ANDROID_HARDWARE_HWDISPLAY_V2_0_HWDISPLAY_H #include #include #include #include #include "display.h" namespace vendor { namespace huanglong { namespace hardware { namespace hwdisplay { namespace V2_0 { namespace implementation { using ::vendor::huanglong::hardware::hwdisplay::V2_0::IHwdisplay; using ::vendor::huanglong::hardware::hwdisplay::V2_0::IDispmngCallback; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; using ::android::hardware::hidl_string; using ::android::hardware::hidl_death_recipient; using ::android::sp; using ClientId = uint64_t; class DisplayDeathRecipient; class HwDisplay : public IHwdisplay { public: HwDisplay(); ~HwDisplay() override; Return hwInvoke(const hidl_string& request, hwInvoke_cb _hidl_cb) override; Return RegisterCallback(uint32_t eventid, const sp &cb) override; Return UnRegisterCallback(uint32_t eventid, const sp &cb) override; private: struct DispDeathRecipient : android::hardware::hidl_death_recipient { DispDeathRecipient() {} void serviceDied(uint64_t deathid, const android::wp<::android::hidl::base::V1_0::IBase> &) override { HandleDispmngHidlDeath(deathid); } }; sp mDeathRecipient; static ClientId GetDispmngClientId(const sp &callback); static void HandleDispmngHidlDeath(ClientId deathid); const hw_module_t *mModule; DisplayDeviceT *mDevice; }; extern "C" IHwdisplay* HIDL_FETCH_IHwdisplay(const char*); } // namespace implementation } // namespace V2_0 } // namespace hwdisplay } // namespace hardware } // namespace huanglong } // namespace vendor #endif