mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 22:04:26 +00:00
Merge "contexthub: Pass target API version in new fields" into oc-mr1-dev
am: 814b6922c5
Change-Id: Ie927e555a9a46474785d67122ad27f797f493da0
This commit is contained in:
@@ -440,18 +440,15 @@ Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
|
||||
// Data from the nanoapp header is passed through HIDL as explicit fields,
|
||||
// but the legacy HAL expects it prepended to the binary, therefore we must
|
||||
// reconstruct it here prior to passing to the legacy HAL.
|
||||
uint32_t targetChreApiVersion =
|
||||
(appBinary.targetChreApiMajorVersion << 24) |
|
||||
(appBinary.targetChreApiMinorVersion << 16);
|
||||
const struct nano_app_binary_t header = {
|
||||
.header_version = htole32(1),
|
||||
.magic = htole32(NANOAPP_MAGIC),
|
||||
.app_id.id = htole64(appBinary.appId),
|
||||
.app_version = htole32(appBinary.appVersion),
|
||||
.flags = htole32(appBinary.flags),
|
||||
.hw_hub_type = htole64(0),
|
||||
.reserved[0] = htole32(targetChreApiVersion),
|
||||
.reserved[1] = 0,
|
||||
.magic = htole32(NANOAPP_MAGIC),
|
||||
.app_id.id = htole64(appBinary.appId),
|
||||
.app_version = htole32(appBinary.appVersion),
|
||||
.flags = htole32(appBinary.flags),
|
||||
.hw_hub_type = htole64(0),
|
||||
.target_chre_api_major_version = appBinary.targetChreApiMajorVersion,
|
||||
.target_chre_api_minor_version = appBinary.targetChreApiMinorVersion,
|
||||
};
|
||||
const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user