Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fd34982 authored by Brian Duddie's avatar Brian Duddie Committed by android-build-merger
Browse files

Merge "contexthub: Pass target API version in new fields" into oc-mr1-dev

am: 814b6922

Change-Id: Ie927e555a9a46474785d67122ad27f797f493da0
parents 8a61c0f5 814b6922
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -440,9 +440,6 @@ Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
    // Data from the nanoapp header is passed through HIDL as explicit fields,
    // 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
    // but the legacy HAL expects it prepended to the binary, therefore we must
    // reconstruct it here prior to passing to the legacy HAL.
    // 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 = {
    const struct nano_app_binary_t header = {
        .header_version = htole32(1),
        .header_version = htole32(1),
        .magic = htole32(NANOAPP_MAGIC),
        .magic = htole32(NANOAPP_MAGIC),
@@ -450,8 +447,8 @@ Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
        .app_version = htole32(appBinary.appVersion),
        .app_version = htole32(appBinary.appVersion),
        .flags = htole32(appBinary.flags),
        .flags = htole32(appBinary.flags),
        .hw_hub_type = htole64(0),
        .hw_hub_type = htole64(0),
        .reserved[0]    = htole32(targetChreApiVersion),
        .target_chre_api_major_version = appBinary.targetChreApiMajorVersion,
        .reserved[1]    = 0,
        .target_chre_api_minor_version = appBinary.targetChreApiMinorVersion,
    };
    };
    const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);
    const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);