Merge changes from topic "nfc1.1" into pi-dev
* changes:
Changes in current.txt as per NFC 1.1 changes
Add defaultSysCodePowerState in types.hal in NFC 1.1
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp
index 3e32b3e..4b93008 100644
--- a/automotive/vehicle/2.0/Android.bp
+++ b/automotive/vehicle/2.0/Android.bp
@@ -26,14 +26,15 @@
"Obd2IgnitionMonitorKind",
"Obd2SecondaryAirStatus",
"Obd2SparkIgnitionMonitors",
+ "PortLocationType",
"StatusCode",
"SubscribeFlags",
"SubscribeOptions",
"VehicleApPowerBootupReason",
- "VehicleApPowerSetState",
- "VehicleApPowerState",
"VehicleApPowerStateConfigFlag",
- "VehicleApPowerStateIndex",
+ "VehicleApPowerStateReq",
+ "VehicleApPowerStateReqIndex",
+ "VehicleApPowerStateReport",
"VehicleApPowerStateShutdownParam",
"VehicleArea",
"VehicleAreaConfig",
@@ -41,12 +42,13 @@
"VehicleAreaMirror",
"VehicleAreaSeat",
"VehicleAreaWindow",
- "VehicleAreaZone",
"VehicleDisplay",
"VehicleGear",
"VehicleHvacFanDirection",
"VehicleHwKeyInputAction",
"VehicleIgnitionState",
+ "VehicleLightState",
+ "VehicleLightSwitch",
"VehicleOilLevel",
"VehiclePropConfig",
"VehiclePropValue",
@@ -54,10 +56,8 @@
"VehiclePropertyAccess",
"VehiclePropertyChangeMode",
"VehiclePropertyGroup",
- "VehiclePropertyOperation",
"VehiclePropertyStatus",
"VehiclePropertyType",
- "VehicleRadioConstants",
"VehicleTurnSignal",
"VehicleUnit",
"VmsAvailabilityStateIntegerValuesIndex",
diff --git a/automotive/vehicle/2.0/IVehicleCallback.hal b/automotive/vehicle/2.0/IVehicleCallback.hal
index 7060418..c4a756a 100644
--- a/automotive/vehicle/2.0/IVehicleCallback.hal
+++ b/automotive/vehicle/2.0/IVehicleCallback.hal
@@ -33,7 +33,7 @@
/**
* This method gets called if the client was subscribed to a property using
- * SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called.
+ * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called.
*
* These events must be delivered to subscriber immediately without any
* batching.
diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h
index 359bb6d..946e74d 100644
--- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h
@@ -152,7 +152,7 @@
* VehiclePropValuePool pool;
* auto v = pool.obtain(VehiclePropertyType::INT32);
* v->propId = VehicleProperty::HVAC_FAN_SPEED;
- * v->areaId = VehicleAreaZone::ROW_1_LEFT;
+ * v->areaId = VehicleAreaSeat::ROW_1_LEFT;
* v->timestamp = elapsedRealtimeNano();
* v->value->int32Values[0] = 42;
*
diff --git a/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp
index a7d5f50..97aeca6 100644
--- a/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp
@@ -106,7 +106,7 @@
addClientToPropMapLocked(opts.propId, client);
- if (SubscribeFlags::HAL_EVENT & opts.flags) {
+ if (SubscribeFlags::EVENTS_FROM_CAR & opts.flags) {
SubscribeOptions updated;
if (updateHalEventSubscriptionLocked(opts, &updated)) {
outUpdatedSubscriptions->push_back(updated);
diff --git a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
index 1918421..b5de262 100644
--- a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp
@@ -216,7 +216,7 @@
int32_t property,
int32_t areaId) {
const auto& clients =
- mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::HAL_EVENT);
+ mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::EVENTS_FROM_CAR);
for (auto client : clients) {
client->getCallback()->onPropertySetError(errorCode, property, areaId);
@@ -224,8 +224,8 @@
}
void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& values) {
- const auto& clientValues = mSubscriptionManager.distributeValuesToClients(
- values, SubscribeFlags::HAL_EVENT);
+ const auto& clientValues =
+ mSubscriptionManager.distributeValuesToClients(values, SubscribeFlags::EVENTS_FROM_CAR);
for (const HalClientValues& cv : clientValues) {
auto vecSize = cv.values.size();
@@ -250,8 +250,7 @@
}
bool VehicleHalManager::isSampleRateFixed(VehiclePropertyChangeMode mode) {
- return (mode & VehiclePropertyChangeMode::ON_SET)
- || (mode & VehiclePropertyChangeMode::ON_CHANGE);
+ return (mode & VehiclePropertyChangeMode::ON_CHANGE);
}
float VehicleHalManager::checkSampleRate(const VehiclePropConfig &config,
@@ -281,7 +280,7 @@
SubscribeFlags flags) {
bool isReadable = config.access & VehiclePropertyAccess::READ;
- if (!isReadable && (SubscribeFlags::HAL_EVENT & flags)) {
+ if (!isReadable && (SubscribeFlags::EVENTS_FROM_CAR & flags)) {
ALOGW("Cannot subscribe, property 0x%x is not readable", config.prop);
return false;
}
@@ -289,12 +288,6 @@
ALOGW("Cannot subscribe, property 0x%x is static", config.prop);
return false;
}
-
- //TODO: extend to support event notification for set from android
- if (config.changeMode == VehiclePropertyChangeMode::POLL) {
- ALOGW("Cannot subscribe, property 0x%x is poll only", config.prop);
- return false;
- }
return true;
}
@@ -317,7 +310,8 @@
}
void VehicleHalManager::handlePropertySetEvent(const VehiclePropValue& value) {
- auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::SET_CALL);
+ auto clients =
+ mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::EVENTS_FROM_ANDROID);
for (auto client : clients) {
client->getCallback()->onPropertySet(value);
}
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 479f8af..56813ce 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
@@ -30,7 +30,8 @@
//
// Some handy constants to avoid conversions from enum to int.
constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE;
-constexpr int AP_POWER_STATE = (int)VehicleProperty::AP_POWER_STATE;
+constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ;
+constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT;
constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME;
constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME;
constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO;
@@ -149,14 +150,6 @@
},
.initialValue = {.floatValues = {0.0f}}},
- {.config =
- {
- .prop = toInt(VehicleProperty::ENGINE_ON),
- .access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- },
- .initialValue = {.int32Values = {0}}},
-
{
.config =
{
@@ -255,7 +248,7 @@
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}},
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}},
// TODO(bryaneyler): Ideally, this is generated dynamically from
// kHvacPowerProperties.
.configString = "0x12400500,0x12400501" // HVAC_FAN_SPEED,HVAC_FAN_DIRECTION
@@ -276,28 +269,28 @@
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}},
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}},
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}},
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT),
.minInt32Value = 1,
.maxInt32Value = 7}}},
.initialValue = {.int32Values = {3}}},
@@ -306,24 +299,24 @@
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}},
+ .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
.initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = toInt(VehicleAreaZone::ROW_1_LEFT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
.minFloatValue = 16,
.maxFloatValue = 32,
},
VehicleAreaConfig{
- .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT),
.minFloatValue = 16,
.maxFloatValue = 32,
}}},
- .initialAreaValues = {{toInt(VehicleAreaZone::ROW_1_LEFT), {.floatValues = {16}}},
- {toInt(VehicleAreaZone::ROW_1_RIGHT), {.floatValues = {20}}}}},
+ .initialAreaValues = {{toInt(VehicleAreaSeat::ROW_1_LEFT), {.floatValues = {16}}},
+ {toInt(VehicleAreaSeat::ROW_1_RIGHT), {.floatValues = {20}}}}},
{.config =
{
@@ -424,11 +417,17 @@
},
},
- {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE),
- .access = VehiclePropertyAccess::READ_WRITE,
+ {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ),
+ .access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {3}},
- .initialValue = {.int32Values = {toInt(VehicleApPowerState::ON_FULL), 0}}},
+ .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON_FULL), 0}}},
+
+ {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {3}},
+ .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::BOOT_COMPLETE), 0}}},
{.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
.access = VehiclePropertyAccess::READ_WRITE,
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index 3979ac2..2eb905d 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -138,7 +138,7 @@
// TODO(75328113): this should be handled by property status
auto hvacPowerOn = mPropStore->readValueOrNull(
toInt(VehicleProperty::HVAC_POWER_ON),
- (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT));
+ (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT));
if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1
&& hvacPowerOn->value.int32Values[0] == 0) {
@@ -153,7 +153,7 @@
// Placeholder for future implementation of VMS property in the default hal. For
// now, just returns OK; otherwise, hal clients crash with property not supported.
return StatusCode::OK;
- case AP_POWER_STATE:
+ case AP_POWER_STATE_REPORT:
// This property has different behavior between get/set. When it is set, the value
// goes to the vehicle but is NOT updated in the property store back to Android.
// Commented out for now, because it may mess up automated testing that use the
diff --git a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
index 4865e9e..ab2013d 100644
--- a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp
@@ -51,19 +51,16 @@
}
hidl_vec<SubscribeOptions> subscrToProp1 = {
- SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::HAL_EVENT},
+ SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR},
};
hidl_vec<SubscribeOptions> subscrToProp2 = {
- SubscribeOptions {
- .propId = PROP2,
- .flags = SubscribeFlags::HAL_EVENT
- },
+ SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::EVENTS_FROM_CAR},
};
hidl_vec<SubscribeOptions> subscrToProp1and2 = {
- SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::HAL_EVENT},
- SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::HAL_EVENT},
+ SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR},
+ SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::EVENTS_FROM_CAR},
};
static std::list<sp<IVehicleCallback>> extractCallbacks(
@@ -76,11 +73,11 @@
}
std::list<sp<HalClient>> clientsToProp1() {
- return manager.getSubscribedClients(PROP1, SubscribeFlags::DEFAULT);
+ return manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR);
}
std::list<sp<HalClient>> clientsToProp2() {
- return manager.getSubscribedClients(PROP2, SubscribeFlags::DEFAULT);
+ return manager.getSubscribedClients(PROP2, SubscribeFlags::EVENTS_FROM_CAR);
}
void onPropertyUnsubscribed(int propertyId) {
@@ -110,9 +107,7 @@
ASSERT_EQ(StatusCode::OK,
manager.addOrUpdateSubscription(2, cb2, subscrToProp1, &updatedOptions));
- auto clients = manager.getSubscribedClients(
- PROP1,
- SubscribeFlags::HAL_EVENT);
+ auto clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR);
ASSERT_ALL_EXISTS({cb1, cb2}, extractCallbacks(clients));
}
@@ -124,13 +119,11 @@
// Wrong prop
auto clients = manager.getSubscribedClients(toInt(VehicleProperty::AP_POWER_BOOTUP_REASON),
- SubscribeFlags::HAL_EVENT);
+ SubscribeFlags::EVENTS_FROM_CAR);
ASSERT_TRUE(clients.empty());
// Wrong flag
- clients = manager.getSubscribedClients(
- PROP1,
- SubscribeFlags::SET_CALL);
+ clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_ANDROID);
ASSERT_TRUE(clients.empty());
}
@@ -139,27 +132,22 @@
ASSERT_EQ(StatusCode::OK, manager.addOrUpdateSubscription(1, cb1, subscrToProp1,
&updatedOptions));
- auto clients = manager.getSubscribedClients(
- PROP1,
- SubscribeFlags::DEFAULT);
+ auto clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR);
ASSERT_EQ((size_t) 1, clients.size());
ASSERT_EQ(cb1, clients.front()->getCallback());
// Same property, but different zone, to make sure we didn't unsubscribe
// from previous zone.
- ASSERT_EQ(StatusCode::OK, manager.addOrUpdateSubscription(1, cb1, {
- SubscribeOptions {
- .propId = PROP1,
- .flags = SubscribeFlags::DEFAULT
- }
- }, &updatedOptions));
+ ASSERT_EQ(
+ StatusCode::OK,
+ manager.addOrUpdateSubscription(
+ 1, cb1, {SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR}},
+ &updatedOptions));
- clients = manager.getSubscribedClients(PROP1,
- SubscribeFlags::DEFAULT);
+ clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR);
ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients));
- clients = manager.getSubscribedClients(PROP1,
- SubscribeFlags::DEFAULT);
+ clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR);
ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients));
}
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
index 5b195db..f64eab5 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp
@@ -241,10 +241,7 @@
sp<MockedVehicleCallback> cb = new MockedVehicleCallback();
hidl_vec<SubscribeOptions> options = {
- SubscribeOptions {
- .propId = PROP,
- .flags = SubscribeFlags::DEFAULT
- },
+ SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR},
};
StatusCode res = manager->subscribe(cb, options);
@@ -259,11 +256,7 @@
sp<MockedVehicleCallback> cb = new MockedVehicleCallback();
hidl_vec<SubscribeOptions> options = {
- SubscribeOptions {
- .propId = PROP,
- .flags = SubscribeFlags::DEFAULT
- }
- };
+ SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR}};
StatusCode res = manager->subscribe(cb, options);
ASSERT_EQ(StatusCode::OK, res);
@@ -301,18 +294,14 @@
sp<MockedVehicleCallback> cb = new MockedVehicleCallback();
hidl_vec<SubscribeOptions> options = {
- SubscribeOptions {
- .propId = PROP,
- .flags = SubscribeFlags::HAL_EVENT
- },
+ SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR},
};
StatusCode res = manager->subscribe(cb, options);
// Unable to subscribe on Hal Events for write-only properties.
ASSERT_EQ(StatusCode::INVALID_ARG, res);
-
- options[0].flags = SubscribeFlags::SET_CALL;
+ options[0].flags = SubscribeFlags::EVENTS_FROM_ANDROID;
res = manager->subscribe(cb, options);
// OK to subscribe on SET method call for write-only properties.
@@ -396,8 +385,8 @@
const auto PROP = toInt(VehicleProperty::HVAC_FAN_SPEED);
const auto VAL1 = 1;
const auto VAL2 = 2;
- const auto AREA1 = toInt(VehicleAreaZone::ROW_1_LEFT);
- const auto AREA2 = toInt(VehicleAreaZone::ROW_1_RIGHT);
+ const auto AREA1 = toInt(VehicleAreaSeat::ROW_1_LEFT);
+ const auto AREA2 = toInt(VehicleAreaSeat::ROW_1_RIGHT);
{
auto expectedValue1 = hal->getValuePool()->obtainInt32(VAL1);
diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
index 3cabcf2..108e32f 100644
--- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
+++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h
@@ -40,64 +40,38 @@
.configString = "Some=config,options=if,you=have_any",
},
- {
- .prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
- .access = VehiclePropertyAccess::READ_WRITE,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_1_LEFT),
- .minInt32Value = 1,
- .maxInt32Value = 7},
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
- .minInt32Value = 1,
- .maxInt32Value = 5,
- }
- }
- },
+ {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs =
+ {VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT), .minInt32Value = 1, .maxInt32Value = 7},
+ VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT), .minInt32Value = 1, .maxInt32Value = 5,
+ }}},
// Write-only property
- {
- .prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE),
- .access = VehiclePropertyAccess::WRITE,
- .changeMode = VehiclePropertyChangeMode::ON_SET,
- .areaConfigs = {
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_1_LEFT),
- .minInt32Value = 64,
- .maxInt32Value = 80},
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
- .minInt32Value = 64,
- .maxInt32Value = 80,
- }
- }
- },
+ {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ .minInt32Value = 64,
+ .maxInt32Value = 80},
+ VehicleAreaConfig{
+ .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT),
+ .minInt32Value = 64,
+ .maxInt32Value = 80,
+ }}},
- {
- .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
- .access = VehiclePropertyAccess::READ,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {
- VehicleAreaConfig {
- .minFloatValue = 0,
- .maxFloatValue = 1.0
- }
- }
- },
+ {.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.minFloatValue = 0, .maxFloatValue = 1.0}}},
- {
- .prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
- .access = VehiclePropertyAccess::READ_WRITE,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {
- VehicleAreaConfig {
- .minInt32Value = 0,
- .maxInt32Value = 10
- }
- }
- },
+ {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS),
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 10}}},
{
.prop = toInt(VehicleProperty::MIRROR_FOLD),
@@ -107,12 +81,9 @@
},
// Complex data type.
- {
- .prop = kCustomComplexProperty,
- .access = VehiclePropertyAccess::READ_WRITE,
- .changeMode = VehiclePropertyChangeMode::ON_CHANGE
- }
-};
+ {.prop = kCustomComplexProperty,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE}};
constexpr auto kTimeout = std::chrono::milliseconds(500);
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index 93a903f..15ba494 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -17,28 +17,28 @@
package android.hardware.automotive.vehicle@2.0;
/**
- * Enumerates supported data types for VehicleProperty.
+ * Enumerates supported data type for VehicleProperty.
*
- * This is a bitwise flag that supposed to be used in VehicleProperty enum.
+ * Used to create property ID in VehicleProperty enum.
*/
enum VehiclePropertyType : int32_t {
- STRING = 0x00100000,
- BOOLEAN = 0x00200000,
- INT32 = 0x00400000,
- INT32_VEC = 0x00410000,
- INT64 = 0x00500000,
- INT64_VEC = 0x00510000,
- FLOAT = 0x00600000,
- FLOAT_VEC = 0x00610000,
- BYTES = 0x00700000,
+ STRING = 0x00100000,
+ BOOLEAN = 0x00200000,
+ INT32 = 0x00400000,
+ INT32_VEC = 0x00410000,
+ INT64 = 0x00500000,
+ INT64_VEC = 0x00510000,
+ FLOAT = 0x00600000,
+ FLOAT_VEC = 0x00610000,
+ BYTES = 0x00700000,
/**
* Any combination of scalar or vector types. The exact format must be
* provided in the description of the property.
*/
- MIXED = 0x00e00000,
+ MIXED = 0x00e00000,
- MASK = 0x00ff0000
+ MASK = 0x00ff0000
};
/**
@@ -50,51 +50,60 @@
* Other properties may not be associated with particular vehicle area,
* these kind of properties must have VehicleArea:GLOBAL flag.
*
- * This is a bitwise flag that supposed to be used in VehicleProperty enum.
+ * Used to create property ID in VehicleProperty enum.
*/
enum VehicleArea : int32_t {
- GLOBAL = 0x01000000,
- ZONE = 0x02000000,
- WINDOW = 0x03000000,
- MIRROR = 0x04000000,
- SEAT = 0x05000000,
- DOOR = 0x06000000,
+ GLOBAL = 0x01000000,
+ /** WINDOW maps to enum VehicleAreaWindow */
+ WINDOW = 0x03000000,
+ /** MIRROR maps to enum VehicleAreaMirror */
+ MIRROR = 0x04000000,
+ /** SEAT maps to enum VehicleAreaSeat */
+ SEAT = 0x05000000,
+ /** DOOR maps to enum VehicleAreaDoor */
+ DOOR = 0x06000000,
+ /** WHEEL maps to enum Wheel */
+ WHEEL = 0x07000000,
- MASK = 0x0f000000,
+ MASK = 0x0f000000,
};
/**
* Enumerates property groups.
*
- * This is a bitwise flag that supposed to be used in VehicleProperty enum.
+ * Used to create property ID in VehicleProperty enum.
*/
enum VehiclePropertyGroup : int32_t {
/**
- * Properties declared in AOSP must have this flag.
+ * Properties declared in AOSP must use this flag.
*/
- SYSTEM = 0x10000000,
+ SYSTEM = 0x10000000,
/**
- * Properties declared by vendors must have this flag.
+ * Properties declared by vendors must use this flag.
*/
- VENDOR = 0x20000000,
+ VENDOR = 0x20000000,
- MASK = 0xf0000000,
+ MASK = 0xf0000000,
};
/**
* Declares all vehicle properties. VehicleProperty has a bitwise structure.
* Each property must have:
- * - an unique id from range 0x0100 - 0xffff
- * - associated data type using VehiclePropertyType
- * - property group (VehiclePropertyGroup)
- * - vehicle area (VehicleArea)
+ * - a unique id from range 0x0100 - 0xffff
+ * - associated data type using VehiclePropertyType
+ * - property group (VehiclePropertyGroup)
+ * - vehicle area (VehicleArea)
*
* Vendors are allowed to extend this enum with their own properties. In this
* case they must use VehiclePropertyGroup:VENDOR flag when property is
* declared.
+ *
+ * When a property's status field is not set to AVAILABLE:
+ * - IVehicle#set may return StatusCode::NOT_AVAILABLE.
+ * - IVehicle#get is not guaranteed to work.
*/
-enum VehicleProperty: int32_t {
+enum VehicleProperty : int32_t {
/** Undefined property. */
INVALID = 0x00000000,
@@ -105,14 +114,14 @@
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
*/
- INFO_VIN= (
+ INFO_VIN = (
0x0100
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:STRING
| VehicleArea:GLOBAL),
/**
- * Maker name of vehicle
+ * Manufacturer of vehicle
*
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
@@ -162,11 +171,11 @@
| VehicleArea:GLOBAL),
/**
- * List of fuels the vehicle may use. Uses enum FuelType
+ * List of fuels the vehicle may use
*
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
- * @unit VehicleUnit:MILLILITERS
+ * @data_enum FuelType
*/
INFO_FUEL_TYPE = (
0x0105
@@ -189,9 +198,10 @@
| VehicleArea:GLOBAL),
/**
- * List of connectors this EV may use. Uses enum EvConnectorType
+ * List of connectors this EV may use
*
* @change_mode VehiclePropertyChangeMode:STATIC
+ * @data_enum EvConnectorType
* @access VehiclePropertyAccess:READ
*/
INFO_EV_CONNECTOR_TYPE = (
@@ -201,9 +211,49 @@
| VehicleArea:GLOBAL),
/**
+ * Fuel door location
+ *
+ * @change_mode VehiclePropertyChangeMode:STATIC
+ * @data_enum FuelDoorLocationType
+ * @access VehiclePropertyAccess:READ
+ */
+ INFO_FUEL_DOOR_LOCATION = (
+ 0x0108
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * EV port location
+ *
+ * @change_mode VehiclePropertyChangeMode:STATIC
+ * @access VehiclePropertyAccess:READ
+ * @data_enum PortLocationType
+ */
+ INFO_EV_PORT_LOCATION = (
+ 0x0109
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Driver's seat location
+ *
+ * @change_mode VehiclePropertyChangeMode:STATIC
+ * @data_enum VehicleAreaSeat
+ * @access VehiclePropertyAccess:READ
+ */
+ INFO_DRIVER_SEAT = (
+ 0x010A
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:SEAT),
+
+
+ /**
* Current odometer value of the vehicle
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE | VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:KILOMETER
*/
@@ -216,7 +266,7 @@
/**
* Speed of the vehicle
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:METER_PER_SEC
*/
@@ -227,22 +277,9 @@
| VehicleArea:GLOBAL),
/**
- * Engine on
- *
- * @change_mode VehiclePropertyChangeMode:STATIC
- * @access VehiclePropertyAccess:READ
- */
- ENGINE_ON = (
- 0x0300
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:BOOLEAN
- | VehicleArea:GLOBAL),
-
-
- /**
* Temperature of engine coolant
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:CELSIUS
*/
@@ -268,7 +305,7 @@
/**
* Temperature of engine oil
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:CELSIUS
*/
@@ -281,7 +318,7 @@
/**
* Engine rpm
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:RPM
*/
@@ -310,7 +347,7 @@
* int64Values[3] = rear right ticks
* int64Values[4] = rear left ticks
*
- * configArray is used to indicate the micrometers-per-wheel-tick value as well as
+ * configArray is used to indicate the micrometers-per-wheel-tick value and
* which wheels are supported. configArray is set as follows:
*
* configArray[0], bits [0:3] = supported wheels. Uses enum Wheel.
@@ -327,10 +364,10 @@
* @access VehiclePropertyAccess:READ
*/
WHEEL_TICK = (
- 0x0306
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:MIXED
- | VehicleArea:GLOBAL),
+ 0x0306
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT64_VEC
+ | VehicleArea:GLOBAL),
/**
@@ -338,7 +375,7 @@
*
* Value may not exceed INFO_FUEL_CAPACITY
*
- * @change_mode VehiclePropertyChangeMode:STATIC
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:MILLILITER
*/
@@ -351,8 +388,8 @@
/**
* Fuel door open
*
- * @change_mode VehiclePropertyChangeMode:STATIC
- * @access VehiclePropertyAccess:READ
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
*/
FUEL_DOOR_OPEN = (
0x0308
@@ -365,7 +402,7 @@
*
* Value may not exceed INFO_EV_BATTERY_CAPACITY
*
- * @change_mode VehiclePropertyChangeMode:STATIC
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:WH
*/
@@ -378,8 +415,8 @@
/**
* EV charge port open
*
- * @change_mode VehiclePropertyChangeMode:STATIC
- * @access VehiclePropertyAccess:READ
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
*/
EV_CHARGE_PORT_OPEN = (
0x030A
@@ -390,7 +427,7 @@
/**
* EV charge port connected
*
- * @change_mode VehiclePropertyChangeMode:STATIC
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
EV_CHARGE_PORT_CONNECTED = (
@@ -405,7 +442,7 @@
* Positive value indicates battery is being charged.
* Negative value indicates battery being discharged.
*
- * @change_mode VehiclePropertyChangeMode:STATIC
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:MW
*/
@@ -416,8 +453,42 @@
| VehicleArea:GLOBAL),
/**
+ * Range remaining
+ *
+ * Meters remaining of fuel and charge. Range remaining shall account for
+ * all energy sources in a vehicle. For example, a hybrid car's range will
+ * be the sum of the ranges based on fuel and battery.
+ *
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @unit VehicleUnit:METER
+ */
+ RANGE_REMAINING = (
+ 0x0308
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:FLOAT
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Tire pressure
+ *
+ * The min/max range is used to indicate the recommended tire pressure.
+ *
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
+ * @access VehiclePropertyAccess:READ
+ * @unit VehicleUnit:KILOPASCAL
+ */
+ TIRE_PRESSURE = (
+ 0x0309
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:WHEEL),
+
+ /**
* Currently selected gear
*
+ * This is the gear selected by the user.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
* @data_enum VehicleGear
@@ -469,6 +540,10 @@
/**
* Warning for fuel low level.
*
+ * This property corresponds to the low fuel warning on the dashboard.
+ * Once FUEL_LEVEL_LOW is set, it should not be cleared until more fuel is
+ * added to the vehicle.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
@@ -479,7 +554,9 @@
| VehicleArea:GLOBAL),
/**
- * Night mode or not.
+ * Night mode
+ *
+ * True indicates that night mode is currently enabled.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
@@ -493,8 +570,6 @@
/**
* State of the vehicles turn signals
*
- * Values from VehicleTurnSignal
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
* @data_enum VehicleTurnSignal
@@ -514,12 +589,16 @@
*/
IGNITION_STATE = (
0x0409
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
- | VehicleArea:GLOBAL),
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
/**
- * ABS is active. Set to true whenever ABS is activated. Reset to false when ABS is off.
+ * ABS is active
+ *
+ * Set to true when ABS is active. Reset to false when ABS is off. This
+ * property may be intermittently set (pulsing) based on the real-time
+ * state of the ABS system.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
@@ -531,7 +610,11 @@
| VehicleArea:GLOBAL),
/**
- * Traction Control is active.
+ * Traction Control is active
+ *
+ * Set to true when traction control (TC) is active. Reset to false when
+ * TC is off. This property may be intermittently set (pulsing) based on
+ * the real-time state of the TC system.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
@@ -545,10 +628,6 @@
/**
* Fan speed setting
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -556,15 +635,11 @@
0x0500
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* Fan direction setting
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
* @data_enum VehicleHvacFanDirection
@@ -573,15 +648,11 @@
0x0501
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* HVAC current temperature.
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -589,15 +660,11 @@
0x0502
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:FLOAT
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* HVAC, target temperature set.
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -605,14 +672,10 @@
0x0503
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:FLOAT
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
- * On/off defrost
- *
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * On/off defrost for designated window
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -624,28 +687,25 @@
| VehicleArea:WINDOW),
/**
- * On/off AC
- *
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * On/off AC for designated areaId
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
- * @config_flags Supported zones
+ * @config_flags Supported areaIds
*/
HVAC_AC_ON = (
0x0505
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* On/off max AC
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * When MAX AC is on, the ECU may adjust the vent position, fan speed,
+ * temperature, etc as necessary to cool the vehicle as quickly as possible.
+ * Any parameters modified as a side effect of turning on/off the MAX AC
+ * parameter shall generate onPropertyEvent() callbacks to the VHAL.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -654,14 +714,16 @@
0x0506
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* On/off max defrost
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * When MAX DEFROST is on, the ECU may adjust the vent position, fan speed,
+ * temperature, etc as necessary to defrost the windows as quickly as
+ * possible. Any parameters modified as a side effect of turning on/off
+ * the MAX DEFROST parameter shall generate onPropertyEvent() callbacks to
+ * the VHAL.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -670,14 +732,15 @@
0x0507
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
- * On/off re-circulation
+ * Recirculation on/off
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * Controls the supply of exterior air to the cabin. Recirc “on” means the
+ * majority of the airflow into the cabin is originating in the cabin.
+ * Recirc “off” means the majority of the airflow into the cabin is coming
+ * from outside the car.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -686,14 +749,25 @@
0x0508
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
- * On/off dual. This must be defined per each row.
+ * Enable temperature coupling between zones.
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * The areaId for this property must include the zones that are coupled
+ * together. Typically, the front two zones (ROW_1_LEFT and ROW_1_RIGHT)
+ * are coupled together when this property is enabled. Thus, the areaId
+ * shall be (ROW_1_LEFT | ROW_1_RIGHT). When the property is enabled, the
+ * ECU may synchronize the temperature for the affected zones. Any
+ * parameters modified as a side effect of turning on/off the DUAL_ON
+ * parameter shall generate onPropertyEvent() callbacks to the VHAL. In
+ * addition, if setting a temperature (i.e. driver's temp) changes another
+ * temperature (i.e. front passenger's temp), then the appropriate
+ * onPropertyEvent() callbacks must be generated. If a user changes a
+ * temperature that breaks the coupling (e.g. setting the passenger
+ * temperature independently) then the VHAL must send the appropriate
+ * onPropertyEvent() callbacks (i.e. HVAC_DUAL_ON = false,
+ * HVAC_TEMPERATURE_SET[zone] = xxx, etc).
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -702,15 +776,11 @@
0x0509
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* On/off automatic mode
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -718,7 +788,7 @@
0x050A
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* Seat temperature
@@ -731,10 +801,6 @@
* min/max range defines the allowable range and number of steps in each
* direction.
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -747,12 +813,9 @@
/**
* Side Mirror Heat
*
- * Increase values denote higher heating levels for side mirrors.
- * 0 indicates heating is turned off.
- *
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
+ * Increasing values denote higher heating levels for side mirrors.
+ * The Max value in the config data represents the highest heating level.
+ * The Min value in the config data MUST be zero and indicates no heating.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -764,51 +827,42 @@
| VehicleArea:MIRROR),
/**
- * Steering Wheel Temperature
+ * Steering Wheel Heating/Cooling
*
- * Sets the temperature for the steering wheel
+ * Sets the amount of heating/cooling for the steering wheel
+ * config data Min and Max MUST be set appropriately.
* Positive value indicates heating.
* Negative value indicates cooling.
* 0 indicates temperature control is off.
*
- * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not
- * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for
- * details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
- HVAC_STEERING_WHEEL_TEMP = (
+ HVAC_STEERING_WHEEL_HEAT = (
0x050D
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
| VehicleArea:GLOBAL),
/**
- * Temperature units
+ * Temperature units for display
*
* Indicates whether the temperature is in Celsius, Fahrenheit, or a
- * different unit from VehicleUnit enum.
- * This parameter affects all HVAC temperatures in the system.
- *
- * IVehicle#get is not guaranteed to work if HVAC unit is off. See
- * HVAC_POWER_ON property for details.
+ * different unit from VehicleUnit enum. This parameter MAY be used for
+ * displaying any HVAC temperature in the system.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ
+ * @access VehiclePropertyAccess:READ_WRITE
*/
- HVAC_TEMPERATURE_UNITS = (
+ HVAC_TEMPERATURE_DISPLAY_UNITS = (
0x050E
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
- | VehicleArea:ZONE),
+ | VehicleArea:GLOBAL),
/**
* Actual fan speed
*
- * IVehicle#get is not guaranteed to work if HVAC unit is off. See
- * HVAC_POWER_ON property for details.
- *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
@@ -816,37 +870,38 @@
0x050F
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
- * Represents power state for HVAC. Some HVAC properties must require
- * matching power to be turned on to get out of OFF state. For non-zoned
- * HVAC properties, VEHICLE_ALL_ZONE corresponds to global power state.
+ * Represents global power state for HVAC. Setting this property to false
+ * MAY mark some properties that control individual HVAC features/subsystems
+ * to UNAVAILABLE state. Setting this property to true MAY mark some
+ * properties that control individual HVAC features/subsystems to AVAILABLE
+ * state (unless any/all of them are UNAVAILABLE on their own individual
+ * merits). The list of properties affected by HVAC_POWER_ON must be set
+ * in the VehiclePropConfig.configArray.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
- * @config_string list of HVAC properties whose power is controlled by this
- * property. Format is hexa-decimal number (0x...) separated
- * by comma like "0x500,0x503". All zones defined in these
- * affected properties must be available in the property.
*/
HVAC_POWER_ON = (
0x0510
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
* Fan Positions Available
*
- * This is a bit mask of fan positions available for the zone. Each available fan direction is
- * denoted by a separate entry in the vector. A fan direction may have multiple bits from
- * vehicle_hvac_fan_direction set. For instance, a typical car may have the following setting:
- * - [0] = FAN_DIRECTION_FACE (0x1)
- * - [1] = FAN_DIRECTION_FLOOR (0x2)
- * - [2] = FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3)
- * - [3] = FAN_DIRECTION_DEFROST (0x4)
- * - [4] = FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6)
+ * This is a bit mask of fan positions available for the zone. Each
+ * available fan direction is denoted by a separate entry in the vector. A
+ * fan direction may have multiple bits from vehicle_hvac_fan_direction set.
+ * For instance, a typical car may have the following fan positions:
+ * - FAN_DIRECTION_FACE (0x1)
+ * - FAN_DIRECTION_FLOOR (0x2)
+ * - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3)
+ * - FAN_DIRECTION_DEFROST (0x4)
+ * - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6)
*
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
@@ -855,13 +910,14 @@
0x0511
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32_VEC
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
/**
- * Automatic re-circulation on/off
+ * Automatic recirculation on/off
*
- * IVehicle#set and IVehicle#get must return StatusCode::NOT_AVAILABLE when HVAC unit is off.
- * See HVAC_POWER_ON property for details.
+ * When automatic recirculation is ON, the HVAC system may automatically
+ * switch to recirculation mode if the vehicle detects poor incoming air
+ * quality.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
@@ -870,12 +926,32 @@
0x0512
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
- | VehicleArea:ZONE),
+ | VehicleArea:SEAT),
+
+ /**
+ * Seat ventilation
+ *
+ * 0 indicates off.
+ * Positive values indicates ventilation level.
+ *
+ * Used by HVAC apps and Assistant to enable, change, or read state of seat
+ * ventilation. This is different than seating cooling. It can be on at the
+ * same time as cooling, or not.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ HVAC_SEAT_VENTILATION = (
+ 0x0513
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:SEAT),
+
/**
* Outside temperature
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:CELSIUS
*/
@@ -888,7 +964,7 @@
/**
* Cabin temperature
*
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS
+ * @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
* @unit VehicleUnit:CELSIUS
*/
@@ -896,31 +972,7 @@
0x0704
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:FLOAT
- | VehicleArea:GLOBAL),
-
- /**
- * Radio presets stored on the Car radio module. The data type used is int32
- * array with the following fields:
- * <ul>
- * <li> int32Values[0]: Preset number </li>
- * <li> int32Values[1]: Band type (see #RADIO_BAND_FM in
- * system/core/include/system/radio.h).
- * <li> int32Values[2]: Channel number </li>
- * <li> int32Values[3]: Sub channel number </li>
- * </ul>
- *
- * NOTE: When getting a current preset config ONLY set preset number (i.e.
- * int32Values[0]). For setting a preset other fields are required.
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- * @config_flags Number of presets supported
- */
- RADIO_PRESET = (
- 0x0801
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32_VEC
- | VehicleArea:GLOBAL),
+ | VehicleArea:SEAT),
/**
* Property to control power state of application processor
@@ -931,40 +983,36 @@
* For configuration information, VehiclePropConfig.configFlags can
* have bit flag combining values in VehicleApPowerStateConfigFlag.
*
- * Value format for IVehicle#get / IVehicle#subscribe:
- * int32Values[0] : vehicle_ap_power_state_type
+ * int32Values[0] : VehicleApPowerStateReq enum value
* int32Values[1] : additional parameter relevant for each state,
* 0 if not used.
- * Value format for IVehicle#set:
- * int32Values[0] : vehicle_ap_power_state_set_type
- * int32Values[1] : additional parameter relevant for each request. should be 0 if not used.
*
- * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE
- * @access VEHICLE_PROP_ACCESS_READ_WRITE
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VEHICLE_PROP_ACCESS_READ
*/
- AP_POWER_STATE = (
+ AP_POWER_STATE_REQ = (
0x0A00
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
/**
- * Property to represent brightness of the display. Some cars have single
- * control for the brightness of all displays and this property is to share
- * change in that control.
+ * Property to report power state of application processor
*
- * If this is writable, android side can set this value when user changes
- * display brightness from Settings. If this is read only, user may still
- * change display brightness from Settings, but that will not be reflected
- * to other displays.
+ * It is assumed that AP's power state is controller by separate power
+ * controller.
+ *
+ * int32Values[0] : VehicleApPowerStateReport enum value
+ * int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0.
+
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
+ * @access VEHICLE_PROP_ACCESS_WRITE
*/
- DISPLAY_BRIGHTNESS = (
+ AP_POWER_STATE_REPORT = (
0x0A01
| VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
+ | VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
/**
@@ -986,6 +1034,25 @@
| VehicleArea:GLOBAL),
/**
+ * Property to represent brightness of the display. Some cars have single
+ * control for the brightness of all displays and this property is to share
+ * change in that control.
+ *
+ * If this is writable, android side can set this value when user changes
+ * display brightness from Settings. If this is read only, user may still
+ * change display brightness from Settings, but that must not be reflected
+ * to other displays.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ */
+ DISPLAY_BRIGHTNESS = (
+ 0x0A03
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
* Property to feed H/W input events to android
*
* int32Values[0] : action defined by VehicleHwKeyInputAction
@@ -993,6 +1060,7 @@
* int32Values[2] : target display defined in VehicleDisplay. Events not
* tied to specific display must be sent to
* VehicleDisplay#MAIN.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
* @config_flags
@@ -1003,36 +1071,23 @@
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
- /**
- * Current date and time, encoded as Unix time.
- * This value denotes the number of seconds that have elapsed since
- * 1/1/1970.
+ /***************************************************************************
+ * Most Car Cabin properties have both a POSition and MOVE parameter. These
+ * are used to control the various movements for seats, doors, and windows
+ * in a vehicle.
*
- * @change_mode VehiclePropertyChangeMode:ON_SET
- * @access VehiclePropertyAccess:READ_WRITE
- * @unit VehicleUnit:SECS
- */
- UNIX_TIME = (
- 0x0A30
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT64
- | VehicleArea:GLOBAL),
-
- /**
- * Current time only.
- * Some vehicles may not keep track of date. This property only affects
- * the current time, in seconds during the day. Thus, the max value for
- * this parameter is 86,400 (24 * 60 * 60)
+ * A POS parameter allows the user to set the absolution position. For
+ * instance, for a door, 0 indicates fully closed and max value indicates
+ * fully open. Thus, a value halfway between min and max must indicate
+ * the door is halfway open.
*
- * @change_mode VehiclePropertyChangeMode:ON_SET
- * @access VehiclePropertyAccess:READ_WRITE
- * @unit VehicleUnit:SECS
- */
- CURRENT_TIME_IN_SECONDS = (
- 0x0A31
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
- | VehicleArea:GLOBAL),
+ * A MOVE parameter moves the device in a particular direction. The sign
+ * indicates direction, and the magnitude indicates speed (if multiple
+ * speeds are available). For a door, a move of -1 will close the door, and
+ * a move of +1 will open it. Once a door reaches the limit of open/close,
+ * the door should automatically stop moving. The user must NOT need to
+ * send a MOVE(0) command to stop the door at the end of its range.
+ **************************************************************************/
/**
* Door position
@@ -1187,7 +1242,7 @@
*
* This setting allows the user to save the current seat position settings
* into the selected preset slot. The maxValue for each seat position
- * shall match the maxValue for SEAT_MEMORY_SELECT.
+ * must match the maxValue for SEAT_MEMORY_SELECT.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:WRITE
@@ -1577,6 +1632,14 @@
* Max = window up / closed
* Min = window down / open
*
+ * For a window that may open out of plane (i.e. vent mode of sunroof) this
+ * parameter will work with negative values as follows:
+ * Max = sunroof completely open
+ * 0 = sunroof closed.
+ * Min = sunroof vent completely open
+ *
+ * Note that in this mode, 0 indicates the window is closed.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -1594,6 +1657,21 @@
* Magnitude denotes relative speed. I.e. +2 is faster than +1 in raising
* the window.
*
+ * For a window that may open out of plane (i.e. vent mode of sunroof) this
+ * parameter will work as follows:
+ *
+ * If sunroof is open:
+ * Max = open the sunroof further, automatically stop when fully open.
+ * Min = close the sunroof, automatically stop when sunroof is closed.
+ *
+ * If vent is open:
+ * Max = close the vent, automatically stop when vent is closed.
+ * Min = open the vent further, automatically stop when vent is fully open.
+ *
+ * If window is in the closed position:
+ * Max = open the sunroof, automatically stop when sunroof is fully open.
+ * Min = open the vent, automatically stop when vent is fully open.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -1604,40 +1682,6 @@
| VehicleArea:WINDOW),
/**
- * Window Vent Position
- *
- * This feature is used to control the vent feature on a sunroof.
- *
- * Max = vent open
- * Min = vent closed
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- WINDOW_VENT_POS = (
- 0x0BC2
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
- | VehicleArea:WINDOW),
-
- /**
- * Window Vent Move
- *
- * This feature is used to control the vent feature on a sunroof.
- *
- * Max = vent open
- * Min = vent closed
- *
- * @change_mode VehiclePropertyChangeMode:ON_CHANGE
- * @access VehiclePropertyAccess:READ_WRITE
- */
- WINDOW_VENT_MOVE = (
- 0x0BC3
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:INT32
- | VehicleArea:WINDOW),
-
- /**
* Window Lock
*
* True indicates windows are locked and can't be moved.
@@ -1716,10 +1760,10 @@
* @access VehiclePropertyAccess:READ
*/
OBD2_LIVE_FRAME = (
- 0x0D00
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:MIXED
- | VehicleArea:GLOBAL),
+ 0x0D00
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Sensor Data
@@ -1746,10 +1790,10 @@
* @access VehiclePropertyAccess:READ
*/
OBD2_FREEZE_FRAME = (
- 0x0D01
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:MIXED
- | VehicleArea:GLOBAL),
+ 0x0D01
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Information
@@ -1767,10 +1811,10 @@
* @access VehiclePropertyAccess:READ
*/
OBD2_FREEZE_FRAME_INFO = (
- 0x0D02
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:MIXED
- | VehicleArea:GLOBAL),
+ 0x0D02
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Clear
@@ -1793,10 +1837,164 @@
* @access VehiclePropertyAccess:WRITE
*/
OBD2_FREEZE_FRAME_CLEAR = (
- 0x0D03
- | VehiclePropertyGroup:SYSTEM
- | VehiclePropertyType:MIXED
- | VehicleArea:GLOBAL),
+ 0x0D03
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Headlights State
+ *
+ * Return the current state of headlights.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum VehicleLightState
+ */
+ HEADLIGHTS_STATE = (
+ 0x0E00
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * High beam lights state
+ *
+ * Return the current state of high beam lights.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum VehicleLightState
+ */
+ HIGH_BEAM_LIGHTS_STATE = (
+ 0x0E01
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Fog light state
+ *
+ * Return the current state of fog lights.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum VehicleLightState
+ */
+ FOG_LIGHTS_STATE = (
+ 0x0E02
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Hazard light status
+ *
+ * Return the current status of hazard lights.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ * @data_enum VehicleLightState
+ */
+ HAZARD_LIGHTS_STATE = (
+ 0x0E03
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Headlight switch
+ *
+ * The setting that the user wants.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @data_enum VehicleLightSwitch
+ */
+ HEADLIGHTS_SWITCH = (
+ 0x0E10
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * High beam light switch
+ *
+ * The setting that the user wants.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @data_enum VehicleLightSwitch
+ */
+ HIGH_BEAM_LIGHTS_SWITCH = (
+ 0x0E11
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Fog light switch
+ *
+ * The setting that the user wants.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @data_enum VehicleLightSwitch
+ */
+ FOG_LIGHTS_SWITCH = (
+ 0x0E12
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Hazard light switch
+ *
+ * The setting that the user wants.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ_WRITE
+ * @data_enum VehicleLightSwitch
+ */
+ HAZARD_LIGHTS_SWITCH = (
+ 0x0E13
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT32
+ | VehicleArea:GLOBAL),
+};
+
+/**
+ * Used by lights state properties to enumerate the current state of the lights.
+ *
+ * Most XXX_LIGHTS_STATE properties will only report ON and OFF states. Only
+ * the HEADLIGHTS_STATE property will report DAYTIME_RUNNING.
+ */
+enum VehicleLightState : int32_t {
+
+ OFF = 0,
+ ON = 1,
+ DAYTIME_RUNNING = 2
+};
+
+/**
+ * Used by lights switch properties to enumerate user selected switch setting.
+ *
+ * XXX_LIGHTS_SWITCH properties report the switch settings that the user
+ * selects. The switch setting may be decoupled from the state reported if the
+ * user selects AUTOMATIC.
+ */
+enum VehicleLightSwitch : int32_t {
+ OFF = 0,
+ ON = 1,
+ /**
+ * Daytime running lights mode. Most cars automatically use DRL but some
+ * cars allow the user to activate them manually.
+ */
+ DAYTIME_RUNNING = 2,
+ /**
+ * Allows the vehicle ECU to set the lights automatically
+ */
+ AUTOMATIC = 0x100,
};
/**
@@ -1828,6 +2026,24 @@
};
/**
+ * Used by INFO_FUEL_DOOR_LOCATION/INFO_CHARGE_PORT_LOCATION to enumerate fuel door or
+ * ev port location.
+ */
+enum PortLocationType : int32_t {
+ /**
+ * Default type if the vehicle does not know or report the Fuel door
+ * and ev port location.
+ */
+ UNKNOWN = 0,
+ FRONT_LEFT = 1,
+ FRONT_RIGHT = 2,
+ REAR_RIGHT = 3,
+ REAR_LEFT = 4,
+ FRONT = 5,
+ REAR = 6,
+};
+
+/**
* Used by INFO_FUEL_TYPE to enumerate the type of fuels this vehicle uses.
* Consistent with projection protocol.
*/
@@ -1886,14 +2102,6 @@
ERROR = 4,
};
-/**
- * Constants relevant to radio.
- */
-enum VehicleRadioConstants : int32_t {
- /** Minimum value for the radio preset */
- VEHICLE_RADIO_PRESET_MIN_VALUE = 1,
-};
-
enum VehicleApPowerStateConfigFlag : int32_t /* NOTE: type is guessed */ {
/**
* AP can enter deep sleep state. If not set, AP will always shutdown from
@@ -1908,7 +2116,7 @@
CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2,
};
-enum VehicleApPowerState : int32_t /* NOTE: type is guessed */ {
+enum VehicleApPowerStateReq : int32_t {
/** vehicle HAL will never publish this state to AP */
OFF = 0,
@@ -1933,6 +2141,16 @@
SHUTDOWN_PREPARE = 4,
};
+/**
+ * Index in int32Values for VehicleProperty#AP_POWER_STATE_REQ property.
+ */
+enum VehicleApPowerStateReqIndex : int32_t {
+ STATE = 0,
+ ADDITIONAL = 1,
+};
+
+
+
enum VehicleApPowerStateShutdownParam : int32_t {
/** AP must shutdown immediately. Postponing is not allowed. */
SHUTDOWN_IMMEDIATELY = 1,
@@ -1944,7 +2162,7 @@
SHUTDOWN_ONLY = 3,
};
-enum VehicleApPowerSetState : int32_t /* NOTE: type is guessed */ {
+enum VehicleApPowerStateReport : int32_t {
/**
* AP has finished boot up, and can start shutdown if requested by power
* controller.
@@ -2009,14 +2227,6 @@
};
/**
- * Index in int32Values for VehicleProperty#AP_POWER_STATE property.
- */
-enum VehicleApPowerStateIndex : int32_t {
- STATE = 0,
- ADDITIONAL = 1,
-};
-
-/**
* Enum to represent bootup reason.
*/
enum VehicleApPowerBootupReason : int32_t {
@@ -2050,7 +2260,7 @@
};
enum VehicleDisplay : int32_t {
- /** center console */
+ /** The primary Android display (for example, center console) */
MAIN = 0,
INSTRUMENT_CLUSTER = 1,
@@ -2076,6 +2286,7 @@
NANO_SECS = 0x50,
SECS = 0x53,
YEAR = 0x59,
+ KILOPASCAL = 0x70,
// Electrical Units
WATT_HOUR = 0x60,
@@ -2084,46 +2295,33 @@
MILLIWATTS = 0x63,
};
- /**
- * This describes how value of property can change.
- */
+/**
+ * This describes how value of property can change.
+ */
enum VehiclePropertyChangeMode : int32_t {
- /**
- * Property of this type must never be changed. Subscription is not supported
- * for these properties.
- */
- STATIC = 0x00,
+ /**
+ * Property of this type must never be changed. Subscription is not supported
+ * for these properties.
+ */
+ STATIC = 0x00,
- /**
- * Property of this type must be reported when there is a change.
- * IVehicle#get call must return the current value.
- * Set operation for this property is assumed to be asynchronous. When the
- * property is read (using IVehicle#get) after IVehicle#set, it may still
- * return old value until underlying H/W backing this property has actually
- * changed the state. Once state is changed, the property must dispatch
- * changed value as event.
- */
- ON_CHANGE = 0x01,
+ /**
+ * Properties of this type must report when there is a change.
+ * IVehicle#get call must return the current value.
+ * Set operation for this property is assumed to be asynchronous. When the
+ * property is read (using IVehicle#get) after IVehicle#set, it may still
+ * return old value until underlying H/W backing this property has actually
+ * changed the state. Once state is changed, the property must dispatch
+ * changed value as event.
+ */
+ ON_CHANGE = 0x01,
- /**
- * Property of this type change continuously and requires fixed rate of
- * sampling to retrieve the data.
- */
- CONTINUOUS = 0x02,
-
- /**
- * Property of this type may be polled to get the current value.
- */
- POLL = 0x03,
-
- /**
- * This is for property where change event must be sent only when the
- * value is set from external component. Normal value change must not trigger
- * event. For example, clock property can send change event only when it is
- * set, outside android, for case like user setting time or time getting
- * update. There is no need to send it per every value change.
- */
- ON_SET = 0x04,
+ /**
+ * Properties of this type change continuously and require a fixed rate of
+ * sampling to retrieve the data. Implementers may choose to send extra
+ * notifications on significant value changes.
+ */
+ CONTINUOUS = 0x02,
};
/**
@@ -2147,8 +2345,15 @@
/** Property is available and behaving normally */
AVAILABLE = 0x00,
/**
- * Property is not available, for read and/or write. This is a transient state, as the
- * property is expected to be available at a later time.
+ * A property in this state is not available for reading and writing. This
+ * is a transient state that depends on the availability of the underlying
+ * implementation (e.g. hardware or driver). It MUST NOT be used to
+ * represent features that this vehicle is always incapable of. A get() of
+ * a property in this state MAY return an undefined value, but MUST
+ * correctly describe its status as UNAVAILABLE A set() of a property in
+ * this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore
+ * the value of the status field when writing a property value coming from
+ * Android.
*/
UNAVAILABLE = 0x01,
/** There is an error with this property. */
@@ -2158,12 +2363,11 @@
/**
* Various gears which can be selected by user and chosen in system.
*/
-enum VehicleGear: int32_t {
+enum VehicleGear : int32_t {
GEAR_NEUTRAL = 0x0001,
GEAR_REVERSE = 0x0002,
GEAR_PARK = 0x0004,
GEAR_DRIVE = 0x0008,
- GEAR_LOW = 0x0010,
GEAR_1 = 0x0010,
GEAR_2 = 0x0020,
GEAR_3 = 0x0040,
@@ -2176,27 +2380,6 @@
};
/**
- * Various zones in the car.
- *
- * Zones are used for Air Conditioning purposes and divide the car into physical
- * area zones.
- */
-enum VehicleAreaZone : int32_t {
- ROW_1_LEFT = 0x00000001,
- ROW_1_CENTER = 0x00000002,
- ROW_1_RIGHT = 0x00000004,
- ROW_2_LEFT = 0x00000010,
- ROW_2_CENTER = 0x00000020,
- ROW_2_RIGHT = 0x00000040,
- ROW_3_LEFT = 0x00000100,
- ROW_3_CENTER = 0x00000200,
- ROW_3_RIGHT = 0x00000400,
- ROW_4_LEFT = 0x00001000,
- ROW_4_CENTER = 0x00002000,
- ROW_4_RIGHT = 0x00004000,
-};
-
-/**
* Various Seats in the car.
*/
enum VehicleAreaSeat : int32_t {
@@ -2215,15 +2398,18 @@
* Various windshields/windows in the car.
*/
enum VehicleAreaWindow : int32_t {
- FRONT_WINDSHIELD = 0x0001,
- REAR_WINDSHIELD = 0x0002,
- ROOF_TOP = 0x0004,
- ROW_1_LEFT = 0x0010,
- ROW_1_RIGHT = 0x0020,
- ROW_2_LEFT = 0x0100,
- ROW_2_RIGHT = 0x0200,
- ROW_3_LEFT = 0x1000,
- ROW_3_RIGHT = 0x2000,
+ FRONT_WINDSHIELD = 0x00000001,
+ REAR_WINDSHIELD = 0x00000002,
+ ROW_1_LEFT = 0x00000010,
+ ROW_1_RIGHT = 0x00000040,
+ ROW_2_LEFT = 0x00000100,
+ ROW_2_RIGHT = 0x00000400,
+ ROW_3_LEFT = 0x00001000,
+ ROW_3_RIGHT = 0x00004000,
+
+ ROOF_TOP_1 = 0x00010000,
+ ROOF_TOP_2 = 0x00020000,
+
};
enum VehicleAreaDoor : int32_t {
@@ -2247,7 +2433,6 @@
NONE = 0x00,
RIGHT = 0x01,
LEFT = 0x02,
- EMERGENCY = 0x04,
};
struct VehicleAreaConfig {
@@ -2321,9 +2506,6 @@
* events.
*/
struct VehiclePropValue {
- /** Property identifier */
- int32_t prop;
-
/** Time is elapsed nanoseconds since boot */
int64_t timestamp;
@@ -2333,6 +2515,9 @@
*/
int32_t areaId;
+ /** Property identifier */
+ int32_t prop;
+
/** Status of the property */
VehiclePropertyStatus status;
@@ -2372,11 +2557,11 @@
/** Steering wheel is locked */
LOCK = 1,
- /**
- * Steering wheel is not locked, engine and all accessories are OFF. If
- * car can be in LOCK and OFF state at the same time than HAL must report
- * LOCK state.
- */
+ /**
+ * Steering wheel is not locked, engine and all accessories are OFF. If
+ * car can be in LOCK and OFF state at the same time than HAL must report
+ * LOCK state.
+ */
OFF,
/**
@@ -2395,33 +2580,6 @@
START
};
-
-/**
- * Represent the operation where the current error has happened.
- */
-enum VehiclePropertyOperation : int32_t {
- /**
- * Generic error to this property which is not tied to any operation.
- */
- GENERIC = 0,
-
- /**
- * Error happened while handling property set.
- */
- SET = 1,
-
- /**
- * Error happened while handling property get.
- */
- GET = 2,
-
- /**
- * Error happened while handling property subscription.
- */
- SUBSCRIBE = 3,
-};
-
-
enum SubscribeFlags : int32_t {
UNDEFINED = 0x0,
@@ -2429,15 +2587,13 @@
* Subscribe to event that was originated in vehicle HAL
* (most likely this event came from the vehicle itself).
*/
- HAL_EVENT = 0x1,
+ EVENTS_FROM_CAR = 0x1,
/**
* Use this flag to subscribe on events when IVehicle#set(...) was called by
* vehicle HAL's client (e.g. Car Service).
*/
- SET_CALL = 0x2,
-
- DEFAULT = HAL_EVENT,
+ EVENTS_FROM_ANDROID = 0x2,
};
/**
@@ -2458,7 +2614,7 @@
*/
float sampleRate;
- /** Flags that indicate what kind of events listen to. */
+ /** Flags that indicate to which event sources to listen. */
SubscribeFlags flags;
};
@@ -2748,11 +2904,11 @@
ACCELERATOR_PEDAL_POSITION_E = 54, /* PID 0x4A */
ACCELERATOR_PEDAL_POSITION_F = 55, /* PID 0x4B */
COMMANDED_THROTTLE_ACTUATOR = 56, /* PID 0x4C */
- ETHANOL_FUEL_PERCENTAGE = 57,/* PID 0x52 */
+ ETHANOL_FUEL_PERCENTAGE = 57, /* PID 0x52 */
ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, /* PID 0x53 */
SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, /* PID 0x55 */
SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, /* PID 0x57 */
- SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,/* PID 0x55 */
+ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, /* PID 0x55 */
SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, /* PID 0x57 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, /* PID 0x56 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, /* PID 0x58 */
@@ -2978,7 +3134,7 @@
* - Layer version
* - Number of publisher IDs (N)
* - N x publisher ID
-*/
+ */
enum VmsAvailabilityStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
SEQUENCE_NUMBER = 1,
NUMBER_OF_ASSOCIATED_LAYERS = 2,
diff --git a/camera/device/3.4/default/CameraDeviceSession.cpp b/camera/device/3.4/default/CameraDeviceSession.cpp
index ad7f6f5..550d65a 100644
--- a/camera/device/3.4/default/CameraDeviceSession.cpp
+++ b/camera/device/3.4/default/CameraDeviceSession.cpp
@@ -51,6 +51,32 @@
}
}
}
+
+ camera_metadata_entry_t capabilities =
+ mDeviceInfo.find(ANDROID_REQUEST_AVAILABLE_CAPABILITIES);
+ bool isLogicalMultiCamera = false;
+ for (size_t i = 0; i < capabilities.count; i++) {
+ if (capabilities.data.u8[i] ==
+ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA) {
+ isLogicalMultiCamera = true;
+ break;
+ }
+ }
+ if (isLogicalMultiCamera) {
+ camera_metadata_entry entry =
+ mDeviceInfo.find(ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS);
+ const uint8_t* ids = entry.data.u8;
+ size_t start = 0;
+ for (size_t i = 0; i < entry.count; ++i) {
+ if (ids[i] == '\0') {
+ if (start != i) {
+ const char* physicalId = reinterpret_cast<const char*>(ids+start);
+ mPhysicalCameraIds.emplace(physicalId);
+ }
+ start = i + 1;
+ }
+ }
+ }
}
CameraDeviceSession::~CameraDeviceSession() {
@@ -456,9 +482,19 @@
return;
}
+ if (hal_result->num_physcam_metadata > d->mPhysicalCameraIds.size()) {
+ ALOGE("%s: Fatal: Invalid num_physcam_metadata %u", __FUNCTION__,
+ hal_result->num_physcam_metadata);
+ return;
+ }
result.physicalCameraMetadata.resize(hal_result->num_physcam_metadata);
for (uint32_t i = 0; i < hal_result->num_physcam_metadata; i++) {
std::string physicalId = hal_result->physcam_ids[i];
+ if (d->mPhysicalCameraIds.find(physicalId) == d->mPhysicalCameraIds.end()) {
+ ALOGE("%s: Fatal: Invalid physcam_ids[%u]: %s", __FUNCTION__,
+ i, hal_result->physcam_ids[i]);
+ return;
+ }
V3_2::CameraMetadata physicalMetadata;
V3_2::implementation::convertToHidl(hal_result->physcam_metadata[i], &physicalMetadata);
PhysicalCameraMetadata physicalCameraMetadata = {
diff --git a/camera/device/3.4/default/include/device_v3_4_impl/CameraDeviceSession.h b/camera/device/3.4/default/include/device_v3_4_impl/CameraDeviceSession.h
index 6e90ed4..5d6a112 100644
--- a/camera/device/3.4/default/include/device_v3_4_impl/CameraDeviceSession.h
+++ b/camera/device/3.4/default/include/device_v3_4_impl/CameraDeviceSession.h
@@ -27,6 +27,7 @@
#include <hidl/Status.h>
#include <deque>
#include <map>
+#include <unordered_set>
#include <unordered_map>
#include "CameraMetadata.h"
#include "HandleImporter.h"
@@ -110,6 +111,10 @@
// Whether this camera device session is created with version 3.4 callback.
bool mHasCallback_3_4;
+
+ // Physical camera ids for the logical multi-camera. Empty if this
+ // is not a logical multi-camera.
+ std::unordered_set<std::string> mPhysicalCameraIds;
private:
struct TrampolineSessionInterface_3_4 : public ICameraDeviceSession {
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index 23be7de..948b4fe 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -54,8 +54,8 @@
# TODO(b/72409164): STOPSHIP: update kernel version requirements
include $(CLEAR_VARS)
-LOCAL_MODULE := framework_compatibility_matrix.current.xml
-LOCAL_MODULE_STEM := compatibility_matrix.current.xml
+LOCAL_MODULE := framework_compatibility_matrix.3.xml
+LOCAL_MODULE_STEM := compatibility_matrix.3.xml
LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
LOCAL_KERNEL_VERSIONS := 4.4.0 4.9.0
include $(BUILD_FRAMEWORK_COMPATIBILITY_MATRIX)
@@ -116,7 +116,7 @@
framework_compatibility_matrix.legacy.xml \
framework_compatibility_matrix.1.xml \
framework_compatibility_matrix.2.xml \
- framework_compatibility_matrix.current.xml \
+ framework_compatibility_matrix.3.xml \
framework_compatibility_matrix.device.xml
LOCAL_GENERATED_SOURCES := $(call module-installed-files,$(LOCAL_REQUIRED_MODULES))
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.3.xml
similarity index 94%
rename from compatibility_matrices/compatibility_matrix.current.xml
rename to compatibility_matrices/compatibility_matrix.3.xml
index 467e11e..6aa5fc5 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.3.xml
@@ -24,6 +24,14 @@
</interface>
</hal>
<hal format="hidl" optional="true">
+ <name>android.hardware.automotive.audiocontrol</name>
+ <version>1.0</version>
+ <interface>
+ <name>IAudioControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
<name>android.hardware.automotive.evs</name>
<version>1.0</version>
<interface>
@@ -104,6 +112,14 @@
</interface>
</hal>
<hal format="hidl" optional="true">
+ <name>android.hardware.confirmationui</name>
+ <version>1.0</version>
+ <interface>
+ <name>IConfirmationUI</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
<name>android.hardware.contexthub</name>
<version>1.0</version>
<interface>
@@ -287,6 +303,14 @@
</interface>
</hal>
<hal format="hidl" optional="true">
+ <name>android.hardware.radio.config</name>
+ <version>1.0</version>
+ <interface>
+ <name>IRadioConfig</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
<name>android.hardware.renderscript</name>
<version>1.0</version>
<interface>
diff --git a/current.txt b/current.txt
index 8d1d6e6..5aa6259 100644
--- a/current.txt
+++ b/current.txt
@@ -296,8 +296,8 @@
14ef8e993a4a7c899b19bb5e39b5b0cafd28312ea2b127e35b3be8f08e23fe8e android.hardware.automotive.evs@1.0::IEvsEnumerator
3b17c1fdfc389e0abe626c37054954b07201127d890c2bc05d47613ec1f4de4f android.hardware.automotive.evs@1.0::types
b3caf524c46a47d67e6453a34419e1881942d059e146cda740502670e9a752c3 android.hardware.automotive.vehicle@2.0::IVehicle
-80fb4156fa91ce86e49bd2cabe215078f6b69591d416a09e914532eae6712052 android.hardware.automotive.vehicle@2.0::IVehicleCallback
-a7ac51f419107020b9544efb25e030485e5dc4914c5138c2b8d83a1f52a76825 android.hardware.automotive.vehicle@2.0::types
+7ce8728b27600e840cacf0a832f6942819fe535f9d3797ae052d5eef5065921c android.hardware.automotive.vehicle@2.0::IVehicleCallback
+848fb32d5ca79dd527d966e67c0af5874b6d7b361246b491e315cf7dea7888ab android.hardware.automotive.vehicle@2.0::types
32cc50cc2a7658ec613c0c2dd2accbf6a05113b749852879e818b8b7b438db19 android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioHost
ff4be64d7992f8bec97dff37f35450e79b3430c61f85f54322ce45bef229dc3b android.hardware.bluetooth.a2dp@1.0::IBluetoothAudioOffload
27f22d2e873e6201f9620cf4d8e2facb25bd0dd30a2b911e441b4600d560fa62 android.hardware.bluetooth.a2dp@1.0::types
@@ -318,14 +318,14 @@
7877ff8e4c1e48b825e6e5e66d050288e5656ed535c61cc7830a92ed4a9e1990 android.hardware.drm@1.1::IDrmFactory
fef2f0ebde7704548fb203df46673ceb342272fc4fa9d0af25a980d2584a36e7 android.hardware.drm@1.1::IDrmPlugin
5047a346ecce239404b9020959f60dd467318e9c17b290a6386bc3894df62c3c android.hardware.drm@1.1::types
-be794f5df97f134d6dcabb866b250d1305100e7ae07fb253b7841df890b931bb android.hardware.gnss@1.1::IGnss
+a830336ac8627d6432cfafb1b884343ad9f885dee0a5323e380e6d3c519156b8 android.hardware.gnss@1.1::IGnss
8ad55bc35bb3a83e65c018bdfde7ae5ebc749ff2bf6b79412ded0bc6c89b97d8 android.hardware.gnss@1.1::IGnssCallback
3c5183d7506010be57e0f748e3640fc2ded1ba955784b6256ba427f4c399591c android.hardware.gnss@1.1::IGnssConfiguration
-b054af24fbb70d54cde1fb5cba126809e7c4e863e8f9115dc492321dfbcbc993 android.hardware.gnss@1.1::IGnssMeasurement
+1a07d1383e847c3deb696ec7a2c9e33b9683772945660448a010b18063da67a4 android.hardware.gnss@1.1::IGnssMeasurement
83e7a10ff3702147bd7ffa04567b20d407a3b16bbb7705644af44d919afe9103 android.hardware.gnss@1.1::IGnssMeasurementCallback
-82da7e7624f72ff1927f48738913e20bee3a513adfe5dc7c4f888176e20376e6 android.hardware.graphics.common@1.1::types
+0b96e0254e2168cfecb30c1ed5fb42681652cc00faa68c6e07568fafe64d1d50 android.hardware.graphics.common@1.1::types
d9b40a5b09962a5a0780b10fe33a4e607e69e2e088fc83de88a584115b7cb1c0 android.hardware.graphics.composer@2.2::IComposer
-d6ce042995239712bc1d0970fa9d512c15c0b1ac9bcb048bd8b69f617b45c25e android.hardware.graphics.composer@2.2::IComposerClient
+c3cd2a3e245ffefae859c9a3d31382a9421be95cfa6bc1231571eb3533049b54 android.hardware.graphics.composer@2.2::IComposerClient
dd83be076b6b3f10ed62ab34d8c8b95f2415961fb785200eb842e7bfb2b0ee92 android.hardware.graphics.mapper@2.1::IMapper
675682dd3007805c985eaaec91612abc88f4c25b3431fb84070b7584a1a741fb android.hardware.health@2.0::IHealth
434c4c32c00b0e54bb05e40c79503208b40f786a318029a2a4f66e34f10f2a76 android.hardware.health@2.0::IHealthInfoCallback
diff --git a/gnss/1.1/IGnss.hal b/gnss/1.1/IGnss.hal
index 096f251..672f742 100644
--- a/gnss/1.1/IGnss.hal
+++ b/gnss/1.1/IGnss.hal
@@ -46,15 +46,17 @@
* @param minIntervalMs Represents the time between fixes in milliseconds.
* @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
* @param preferredTimeMs Represents the requested time to first fix in milliseconds.
- * @param lowPowerMode When true, HAL must make strong tradeoffs to substantially restrict power
- * use. Specifically, in the case of a several second long minIntervalMs, the GNSS chipset
- * must not, on average, run power hungry operations like RF and signal searches for more
- * than one second per interval, and must make exactly one call to gnssSvStatusCb(), and
- * either zero or one call to GnssLocationCb() at each interval. When false, HAL must
- * operate in the nominal mode (similar to V1.0 where this flag wasn't present) and is
- * expected to make power and performance tradoffs such as duty-cycling when signal
- * conditions are good and more active searches to reacquire GNSS signals when no signals
- * are present.
+ * @param lowPowerMode When true, and IGnss.hal is the only client to the GNSS hardware, the
+ * GNSS hardware must make strong tradeoffs to substantially restrict power use.
+ * Specifically, in the case of a several second long minIntervalMs, the GNSS hardware must
+ * not, on average, run power hungry operations like RF and signal searches for more than
+ * one second per interval, and must make exactly one call to gnssSvStatusCb(), and either
+ * zero or one call to GnssLocationCb() at each interval. When false, HAL must operate in
+ * the nominal mode (similar to V1.0 where this flag wasn't present) and is expected to make
+ * power and performance tradoffs such as duty-cycling when signal conditions are good and
+ * more active searches to reacquire GNSS signals when no signals are present.
+ * When there are additional clients using the GNSS hardware other than IGnss.hal, the GNSS
+ * hardware may operate in a higher power mode, on behalf of those clients.
*
* @return success Returns true if successful.
*/
diff --git a/gnss/1.1/IGnssMeasurement.hal b/gnss/1.1/IGnssMeasurement.hal
index cd83ae3..6ed8e53 100644
--- a/gnss/1.1/IGnssMeasurement.hal
+++ b/gnss/1.1/IGnssMeasurement.hal
@@ -33,10 +33,11 @@
* @param callback Handle to GnssMeasurement callback interface.
* @param enableFullTracking If true, GNSS chipset must switch off duty cycling. In such mode
* no clock discontinuities are expected and, when supported, carrier phase should be
- * continuous in good signal conditions. All constellations and frequency bands that the
- * chipset supports must be reported in this mode. The GNSS chipset is allowed to consume
- * more power in this mode. If false, API must behave as in HAL V1_0, optimizing power via
- * duty cycling, constellations and frequency limits, etc.
+ * continuous in good signal conditions. All non-blacklisted, healthy constellations,
+ * satellites and frequency bands that the chipset supports must be reported in this mode.
+ * The GNSS chipset is allowed to consume more power in this mode. If false, API must behave
+ * as in HAL V1_0, optimizing power via duty cycling, constellations and frequency limits,
+ * etc.
*
* @return initRet Returns SUCCESS if successful. Returns ERROR_ALREADY_INIT if a callback has
* already been registered without a corresponding call to 'close'. Returns ERROR_GENERIC
diff --git a/graphics/common/1.1/Android.bp b/graphics/common/1.1/Android.bp
index c319d80..8bc68f5 100644
--- a/graphics/common/1.1/Android.bp
+++ b/graphics/common/1.1/Android.bp
@@ -15,8 +15,10 @@
],
types: [
"BufferUsage",
+ "ColorMode",
"Dataspace",
"PixelFormat",
+ "RenderIntent",
],
gen_java: true,
gen_java_constants: true,
diff --git a/graphics/common/1.1/types.hal b/graphics/common/1.1/types.hal
index b917d5e..5dca482 100644
--- a/graphics/common/1.1/types.hal
+++ b/graphics/common/1.1/types.hal
@@ -16,9 +16,10 @@
package android.hardware.graphics.common@1.1;
-import @1.0::PixelFormat;
import @1.0::BufferUsage;
+import @1.0::ColorMode;
import @1.0::Dataspace;
+import @1.0::PixelFormat;
/**
* Pixel formats for graphics buffers.
@@ -129,15 +130,165 @@
@export(name="android_dataspace_v1_1_t", value_prefix="HAL_DATASPACE_",
export_parent="false")
enum Dataspace : @1.0::Dataspace {
+ /*
+ * @1.0::Dataspace defines six legacy dataspaces
+ *
+ * SRGB_LINEAR = 0x200, // deprecated, use V0_SRGB_LINEAR
+ * SRGB = 0x201, // deprecated, use V0_SRGB
+ * JFIF = 0x101, // deprecated, use V0_JFIF
+ * BT601_625 = 0x102, // deprecated, use V0_BT601_625
+ * BT601_525 = 0x103, // deprecated, use V0_BT601_525
+ * BT709 = 0x104, // deprecated, use V0_BT709
+ *
+ * The difference between the legacy dataspaces and their modern
+ * counterparts is that, with legacy dataspaces, the pixel values may have
+ * been desaturated by the content creator in an unspecified way.
+ *
+ * When colorimetric mapping is required, the legacy dataspaces must be
+ * treated as their modern counterparts (e.g., SRGB must be treated as
+ * V0_SRGB) and no re-saturation is allowed. When non-colorimetric mapping
+ * is allowed, the pixel values can be interpreted freely by
+ * implementations for the purpose of re-saturation, and the re-saturated
+ * pixel values are in the respective modern dataspaces.
+ *
+ * This is also true when UNKNOWN is treated as a legacy dataspace.
+ */
+
/**
* ITU-R Recommendation 2020 (BT.2020)
*
* Ultra High-definition television
*
- * Use limited range, SMPTE 2084 (PQ) transfer and BT2020 standard
- * limited range is the preferred / normative definition for BT.2020
+ * Use limited range, BT.709 transfer and BT2020 standard
*/
BT2020_ITU = STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_LIMITED,
+ /**
+ * ITU-R Recommendation 2100 (BT.2100)
+ *
+ * High dynamic range television
+ *
+ * Use limited/full range, PQ/HLG transfer, and BT2020 standard
+ * limited range is the preferred / normative definition for BT.2100
+ */
BT2020_ITU_PQ = STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_LIMITED,
+ BT2020_ITU_HLG = STANDARD_BT2020 | TRANSFER_HLG | RANGE_LIMITED,
+ BT2020_HLG = STANDARD_BT2020 | TRANSFER_HLG | RANGE_FULL,
+};
+
+@export(name="android_color_mode_v1_1_t", value_prefix="HAL_COLOR_MODE_",
+ export_parent="false")
+enum ColorMode : @1.0::ColorMode {
+ /**
+ * BT2020 corresponds with display settings that implement the ITU-R
+ * Recommendation BT.2020 / Rec. 2020 for UHDTV.
+ *
+ * Primaries:
+ * x y
+ * green 0.170 0.797
+ * blue 0.131 0.046
+ * red 0.708 0.292
+ * white (D65) 0.3127 0.3290
+ *
+ * Inverse Gamma Correction (IGC): V represents normalized (with [0 to 1]
+ * range) value of R, G, or B.
+ *
+ * if Vnonlinear < b * 4.5
+ * Vlinear = Vnonlinear / 4.5
+ * else
+ * Vlinear = ((Vnonlinear + (a - 1)) / a) ^ (1/0.45)
+ *
+ * Gamma Correction (GC):
+ *
+ * if Vlinear < b
+ * Vnonlinear = 4.5 * Vlinear
+ * else
+ * Vnonlinear = a * Vlinear ^ 0.45 - (a - 1)
+ *
+ * where
+ *
+ * a = 1.09929682680944, b = 0.018053968510807
+ *
+ * For practical purposes, these a/b values can be used instead
+ *
+ * a = 1.099, b = 0.018 for 10-bit display systems
+ * a = 1.0993, b = 0.0181 for 12-bit display systems
+ */
+ BT2020 = 10,
+
+ /**
+ * BT2100_PQ and BT2100_HLG correspond with display settings that
+ * implement the ITU-R Recommendation BT.2100 / Rec. 2100 for HDR TV.
+ *
+ * Primaries:
+ * x y
+ * green 0.170 0.797
+ * blue 0.131 0.046
+ * red 0.708 0.292
+ * white (D65) 0.3127 0.3290
+ *
+ * For BT2100_PQ, the transfer function is Perceptual Quantizer (PQ). For
+ * BT2100_HLG, the transfer function is Hybrid Log-Gamma (HLG).
+ */
+ BT2100_PQ = 11,
+ BT2100_HLG = 12,
+};
+
+/**
+ * RenderIntent defines the mapping from color mode colors to display colors.
+ *
+ * A render intent must not change how it maps colors when the color mode
+ * changes. That is to say that when a render intent maps color C to color C',
+ * the fact that color C can have different pixel values in different color
+ * modes should not affect the mapping.
+ *
+ * RenderIntent overrides the render intents defined for individual color
+ * modes. It is ignored when the color mode is ColorMode::NATIVE, because
+ * ColorMode::NATIVE colors are already display colors.
+ */
+@export(name="android_render_intent_v1_1_t", value_prefix="HAL_RENDER_INTENT_",
+ export_parent="false")
+enum RenderIntent : int32_t {
+ /**
+ * Colors in the display gamut are unchanged. Colors out of the display
+ * gamut are hard-clipped.
+ *
+ * This implies that the display must have been calibrated unless
+ * ColorMode::NATIVE is the only supported color mode.
+ */
+ COLORIMETRIC = 0,
+
+ /**
+ * Enhance colors that are in the display gamut. Colors out of the display
+ * gamut are hard-clipped.
+ *
+ * The enhancement typically picks the biggest standard color space (e.g.
+ * DCI-P3) that is narrower than the display gamut and stretches it to the
+ * display gamut. The stretching is recommended to preserve skin tones.
+ */
+ ENHANCE = 1,
+
+ /**
+ * Tone map high-dynamic-range colors to the display's dynamic range. The
+ * dynamic range of the colors are communicated separately. After tone
+ * mapping, the mapping to the display gamut is as defined in
+ * COLORIMETRIC.
+ */
+ TONE_MAP_COLORIMETRIC = 2,
+
+ /**
+ * Tone map high-dynamic-range colors to the display's dynamic range. The
+ * dynamic range of the colors are communicated separately. After tone
+ * mapping, the mapping to the display gamut is as defined in ENHANCE.
+ *
+ * The tone mapping step and the enhancing step must match
+ * TONE_MAP_COLORIMETRIC and ENHANCE respectively when they are also
+ * supported.
+ */
+ TONE_MAP_ENHANCE = 3,
+
+ /*
+ * Vendors are recommended to use 0x100 - 0x1FF for their own values, and
+ * that must be done with subtypes defined by vendor extensions.
+ */
};
diff --git a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
index df529ec..2742207 100644
--- a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
+++ b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
@@ -247,21 +247,8 @@
void setClientTarget(uint32_t slot, const native_handle_t* target, int acquireFence,
Dataspace dataspace, const std::vector<IComposerClient::Rect>& damage) {
- bool doWrite = (damage.size() <= (kMaxLength - 4) / 4);
- size_t length = 4 + ((doWrite) ? damage.size() * 4 : 0);
-
- beginCommand(IComposerClient::Command::SET_CLIENT_TARGET, length);
- write(slot);
- writeHandle(target, true);
- writeFence(acquireFence);
- writeSigned(static_cast<int32_t>(dataspace));
- // When there are too many rectangles in the damage region and doWrite
- // is false, we write no rectangle at all which means the entire
- // client target is damaged.
- if (doWrite) {
- writeRegion(damage);
- }
- endCommand();
+ setClientTargetInternal(slot, target, acquireFence, static_cast<int32_t>(dataspace),
+ damage);
}
static constexpr uint16_t kSetOutputBufferLength = 3;
@@ -354,9 +341,7 @@
static constexpr uint16_t kSetLayerDataspaceLength = 1;
void setLayerDataspace(Dataspace dataspace) {
- beginCommand(IComposerClient::Command::SET_LAYER_DATASPACE, kSetLayerDataspaceLength);
- writeSigned(static_cast<int32_t>(dataspace));
- endCommand();
+ setLayerDataspaceInternal(static_cast<int32_t>(dataspace));
}
static constexpr uint16_t kSetLayerDisplayFrameLength = 4;
@@ -418,6 +403,32 @@
}
protected:
+ void setClientTargetInternal(uint32_t slot, const native_handle_t* target, int acquireFence,
+ int32_t dataspace,
+ const std::vector<IComposerClient::Rect>& damage) {
+ bool doWrite = (damage.size() <= (kMaxLength - 4) / 4);
+ size_t length = 4 + ((doWrite) ? damage.size() * 4 : 0);
+
+ beginCommand(IComposerClient::Command::SET_CLIENT_TARGET, length);
+ write(slot);
+ writeHandle(target, true);
+ writeFence(acquireFence);
+ writeSigned(dataspace);
+ // When there are too many rectangles in the damage region and doWrite
+ // is false, we write no rectangle at all which means the entire
+ // client target is damaged.
+ if (doWrite) {
+ writeRegion(damage);
+ }
+ endCommand();
+ }
+
+ void setLayerDataspaceInternal(int32_t dataspace) {
+ beginCommand(IComposerClient::Command::SET_LAYER_DATASPACE, kSetLayerDataspaceLength);
+ writeSigned(dataspace);
+ endCommand();
+ }
+
void beginCommand(IComposerClient::Command command, uint16_t length) {
if (mCommandEnd) {
LOG_FATAL("endCommand was not called before command 0x%x", command);
diff --git a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
index 0d883e4..8d5493e 100644
--- a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
+++ b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
@@ -104,9 +104,7 @@
void execute(TestCommandReader* reader, CommandWriterBase* writer);
- private:
- sp<IComposerClient> mClient;
-
+ protected:
// Keep track of all virtual displays and layers. When a test fails with
// ASSERT_*, the destructor will clean up the resources for the test.
struct DisplayResource {
@@ -116,6 +114,9 @@
std::unordered_set<Layer> layers;
};
std::unordered_map<Display, DisplayResource> mDisplayResources;
+
+ private:
+ sp<IComposerClient> mClient;
};
} // namespace vts
diff --git a/graphics/composer/2.2/Android.bp b/graphics/composer/2.2/Android.bp
index 633a208..fe71e9e 100644
--- a/graphics/composer/2.2/Android.bp
+++ b/graphics/composer/2.2/Android.bp
@@ -12,6 +12,7 @@
],
interfaces: [
"android.hardware.graphics.common@1.0",
+ "android.hardware.graphics.common@1.1",
"android.hardware.graphics.composer@2.1",
"android.hidl.base@1.0",
],
diff --git a/graphics/composer/2.2/IComposerClient.hal b/graphics/composer/2.2/IComposerClient.hal
index dcd9c8d..b7ba6a6 100644
--- a/graphics/composer/2.2/IComposerClient.hal
+++ b/graphics/composer/2.2/IComposerClient.hal
@@ -16,11 +16,14 @@
package android.hardware.graphics.composer@2.2;
-import android.hardware.graphics.common@1.0::PixelFormat;
-import android.hardware.graphics.common@1.0::Dataspace;
+import android.hardware.graphics.common@1.1::ColorMode;
+import android.hardware.graphics.common@1.1::Dataspace;
+import android.hardware.graphics.common@1.1::PixelFormat;
+import android.hardware.graphics.common@1.1::RenderIntent;
import @2.1::IComposerClient;
import @2.1::Display;
import @2.1::Error;
+import @2.1::IComposerClient;
interface IComposerClient extends @2.1::IComposerClient {
@@ -90,16 +93,20 @@
enum Command : @2.1::IComposerClient.Command {
/**
- * setPerFrameMetadata(Display display, vec<PerFrameMetadata> data)
+ * SET_LAYER_PER_FRAME_METADATA has this pseudo prototype
+ *
+ * setLayerPerFrameMetadata(Display display, Layer layer,
+ * vec<PerFrameMetadata> data);
+ *
* Sets the PerFrameMetadata for the display. This metadata must be used
* by the implementation to better tone map content to that display.
*
* This is a method that may be called every frame. Thus it's
* implemented using buffered transport.
- * SET_PER_FRAME_METADATA is the command used by the buffered transport
+ * SET_LAYER_PER_FRAME_METADATA is the command used by the buffered transport
* mechanism.
*/
- SET_PER_FRAME_METADATA = 0x207 << @2.1::IComposerClient.Command:OPCODE_SHIFT,
+ SET_LAYER_PER_FRAME_METADATA = 0x303 << @2.1::IComposerClient.Command:OPCODE_SHIFT,
/**
* SET_LAYER_COLOR has this pseudo prototype
@@ -242,6 +249,65 @@
setReadbackBuffer(Display display, handle buffer, handle releaseFence) generates (Error error);
/**
+ * createVirtualDisplay_2_2
+ * Creates a new virtual display with the given width and height. The
+ * format passed into this function is the default format requested by the
+ * consumer of the virtual display output buffers.
+ *
+ * The display must be assumed to be on from the time the first frame is
+ * presented until the display is destroyed.
+ *
+ * @param width is the width in pixels.
+ * @param height is the height in pixels.
+ * @param formatHint is the default output buffer format selected by
+ * the consumer.
+ * @param outputBufferSlotCount is the number of output buffer slots to be
+ * reserved.
+ * @return error is NONE upon success. Otherwise,
+ * UNSUPPORTED when the width or height is too large for the
+ * device to be able to create a virtual display.
+ * NO_RESOURCES when the device is unable to create a new virtual
+ * display at this time.
+ * @return display is the newly-created virtual display.
+ * @return format is the format of the buffer the device will produce.
+ */
+ @callflow(next="*")
+ createVirtualDisplay_2_2(uint32_t width,
+ uint32_t height,
+ PixelFormat formatHint,
+ uint32_t outputBufferSlotCount)
+ generates (Error error,
+ Display display,
+ PixelFormat format);
+
+ /**
+ * getClientTargetSupport_2_2
+ * Returns whether a client target with the given properties can be
+ * handled by the device.
+ *
+ * This function must return true for a client target with width and
+ * height equal to the active display configuration dimensions,
+ * PixelFormat::RGBA_8888, and Dataspace::UNKNOWN. It is not required to
+ * return true for any other configuration.
+ *
+ * @param display is the display to query.
+ * @param width is the client target width in pixels.
+ * @param height is the client target height in pixels.
+ * @param format is the client target format.
+ * @param dataspace is the client target dataspace, as described in
+ * setLayerDataspace.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_DISPLAY when an invalid display handle was passed in.
+ * UNSUPPORTED when the given configuration is not supported.
+ */
+ @callflow(next="*")
+ getClientTargetSupport_2_2(Display display,
+ uint32_t width,
+ uint32_t height,
+ PixelFormat format,
+ Dataspace dataspace)
+ generates (Error error);
+ /**
* setPowerMode_2_2
* Sets the power mode of the given display. The transition must be
* complete when this function returns. It is valid to call this function
@@ -260,4 +326,118 @@
*/
setPowerMode_2_2(Display display, PowerMode mode) generates (Error error);
+ /**
+ * Returns the color modes supported on this display.
+ *
+ * All devices must support at least ColorMode::NATIVE.
+ *
+ * @param display is the display to query.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_DISPLAY when an invalid display handle was passed in.
+ * @return modes is an array of color modes.
+ */
+ getColorModes_2_2(Display display)
+ generates (Error error,
+ vec<ColorMode> modes);
+
+ /**
+ * Returns the render intents supported by the specified display and color
+ * mode.
+ *
+ * RenderIntent::COLORIMETRIC is always supported.
+ *
+ * @param display is the display to query.
+ * @param mode is the color mode to query.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_DISPLAY when an invalid display handle was passed in.
+ * BAD_PARAMETER when an invalid color mode was passed in.
+ * @return intents is an array of render intents.
+ */
+ getRenderIntents(Display display, ColorMode mode)
+ generates (Error error,
+ vec<RenderIntent> intents);
+
+ /**
+ * Sets the color mode and render intent of the given display.
+ *
+ * The color mode and render intent change must take effect on next
+ * presentDisplay.
+ *
+ * All devices must support at least ColorMode::NATIVE and
+ * RenderIntent::COLORIMETRIC, and displays are assumed to be in this mode
+ * upon hotplug.
+ *
+ * @param display is the display to which the color mode is set.
+ * @param mode is the color mode to set to.
+ * @param intent is the render intent to set to.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_DISPLAY when an invalid display handle was passed in.
+ * BAD_PARAMETER when mode or intent is invalid
+ * UNSUPPORTED when mode or intent is not supported on this
+ * display.
+ */
+ setColorMode_2_2(Display display, ColorMode mode, RenderIntent intent)
+ generates (Error error);
+
+ /*
+ * By default, layer dataspaces are mapped to the current color mode
+ * colorimetrically with a few exceptions.
+ *
+ * When the layer dataspace is a legacy sRGB dataspace
+ * (Dataspace::SRGB_LINEAR, Dataspace::SRGB, or Dataspace::UNKNOWN when
+ * treated as such) and the display render intent is
+ * RenderIntent::ENHANCE, the pixel values can go through an
+ * implementation-defined saturation transform before being mapped to the
+ * current color mode colorimetrically.
+ *
+ * Colors that are out of the gamut of the current color mode are
+ * hard-clipped.
+ */
+
+ /**
+ * Returns the saturation matrix of the specified legacy dataspace.
+ *
+ * The saturation matrix can be used to approximate the legacy dataspace
+ * saturation transform. It is to be applied on linear pixel values like
+ * this:
+ *
+ * (in GLSL)
+ * linearSrgb = clamp(saturationMatrix * linearSrgb, 0.0, 1.0);
+ *
+ * @param dataspace must be Dataspace::SRGB_LINEAR.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_PARAMETER when an invalid dataspace was passed in.
+ * @return matrix is the 4x4 column-major matrix used to approximate the
+ * legacy dataspace saturation operation. The last row must be
+ * [0.0, 0.0, 0.0, 1.0].
+ */
+ getDataspaceSaturationMatrix(Dataspace dataspace)
+ generates (Error error,
+ float[4][4] matrix);
+
+ /**
+ * Executes commands from the input command message queue. Return values
+ * generated by the input commands are written to the output command
+ * message queue in the form of value commands.
+ *
+ * @param inLength is the length of input commands.
+ * @param inHandles is an array of handles referenced by the input
+ * commands.
+ * @return error is NONE upon success. Otherwise,
+ * BAD_PARAMETER when inLength is not equal to the length of
+ * commands in the input command message queue.
+ * NO_RESOURCES when the output command message queue was not
+ * properly drained.
+ * @param outQueueChanged indicates whether the output command message
+ * queue has changed.
+ * @param outLength is the length of output commands.
+ * @param outHandles is an array of handles referenced by the output
+ * commands.
+ */
+ executeCommands_2_2(uint32_t inLength,
+ vec<handle> inHandles)
+ generates (Error error,
+ bool outQueueChanged,
+ uint32_t outLength,
+ vec<handle> outHandles);
};
diff --git a/graphics/composer/2.2/default/Android.bp b/graphics/composer/2.2/default/Android.bp
deleted file mode 100644
index 906479e..0000000
--- a/graphics/composer/2.2/default/Android.bp
+++ /dev/null
@@ -1,31 +0,0 @@
-cc_binary {
- name: "android.hardware.graphics.composer@2.2-service",
- defaults: ["hidl_defaults"],
- vendor: true,
- relative_install_path: "hw",
- srcs: ["service.cpp"],
- init_rc: ["android.hardware.graphics.composer@2.2-service.rc"],
- header_libs: [
- "android.hardware.graphics.composer@2.2-passthrough",
- ],
- shared_libs: [
- "android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.composer@2.2",
- "android.hardware.graphics.mapper@2.0",
- "libbase",
- "libbinder",
- "libcutils",
- "libfmq",
- "libhardware",
- "libhidlbase",
- "libhidltransport",
- "libhwc2on1adapter",
- "libhwc2onfbadapter",
- "liblog",
- "libsync",
- "libutils",
- ],
- cflags: [
- "-DLOG_TAG=\"ComposerHal\""
- ],
-}
diff --git a/graphics/composer/2.2/default/Android.mk b/graphics/composer/2.2/default/Android.mk
new file mode 100644
index 0000000..2f80f0c
--- /dev/null
+++ b/graphics/composer/2.2/default/Android.mk
@@ -0,0 +1,32 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.graphics.composer@2.2-service
+LOCAL_VENDOR_MODULE := true
+LOCAL_MODULE_RELATIVE_PATH := hw
+LOCAL_CFLAGS := -Wall -Werror -DLOG_TAG=\"ComposerHal\"
+LOCAL_SRC_FILES := service.cpp
+LOCAL_INIT_RC := android.hardware.graphics.composer@2.2-service.rc
+LOCAL_HEADER_LIBRARIES := android.hardware.graphics.composer@2.2-passthrough
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.graphics.composer@2.1 \
+ android.hardware.graphics.composer@2.2 \
+ android.hardware.graphics.mapper@2.0 \
+ libbase \
+ libbinder \
+ libcutils \
+ libfmq \
+ libhardware \
+ libhidlbase \
+ libhidltransport \
+ libhwc2on1adapter \
+ libhwc2onfbadapter \
+ liblog \
+ libsync \
+ libutils
+
+ifdef TARGET_USES_DISPLAY_RENDER_INTENTS
+LOCAL_CFLAGS += -DUSES_DISPLAY_RENDER_INTENTS
+endif
+
+include $(BUILD_EXECUTABLE)
diff --git a/graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h b/graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h
index c803d3c..138d700 100644
--- a/graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h
+++ b/graphics/composer/2.2/utils/command-buffer/include/composer-command-buffer/2.2/ComposerCommandBuffer.h
@@ -47,8 +47,8 @@
using android::hardware::MessageQueue;
using android::hardware::graphics::common::V1_0::ColorTransform;
-using android::hardware::graphics::common::V1_0::Dataspace;
using android::hardware::graphics::common::V1_0::Transform;
+using android::hardware::graphics::common::V1_1::Dataspace;
using android::hardware::graphics::composer::V2_1::Config;
using android::hardware::graphics::composer::V2_1::Display;
using android::hardware::graphics::composer::V2_1::Error;
@@ -64,6 +64,16 @@
public:
CommandWriterBase(uint32_t initialMaxSize) : V2_1::CommandWriterBase(initialMaxSize) {}
+ void setClientTarget(uint32_t slot, const native_handle_t* target, int acquireFence,
+ Dataspace dataspace, const std::vector<IComposerClient::Rect>& damage) {
+ setClientTargetInternal(slot, target, acquireFence, static_cast<int32_t>(dataspace),
+ damage);
+ }
+
+ void setLayerDataspace(Dataspace dataspace) {
+ setLayerDataspaceInternal(static_cast<int32_t>(dataspace));
+ }
+
static constexpr uint16_t kSetLayerFloatColorLength = 4;
void setLayerFloatColor(IComposerClient::FloatColor color) {
beginCommand_2_2(IComposerClient::Command::SET_LAYER_FLOAT_COLOR,
@@ -72,8 +82,9 @@
endCommand();
}
- void setPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) {
- beginCommand_2_2(IComposerClient::Command::SET_PER_FRAME_METADATA, metadataVec.size() * 2);
+ void setLayerPerFrameMetadata(const hidl_vec<IComposerClient::PerFrameMetadata>& metadataVec) {
+ beginCommand_2_2(IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA,
+ metadataVec.size() * 2);
for (const auto& metadata : metadataVec) {
writeSigned(static_cast<int32_t>(metadata.key));
writeFloat(metadata.value);
diff --git a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerClient.h b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerClient.h
index d550f83..a6871fb 100644
--- a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerClient.h
+++ b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerClient.h
@@ -99,10 +99,87 @@
return mHal->setReadbackBuffer(display, readbackBuffer, std::move(fenceFd));
}
+ Return<void> createVirtualDisplay_2_2(
+ uint32_t width, uint32_t height, PixelFormat formatHint, uint32_t outputBufferSlotCount,
+ IComposerClient::createVirtualDisplay_2_2_cb hidl_cb) override {
+ Display display = 0;
+ Error err = mHal->createVirtualDisplay_2_2(width, height, &formatHint, &display);
+ if (err == Error::NONE) {
+ mResources->addVirtualDisplay(display, outputBufferSlotCount);
+ }
+
+ hidl_cb(err, display, formatHint);
+ return Void();
+ }
+
+ Return<Error> getClientTargetSupport_2_2(Display display, uint32_t width, uint32_t height,
+ PixelFormat format, Dataspace dataspace) override {
+ Error err = mHal->getClientTargetSupport_2_2(display, width, height, format, dataspace);
+ return err;
+ }
+
Return<Error> setPowerMode_2_2(Display display, IComposerClient::PowerMode mode) override {
return mHal->setPowerMode_2_2(display, mode);
}
+ Return<void> getColorModes_2_2(Display display,
+ IComposerClient::getColorModes_2_2_cb hidl_cb) override {
+ hidl_vec<ColorMode> modes;
+ Error err = mHal->getColorModes_2_2(display, &modes);
+ hidl_cb(err, modes);
+ return Void();
+ }
+
+ Return<void> getRenderIntents(Display display, ColorMode mode,
+ IComposerClient::getRenderIntents_cb hidl_cb) override {
+#ifdef USES_DISPLAY_RENDER_INTENTS
+ std::vector<RenderIntent> intents;
+ Error err = mHal->getRenderIntents(display, mode, &intents);
+ hidl_cb(err, intents);
+#else
+ (void)display;
+ (void)mode;
+ hidl_cb(Error::NONE, hidl_vec<RenderIntent>({RenderIntent::COLORIMETRIC}));
+#endif
+ return Void();
+ }
+
+ Return<Error> setColorMode_2_2(Display display, ColorMode mode, RenderIntent intent) override {
+#ifndef USES_DISPLAY_RENDER_INTENTS
+ if (intent != RenderIntent::COLORIMETRIC) {
+ return Error::BAD_PARAMETER;
+ }
+#endif
+ return mHal->setColorMode_2_2(display, mode, intent);
+ }
+
+ Return<void> getDataspaceSaturationMatrix(
+ Dataspace dataspace, IComposerClient::getDataspaceSaturationMatrix_cb hidl_cb) override {
+ if (dataspace != Dataspace::SRGB_LINEAR) {
+ hidl_cb(Error::BAD_PARAMETER, std::array<float, 16>{0.0f}.data());
+ return Void();
+ }
+
+ hidl_cb(Error::NONE, mHal->getDataspaceSaturationMatrix(dataspace).data());
+ return Void();
+ }
+
+ Return<void> executeCommands_2_2(uint32_t inLength, const hidl_vec<hidl_handle>& inHandles,
+ IComposerClient::executeCommands_2_2_cb hidl_cb) override {
+ std::lock_guard<std::mutex> lock(mCommandEngineMutex);
+ bool outChanged = false;
+ uint32_t outLength = 0;
+ hidl_vec<hidl_handle> outHandles;
+ Error error =
+ mCommandEngine->execute(inLength, inHandles, &outChanged, &outLength, &outHandles);
+
+ hidl_cb(error, outChanged, outLength, outHandles);
+
+ mCommandEngine->reset();
+
+ return Void();
+ }
+
protected:
std::unique_ptr<V2_1::hal::ComposerResources> createResources() override {
return ComposerResources::create();
@@ -146,6 +223,8 @@
private:
using BaseType2_1 = V2_1::hal::detail::ComposerClientImpl<Interface, Hal>;
+ using BaseType2_1::mCommandEngine;
+ using BaseType2_1::mCommandEngineMutex;
using BaseType2_1::mHal;
using BaseType2_1::mResources;
};
diff --git a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
index adcac46..97e3a9e 100644
--- a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
+++ b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerCommandEngine.h
@@ -40,8 +40,8 @@
protected:
bool executeCommand(V2_1::IComposerClient::Command command, uint16_t length) override {
switch (static_cast<IComposerClient::Command>(command)) {
- case IComposerClient::Command::SET_PER_FRAME_METADATA:
- return executeSetPerFrameMetadata(length);
+ case IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA:
+ return executeSetLayerPerFrameMetadata(length);
case IComposerClient::Command::SET_LAYER_FLOAT_COLOR:
return executeSetLayerFloatColor(length);
default:
@@ -49,7 +49,7 @@
}
}
- bool executeSetPerFrameMetadata(uint16_t length) {
+ bool executeSetLayerPerFrameMetadata(uint16_t length) {
// (key, value) pairs
if (length % 2 != 0) {
return false;
@@ -63,7 +63,7 @@
length -= 2;
}
- auto err = mHal->setPerFrameMetadata(mCurrentDisplay, metadata);
+ auto err = mHal->setLayerPerFrameMetadata(mCurrentDisplay, mCurrentLayer, metadata);
if (err != Error::NONE) {
mWriter.setError(getCommandLoc(), err);
}
diff --git a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerHal.h b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerHal.h
index 30b3643..335dc24 100644
--- a/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerHal.h
+++ b/graphics/composer/2.2/utils/hal/include/composer-hal/2.2/ComposerHal.h
@@ -28,34 +28,68 @@
namespace V2_2 {
namespace hal {
-using common::V1_0::Dataspace;
-using common::V1_0::PixelFormat;
+using common::V1_1::ColorMode;
+using common::V1_1::Dataspace;
+using common::V1_1::PixelFormat;
+using common::V1_1::RenderIntent;
using V2_1::Display;
using V2_1::Error;
using V2_1::Layer;
class ComposerHal : public V2_1::hal::ComposerHal {
public:
+ Error createVirtualDisplay(uint32_t width, uint32_t height, common::V1_0::PixelFormat* format,
+ Display* outDisplay) override {
+ return createVirtualDisplay_2_2(width, height, reinterpret_cast<PixelFormat*>(format),
+ outDisplay);
+ }
+ Error getClientTargetSupport(Display display, uint32_t width, uint32_t height,
+ common::V1_0::PixelFormat format,
+ common::V1_0::Dataspace dataspace) override {
+ return getClientTargetSupport_2_2(display, width, height, static_cast<PixelFormat>(format),
+ static_cast<Dataspace>(dataspace));
+ }
// superceded by setPowerMode_2_2
Error setPowerMode(Display display, V2_1::IComposerClient::PowerMode mode) override {
return setPowerMode_2_2(display, static_cast<IComposerClient::PowerMode>(mode));
}
+ // superceded by getColorModes_2_2
+ Error getColorModes(Display display, hidl_vec<common::V1_0::ColorMode>* outModes) override {
+ return getColorModes_2_2(display, reinterpret_cast<hidl_vec<ColorMode>*>(outModes));
+ }
+
+ // superceded by setColorMode_2_2
+ Error setColorMode(Display display, common::V1_0::ColorMode mode) override {
+ return setColorMode_2_2(display, static_cast<ColorMode>(mode), RenderIntent::COLORIMETRIC);
+ }
+
virtual Error getPerFrameMetadataKeys(
Display display, std::vector<IComposerClient::PerFrameMetadataKey>* outKeys) = 0;
- virtual Error setPerFrameMetadata(
- Display display, const std::vector<IComposerClient::PerFrameMetadata>& metadata) = 0;
+ virtual Error setLayerPerFrameMetadata(
+ Display display, Layer layer,
+ const std::vector<IComposerClient::PerFrameMetadata>& metadata) = 0;
virtual Error getReadbackBufferAttributes(Display display, PixelFormat* outFormat,
Dataspace* outDataspace) = 0;
virtual Error setReadbackBuffer(Display display, const native_handle_t* bufferHandle,
base::unique_fd fenceFd) = 0;
virtual Error getReadbackBufferFence(Display display, base::unique_fd* outFenceFd) = 0;
-
+ virtual Error createVirtualDisplay_2_2(uint32_t width, uint32_t height, PixelFormat* format,
+ Display* outDisplay) = 0;
+ virtual Error getClientTargetSupport_2_2(Display display, uint32_t width, uint32_t height,
+ PixelFormat format, Dataspace dataspace) = 0;
virtual Error setPowerMode_2_2(Display display, IComposerClient::PowerMode mode) = 0;
virtual Error setLayerFloatColor(Display display, Layer layer,
IComposerClient::FloatColor color) = 0;
+
+ virtual Error getColorModes_2_2(Display display, hidl_vec<ColorMode>* outModes) = 0;
+ virtual Error getRenderIntents(Display display, ColorMode mode,
+ std::vector<RenderIntent>* outIntents) = 0;
+ virtual Error setColorMode_2_2(Display display, ColorMode mode, RenderIntent intent) = 0;
+
+ virtual std::array<float, 16> getDataspaceSaturationMatrix(Dataspace dataspace) = 0;
};
} // namespace hal
diff --git a/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h b/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h
index b251351..93da0a5 100644
--- a/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h
+++ b/graphics/composer/2.2/utils/passthrough/include/composer-passthrough/2.2/HwcHal.h
@@ -34,8 +34,10 @@
namespace detail {
-using common::V1_0::Dataspace;
-using common::V1_0::PixelFormat;
+using common::V1_1::ColorMode;
+using common::V1_1::Dataspace;
+using common::V1_1::PixelFormat;
+using common::V1_1::RenderIntent;
using V2_1::Display;
using V2_1::Error;
using V2_1::Layer;
@@ -72,9 +74,10 @@
return Error::NONE;
}
- Error setPerFrameMetadata(
- Display display, const std::vector<IComposerClient::PerFrameMetadata>& metadata) override {
- if (!mDispatch.setPerFrameMetadata) {
+ Error setLayerPerFrameMetadata(
+ Display display, Layer layer,
+ const std::vector<IComposerClient::PerFrameMetadata>& metadata) override {
+ if (!mDispatch.setLayerPerFrameMetadata) {
return Error::UNSUPPORTED;
}
@@ -87,8 +90,8 @@
values.push_back(m.value);
}
- int32_t error = mDispatch.setPerFrameMetadata(mDevice, display, metadata.size(),
- keys.data(), values.data());
+ int32_t error = mDispatch.setLayerPerFrameMetadata(mDevice, display, layer, metadata.size(),
+ keys.data(), values.data());
return static_cast<Error>(error);
}
@@ -131,6 +134,19 @@
return static_cast<Error>(error);
}
+ Error createVirtualDisplay_2_2(uint32_t width, uint32_t height, PixelFormat* format,
+ Display* outDisplay) override {
+ return createVirtualDisplay(
+ width, height, reinterpret_cast<common::V1_0::PixelFormat*>(format), outDisplay);
+ }
+
+ Error getClientTargetSupport_2_2(Display display, uint32_t width, uint32_t height,
+ PixelFormat format, Dataspace dataspace) override {
+ return getClientTargetSupport(display, width, height,
+ static_cast<common::V1_0::PixelFormat>(format),
+ static_cast<common::V1_0::Dataspace>(dataspace));
+ }
+
Error setPowerMode_2_2(Display display, IComposerClient::PowerMode mode) override {
if (mode == IComposerClient::PowerMode::ON_SUSPEND) {
return Error::UNSUPPORTED;
@@ -149,6 +165,69 @@
return static_cast<Error>(error);
}
+ Error getColorModes_2_2(Display display, hidl_vec<ColorMode>* outModes) override {
+ return getColorModes(display,
+ reinterpret_cast<hidl_vec<common::V1_0::ColorMode>*>(outModes));
+ }
+
+ Error getRenderIntents(Display display, ColorMode mode,
+ std::vector<RenderIntent>* outIntents) override {
+ if (!mDispatch.getRenderIntents) {
+ *outIntents = std::vector<RenderIntent>({RenderIntent::COLORIMETRIC});
+ return Error::NONE;
+ }
+
+ uint32_t count = 0;
+ int32_t error =
+ mDispatch.getRenderIntents(mDevice, display, int32_t(mode), &count, nullptr);
+ if (error != HWC2_ERROR_NONE) {
+ return static_cast<Error>(error);
+ }
+
+ std::vector<RenderIntent> intents(count);
+ error = mDispatch.getRenderIntents(
+ mDevice, display, int32_t(mode), &count,
+ reinterpret_cast<std::underlying_type<RenderIntent>::type*>(intents.data()));
+ if (error != HWC2_ERROR_NONE) {
+ return static_cast<Error>(error);
+ }
+ intents.resize(count);
+
+ *outIntents = std::move(intents);
+ return Error::NONE;
+ }
+
+ Error setColorMode_2_2(Display display, ColorMode mode, RenderIntent intent) override {
+ if (!mDispatch.setColorModeWithRenderIntent) {
+ if (intent != RenderIntent::COLORIMETRIC) {
+ return Error::UNSUPPORTED;
+ }
+ return setColorMode(display, static_cast<common::V1_0::ColorMode>(mode));
+ }
+
+ int32_t err = mDispatch.setColorModeWithRenderIntent(
+ mDevice, display, static_cast<int32_t>(mode), static_cast<int32_t>(intent));
+ return static_cast<Error>(err);
+ }
+
+ std::array<float, 16> getDataspaceSaturationMatrix(Dataspace dataspace) override {
+ std::array<float, 16> matrix;
+
+ int32_t error = HWC2_ERROR_UNSUPPORTED;
+ if (mDispatch.getDataspaceSaturationMatrix) {
+ error = mDispatch.getDataspaceSaturationMatrix(mDevice, static_cast<int32_t>(dataspace),
+ matrix.data());
+ }
+ if (error != HWC2_ERROR_NONE) {
+ return std::array<float, 16>{
+ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f,
+ };
+ }
+
+ return matrix;
+ }
+
protected:
template <typename T>
bool initOptionalDispatch(hwc2_function_descriptor_t desc, T* outPfn) {
@@ -168,7 +247,8 @@
initOptionalDispatch(HWC2_FUNCTION_SET_LAYER_FLOAT_COLOR, &mDispatch.setLayerFloatColor);
- initOptionalDispatch(HWC2_FUNCTION_SET_PER_FRAME_METADATA, &mDispatch.setPerFrameMetadata);
+ initOptionalDispatch(HWC2_FUNCTION_SET_LAYER_PER_FRAME_METADATA,
+ &mDispatch.setLayerPerFrameMetadata);
initOptionalDispatch(HWC2_FUNCTION_GET_PER_FRAME_METADATA_KEYS,
&mDispatch.getPerFrameMetadataKeys);
@@ -178,21 +258,34 @@
initOptionalDispatch(HWC2_FUNCTION_GET_READBACK_BUFFER_FENCE,
&mDispatch.getReadbackBufferFence);
+ initOptionalDispatch(HWC2_FUNCTION_GET_RENDER_INTENTS, &mDispatch.getRenderIntents);
+ initOptionalDispatch(HWC2_FUNCTION_SET_COLOR_MODE_WITH_RENDER_INTENT,
+ &mDispatch.setColorModeWithRenderIntent);
+ initOptionalDispatch(HWC2_FUNCTION_GET_DATASPACE_SATURATION_MATRIX,
+ &mDispatch.getDataspaceSaturationMatrix);
+
return true;
}
struct {
HWC2_PFN_SET_LAYER_FLOAT_COLOR setLayerFloatColor;
- HWC2_PFN_SET_PER_FRAME_METADATA setPerFrameMetadata;
+ HWC2_PFN_SET_LAYER_PER_FRAME_METADATA setLayerPerFrameMetadata;
HWC2_PFN_GET_PER_FRAME_METADATA_KEYS getPerFrameMetadataKeys;
HWC2_PFN_SET_READBACK_BUFFER setReadbackBuffer;
HWC2_PFN_GET_READBACK_BUFFER_ATTRIBUTES getReadbackBufferAttributes;
HWC2_PFN_GET_READBACK_BUFFER_FENCE getReadbackBufferFence;
+ HWC2_PFN_GET_RENDER_INTENTS getRenderIntents;
+ HWC2_PFN_SET_COLOR_MODE_WITH_RENDER_INTENT setColorModeWithRenderIntent;
+ HWC2_PFN_GET_DATASPACE_SATURATION_MATRIX getDataspaceSaturationMatrix;
} mDispatch = {};
private:
using BaseType2_1 = V2_1::passthrough::detail::HwcHalImpl<Hal>;
+ using BaseType2_1::getColorModes;
using BaseType2_1::mDevice;
+ using BaseType2_1::setColorMode;
+ using BaseType2_1::createVirtualDisplay;
+ using BaseType2_1::getClientTargetSupport;
using BaseType2_1::setPowerMode;
};
diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp
index 641fdcb..c6b524d 100644
--- a/graphics/composer/2.2/utils/vts/Android.bp
+++ b/graphics/composer/2.2/utils/vts/Android.bp
@@ -26,10 +26,17 @@
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
],
+ export_static_lib_headers: [
+ "android.hardware.graphics.composer@2.1-vts",
+ ],
header_libs: [
"android.hardware.graphics.composer@2.1-command-buffer",
"android.hardware.graphics.composer@2.2-command-buffer",
],
+ export_header_lib_headers: [
+ "android.hardware.graphics.composer@2.1-command-buffer",
+ "android.hardware.graphics.composer@2.2-command-buffer",
+ ],
cflags: [
"-O0",
"-g",
diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
index b536f67..357c772 100644
--- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
@@ -87,6 +87,33 @@
});
}
+Display ComposerClient_v2_2::createVirtualDisplay_2_2(uint32_t width, uint32_t height,
+ PixelFormat formatHint,
+ uint32_t outputBufferSlotCount,
+ PixelFormat* outFormat) {
+ Display display = 0;
+ mClient_v2_2->createVirtualDisplay_2_2(
+ width, height, formatHint, outputBufferSlotCount,
+ [&](const auto& tmpError, const auto& tmpDisplay, const auto& tmpFormat) {
+ ASSERT_EQ(Error::NONE, tmpError) << "failed to create virtual display";
+ display = tmpDisplay;
+ *outFormat = tmpFormat;
+
+ ASSERT_TRUE(mDisplayResources.insert({display, DisplayResource(true)}).second)
+ << "duplicated virtual display id " << display;
+ });
+
+ return display;
+}
+
+bool ComposerClient_v2_2::getClientTargetSupport_2_2(Display display, uint32_t width,
+ uint32_t height, PixelFormat format,
+ Dataspace dataspace) {
+ Error error =
+ mClient_v2_2->getClientTargetSupport_2_2(display, width, height, format, dataspace);
+ return error == Error::NONE;
+}
+
void ComposerClient_v2_2::setPowerMode_2_2(Display display, V2_2::IComposerClient::PowerMode mode) {
Error error = mClient_v2_2->setPowerMode_2_2(display, mode);
ASSERT_TRUE(error == Error::NONE || error == Error::UNSUPPORTED) << "failed to set power mode";
@@ -119,6 +146,41 @@
*outFence = 0;
}
+std::vector<ColorMode> ComposerClient_v2_2::getColorModes(Display display) {
+ std::vector<ColorMode> modes;
+ mClient_v2_2->getColorModes_2_2(display, [&](const auto& tmpError, const auto& tmpModes) {
+ ASSERT_EQ(Error::NONE, tmpError) << "failed to get color modes";
+ modes = tmpModes;
+ });
+ return modes;
+}
+
+std::vector<RenderIntent> ComposerClient_v2_2::getRenderIntents(Display display, ColorMode mode) {
+ std::vector<RenderIntent> intents;
+ mClient_v2_2->getRenderIntents(
+ display, mode, [&](const auto& tmpError, const auto& tmpIntents) {
+ ASSERT_EQ(Error::NONE, tmpError) << "failed to get render intents";
+ intents = tmpIntents;
+ });
+ return intents;
+}
+
+void ComposerClient_v2_2::setColorMode(Display display, ColorMode mode, RenderIntent intent) {
+ Error error = mClient_v2_2->setColorMode_2_2(display, mode, intent);
+ ASSERT_TRUE(error == Error::NONE || error == Error::UNSUPPORTED) << "failed to set color mode";
+}
+
+std::array<float, 16> ComposerClient_v2_2::getDataspaceSaturationMatrix(Dataspace dataspace) {
+ std::array<float, 16> matrix;
+ mClient_v2_2->getDataspaceSaturationMatrix(
+ dataspace, [&](const auto& tmpError, const auto& tmpMatrix) {
+ ASSERT_EQ(Error::NONE, tmpError) << "failed to get datasapce saturation matrix";
+ std::copy_n(tmpMatrix.data(), matrix.size(), matrix.begin());
+ });
+
+ return matrix;
+}
+
} // namespace vts
} // namespace V2_2
} // namespace composer
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
index eced69f..62ab83f 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
@@ -36,10 +36,11 @@
namespace V2_2 {
namespace vts {
-using android::hardware::graphics::common::V1_0::ColorMode;
-using android::hardware::graphics::common::V1_0::Dataspace;
using android::hardware::graphics::common::V1_0::Hdr;
-using android::hardware::graphics::common::V1_0::PixelFormat;
+using android::hardware::graphics::common::V1_1::ColorMode;
+using android::hardware::graphics::common::V1_1::Dataspace;
+using android::hardware::graphics::common::V1_1::PixelFormat;
+using android::hardware::graphics::common::V1_1::RenderIntent;
using android::hardware::graphics::composer::V2_2::IComposer;
using android::hardware::graphics::composer::V2_2::IComposerClient;
@@ -66,12 +67,22 @@
std::vector<IComposerClient::PerFrameMetadataKey> getPerFrameMetadataKeys(Display display);
+ Display createVirtualDisplay_2_2(uint32_t width, uint32_t height, PixelFormat formatHint,
+ uint32_t outputBufferSlotCount, PixelFormat* outFormat);
+ bool getClientTargetSupport_2_2(Display display, uint32_t width, uint32_t height,
+ PixelFormat format, Dataspace dataspace);
void setPowerMode_2_2(Display display, V2_2::IComposerClient::PowerMode mode);
void setReadbackBuffer(Display display, const native_handle_t* buffer, int32_t releaseFence);
void getReadbackBufferAttributes(Display display, PixelFormat* outPixelFormat,
Dataspace* outDataspace);
void getReadbackBufferFence(Display display, int32_t* outFence);
+ std::vector<ColorMode> getColorModes(Display display);
+ std::vector<RenderIntent> getRenderIntents(Display display, ColorMode mode);
+ void setColorMode(Display display, ColorMode mode, RenderIntent intent);
+
+ std::array<float, 16> getDataspaceSaturationMatrix(Dataspace dataspace);
+
private:
sp<V2_2::IComposerClient> mClient_v2_2;
};
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index 7747900..669fbae 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -27,6 +27,7 @@
],
static_libs: [
"android.hardware.graphics.allocator@2.0",
+ "android.hardware.graphics.common@1.1",
"android.hardware.graphics.composer@2.1",
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
@@ -34,6 +35,7 @@
"android.hardware.graphics.mapper@2.0",
"android.hardware.graphics.mapper@2.0-vts",
"android.hardware.graphics.mapper@2.1",
+ "android.hardware.graphics.mapper@2.1-vts",
],
header_libs: [
"android.hardware.graphics.composer@2.1-command-buffer",
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
index c494329..4e41333 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
@@ -22,7 +22,7 @@
#include <composer-vts/2.1/GraphicsComposerCallback.h>
#include <composer-vts/2.1/TestCommandReader.h>
#include <composer-vts/2.2/ComposerVts.h>
-#include <mapper-vts/2.0/MapperVts.h>
+#include <mapper-vts/2.1/MapperVts.h>
namespace android {
namespace hardware {
@@ -33,14 +33,15 @@
namespace {
using android::hardware::graphics::common::V1_0::BufferUsage;
-using android::hardware::graphics::common::V1_0::ColorMode;
using android::hardware::graphics::common::V1_0::ColorTransform;
-using android::hardware::graphics::common::V1_0::Dataspace;
-using android::hardware::graphics::common::V1_0::PixelFormat;
using android::hardware::graphics::common::V1_0::Transform;
+using android::hardware::graphics::common::V1_1::ColorMode;
+using android::hardware::graphics::common::V1_1::Dataspace;
+using android::hardware::graphics::common::V1_1::PixelFormat;
+using android::hardware::graphics::common::V1_1::RenderIntent;
using android::hardware::graphics::composer::V2_2::IComposerClient;
-using android::hardware::graphics::mapper::V2_0::IMapper;
-using android::hardware::graphics::mapper::V2_0::vts::Gralloc;
+using android::hardware::graphics::mapper::V2_1::IMapper;
+using android::hardware::graphics::mapper::V2_1::vts::Gralloc;
using GrallocError = android::hardware::graphics::mapper::V2_0::Error;
// Test environment for graphics.composer
@@ -146,9 +147,9 @@
};
/**
- * Test IComposerClient::Command::SET_PER_FRAME_METADATA.
+ * Test IComposerClient::Command::SET_LAYER_PER_FRAME_METADATA.
*/
-TEST_F(GraphicsComposerHidlCommandTest, SET_PER_FRAME_METADATA) {
+TEST_F(GraphicsComposerHidlCommandTest, SET_LAYER_PER_FRAME_METADATA) {
Layer layer;
ASSERT_NO_FATAL_FAILURE(layer =
mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount));
@@ -182,7 +183,7 @@
hidlMetadata.push_back({IComposerClient::PerFrameMetadataKey::MAX_CONTENT_LIGHT_LEVEL, 78.0});
hidlMetadata.push_back(
{IComposerClient::PerFrameMetadataKey::MAX_FRAME_AVERAGE_LIGHT_LEVEL, 62.0});
- mWriter->setPerFrameMetadata(hidlMetadata);
+ mWriter->setLayerPerFrameMetadata(hidlMetadata);
execute();
}
@@ -192,6 +193,55 @@
TEST_F(GraphicsComposerHidlTest, GetPerFrameMetadataKeys) {
mComposerClient->getPerFrameMetadataKeys(mPrimaryDisplay);
}
+
+/**
+ * Test IComposerClient::createVirtualDisplay_2_2 and
+ * IComposerClient::destroyVirtualDisplay.
+ *
+ * Test that virtual displays can be created and has the correct display type.
+ */
+TEST_F(GraphicsComposerHidlTest, CreateVirtualDisplay_2_2) {
+ if (mComposerClient->getMaxVirtualDisplayCount() == 0) {
+ GTEST_SUCCEED() << "no virtual display support";
+ return;
+ }
+
+ Display display;
+ PixelFormat format;
+ ASSERT_NO_FATAL_FAILURE(
+ display = mComposerClient->createVirtualDisplay_2_2(
+ 64, 64, PixelFormat::IMPLEMENTATION_DEFINED, kBufferSlotCount, &format));
+
+ // test display type
+ IComposerClient::DisplayType type = mComposerClient->getDisplayType(display);
+ EXPECT_EQ(IComposerClient::DisplayType::VIRTUAL, type);
+
+ mComposerClient->destroyVirtualDisplay(display);
+}
+
+/**
+ * Test IComposerClient::getClientTargetSupport_2_2.
+ *
+ * Test that IComposerClient::getClientTargetSupport returns true for the
+ * required client targets.
+ */
+TEST_F(GraphicsComposerHidlTest, GetClientTargetSupport_2_2) {
+ std::vector<Config> configs = mComposerClient->getDisplayConfigs(mPrimaryDisplay);
+ for (auto config : configs) {
+ int32_t width = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config,
+ IComposerClient::Attribute::WIDTH);
+ int32_t height = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config,
+ IComposerClient::Attribute::HEIGHT);
+ ASSERT_LT(0, width);
+ ASSERT_LT(0, height);
+
+ mComposerClient->setActiveConfig(mPrimaryDisplay, config);
+
+ ASSERT_TRUE(mComposerClient->getClientTargetSupport_2_2(
+ mPrimaryDisplay, width, height, PixelFormat::RGBA_8888, Dataspace::UNKNOWN));
+ }
+}
+
/**
* Test IComposerClient::setPowerMode_2_2.
*/
@@ -235,6 +285,56 @@
mWriter->setLayerFloatColor(IComposerClient::FloatColor{0.0, 0.0, 0.0, 0.0});
}
+/**
+ * Test IComposerClient::getDataspaceSaturationMatrix.
+ */
+TEST_F(GraphicsComposerHidlTest, getDataspaceSaturationMatrix) {
+ auto matrix = mComposerClient->getDataspaceSaturationMatrix(Dataspace::SRGB_LINEAR);
+ // the last row is known
+ ASSERT_EQ(0.0f, matrix[12]);
+ ASSERT_EQ(0.0f, matrix[13]);
+ ASSERT_EQ(0.0f, matrix[14]);
+ ASSERT_EQ(1.0f, matrix[15]);
+}
+
+/**
+ * Test IComposerClient::getColorMode_2_2.
+ */
+TEST_F(GraphicsComposerHidlTest, GetColorMode_2_2) {
+ std::vector<ColorMode> modes = mComposerClient->getColorModes(mPrimaryDisplay);
+
+ auto nativeMode = std::find(modes.cbegin(), modes.cend(), ColorMode::NATIVE);
+ EXPECT_NE(modes.cend(), nativeMode);
+}
+
+/**
+ * Test IComposerClient::getRenderIntent.
+ */
+TEST_F(GraphicsComposerHidlTest, GetRenderIntent) {
+ std::vector<ColorMode> modes = mComposerClient->getColorModes(mPrimaryDisplay);
+ for (auto mode : modes) {
+ std::vector<RenderIntent> intents =
+ mComposerClient->getRenderIntents(mPrimaryDisplay, mode);
+ auto colorimetricIntent =
+ std::find(intents.cbegin(), intents.cend(), RenderIntent::COLORIMETRIC);
+ EXPECT_NE(intents.cend(), colorimetricIntent);
+ }
+}
+
+/**
+ * Test IComposerClient::setColorMode_2_2.
+ */
+TEST_F(GraphicsComposerHidlTest, SetColorMode_2_2) {
+ std::vector<ColorMode> modes = mComposerClient->getColorModes(mPrimaryDisplay);
+ for (auto mode : modes) {
+ std::vector<RenderIntent> intents =
+ mComposerClient->getRenderIntents(mPrimaryDisplay, mode);
+ for (auto intent : intents) {
+ mComposerClient->setColorMode(mPrimaryDisplay, mode, intent);
+ }
+ }
+}
+
} // namespace
} // namespace vts
} // namespace V2_2
diff --git a/graphics/mapper/2.1/utils/vts/MapperVts.cpp b/graphics/mapper/2.1/utils/vts/MapperVts.cpp
index 0aaa926..078068e 100644
--- a/graphics/mapper/2.1/utils/vts/MapperVts.cpp
+++ b/graphics/mapper/2.1/utils/vts/MapperVts.cpp
@@ -43,6 +43,13 @@
offsetof(IMapper::BufferDescriptorInfo, usage),
"");
+Gralloc::Gralloc() : V2_0::vts::Gralloc() {
+ if (::testing::Test::HasFatalFailure()) {
+ return;
+ }
+ init();
+}
+
Gralloc::Gralloc(const std::string& allocatorServiceName, const std::string& mapperServiceName)
: V2_0::vts::Gralloc(allocatorServiceName, mapperServiceName) {
if (::testing::Test::HasFatalFailure()) {
diff --git a/graphics/mapper/2.1/utils/vts/include/mapper-vts/2.1/MapperVts.h b/graphics/mapper/2.1/utils/vts/include/mapper-vts/2.1/MapperVts.h
index b7fa751..423d4b3 100644
--- a/graphics/mapper/2.1/utils/vts/include/mapper-vts/2.1/MapperVts.h
+++ b/graphics/mapper/2.1/utils/vts/include/mapper-vts/2.1/MapperVts.h
@@ -32,6 +32,7 @@
// A wrapper to IAllocator and IMapper.
class Gralloc : public V2_0::vts::Gralloc {
public:
+ Gralloc();
Gralloc(const std::string& allocatorServiceName, const std::string& mapperServiceName);
sp<IMapper> getMapper() const;
diff --git a/keymaster/4.0/support/Keymaster.cpp b/keymaster/4.0/support/Keymaster.cpp
index bf52c47..fac0017 100644
--- a/keymaster/4.0/support/Keymaster.cpp
+++ b/keymaster/4.0/support/Keymaster.cpp
@@ -40,7 +40,7 @@
serviceManager->listByInterface(descriptor, [&](const hidl_vec<hidl_string>& names) {
for (auto& name : names) {
if (name == "default") foundDefault = true;
- auto device = Wrapper::WrappedIKeymasterDevice::getService();
+ auto device = Wrapper::WrappedIKeymasterDevice::getService(name);
CHECK(device) << "Failed to get service for " << descriptor << " with interface name "
<< name;
result.push_back(std::unique_ptr<Keymaster>(new Wrapper(device, name)));