Merge "hwc: Allow callback deregistration"
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 24a7500..fdb8358 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -573,14 +573,14 @@
int32_t HWCSession::RegisterCallback(hwc2_device_t *device, int32_t descriptor,
hwc2_callback_data_t callback_data,
hwc2_function_pointer_t pointer) {
- if (!device || pointer == nullptr) {
+ if (!device) {
return HWC2_ERROR_BAD_PARAMETER;
}
HWCSession *hwc_session = static_cast<HWCSession *>(device);
SCOPE_LOCK(hwc_session->callbacks_lock_);
auto desc = static_cast<HWC2::Callback>(descriptor);
auto error = hwc_session->callbacks_.Register(desc, callback_data, pointer);
- DLOGD("Registering callback: %s", to_string(desc).c_str());
+ DLOGD("%s callback: %s", pointer ? "Registering" : "Deregistering", to_string(desc).c_str());
if (descriptor == HWC2_CALLBACK_HOTPLUG) {
if (hwc_session->hwc_display_[HWC_DISPLAY_PRIMARY]) {
hwc_session->callbacks_.Hotplug(HWC_DISPLAY_PRIMARY, HWC2::Connection::Connected);