From 188552e83fbac49718e0299daed84eaf7c94834d Mon Sep 17 00:00:00 2001 From: Brian Duddie Date: Tue, 3 Jan 2017 09:38:24 -0800 Subject: [PATCH] contexthub: Expose CHRE version information Add chrePlatformId and chreVersion fields to context hub metadata returned by getHubs(). This information will be used to make compatibility decisions at runtime. Also, add a brief description of CHRE to the IContexthub documentation to help clarify the relationship between the HAL and these concepts in the CHRE API. Bug: 31402693 Test: compile test only, this only adds fields to HIDL structures Change-Id: Iea2436ccc23b47c4cf06040bebe1c550fe58ccb7 --- contexthub/1.0/IContexthub.hal | 7 +++++++ contexthub/1.0/types.hal | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/contexthub/1.0/IContexthub.hal b/contexthub/1.0/IContexthub.hal index 8c792fd387..a9b8fdb7c2 100644 --- a/contexthub/1.0/IContexthub.hal +++ b/contexthub/1.0/IContexthub.hal @@ -18,6 +18,13 @@ package android.hardware.contexthub@1.0; import IContexthubCallback; +/* + * The Context Hub HAL provides an interface to a separate low-power processing + * domain that has direct access to contextual information, such as sensors. + * Native applications that run within a context hub are known as nanoapps, and + * they execute within the Context Hub Runtime Environment (CHRE), which is + * standardized via the CHRE API, defined elsewhere. + */ interface IContexthub { /* * Enumerate all available context hubs on the system. diff --git a/contexthub/1.0/types.hal b/contexthub/1.0/types.hal index c8ea623df2..02fd42fe40 100644 --- a/contexthub/1.0/types.hal +++ b/contexthub/1.0/types.hal @@ -108,6 +108,22 @@ struct ContextHub { uint32_t maxSupportedMsgLen;// This is the maximum size of the message that can // be sent to the hub in one chunk (in bytes) + + // Machine-readable CHRE platform ID, returned to nanoapps in the CHRE API + // function call chreGetPlatformId(). The most significant 5 bytes of this + // value identify the vendor, while the remaining bytes are set by the + // vendor to uniquely identify each different CHRE implementation/hardware + // that the vendor supplies. This field pairs with the patch version part of + // chreVersion to fully specify the CHRE implementation version. See also + // the CHRE API header file chre/version.h. + uint64_t chrePlatformId; + + // CHRE implementation version, returned to nanoApps in the CHRE API + // function call chreGetVersion(). This value consists of the implemented + // CHRE API version (major version in most significant byte, followed by + // minor version), and the platform-specific implementation patch version + // in the lower two bytes. See also the CHRE API header file chre/version.h. + uint32_t chreVersion; }; struct ContextHubMsg {