context_hub: Define target version bytes

Define that the first two previously-reserved bytes in the nanoapp
header are used to indicate the target CHRE API version.

Bug: 64852297
Test: run CHQTS on Nanohub, rebuild test app targeting 1.2 and confirm
      it's interpreted correctly
Change-Id: I0582f718bb641cc9c4e1f013578dc2dd50e6d3ec
diff --git a/include/hardware/context_hub.h b/include/hardware/context_hub.h
index aaa4274..137cb3e 100644
--- a/include/hardware/context_hub.h
+++ b/include/hardware/context_hub.h
@@ -47,12 +47,13 @@
 /*****************************************************************************/
 
 #define CONTEXT_HUB_HEADER_MAJOR_VERSION          1
-#define CONTEXT_HUB_HEADER_MINOR_VERSION          0
+#define CONTEXT_HUB_HEADER_MINOR_VERSION          1
 #define CONTEXT_HUB_DEVICE_API_VERSION \
      HARDWARE_DEVICE_API_VERSION(CONTEXT_HUB_HEADER_MAJOR_VERSION, \
                                  CONTEXT_HUB_HEADER_MINOR_VERSION)
 
 #define CONTEXT_HUB_DEVICE_API_VERSION_1_0  HARDWARE_DEVICE_API_VERSION(1, 0)
+#define CONTEXT_HUB_DEVICE_API_VERSION_1_1  HARDWARE_DEVICE_API_VERSION(1, 1)
 
 /**
  * The id of this module
@@ -131,9 +132,17 @@
     uint32_t app_version;          // Version of the app
     uint32_t flags;                // Signed, encrypted
     uint64_t hw_hub_type;          // which hub type is this compiled for
-    uint32_t reserved[2];          // Should be all zeroes
-    uint8_t  custom_binary[0];     // start of custom binary data
-};
+
+    // The version of the CHRE API that this nanoapp was compiled against.
+    // If these values are both set to 0, then they must be interpreted the same
+    // as if major version were set to 1, and minor 0 (the first valid CHRE API
+    // version).
+    uint8_t target_chre_api_major_version;
+    uint8_t target_chre_api_minor_version;
+
+    uint8_t reserved[6];           // Should be all zeroes
+    uint8_t custom_binary[0];      // start of custom binary data
+} __attribute__((packed));
 
 struct hub_app_info {
     struct hub_app_name_t app_name;