From a9a3ec3e1a7e681e940534567ac80e8a7ab6691f Mon Sep 17 00:00:00 2001 From: Eric Jeong Date: Wed, 15 Feb 2023 12:48:45 -0800 Subject: [PATCH] Add PASSENGER_DISPLAY_BRIGHTNESS property - DISPLAY_BRIGHTNESS can send a brightness to be applied on one display. - On multi-display devices, brightness of each display should be communicated separately to VHAL. - PASSENGER_DISPLAY_BRIGHTNESS is added to serve that purpose. Bug: 269186221 Test: build okay Change-Id: I749ecd451afc4f24039f6e594860f1cb0fcf3509 (cherry picked from commit b9748bad632e92d36f70c8800d388c5f48a7924c) Merged-In: I749ecd451afc4f24039f6e594860f1cb0fcf3509 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 36 +++++++++++++++++-- 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index d4ab0f7678..2335d6d564 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -119,6 +119,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::AP_POWER_STATE_REPORT, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyAccess::READ}, {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HW_KEY_INPUT, VehiclePropertyAccess::READ}, {VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyAccess::READ}, {VehicleProperty::HW_MOTION_INPUT, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index d56de3f1ca..a0911c5ca0 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -119,6 +119,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::AP_POWER_STATE_REPORT, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HW_KEY_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HW_MOTION_INPUT, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index caeb26676b..e9670c1e97 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -111,6 +111,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.AP_POWER_STATE_REPORT, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 0beab94381..2513e4ecd2 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -111,6 +111,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.AP_POWER_STATE_REPORT, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl index cc06bf342b..a525ab0623 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -117,6 +117,7 @@ enum VehicleProperty { AP_POWER_STATE_REPORT = (((0x0A01 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475073 */, AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409538 */, DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */, + PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */, HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475088 */, HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004177 */, HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004178 */, 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 473dffcf97..b350f90a7e 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -1252,9 +1252,16 @@ enum VehicleProperty { AP_POWER_BOOTUP_REASON = 0x0A02 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 /** - * 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 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. In cars which have displays + * whose brightness is controlled separately, they must use + * PER_DISPLAY_BRIGHTNESS. + * + * Only one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be + * implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by + * AAOS. * * 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 @@ -1266,6 +1273,29 @@ enum VehicleProperty { */ DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 + /** + * Property to represent brightness of the displays which are controlled separately. + * + * Some 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. + * + * Only one of DISPLAY_BRIGHTNESS and PER_DISPLAY_BRIGHTNESS should be + * implemented. If both are available, PER_DISPLAY_BRIGHTNESS is used by + * AAOS. + * + * The display port uniquely identifies a physical connector on the device + * for display output, ranging from 0 to 255. + * + * int32Values[0] : display port + * int32Values[1] : brightness + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + */ + PER_DISPLAY_BRIGHTNESS = 0x0A04 + 0x10000000 + 0x01000000 + + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC /** * Property to feed H/W input events to android *