You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

/*
* 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 <vendor/huanglong/hardware/hwdisplay/2.0/IHwdisplay.h>
#include <vendor/huanglong/hardware/hwdisplay/2.0/types.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
#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<void> hwInvoke(const hidl_string& request, hwInvoke_cb _hidl_cb) override;
Return<int32_t> RegisterCallback(uint32_t eventid, const sp<IDispmngCallback> &cb) override;
Return<int32_t> UnRegisterCallback(uint32_t eventid, const sp<IDispmngCallback> &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<DispDeathRecipient> mDeathRecipient;
static ClientId GetDispmngClientId(const sp<IDispmngCallback> &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