From fd2cbf9981a4b467c22d0cb4bc4a45b67e59712a Mon Sep 17 00:00:00 2001 From: Kai Date: Sun, 21 Feb 2021 19:48:28 -0800 Subject: [PATCH] Add Unix_time and STORAGE_ENCRYPTION_BINDING_SEED Add two new properties. Unix_time and STORAGE_ENCRYPTION_BINDING_SEED. Bug: 176936731 Bug: 176985441 Test: adb shell cmd car_service get-carpropertyconfig Change-Id: Ib94d8747a1b9ad0f187a8f78a87cd7f10b4506c5 --- .../default/impl/vhal_v2_0/DefaultConfig.h | 16 +++++++ automotive/vehicle/2.0/types.hal | 43 +++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index 9d0b9ec989..5dca1dc0ff 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -1146,6 +1146,22 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, + { + .config = + { + .prop = toInt(VehicleProperty::UNIX_TIME), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(VehicleProperty::STORAGE_ENCRYPTION_BINDING_SEED), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + }, { .config = { diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index 9ecb2d56d2..eabd7e11fe 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -1347,6 +1347,48 @@ enum VehicleProperty : int32_t { | VehiclePropertyType:INT32 | VehicleArea:GLOBAL), + /** + * Current date and time, encoded as Unix time (in milliseconds). + * This value denotes the number of milliseconds seconds that have + * elapsed since 1/1/1970 UTC. + * + * Reading this value will give you the system’s time. This can be + * useful to synchronize other vehicle systems (dash clock etc). + * + * Writing this value will update the ‘ExternalTimeSuggestion’ + * value (if enabled). This value may be consumed by the “Time + * Detector Service”, if other sources do not have a higher + * priority. For information on how to adjust time source + * priorities see Time Detector Service documentation. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:MILLI_SECS + */ + UNIX_TIME = ( + 0x0606 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT64 + | VehicleArea:GLOBAL), + + /** + * External encryption binding seed. + * + * This value is mixed with the local key storage encryption key. + * This property holds 16 bytes, and is expected to be persisted on an ECU separate from + * the IVI. The property is initially set by AAOS, who generates it using a CSRNG. + * AAOS will then read the property on subsequent boots. The binding seed is expected to be + * reliably persisted. Any loss of the seed results in a factory reset of the IVI. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + STORAGE_ENCRYPTION_BINDING_SEED = ( + 0x0607 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BYTES + | VehicleArea:GLOBAL), + /** * Outside temperature * @@ -3623,6 +3665,7 @@ enum VehicleUnit : int32_t { US_GALLON = 0x42, IMPERIAL_GALLON = 0x43, NANO_SECS = 0x50, + MILLI_SECS = 0x51, SECS = 0x53, YEAR = 0x59,