mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Creates a dummy pointer for empty messages
Changes to Java HIDL at ContextHubService caused empty messages with sendMessageToHub to be populated with null pointers. Work around this by creating a dummy pointer in this case. Bug: 69065562 Test: Compile on sailfish-userdebug, run CHQTS and verify pass Change-Id: I763cbf9696f6dc04637add3ed1da01f9c32d458b
This commit is contained in:
@@ -155,6 +155,12 @@ Return<Result> Contexthub::sendMessageToHub(uint32_t hubId,
|
||||
.message = static_cast<const uint8_t *>(msg.msg.data()),
|
||||
};
|
||||
|
||||
// Use a dummy to prevent send_message with empty message from failing prematurely
|
||||
static uint8_t dummy;
|
||||
if (txMsg.message_len == 0 && txMsg.message == nullptr) {
|
||||
txMsg.message = &dummy;
|
||||
}
|
||||
|
||||
ALOGI("Sending msg of type %" PRIu32 ", size %" PRIu32 " to app 0x%" PRIx64,
|
||||
txMsg.message_type,
|
||||
txMsg.message_len,
|
||||
|
||||
Reference in New Issue
Block a user