From 4fd217a1c6d149a826b7d6d09661d32cfecb6454 Mon Sep 17 00:00:00 2001 From: Ching Tzung Lin Date: Thu, 23 Jul 2015 10:18:06 -0700 Subject: Fix compilation error on emerald-dev Change-Id: I324fb9b1b54e31610fe4fdce8edbb6979e666cbb --- modules/sensors/multihal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index cd67f6d..d26d168 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -34,6 +34,8 @@ #include #include +#include +#include static const char* CONFIG_FILENAME = "/system/etc/sensors/hals.conf"; static const char* LEGAL_SUBHAL_PATH_PREFIX = "/system/lib/hw/"; -- cgit v1.1 From dcc6b5fd693b129492a45ec75038ca582689bd5d Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Fri, 15 Jan 2016 16:12:39 -0800 Subject: amplifier: Fix compilation warning * Forward declare str_parms Change-Id: Iafb0ad8e4b0696807cfe568d0f89ce5dad6bcade --- include/hardware/audio_amplifier.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hardware/audio_amplifier.h b/include/hardware/audio_amplifier.h index 4305094..e3477d5 100644 --- a/include/hardware/audio_amplifier.h +++ b/include/hardware/audio_amplifier.h @@ -38,6 +38,8 @@ __BEGIN_DECLS #define AMPLIFIER_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) #define AMPLIFIER_DEVICE_API_VERSION_CURRENT AMPLIFIER_DEVICE_API_VERSION_2_0 +struct str_parms; + typedef struct amplifier_device { /** * Common methods of the amplifier device. This *must* be the first member -- cgit v1.1 From 2a5e3d2ea98049b7c96f39f434f40ba1a690df7c Mon Sep 17 00:00:00 2001 From: Andre Eisenbach Date: Thu, 14 Jan 2016 02:03:36 -0800 Subject: DO NOT MERGE Add ability to add interop entries dynamically (1/2) Add ability and interface for adding dynamic entries to the interop workaround database. Bug: 26548845 Change-Id: I17f8cbdf1e63c316aa52903be7ec526c9b1376bb (cherry picked from commit 9cacd60df4d3a6cfe5af687177b478bc9855130f) --- include/hardware/bluetooth.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h index 3427213..0f1a35b 100644 --- a/include/hardware/bluetooth.h +++ b/include/hardware/bluetooth.h @@ -548,6 +548,17 @@ typedef struct { */ int (*config_clear)(void); + /** + * Clear (reset) the dynamic portion of the device interoperability database. + */ + void (*interop_database_clear)(void); + + /** + * Add a new device interoperability workaround for a remote device whose + * first |len| bytes of the its device address match |addr|. + * NOTE: |feature| has to match an item defined in interop_feature_t (interop.h). + */ + void (*interop_database_add)(uint16_t feature, const bt_bdaddr_t *addr, size_t len); } bt_interface_t; /** TODO: Need to add APIs for Service Discovery, Service authorization and -- cgit v1.1 From 397277cc4ee0764184d3a5eaeea9f3dd26c996ab Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Fri, 6 May 2016 04:27:57 -0700 Subject: hardware: Add definition for launch boost info Change-Id: I43e556d5a2c7e44eaa377636b8c9456b0acc30a0 --- include/hardware/power.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hardware/power.h b/include/hardware/power.h index c266d8b..2eb98fe 100644 --- a/include/hardware/power.h +++ b/include/hardware/power.h @@ -62,6 +62,15 @@ typedef enum { } feature_t; /** + * Process info, passed as an opaque handle when + * using POWER_HINT_LAUNCH_BOOST. + */ +typedef struct launch_boost_info { + pid_t pid; + const char* packageName; +} launch_boost_info_t; + +/** * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM * and the fields of this data structure must begin with hw_module_t * followed by module specific information. @@ -170,7 +179,6 @@ typedef struct power_module { } power_module_t; - __END_DECLS #endif // ANDROID_INCLUDE_HARDWARE_POWER_H -- cgit v1.1 From 8b3d5a64c3c8d010ad4517f652731f09107ae9c5 Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Fri, 18 Mar 2016 14:27:36 -0700 Subject: Add guest mode functionality (1/3) Add a flag to enable() to start Bluetooth in restricted mode. In restricted mode, all devices that are paired during restricted mode are deleted upon leaving restricted mode. Right now restricted mode is only entered while a guest user is active Bug: 27410683 Change-Id: I994a2933fd60301927ff2df65da634f81d4c9428 --- include/hardware/bluetooth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hardware/bluetooth.h b/include/hardware/bluetooth.h index 0f1a35b..68cbd1e 100644 --- a/include/hardware/bluetooth.h +++ b/include/hardware/bluetooth.h @@ -438,7 +438,7 @@ typedef struct { int (*init)(bt_callbacks_t* callbacks ); /** Enable Bluetooth. */ - int (*enable)(void); + int (*enable)(bool guest_mode); /** Disable Bluetooth. */ int (*disable)(void); -- cgit v1.1 From a90055612f3b606a66211706821b4f42d1bc85b7 Mon Sep 17 00:00:00 2001 From: Mao Li Date: Tue, 24 Nov 2015 13:35:26 +0800 Subject: keymaster: Add SOTER tags and API definations Add SOTER tags and API definations according to SOTER specification. Change-Id: I20ba0f51d8825a326b51f47ef4d2a3e4f60e2172 --- include/hardware/keymaster1.h | 49 +++++++++++++++++++++++++++++++++++++++ include/hardware/keymaster_defs.h | 21 +++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/include/hardware/keymaster1.h b/include/hardware/keymaster1.h index afd202c..ac2cc2b 100644 --- a/include/hardware/keymaster1.h +++ b/include/hardware/keymaster1.h @@ -530,6 +530,55 @@ struct keymaster1_device { */ keymaster_error_t (*abort)(const struct keymaster1_device* dev, keymaster_operation_handle_t operation_handle); + + /** + * Generates a pair of ATTK defined in SOTER. Save the private key into RPMB. + * Note that the ATTK generated will never be touched outside the keymaster. + * + * \param[in] dev The keymaster device structure. + * + * \param[in] copy_num The number of copies that will be saved in the RPMB. + */ + keymaster_error_t (*generate_attk_key_pair)(const struct keymaster1_device* dev, + const uint8_t copy_num); + + /** + * Verify the existance ATTK defined in SOTER. + * + * \param[in] dev The keymaster device structure. + * + * Returns: 0 if the ATTK exists. + */ + keymaster_error_t (*verify_attk_key_pair)(const struct keymaster1_device* dev); + + /** + * Export the public key of ATTK in PEM format. + * + * \param[in] dev The keymaster device structure. + * + * \param[out] pub_key_data The public key data in X.509v3 format PEM encoded + * + * \param[out] pub_key_data_length The length of the public key data. + */ + keymaster_error_t (*export_attk_public_key)(const struct keymaster1_device* dev, + const uint8_t* pub_key_data, + const size_t pub_key_data_length); + + /** + * Get Unique device ID. + * + * \param[in] dev The keymaster device structure. + * + * \param[out] device_id The unique id for each device, format as below: + * 1.bytes 0-3: Identify each silicon provider id. + * 2.bytes 4-7: SoC model ID, defined by each silicon provider + * 3.bytes 8-15: Public Chip Serial *Number of SoC, defined by each silicon provider + * + * \param[out] device_id_length The length of the device id. + */ + keymaster_error_t (*get_device_id)(const struct keymaster1_device* dev, + const uint8_t* device_id, + const size_t device_id_length); }; typedef struct keymaster1_device keymaster1_device_t; diff --git a/include/hardware/keymaster_defs.h b/include/hardware/keymaster_defs.h index 5be956d..1a723c9 100644 --- a/include/hardware/keymaster_defs.h +++ b/include/hardware/keymaster_defs.h @@ -124,6 +124,27 @@ typedef enum { authentication has been performed. Structure defined in hw_auth_token_t in hw_auth_token.h. */ KM_TAG_MAC_LENGTH = KM_UINT | 1003, /* MAC or AEAD authentication tag length in bits. */ + + /* Tags used only for SOTER */ + /* Tags used only to check if the key is for SOTER */ + KM_TAG_SOTER_IS_FROM_SOTER = KM_BOOL | 11000, + /* Attach signature signed with ATTK[pri] while exporting public key */ + KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_ATTK_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11001, + /* Attach signature signed with specified private key while exporting public key */ + KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_COMMON_KEY_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11002, + /* keyalias for the keypair of KM_TAG_SOTER_IS_AUTO_SIGNED_WITH_COMMON_KEY_WHEN_GET_PUBLIC_KEY */ + KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY = KM_BYTES | 11003, + /* Attach counter while exporting publick key */ + KM_TAG_SOTER_AUTO_ADD_COUNTER_WHEN_GET_PUBLIC_KEY = KM_BOOL | 11004, + /* Attach secmsg(TEE_Name, TEE_Version, Fingerprint_Sensor_Name, Fingerprint_Sensor_Version) + fingerprint_id and counter while signing */ + KM_TAG_SOTER_IS_SECMSG_FID_COUNTER_SIGNED_WHEN_SIGN = KM_BOOL | 11005, + /* use and set ATTK index to next backup ATTK */ + KM_TAG_SOTER_USE_NEXT_ATTK = KM_BOOL | 11006, + /* attach soter uid */ + KM_TAG_SOTER_UID = KM_UINT | 11007, + /* attach key blob of KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY if needed */ + KM_TAG_SOTER_AUTO_SIGNED_COMMON_KEY_WHEN_GET_PUBLIC_KEY_BLOB = KM_BYTES | 11008, } keymaster_tag_t; /** -- cgit v1.1 From 7659cdd34d33498b3e172730a888f8ea793e1ef3 Mon Sep 17 00:00:00 2001 From: Dhruva Krishnamurthy Date: Tue, 30 Aug 2016 06:45:14 -0700 Subject: Memory leak fix during sensor HAL initialization Change-Id: If8833dd1285f33498277c10b0e1fd0a1269284a0 --- modules/sensors/multihal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index 8330ff3..48f2be3 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -490,14 +490,14 @@ static void lazy_init_modules() { pthread_mutex_unlock(&init_modules_mutex); return; } - std::vector *so_paths = new std::vector(); - get_so_paths(so_paths); + std::vector so_paths; + get_so_paths(&so_paths); // dlopen the module files and cache their module symbols in sub_hw_modules sub_hw_modules = new std::vector(); dlerror(); // clear any old errors const char* sym = HAL_MODULE_INFO_SYM_AS_STR; - for (std::vector::iterator it = so_paths->begin(); it != so_paths->end(); it++) { + for (std::vector::iterator it = so_paths.begin(); it != so_paths.end(); it++) { const char* path = it->c_str(); void* lib_handle = dlopen(path, RTLD_LAZY); if (lib_handle == NULL) { -- cgit v1.1