Merge "Add subscribe to VHAL proto." into main
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
index 135f30a..0dea16b 100644
--- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -516,12 +516,12 @@
{
"name": "DISPLAY_BRIGHTNESS",
"value": 289409539,
- "description": "Property to represent brightness of the display.\nSome cars have single control for the brightness of all displays and this property is to share change in that control. In cars which have displays whose brightness is controlled separately, they must use PER_DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nIf 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."
+ "description": "Property to represent brightness of the display.\nSome cars have single control for the brightness of all displays and this property is to share change in that control. In cars which have displays whose brightness is controlled separately, they must use PER_DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nIf 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.\nIf this is writable, writing this property must cause an on property change event even if the new display brightness is the same as the current value."
},
{
"name": "PER_DISPLAY_BRIGHTNESS",
"value": 289475076,
- "description": "Property to represent brightness of the displays which are controlled separately.\nSome cars have one or more displays whose brightness is controlled separately and this property is to inform the brightness of each passenger display. In cars where all displays' brightness is controlled together, they must use DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nThe display port uniquely identifies a physical connector on the device for display output, ranging from 0 to 255.\nint32Values[0] : display port int32Values[1] : brightness"
+ "description": "Property to represent brightness of the displays which are controlled separately.\nSome cars have one or more displays whose brightness is controlled separately and this property is to inform the brightness of each passenger display. In cars where all displays' brightness is controlled together, they must use DISPLAY_BRIGHTNESS.\nOnly one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by AAOS.\nThe display port uniquely identifies a physical connector on the device for display output, ranging from 0 to 255.\nWriting this property must cause an on property change event that contains the same [display port, brightness] tuple even if the new display brightness is the same as the current value.\nTo get the display brightness for a specific display port, the GetValueRequest must contain a VehiclePropValue, which contains one int32Value: displayPort. Getting this property without specifying the the display port is undefined behavior.\nint32Values[0] : display port int32Values[1] : brightness"
},
{
"name": "Valet mode enabled",
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index ab8023d..e54c179 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -1734,8 +1734,13 @@
* change display brightness from Settings, but that must not be reflected
* to other displays.
*
+ * If this is writable, writing this property must cause an on property
+ * change event even if the new display brightness is the same as the
+ * current value.
+ *
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @version 2
*/
DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000
@@ -1755,6 +1760,15 @@
* The display port uniquely identifies a physical connector on the device
* for display output, ranging from 0 to 255.
*
+ * Writing this property must cause an on property change event that
+ * contains the same [display port, brightness] tuple even if the new
+ * display brightness is the same as the current value.
+ *
+ * To get the display brightness for a specific display port, the
+ * GetValueRequest must contain a VehiclePropValue, which contains one
+ * int32Value: displayPort. Getting this property without specifying the
+ * the display port is undefined behavior.
+ *
* int32Values[0] : display port
* int32Values[1] : brightness
*
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index d3842c5..da6116f 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -288,6 +288,20 @@
return false;
}
+ std::string printConfig(int config) {
+ const auto displayConfig = getDisplayConfig(config);
+ const auto vrrConfigOpt = displayConfig.vrrConfigOpt;
+ std::stringstream ss;
+ if (displayConfig.vrrConfigOpt) {
+ ss << "{Config " << config << ": vsyncPeriod " << displayConfig.vsyncPeriod
+ << ", minFrameIntervalNs " << vrrConfigOpt->minFrameIntervalNs << "}";
+ }
+ else {
+ ss << "{Config " << config << ": vsyncPeriod " << displayConfig.vsyncPeriod << "}";
+ }
+ return ss.str();
+ }
+
std::unordered_map<int32_t, DisplayConfig> getDisplayConfigs() { return mDisplayConfigs; }
private:
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 0227e39..ba15421 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -2877,8 +2877,9 @@
} while (--retryCount > 0);
if (retryCount == 0) {
- GTEST_FAIL() << "failed to get a callback for the display " << displayId
- << " with config " << config2;
+ GTEST_FAIL() << "Failed to get a callback for Display " << displayId
+ << " switching from " << display.printConfig(config1)
+ << " to " << display.printConfig(config2);
}
});