From 1a207ebc243aaf4da3b039d78e03fc188cf74290 Mon Sep 17 00:00:00 2001 From: shrikar Date: Fri, 18 Nov 2022 11:39:28 -0800 Subject: [PATCH 001/376] Update properties and FakeVehicleHardware to support multi-display Bug: 255430764 Test: atest CarPropertyManagerTest Test: atest FakeVehicleHardwareTest Change-Id: I7e3db2e9e7e0cb58588b11d064e1fa14f2007a2a --- .../config/DefaultProperties.json | 278 +++++++++++++++--- .../hardware/include/FakeVehicleHardware.h | 4 +- .../hardware/src/FakeVehicleHardware.cpp | 45 ++- .../hardware/test/FakeVehicleHardwareTest.cpp | 131 ++++++--- 4 files changed, 346 insertions(+), 112 deletions(-) diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 50e242819c..4b2c75c71b 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1329,22 +1329,26 @@ }, { "property": "VehicleProperty::SEAT_OCCUPANCY", + "defaultValue": { + "int32Values": [ + "VehicleSeatOccupancyState::VACANT" + ] + }, "areas": [ { - "defaultValue": { - "int32Values": [ - "VehicleSeatOccupancyState::VACANT" - ] - }, "areaId": "Constants::SEAT_1_LEFT" }, { - "defaultValue": { - "int32Values": [ - "VehicleSeatOccupancyState::VACANT" - ] - }, "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1854,7 +1858,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1867,7 +1883,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ], "configArray": [ @@ -1918,7 +1946,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1931,7 +1971,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1944,7 +1996,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1957,7 +2021,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1970,7 +2046,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -1983,7 +2071,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -2009,7 +2109,27 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL", + "areaId": "Constants::SEAT_1_LEFT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 1, + "maxInt32Value": 7 + }, + { + "areaId": "Constants::SEAT_2_CENTER", "minInt32Value": 1, "maxInt32Value": 7 } @@ -2024,7 +2144,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -2043,7 +2175,19 @@ }, "areas": [ { - "areaId": "Constants::HVAC_ALL" + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, @@ -2064,6 +2208,21 @@ "areaId": "Constants::SEAT_1_RIGHT", "minInt32Value": 0, "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": 0, + "maxInt32Value": 3 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": 0, + "maxInt32Value": 3 } ], "comment": "0 is off and +ve values indicate ventilation level." @@ -2101,6 +2260,21 @@ "areaId": "Constants::SEAT_1_RIGHT", "minInt32Value": -2, "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minInt32Value": -2, + "maxInt32Value": 2 + }, + { + "areaId": "Constants::SEAT_2_CENTER", + "minInt32Value": -2, + "maxInt32Value": 2 } ], "comment": "+ve values for heating and -ve for cooling" @@ -2122,45 +2296,59 @@ }, { "property": "VehicleProperty::HVAC_TEMPERATURE_CURRENT", + "defaultValue": { + "floatValues": [ + 19.1 + ] + }, "areas": [ { - "defaultValue": { - "floatValues": [ - 17.3 - ] - }, - "areaId": 49 + "areaId": "Constants::SEAT_1_LEFT" }, { - "defaultValue": { - "floatValues": [ - 19.1 - ] - }, - "areaId": 68 + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" } ] }, { "property": "VehicleProperty::HVAC_TEMPERATURE_SET", + "defaultValue": { + "floatValues": [ + 17.0 + ] + }, "areas": [ { - "defaultValue": { - "floatValues": [ - 16.0 - ] - }, - "areaId": 49, + "areaId": "Constants::SEAT_1_LEFT", "minFloatValue": 16.0, "maxFloatValue": 28.0 }, { - "defaultValue": { - "floatValues": [ - 20.0 - ] - }, - "areaId": 68, + "areaId": "Constants::SEAT_1_RIGHT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "minFloatValue": 16.0, + "maxFloatValue": 28.0 + }, + { + "areaId": "Constants::SEAT_2_CENTER", "minFloatValue": 16.0, "maxFloatValue": 28.0 } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 956c7c00fe..6fd2367957 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -194,7 +194,7 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; ValueResultType getEchoReverseBytes( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const; - bool isHvacPropAndHvacNotAvailable(int32_t propId) const; + bool isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const; std::unordered_map loadConfigDeclarations(); @@ -236,7 +236,7 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::SetValueRequest& request); std::string genFakeDataCommand(const std::vector& options); - void sendHvacPropertiesCurrentValues(); + void sendHvacPropertiesCurrentValues(int32_t areaId); static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp( aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index a9dced9f3a..a1b8d203ac 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -295,16 +295,27 @@ VhalResult FakeVehicleHardware::setApPowerStateReport(const VehiclePropVal return {}; } -bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId) const { +bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const { std::unordered_set powerProps(std::begin(HVAC_POWER_PROPERTIES), std::end(HVAC_POWER_PROPERTIES)); if (powerProps.count(propId)) { - auto hvacPowerOnResult = - mServerSidePropStore->readValue(toInt(VehicleProperty::HVAC_POWER_ON), HVAC_ALL); - - if (hvacPowerOnResult.ok() && hvacPowerOnResult.value()->value.int32Values.size() == 1 && - hvacPowerOnResult.value()->value.int32Values[0] == 0) { - return true; + auto hvacPowerOnResults = + mServerSidePropStore->readValuesForProperty(toInt(VehicleProperty::HVAC_POWER_ON)); + if (!hvacPowerOnResults.ok()) { + ALOGW("failed to get HVAC_POWER_ON 0x%x, error: %s", + toInt(VehicleProperty::HVAC_POWER_ON), getErrorMsg(hvacPowerOnResults).c_str()); + return false; + } + auto& hvacPowerOnValues = hvacPowerOnResults.value(); + for (size_t j = 0; j < hvacPowerOnValues.size(); j++) { + auto hvacPowerOnValue = std::move(hvacPowerOnValues[j]); + if ((hvacPowerOnValue->areaId & areaId) == areaId) { + if (hvacPowerOnValue->value.int32Values.size() == 1 && + hvacPowerOnValue->value.int32Values[0] == 0) { + return true; + } + break; + } } } return false; @@ -366,7 +377,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( return getUserHalProp(value); } - if (isHvacPropAndHvacNotAvailable(propId)) { + if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) { *isSpecialValue = true; return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available"; } @@ -413,7 +424,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getEchoReverseBytes( return std::move(gotValue); } -void FakeVehicleHardware::sendHvacPropertiesCurrentValues() { +void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId) { for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { int powerPropId = HVAC_POWER_PROPERTIES[i]; auto powerPropResults = mServerSidePropStore->readValuesForProperty(powerPropId); @@ -425,11 +436,13 @@ void FakeVehicleHardware::sendHvacPropertiesCurrentValues() { auto& powerPropValues = powerPropResults.value(); for (size_t j = 0; j < powerPropValues.size(); j++) { auto powerPropValue = std::move(powerPropValues[j]); - powerPropValue->status = VehiclePropertyStatus::AVAILABLE; - powerPropValue->timestamp = elapsedRealtimeNano(); - // This will trigger a property change event for the current hvac property value. - mServerSidePropStore->writeValue(std::move(powerPropValue), /*updateStatus=*/true, - VehiclePropertyStore::EventMode::ALWAYS); + if ((powerPropValue->areaId & areaId) == powerPropValue->areaId) { + powerPropValue->status = VehiclePropertyStatus::AVAILABLE; + powerPropValue->timestamp = elapsedRealtimeNano(); + // This will trigger a property change event for the current hvac property value. + mServerSidePropStore->writeValue(std::move(powerPropValue), /*updateStatus=*/true, + VehiclePropertyStore::EventMode::ALWAYS); + } } } } @@ -449,10 +462,10 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu value.value.int32Values[0] == 1) { // If we are turning HVAC power on, send current hvac property values through on change // event. - sendHvacPropertiesCurrentValues(); + sendHvacPropertiesCurrentValues(value.areaId); } - if (isHvacPropAndHvacNotAvailable(propId)) { + if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) { *isSpecialValue = true; return StatusError(StatusCode::NOT_AVAILABLE) << "hvac not available"; } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 67b1aa4c9c..7a59e9e384 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -1142,67 +1142,100 @@ TEST_F(FakeVehicleHardwareTest, testSetVehicleMapService) { } TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) { - StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = HVAC_ALL, - .value.int32Values = {0}}); - - ASSERT_EQ(status, StatusCode::OK); + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + int powerPropId = HVAC_POWER_PROPERTIES[i]; + for (int powerDependentAreaId : seatAreaIds) { + auto getValueResult = getValue(VehiclePropValue{ + .prop = powerPropId, + .areaId = powerDependentAreaId, + }); - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - int powerPropId = HVAC_POWER_PROPERTIES[i]; - auto getValueResult = getValue(VehiclePropValue{ - .prop = powerPropId, - .areaId = HVAC_ALL, - }); + if (areaId == powerDependentAreaId) { + EXPECT_FALSE(getValueResult.ok()); + EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE); + } else { + EXPECT_TRUE(getValueResult.ok()); + } + } + } - EXPECT_FALSE(getValueResult.ok()); - EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE); + // Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence + // on this value from any power dependent property values other than those with the same + // areaId. + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); } } TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) { - StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = HVAC_ALL, - .value.int32Values = {0}}); - - ASSERT_EQ(status, StatusCode::OK); - - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - int powerPropId = HVAC_POWER_PROPERTIES[i]; - status = setValue(VehiclePropValue{ - .prop = powerPropId, - .areaId = HVAC_ALL, - }); + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + int powerPropId = HVAC_POWER_PROPERTIES[i]; + for (int powerDependentAreaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = powerPropId, + .areaId = powerDependentAreaId, + .value.int32Values = {1}}); + + if (areaId == powerDependentAreaId) { + EXPECT_EQ(status, StatusCode::NOT_AVAILABLE); + } else { + EXPECT_EQ(status, StatusCode::OK); + } + } + } - EXPECT_EQ(status, StatusCode::NOT_AVAILABLE); + // Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence + // on this value from any power dependent property values other than those with the same + // areaId. + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); } } TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { - StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = HVAC_ALL, - .value.int32Values = {0}}); - - ASSERT_EQ(status, StatusCode::OK); - - clearChangedProperties(); - - status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = HVAC_ALL, - .value.int32Values = {1}}); + int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; + for (int areaId : seatAreaIds) { + StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {0}}); + + ASSERT_EQ(status, StatusCode::OK); + + clearChangedProperties(); + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = areaId, + .value.int32Values = {1}}); + + auto events = getChangedProperties(); + // If we turn HVAC power on, we expect to receive one property event for every HVAC prop + // areas plus one event for HVAC_POWER_ON. + std::vector changedPropIds; + for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { + changedPropIds.push_back(HVAC_POWER_PROPERTIES[i]); + } + changedPropIds.push_back(toInt(VehicleProperty::HVAC_POWER_ON)); - auto events = getChangedProperties(); - // If we turn HVAC power on, we expect to receive one property event for every HVAC prop areas - // plus one event for HVAC_POWER_ON. - std::vector changedPropIds; - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - changedPropIds.push_back(HVAC_POWER_PROPERTIES[i]); - } - changedPropIds.push_back(toInt(VehicleProperty::HVAC_POWER_ON)); - ASSERT_EQ(events.size(), changedPropIds.size()); - for (const auto& event : events) { - EXPECT_EQ(event.areaId, HVAC_ALL); - EXPECT_THAT(event.prop, AnyOfArray(changedPropIds)); + for (const auto& event : events) { + EXPECT_EQ(event.areaId, areaId); + EXPECT_THAT(event.prop, AnyOfArray(changedPropIds)); + } } } -- GitLab From b9748bad632e92d36f70c8800d388c5f48a7924c Mon Sep 17 00:00:00 2001 From: Eric Jeong Date: Wed, 15 Feb 2023 12:48:45 -0800 Subject: [PATCH 002/376] 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 --- .../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 fbd1a3321d..49a950461c 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 291fa204b9..d9dfa2b4a2 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 3395458ea6..7be8399735 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 e74942f77a..9acffd0e20 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 b075993418..5d3e12ce5e 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 267b3dc26d..bf0a71f363 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 * -- GitLab From eb47a4729e339645d3e4f7c3701a37a18d30639f Mon Sep 17 00:00:00 2001 From: Terry Guan Date: Wed, 15 Feb 2023 13:19:16 -0800 Subject: [PATCH 003/376] Added Vendor Error Properties Bug: 269501288 Test: atest android.car.apitest.CarPropertyManagerTest Test: atest FakeVehicleHardwareTest Change-Id: Ia5ec83c750095774fe409edd6e3f2f6072987b9c --- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 1 + .../aidl/impl/default_config/config/TestProperties.json | 5 +++++ .../impl/fake_impl/hardware/src/FakeVehicleHardware.cpp | 9 ++++++++- .../fake_impl/hardware/test/FakeVehicleHardwareTest.cpp | 5 +++++ .../aidl/impl/utils/test/include/TestPropertyUtils.h | 7 +++++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 0111c6bc03..3b2aa8cdd2 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -127,6 +127,7 @@ const std::unordered_map CONSTANTS_BY_NAME = { #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES // Following are test properties: {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES}, + {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID}, {"kMixedTypePropertyForTest", kMixedTypePropertyForTest}, {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE}, {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY}, diff --git a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json index 33c6cc2397..fd4b0026bd 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json @@ -181,6 +181,11 @@ "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, + { + "property": "Constants::VENDOR_PROPERTY_ID", + "access": "VehiclePropertyAccess::READ_WRITE", + "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" + }, { "property": "VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index a9dced9f3a..00ebdda372 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -85,7 +85,8 @@ constexpr char OVERRIDE_CONFIG_DIR[] = "/vendor/etc/automotive/vhaloverride/"; // overwrite the default configs. constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override"; constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config"; - +// The value to be returned if VENDOR_PROPERTY_ID is set as the property +constexpr int VENDOR_ERROR_CODE = 0x00ab0005; // A list of supported options for "--set" command. const std::unordered_set SET_PROP_OPTIONS = { // integer. @@ -389,6 +390,9 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( case ECHO_REVERSE_BYTES: *isSpecialValue = true; return getEchoReverseBytes(value); + case VENDOR_PROPERTY_ID: + *isSpecialValue = true; + return StatusError((StatusCode)VENDOR_ERROR_CODE); default: // Do nothing. break; @@ -469,6 +473,9 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case OBD2_FREEZE_FRAME_CLEAR: *isSpecialValue = true; return mFakeObd2Frame->clearObd2FreezeFrames(value); + case VENDOR_PROPERTY_ID: + *isSpecialValue = true; + return StatusError((StatusCode)VENDOR_ERROR_CODE); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES case toInt(VehicleProperty::CLUSTER_REPORT_STATE): diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 67b1aa4c9c..f3593aa59b 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -409,6 +409,11 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } + if (propId == VENDOR_PROPERTY_ID) { + // Ignore VENDOR_PROPERTY_ID, it has special logic. + continue; + } + if (isGlobalProp(propId)) { if (config.initialValue == RawPropValues{}) { addGetValueRequest(getValueRequests, expectedGetValueResults, requestId++, diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h index e6ea6fef2e..14002884f5 100644 --- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h @@ -84,6 +84,13 @@ constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 | toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | toInt(testpropertyutils_impl::VehiclePropertyType::BYTES); +// This property is used for testing vendor error codes end to end. +// 0x21402a13 +constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 | + toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | + toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | + toInt(testpropertyutils_impl::VehiclePropertyType::INT32); + // This property is used for test purpose. End to end tests use this property to test set and get // method for MIXED type properties. constexpr int32_t kMixedTypePropertyForTest = -- GitLab From f68b9a270973151b7f78882db383d81c0c5a9145 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Wed, 15 Feb 2023 20:56:56 +0000 Subject: [PATCH 004/376] Wifi: Add support to query and use driver advertised interface combination Interface combinations in legacy-hal is predefined with 'WIFI_HAL_INTERFACE_COMBINATIONS' build flag. This change allows the WiFi HAL to request all the possible interface concurrency combinations via vendor HAL API, wifi_get_supported_iface_concurrency_matrix(). Thus build time dependency can be removed by querying the combination at runtime. Bug: 249351396 Change-Id: I3bc85ac013490949aab71a00f60028bf5daee68c Test: Build successfully Signed-off-by: Purushottam Kushwaha --- wifi/aidl/default/aidl_struct_util.cpp | 58 +++++++++++++++++++++ wifi/aidl/default/aidl_struct_util.h | 2 + wifi/aidl/default/wifi_chip.cpp | 31 +++++++++++ wifi/aidl/default/wifi_chip.h | 2 + wifi/aidl/default/wifi_legacy_hal.cpp | 8 +++ wifi/aidl/default/wifi_legacy_hal.h | 2 + wifi/aidl/default/wifi_legacy_hal_stubs.cpp | 1 + 7 files changed, 104 insertions(+) diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index efd6598d62..d3cf7bf60a 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -3300,6 +3300,64 @@ uint32_t convertAidlChannelCategoryToLegacy(uint32_t aidl_channel_category_mask) return channel_category_mask; } +bool convertLegacyIfaceMaskToIfaceConcurrencyType(u32 mask, + std::vector* types) { + if (!mask) return false; + +#ifndef BIT +#define BIT(x) (1 << (x)) +#endif + if (mask & BIT(WIFI_INTERFACE_TYPE_STA)) types->push_back(IfaceConcurrencyType::STA); + if (mask & BIT(WIFI_INTERFACE_TYPE_AP)) types->push_back(IfaceConcurrencyType::AP); + if (mask & BIT(WIFI_INTERFACE_TYPE_AP_BRIDGED)) + types->push_back(IfaceConcurrencyType::AP_BRIDGED); + if (mask & BIT(WIFI_INTERFACE_TYPE_P2P)) types->push_back(IfaceConcurrencyType::P2P); + if (mask & BIT(WIFI_INTERFACE_TYPE_NAN)) types->push_back(IfaceConcurrencyType::NAN_IFACE); + + return true; +} + +bool convertLegacyIfaceCombinationsMatrixToChipMode( + legacy_hal::wifi_iface_concurrency_matrix& legacy_matrix, IWifiChip::ChipMode* chip_mode) { + if (!chip_mode) { + LOG(ERROR) << "chip_mode is null"; + return false; + } + *chip_mode = {}; + + int num_combinations = legacy_matrix.num_iface_combinations; + std::vector driver_Combinations_vec; + if (!num_combinations) { + LOG(ERROR) << "zero iface combinations"; + return false; + } + + for (int i = 0; i < num_combinations; i++) { + IWifiChip::ChipConcurrencyCombination chipComb; + std::vector limits; + wifi_iface_combination* comb = &legacy_matrix.iface_combinations[i]; + if (!comb->num_iface_limits) continue; + for (u32 j = 0; j < comb->num_iface_limits; j++) { + IWifiChip::ChipConcurrencyCombinationLimit chipLimit; + chipLimit.maxIfaces = comb->iface_limits[j].max_limit; + std::vector types; + if (!convertLegacyIfaceMaskToIfaceConcurrencyType(comb->iface_limits[j].iface_mask, + &types)) { + LOG(ERROR) << "Failed to convert from iface_mask:" + << comb->iface_limits[j].iface_mask; + return false; + } + chipLimit.types = types; + limits.push_back(chipLimit); + } + chipComb.limits = limits; + driver_Combinations_vec.push_back(chipComb); + } + + chip_mode->availableCombinations = driver_Combinations_vec; + return true; +} + } // namespace aidl_struct_util } // namespace wifi } // namespace hardware diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h index 904ba81ad1..208b7344da 100644 --- a/wifi/aidl/default/aidl_struct_util.h +++ b/wifi/aidl/default/aidl_struct_util.h @@ -67,6 +67,8 @@ bool convertLegacyRadioCombinationsMatrixToAidl( WifiRadioCombinationMatrix* aidl_matrix); WifiBand convertLegacyMacBandToAidlWifiBand(uint32_t band); WifiAntennaMode convertLegacyAntennaConfigurationToAidl(uint32_t antenna_cfg); +bool convertLegacyIfaceCombinationsMatrixToChipMode( + legacy_hal::wifi_iface_concurrency_matrix& legacy_matrix, IWifiChip::ChipMode* chip_mode); // STA iface conversion methods. bool convertLegacyFeaturesToAidlStaCapabilities(uint64_t legacy_feature_set, uint32_t* aidl_caps); diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp index b4c2ccdbb9..bb3eaf0dad 100644 --- a/wifi/aidl/default/wifi_chip.cpp +++ b/wifi/aidl/default/wifi_chip.cpp @@ -377,6 +377,35 @@ WifiChip::WifiChip(int32_t chip_id, bool is_primary, debug_ring_buffer_cb_registered_(false), subsystemCallbackHandler_(handler) { setActiveWlanIfaceNameProperty(kNoActiveWlanIfaceNamePropertyValue); + using_dynamic_iface_combination_ = false; +} + +void WifiChip::retrieveDynamicIfaceCombination() { + if (using_dynamic_iface_combination_) return; + + legacy_hal::wifi_iface_concurrency_matrix legacy_matrix; + legacy_hal::wifi_error legacy_status; + + std::tie(legacy_status, legacy_matrix) = + legacy_hal_.lock()->getSupportedIfaceConcurrencyMatrix(); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + LOG(ERROR) << "Failed to get SupportedIfaceCombinations matrix from legacy HAL: " + << legacyErrorToString(legacy_status); + return; + } + + IWifiChip::ChipMode aidl_chip_mode; + if (!aidl_struct_util::convertLegacyIfaceCombinationsMatrixToChipMode(legacy_matrix, + &aidl_chip_mode)) { + LOG(ERROR) << "Failed convertLegacyIfaceCombinationsMatrixToChipMode() "; + return; + } + + LOG(INFO) << "Reloading iface concurrency combination from driver"; + aidl_chip_mode.id = feature_flags::chip_mode_ids::kV3; + modes_.clear(); + modes_.push_back(aidl_chip_mode); + using_dynamic_iface_combination_ = true; } std::shared_ptr WifiChip::create( @@ -1509,6 +1538,8 @@ ndk::ScopedAStatus WifiChip::handleChipConfiguration( version_info.first.firmwareDescription.c_str()); property_set("vendor.wlan.driver.version", version_info.first.driverDescription.c_str()); } + // Get the driver supported interface combination. + retrieveDynamicIfaceCombination(); return ndk::ScopedAStatus::ok(); } diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h index ff4ee9ce90..def5da0a6d 100644 --- a/wifi/aidl/default/wifi_chip.h +++ b/wifi/aidl/default/wifi_chip.h @@ -262,6 +262,7 @@ class WifiChip : public BnWifiChip { getSupportedRadioCombinationsMatrixInternal(); std::pair getWifiChipCapabilitiesInternal(); ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode); + void retrieveDynamicIfaceCombination(); void setWeakPtr(std::weak_ptr ptr); int32_t chip_id_; @@ -283,6 +284,7 @@ class WifiChip : public BnWifiChip { // registration mechanism. Use this to check if we have already // registered a callback. bool debug_ring_buffer_cb_registered_; + bool using_dynamic_iface_combination_; aidl_callback_util::AidlCallbackHandler event_cb_handler_; std::weak_ptr weak_ptr_this_; diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp index dbf5a68967..209670bc69 100644 --- a/wifi/aidl/default/wifi_legacy_hal.cpp +++ b/wifi/aidl/default/wifi_legacy_hal.cpp @@ -1885,6 +1885,14 @@ wifi_error WifiLegacyHal::setMloMode(wifi_mlo_mode mode) { return global_func_table_.wifi_set_mlo_mode(global_handle_, mode); } +std::pair +WifiLegacyHal::getSupportedIfaceConcurrencyMatrix() { + wifi_iface_concurrency_matrix iface_concurrency_matrix; + wifi_error status = global_func_table_.wifi_get_supported_iface_concurrency_matrix( + global_handle_, &iface_concurrency_matrix); + return {status, iface_concurrency_matrix}; +} + void WifiLegacyHal::invalidate() { global_handle_ = nullptr; iface_name_to_handle_.clear(); diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h index 1d59b17b8a..5168a8bccf 100644 --- a/wifi/aidl/default/wifi_legacy_hal.h +++ b/wifi/aidl/default/wifi_legacy_hal.h @@ -290,6 +290,7 @@ using ::WIFI_ERROR_UNINITIALIZED; using ::WIFI_ERROR_UNKNOWN; using ::wifi_gscan_capabilities; using ::wifi_hal_fn; +using ::wifi_iface_concurrency_matrix; using ::WIFI_INDOOR_CHANNEL; using ::wifi_information_element; using ::WIFI_INTERFACE_IBSS; @@ -779,6 +780,7 @@ class WifiLegacyHal { std::pair getWifiChipCapabilities(); wifi_error enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag); wifi_error setMloMode(wifi_mlo_mode mode); + std::pair getSupportedIfaceConcurrencyMatrix(); private: // Retrieve interface handles for all the available interfaces. diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp index 77d1cb5edc..b5196c9af6 100644 --- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp @@ -178,6 +178,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_nan_resume_request); populateStubFor(&hal_fn->wifi_set_scan_mode); populateStubFor(&hal_fn->wifi_set_mlo_mode); + populateStubFor(&hal_fn->wifi_get_supported_iface_concurrency_matrix); return true; } -- GitLab From 0b7c65255363ce0bfc52f753688152bf7396ae17 Mon Sep 17 00:00:00 2001 From: Xiang Wang Date: Wed, 15 Feb 2023 15:42:22 -0800 Subject: [PATCH 005/376] Move thermal utils to hardware/interfaces Bug: b/269370789 Test: m Change-Id: I67d035271c177dfee88ac7272baa7cc9cdef3e00 --- thermal/utils/Android.bp | 38 +++ thermal/utils/ThermalHidlWrapper.cpp | 305 ++++++++++++++++++ .../include/thermalutils/ThermalHidlWrapper.h | 106 ++++++ thermal/utils/tests/Android.bp | 40 +++ .../utils/tests/ThermalHidlWrapperTest.cpp | 302 +++++++++++++++++ 5 files changed, 791 insertions(+) create mode 100644 thermal/utils/Android.bp create mode 100644 thermal/utils/ThermalHidlWrapper.cpp create mode 100644 thermal/utils/include/thermalutils/ThermalHidlWrapper.h create mode 100644 thermal/utils/tests/Android.bp create mode 100644 thermal/utils/tests/ThermalHidlWrapperTest.cpp diff --git a/thermal/utils/Android.bp b/thermal/utils/Android.bp new file mode 100644 index 0000000000..72e1e34f9d --- /dev/null +++ b/thermal/utils/Android.bp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_library_static { + name: "libthermalutils", + vendor_available: true, + export_include_dirs: ["include"], + srcs: [ + "ThermalHidlWrapper.cpp", + ], + + cflags: [ + "-Wall", + "-Werror", + ], + + shared_libs: [ + "android.hardware.thermal@2.0", + "android.hardware.thermal-V1-ndk", + ], +} diff --git a/thermal/utils/ThermalHidlWrapper.cpp b/thermal/utils/ThermalHidlWrapper.cpp new file mode 100644 index 0000000000..05a992a792 --- /dev/null +++ b/thermal/utils/ThermalHidlWrapper.cpp @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "include/thermalutils/ThermalHidlWrapper.h" + +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace thermal { + +using ::android::hardware::Void; + +namespace { + +template +Return setFailureAndCallback(T _hidl_cb, hidl_vec data, std::string_view debug_msg) { + ThermalStatus status; + status.code = ThermalStatusCode::FAILURE; + status.debugMessage = debug_msg.data(); + _hidl_cb(status, data); + return Void(); +} + +template +Return setFailureAndCallback(T _hidl_cb, std::string_view debug_msg) { + ThermalStatus status; + status.code = ThermalStatusCode::FAILURE; + status.debugMessage = debug_msg.data(); + _hidl_cb(status); + return Void(); +} + +template +Return setInitFailureAndCallback(T _hidl_cb, hidl_vec data) { + return setFailureAndCallback( + _hidl_cb, data, "Thermal AIDL HAL client used by HIDL wrapper was not initialized"); +} + +template +Return setInitFailureAndCallback(T _hidl_cb) { + return setFailureAndCallback( + _hidl_cb, "Thermal AIDL HAL client used by HIDL wrapper was not initialized"); +} + +template +Return setUnsupportedFailureAndCallback(T _hidl_cb, hidl_vec data) { + return setFailureAndCallback(_hidl_cb, data, "Operation unsupported by Thermal HIDL wrapper"); +} + +TemperatureType_2_0 convertAidlTemperatureType(const TemperatureType& type) { + if (type < TemperatureType::CPU || type > TemperatureType::NPU) { + return TemperatureType_2_0::UNKNOWN; + } + return static_cast(type); +} + +CoolingType_2_0 convertAidlCoolingType(const CoolingType& type) { + if (type < CoolingType::FAN || type > CoolingType::COMPONENT) { + return CoolingType_2_0::COMPONENT; + } + return static_cast(type); +} + +Temperature_2_0 convertAidlTemperature(const Temperature& temperature) { + Temperature_2_0 t = Temperature_2_0{ + convertAidlTemperatureType(temperature.type), temperature.name, temperature.value, + static_cast(temperature.throttlingStatus)}; + return t; +} + +CoolingDevice_2_0 convertAidlCoolingDevice(const CoolingDevice& cooling_device) { + CoolingDevice_2_0 t = + CoolingDevice_2_0{convertAidlCoolingType(cooling_device.type), cooling_device.name, + static_cast(cooling_device.value)}; + return t; +} +TemperatureThreshold_2_0 convertAidlTemperatureThreshold(const TemperatureThreshold& threshold) { + TemperatureThreshold_2_0 t = + TemperatureThreshold_2_0{convertAidlTemperatureType(threshold.type), threshold.name, + threshold.hotThrottlingThresholds.data(), + threshold.coldThrottlingThresholds.data(), NAN}; + return t; +} + +} // namespace + +// Methods from ::android::hardware::thermal::V1_0::IThermal follow. +Return ThermalHidlWrapper::getTemperatures(getTemperatures_cb _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +Return ThermalHidlWrapper::getCpuUsages( + std::function&)> _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +Return ThermalHidlWrapper::getCoolingDevices( + std::function&)> _hidl_cb) { + hidl_vec ret_1_0; + setUnsupportedFailureAndCallback(_hidl_cb, ret_1_0); + return Void(); +} + +// Methods from ::android::hardware::thermal::V2_0::IThermal follow. +Return ThermalHidlWrapper::getCurrentTemperatures( + bool filterType, TemperatureType_2_0 type, + std::function&)> _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getTemperaturesWithType(static_cast(type), + &ret_aidl); + } else { + a_status = thermal_service_->getTemperatures(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& temperature : ret_aidl) { + ret.push_back(convertAidlTemperature(temperature)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::getTemperatureThresholds( + bool filterType, TemperatureType_2_0 type, + std::function&)> + _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getTemperatureThresholdsWithType( + static_cast(type), &ret_aidl); + } else { + a_status = thermal_service_->getTemperatureThresholds(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& threshold : ret_aidl) { + ret.push_back(convertAidlTemperatureThreshold(threshold)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::registerThermalChangedCallback( + const sp& callback, bool filterType, TemperatureType_2_0 type, + std::function _hidl_cb) { + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb); + } + if (callback == nullptr) { + setFailureAndCallback(_hidl_cb, "Invalid nullptr callback"); + return Void(); + } + std::lock_guard _lock(callback_wrappers_mutex_); + for (const auto& callback_wrapper : callback_wrappers_) { + if (::android::hardware::interfacesEqual(callback_wrapper->callback_2_0_.get(), + callback.get())) { + setFailureAndCallback(_hidl_cb, "The callback was already registered through wrapper"); + return Void(); + } + } + std::shared_ptr callback_wrapper = + ndk::SharedRefBase::make(callback); + ::ndk::ScopedAStatus a_status; + ThermalStatus status; + if (filterType) { + a_status = thermal_service_->registerThermalChangedCallbackWithType( + callback_wrapper, static_cast(type)); + } else { + a_status = thermal_service_->registerThermalChangedCallback(callback_wrapper); + } + if (a_status.isOk()) { + callback_wrappers_.push_back(callback_wrapper); + _hidl_cb(status); + } else { + setFailureAndCallback(_hidl_cb, a_status.getMessage()); + } + return Void(); +} + +Return ThermalHidlWrapper::unregisterThermalChangedCallback( + const sp& callback, + std::function _hidl_cb) { + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb); + } + if (callback == nullptr) { + setFailureAndCallback(_hidl_cb, "Invalid nullptr callback"); + return Void(); + } + std::lock_guard _lock(callback_wrappers_mutex_); + for (auto it = callback_wrappers_.begin(); it != callback_wrappers_.end(); it++) { + auto callback_wrapper = *it; + if (::android::hardware::interfacesEqual(callback_wrapper->callback_2_0_.get(), + callback.get())) { + ::ndk::ScopedAStatus a_status; + ThermalStatus status; + a_status = thermal_service_->unregisterThermalChangedCallback(callback_wrapper); + if (a_status.isOk()) { + callback_wrappers_.erase(it); + _hidl_cb(status); + } else { + setFailureAndCallback(_hidl_cb, a_status.getMessage()); + } + return Void(); + } + } + setFailureAndCallback(_hidl_cb, "The callback was not registered through wrapper before"); + return Void(); +} + +Return ThermalHidlWrapper::getCurrentCoolingDevices( + bool filterType, CoolingType_2_0 type, + std::function&)> _hidl_cb) { + hidl_vec ret_2_0; + if (!thermal_service_) { + setInitFailureAndCallback(_hidl_cb, ret_2_0); + } + + std::vector ret_aidl; + ThermalStatus status; + ::ndk::ScopedAStatus a_status; + if (filterType) { + a_status = thermal_service_->getCoolingDevicesWithType(static_cast(type), + &ret_aidl); + } else { + a_status = thermal_service_->getCoolingDevices(&ret_aidl); + } + if (a_status.isOk()) { + std::vector ret; + for (const auto& cooling_device : ret_aidl) { + ret.push_back(convertAidlCoolingDevice(cooling_device)); + } + _hidl_cb(status, hidl_vec(ret)); + } else { + setFailureAndCallback(_hidl_cb, ret_2_0, a_status.getMessage()); + } + return Void(); +} + +// Methods from ::android::hidl::base::V1_0::IBase follow. +Return ThermalHidlWrapper::debug(const hidl_handle& handle, + const hidl_vec& args) { + if (handle != nullptr && handle->numFds >= 1) { + int fd = handle->data[0]; + char** arr = new char*[args.size()]; + for (size_t i = 0; i < args.size(); i++) { + arr[i] = strdup(args[i].c_str()); + } + thermal_service_->dump(fd, (const char**)arr, args.size()); + } + return Void(); +} + +::ndk::ScopedAStatus ThermalHidlWrapper::IThermalChangedCallbackWrapper::notifyThrottling( + const Temperature& temperature) { + callback_2_0_->notifyThrottling(convertAidlTemperature(temperature)); + return ::ndk::ScopedAStatus::ok(); +} + +} // namespace thermal +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/thermal/utils/include/thermalutils/ThermalHidlWrapper.h b/thermal/utils/include/thermalutils/ThermalHidlWrapper.h new file mode 100644 index 0000000000..1fec10076f --- /dev/null +++ b/thermal/utils/include/thermalutils/ThermalHidlWrapper.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace thermal { + +using ::android::sp; +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_handle; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; + +using IThermal_Aidl = ::aidl::android::hardware::thermal::IThermal; +using ::android::hardware::thermal::V1_0::CpuUsage; +using CoolingType_2_0 = ::android::hardware::thermal::V2_0::CoolingType; +using CoolingDevice_1_0 = ::android::hardware::thermal::V1_0::CoolingDevice; +using CoolingDevice_2_0 = ::android::hardware::thermal::V2_0::CoolingDevice; +using IThermal_2_0 = ::android::hardware::thermal::V2_0::IThermal; +using IThermalChangedCallback_2_0 = ::android::hardware::thermal::V2_0::IThermalChangedCallback; +using Temperature_1_0 = ::android::hardware::thermal::V1_0::Temperature; +using Temperature_2_0 = ::android::hardware::thermal::V2_0::Temperature; +using TemperatureType_2_0 = ::android::hardware::thermal::V2_0::TemperatureType; + +using ::android::hardware::thermal::V1_0::ThermalStatus; +using ::android::hardware::thermal::V1_0::ThermalStatusCode; + +using TemperatureThreshold_2_0 = ::android::hardware::thermal::V2_0::TemperatureThreshold; +using ThrottlingSeverity_2_0 = ::android::hardware::thermal::V2_0::ThrottlingSeverity; + +// This wrapper converts all Thermal HIDL 2.0 calls to AIDL calls and converts AIDL response to +// HIDL 2.0 response. +// +// For Thermal HIDL 1.0 calls, it returns unsupported error. +class ThermalHidlWrapper : public IThermal_2_0 { + public: + explicit ThermalHidlWrapper(::std::shared_ptr thermal_service) + : thermal_service_(std::move(thermal_service)) {} + + // Methods from ::android::hardware::thermal::V1_0::IThermal follow. + Return getTemperatures(getTemperatures_cb _hidl_cb) override; + Return getCpuUsages(getCpuUsages_cb _hidl_cb) override; + Return getCoolingDevices(getCoolingDevices_cb _hidl_cb) override; + + // Methods from ::android::hardware::thermal::V2_0::IThermal follow. + Return getCurrentTemperatures(bool filterType, TemperatureType_2_0 type, + getCurrentTemperatures_cb _hidl_cb) override; + Return getTemperatureThresholds(bool filterType, TemperatureType_2_0 type, + getTemperatureThresholds_cb _hidl_cb) override; + Return registerThermalChangedCallback( + const sp& callback, bool filterType, + TemperatureType_2_0 type, registerThermalChangedCallback_cb _hidl_cb) override; + Return unregisterThermalChangedCallback( + const sp& callback, + unregisterThermalChangedCallback_cb _hidl_cb) override; + Return getCurrentCoolingDevices(bool filterType, CoolingType_2_0 type, + getCurrentCoolingDevices_cb _hidl_cb) override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + Return debug(const hidl_handle& handle, const hidl_vec& args) override; + + private: + class IThermalChangedCallbackWrapper : public BnThermalChangedCallback { + public: + explicit IThermalChangedCallbackWrapper(const sp& callback_2_0) + : callback_2_0_(callback_2_0) {} + ::ndk::ScopedAStatus notifyThrottling(const Temperature& temperature) override; + sp callback_2_0_; + }; + + // Reference to thermal service. + ::std::shared_ptr thermal_service_; + // Mutex lock for read/write on callback wrappers. + std::mutex callback_wrappers_mutex_; + // All thermal changed callback wrappers registered. + ::std::vector> callback_wrappers_; +}; + +} // namespace thermal +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/thermal/utils/tests/Android.bp b/thermal/utils/tests/Android.bp new file mode 100644 index 0000000000..fd74e8b4e8 --- /dev/null +++ b/thermal/utils/tests/Android.bp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +cc_test { + name: "ThermalHidlWrapperTest", + srcs: ["ThermalHidlWrapperTest.cpp"], + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + shared_libs: [ + "libbinder_ndk", + "android.hardware.thermal@1.0", + "android.hardware.thermal@2.0", + "android.hardware.thermal-V1-ndk", + ], + static_libs: [ + "libthermalutils", + "libgtest", + ], + test_suites: [ + "device-tests", + ], +} diff --git a/thermal/utils/tests/ThermalHidlWrapperTest.cpp b/thermal/utils/tests/ThermalHidlWrapperTest.cpp new file mode 100644 index 0000000000..1723a1afa8 --- /dev/null +++ b/thermal/utils/tests/ThermalHidlWrapperTest.cpp @@ -0,0 +1,302 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "thermal_hidl_wrapper_test" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::thermal { + +namespace { + +using ::android::sp; +using ::android::hardware::hidl_enum_range; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; + +using ::android::hardware::thermal::V1_0::ThermalStatus; +using ::android::hardware::thermal::V1_0::ThermalStatusCode; +using ::android::hardware::thermal::V2_0::CoolingDevice; +using ::android::hardware::thermal::V2_0::CoolingType; +using IThermal_2_0 = ::android::hardware::thermal::V2_0::IThermal; +using ::android::hardware::thermal::V2_0::IThermalChangedCallback; +using ::android::hardware::thermal::V2_0::Temperature; +using ::android::hardware::thermal::V2_0::TemperatureThreshold; +using ::android::hardware::thermal::V2_0::TemperatureType; +using ::android::hardware::thermal::V2_0::ThrottlingSeverity; + +constexpr char kCallbackNameNotifyThrottling[] = "notifyThrottling"; +static const Temperature kThrottleTemp = { + .type = TemperatureType::SKIN, + .name = "test temperature sensor", + .value = 98.6, + .throttlingStatus = ThrottlingSeverity::CRITICAL, +}; + +class ThermalCallbackArgs { + public: + Temperature temperature; +}; + +// Callback class for receiving thermal event notifications from main class +class ThermalCallback : public ::testing::VtsHalHidlTargetCallbackBase, + public IThermalChangedCallback { + public: + Return notifyThrottling(const Temperature& temperature) override { + ThermalCallbackArgs args; + args.temperature = temperature; + NotifyFromCallback(kCallbackNameNotifyThrottling, args); + return Void(); + } +}; + +// The main test class for THERMAL HIDL HAL 2.0. +class ThermalHidlWrapperTest : public ::testing::TestWithParam { + public: + void SetUp() override { + AIBinder* binder = AServiceManager_waitForService(GetParam().c_str()); + ASSERT_NE(binder, nullptr); + mThermal = sp::make(IThermal::fromBinder(ndk::SpAIBinder(binder))); + ASSERT_NE(mThermal, nullptr); + mThermalCallback = new (std::nothrow) ThermalCallback(); + ASSERT_NE(mThermalCallback, nullptr); + auto ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail if register again + ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + } + + void TearDown() override { + auto ret = mThermal->unregisterThermalChangedCallback( + mThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail if unregister again + ret = mThermal->unregisterThermalChangedCallback( + mThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + } + + protected: + sp mThermal; + sp mThermalCallback; +}; // class ThermalHidlWrapperTest + +// Test ThermalChangedCallback::notifyThrottling(). +// This just calls into and back from our local ThermalChangedCallback impl. +TEST_P(ThermalHidlWrapperTest, NotifyThrottlingTest) { + sp thermalCallback = new (std::nothrow) ThermalCallback(); + auto ret = thermalCallback->notifyThrottling(kThrottleTemp); + ASSERT_TRUE(ret.isOk()); + auto res = thermalCallback->WaitForCallback(kCallbackNameNotifyThrottling); + EXPECT_TRUE(res.no_timeout); + ASSERT_TRUE(res.args); + EXPECT_EQ(kThrottleTemp, res.args->temperature); +} + +// Test Thermal->registerThermalChangedCallback. +TEST_P(ThermalHidlWrapperTest, RegisterThermalChangedCallbackTest) { + // Expect to fail with same callback + auto ret = mThermal->registerThermalChangedCallback( + mThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail with null callback + ret = mThermal->registerThermalChangedCallback( + nullptr, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); }); + ASSERT_TRUE(ret.isOk()); + sp localThermalCallback = new (std::nothrow) ThermalCallback(); + // Expect to succeed with different callback + ret = mThermal->registerThermalChangedCallback( + localThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Remove the local callback + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail with null callback + ret = mThermal->unregisterThermalChangedCallback(nullptr, [](ThermalStatus status) { + EXPECT_EQ(ThermalStatusCode::FAILURE, status.code); + }); + ASSERT_TRUE(ret.isOk()); +} + +// Test Thermal->unregisterThermalChangedCallback. +TEST_P(ThermalHidlWrapperTest, UnregisterThermalChangedCallbackTest) { + sp localThermalCallback = new (std::nothrow) ThermalCallback(); + // Expect to fail as the callback was not registered before + auto ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Register a local callback + ret = mThermal->registerThermalChangedCallback( + localThermalCallback, false, TemperatureType::SKIN, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to succeed with callback removed + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); + // Expect to fail as the callback has been unregistered already + ret = mThermal->unregisterThermalChangedCallback( + localThermalCallback, + [](ThermalStatus status) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); }); + ASSERT_TRUE(ret.isOk()); +} + +// Sanity test for Thermal::getCurrentTemperatures(). +TEST_P(ThermalHidlWrapperTest, TemperatureTest) { + mThermal->getCurrentTemperatures(false, TemperatureType::SKIN, + [](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_LT(0u, temperatures[i].name.size()); + } + }); + auto types = hidl_enum_range(); + for (const auto& type : types) { + mThermal->getCurrentTemperatures( + true, type, [&type](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_EQ(type, temperatures[i].type); + EXPECT_LT(0u, temperatures[i].name.size()); + } + }); + } +} + +// Sanity test for Thermal::getTemperatureThresholds(). +TEST_P(ThermalHidlWrapperTest, TemperatureThresholdTest) { + mThermal->getTemperatureThresholds( + false, TemperatureType::SKIN, + [](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + }); + for (int i = static_cast(TemperatureType::UNKNOWN); + i <= static_cast(TemperatureType::POWER_AMPLIFIER); ++i) { + auto type = static_cast(i); + mThermal->getTemperatureThresholds( + true, type, + [&type](ThermalStatus status, hidl_vec temperatures) { + if (temperatures.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < temperatures.size(); ++i) { + EXPECT_EQ(type, temperatures[i].type); + } + }); + } +} + +// Sanity test for Thermal::getCurrentCoolingDevices(). +TEST_P(ThermalHidlWrapperTest, CoolingDeviceTest) { + mThermal->getCurrentCoolingDevices( + false, CoolingType::CPU, + [](ThermalStatus status, hidl_vec cooling_devices) { + if (cooling_devices.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < cooling_devices.size(); ++i) { + EXPECT_LT(0u, cooling_devices[i].name.size()); + } + }); + for (int i = 0; i <= static_cast(CoolingType::COMPONENT); ++i) { + auto type = static_cast(i); + mThermal->getCurrentCoolingDevices( + true, type, [&type](ThermalStatus status, hidl_vec cooling_devices) { + if (cooling_devices.size()) { + EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code); + } else { + EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); + } + for (int i = 0; i < cooling_devices.size(); ++i) { + EXPECT_EQ(type, cooling_devices[i].type); + EXPECT_LT(0u, cooling_devices[i].name.size()); + } + }); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThermalHidlWrapperTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, ThermalHidlWrapperTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IThermal::descriptor)), + ::android::hardware::PrintInstanceNameToString); + +} // namespace + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ABinderProcess_setThreadPoolMaxThreadCount(1); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} + +} // namespace aidl::android::hardware::thermal -- GitLab From c48b3aed3e4f2211fb601948d99c48af24dcf7d7 Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 2 Feb 2023 01:10:33 +0000 Subject: [PATCH 006/376] Added CRUISE_CONTROL_TARGET_SPEED to HAL layer. Bug: 266861469 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: Ie156bf9df65024bc39e4a1cd40fa870aa69d3a57 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../config/DefaultProperties.json | 15 +++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 19 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 45 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 1d2d910031..7d2c6b1743 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -263,6 +263,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE}, + {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 613636e81c..21cdf225cf 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -263,6 +263,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::CRUISE_CONTROL_TYPE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index f83f1c260e..90c66820ab 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -255,6 +255,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index f0642fe379..b02906514d 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -255,6 +255,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index a0e811579a..c383b99b37 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3207,6 +3207,21 @@ } ] }, + { + "property": "VehicleProperty::CRUISE_CONTROL_TARGET_SPEED", + "defaultValue": { + "floatValues": [ + 25.0 + ] + }, + "areas": [ + { + "areaId": 0, + "minFloatValue": 20.0, + "maxFloatValue": 35.0 + } + ] + }, { "property": "VehicleProperty::HANDS_ON_DETECTION_ENABLED", "defaultValue": { 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 bbec4bf595..7aac30bcde 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 @@ -261,6 +261,7 @@ enum VehicleProperty { CRUISE_CONTROL_TYPE = (((0x1010 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411088 */, CRUISE_CONTROL_STATE = (((0x1011 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411089 */, CRUISE_CONTROL_COMMAND = (((0x1012 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411090 */, + CRUISE_CONTROL_TARGET_SPEED = (((0x1013 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291508243 */, HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, DRIVER_ATTENTION_MONITORING_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */, } 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 68a1e324ee..cdeed851a3 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3930,6 +3930,25 @@ enum VehicleProperty { CRUISE_CONTROL_COMMAND = 0x1012 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Current target speed for Cruise Control (CC). + * + * OEMs should set the minInt32Value and maxInt32Value values for this property to define the + * min and max target speed values. These values must be non-negative. + * + * The maxFloatValue represents the upper bound of the target speed. + * The minFloatValue represents the lower bound of the target speed. + * + * When this property is not available (for example when CRUISE_CONTROL_ENABLED is false), it + * should return StatusCode.NOT_AVAILABLE_DISABLED. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:METER_PER_SEC + */ + CRUISE_CONTROL_TARGET_SPEED = + 0x1013 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT, + /** * Enable or disable hands on detection (HOD). * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index efbcf47680..f18f9e0cb4 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -534,6 +534,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlCommandConfig) { VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTargetSpeedConfig) { + verifyProperty(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) { verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, -- GitLab From 17cc5164b8e8fb0062b12077d042c1ee2a7f1048 Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 2 Feb 2023 19:22:50 +0000 Subject: [PATCH 007/376] Added ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP to HAL layer. Bug: 266866449 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: Ibe1a9cdcc6a82e20f4c0524b362ea52d3ca02f25 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../config/DefaultProperties.json | 16 ++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 22 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 49 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 7d2c6b1743..ec911369a7 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -264,6 +264,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE}, {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 21cdf225cf..8817e391f9 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -264,6 +264,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::CRUISE_CONTROL_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 90c66820ab..fe31805272 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -256,6 +256,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index b02906514d..e7cb0f19d1 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -256,6 +256,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index c383b99b37..f8278910ef 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3222,6 +3222,22 @@ } ] }, + { + "property": "VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP", + "defaultValue": { + "int32Values": [ + 1200 + ] + }, + "configArray": [ + 1200, + 1400, + 1600, + 1800, + 2000, + 2200 + ] + }, { "property": "VehicleProperty::HANDS_ON_DETECTION_ENABLED", "defaultValue": { 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 7aac30bcde..a06e6d0bff 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 @@ -262,6 +262,7 @@ enum VehicleProperty { CRUISE_CONTROL_STATE = (((0x1011 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411089 */, CRUISE_CONTROL_COMMAND = (((0x1012 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411090 */, CRUISE_CONTROL_TARGET_SPEED = (((0x1013 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291508243 */, + ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = (((0x1014 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411092 */, HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, DRIVER_ATTENTION_MONITORING_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */, } 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 cdeed851a3..af9259f9f4 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3949,6 +3949,28 @@ enum VehicleProperty { CRUISE_CONTROL_TARGET_SPEED = 0x1013 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT, + /** + * Current target time gap for Adaptive Cruise Control (ACC) or Predictive Cruise Control in + * milliseconds. + * + * This property should specify the target time gap to a leading vehicle. This gap is defined as + * the time to travel the distance between the leading vehicle's rear-most point to the ACC + * vehicle's front-most point. The actual time gap from a leading vehicle can be above or below + * this value. + * + * The possible values to set for the target time gap should be specified in configArray in + * ascending order. All values must be positive. If the property is writable, all values must be + * writable. + * + * Writing to this property when it is not available should return StatusCode.NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @unit VehicleUnit:MILLI_SECS + */ + ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = + 0x1014 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** * Enable or disable hands on detection (HOD). * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index f18f9e0cb4..80fc5db01e 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -540,6 +540,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCruiseControlTargetSpeedConfig) VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAdaptiveCruiseControlTargetTimeGapConfig) { + verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) { verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, -- GitLab From c11c13a7749b15d7830a172d25523ffb4b3d8d14 Mon Sep 17 00:00:00 2001 From: shrikar Date: Fri, 3 Feb 2023 00:20:04 +0000 Subject: [PATCH 008/376] Added ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE to HAL. Bug: 266861470 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I586f75dea83f52dda4dd2c776aec1d5af417263b --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../config/DefaultProperties.json | 17 ++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 22 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 7 ++++++ 8 files changed, 51 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index ec911369a7..43036a6bf9 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -265,6 +265,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyAccess::WRITE}, {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess::READ}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess::READ}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 8817e391f9..7839404fa2 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -265,6 +265,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode::CONTINUOUS}, {VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index fe31805272..d51b03d649 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -257,6 +257,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index e7cb0f19d1..55c7e69aa0 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -257,6 +257,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CRUISE_CONTROL_TARGET_SPEED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode.CONTINUOUS), Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_ATTENTION_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index f8278910ef..2cf31bc2f2 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3238,6 +3238,23 @@ 2200 ] }, + { + "property": "VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE", + "defaultValue": { + "int32Values": [ + 100000 + ] + }, + "areas": [ + { + "areaId": 0, + "minInt32Value": 0, + "maxInt32Value": 200000 + } + ], + "maxSampleRate": 10.0, + "minSampleRate": 1.0 + }, { "property": "VehicleProperty::HANDS_ON_DETECTION_ENABLED", "defaultValue": { 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 a06e6d0bff..d2c186acb6 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 @@ -263,6 +263,7 @@ enum VehicleProperty { CRUISE_CONTROL_COMMAND = (((0x1012 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411090 */, CRUISE_CONTROL_TARGET_SPEED = (((0x1013 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291508243 */, ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = (((0x1014 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411092 */, + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE = (((0x1015 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411093 */, HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */, DRIVER_ATTENTION_MONITORING_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */, } 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 af9259f9f4..cf5a074251 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3971,6 +3971,28 @@ enum VehicleProperty { ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = 0x1014 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Measured distance from leading vehicle when using Adaptive Cruise Control (ACC) or + * Predictive Cruise Control. + * + * Returns the measured distance in millimeters between the rear-most point of the leading + * vehicle and the front-most point of the ACC vehicle. + * + * The minInt32Value should be 0. + * The maxInt32Value should be populated with the maximum range the distance sensor can support. + * This value should be non-negative. + * + * When no lead vehicle is detected (that is, when there is no leading vehicle or the leading + * vehicle is too far away for the sensor to detect), this property should return + * StatusCode.NOT_AVAILABLE. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:MILLIMETER + */ + ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE = + 0x1015 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** * Enable or disable hands on detection (HOD). * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 80fc5db01e..8b61980870 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -546,6 +546,13 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyAdaptiveCruiseControlTargetTimeG VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, + verifyAdaptiveCruiseControlLeadVehicleMeasuredDistanceConfig) { + verifyProperty(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHandsOnDetectionEnabledConfig) { verifyProperty(VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, -- GitLab From 59ffe92c9e2c2113b5b26020fd05f8536373c4d5 Mon Sep 17 00:00:00 2001 From: Austin Delgado Date: Thu, 16 Feb 2023 11:34:50 -0800 Subject: [PATCH 009/376] Update fingerprint AIDL for Android U 1. Adds sensor shape and touch detection configuration. 2. Adds onPointerCancelWithContext and setIgnoreDisplayTouches. 3. Adds LIFT_TOO_SOON constant to AcquiredInfo. 4. Deprecates SensorLocation displayId, onPointerDown, and onPointerUp. Bug: 266476972 Test: m android.hardware.biometrics.fingerprint-update-api Test: built locally Change-Id: I3aae3c7f8a65d5805f3dd583330407c255ca1369 --- .../biometrics/fingerprint/AcquiredInfo.aidl | 27 +++---- .../biometrics/fingerprint/Error.aidl | 18 ++--- .../fingerprint/FingerprintSensorType.aidl | 12 ++-- .../biometrics/fingerprint/ISession.aidl | 8 +++ .../fingerprint/PointerContext.aidl | 12 ++-- .../fingerprint/SensorLocation.aidl | 4 ++ .../biometrics/fingerprint/SensorProps.aidl | 1 + .../biometrics/fingerprint/SensorShape.aidl | 40 +++++++++++ .../fingerprint/TouchDetectionParameters.aidl | 40 +++++++++++ .../biometrics/fingerprint/AcquiredInfo.aidl | 5 ++ .../biometrics/fingerprint/ISession.aidl | 70 ++++++++++++++++++- .../fingerprint/SensorLocation.aidl | 11 ++- .../biometrics/fingerprint/SensorProps.aidl | 7 ++ .../biometrics/fingerprint/SensorShape.aidl | 29 ++++++++ .../fingerprint/TouchDetectionParameters.aidl | 36 ++++++++++ .../fingerprint/aidl/default/Fingerprint.cpp | 3 +- .../fingerprint/aidl/default/Session.cpp | 8 +++ .../aidl/default/include/Session.h | 4 ++ 18 files changed, 297 insertions(+), 38 deletions(-) create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl create mode 100644 biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl create mode 100644 biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl create mode 100644 biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index 0cc619f991..89f76f437b 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -35,17 +35,18 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum AcquiredInfo { - UNKNOWN = 0, - GOOD = 1, - PARTIAL = 2, - INSUFFICIENT = 3, - SENSOR_DIRTY = 4, - TOO_SLOW = 5, - TOO_FAST = 6, - VENDOR = 7, - START = 8, - TOO_DARK = 9, - TOO_BRIGHT = 10, - IMMOBILE = 11, - RETRYING_CAPTURE = 12, + UNKNOWN, + GOOD, + PARTIAL, + INSUFFICIENT, + SENSOR_DIRTY, + TOO_SLOW, + TOO_FAST, + VENDOR, + START, + TOO_DARK, + TOO_BRIGHT, + IMMOBILE, + RETRYING_CAPTURE, + LIFT_TOO_SOON, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl index 45ce2eb3fe..d3592a1f09 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl @@ -35,13 +35,13 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum Error { - UNKNOWN = 0, - HW_UNAVAILABLE = 1, - UNABLE_TO_PROCESS = 2, - TIMEOUT = 3, - NO_SPACE = 4, - CANCELED = 5, - UNABLE_TO_REMOVE = 6, - VENDOR = 7, - BAD_CALIBRATION = 8, + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + BAD_CALIBRATION, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl index 67af20d872..381aaf7365 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl @@ -35,10 +35,10 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @Backing(type="byte") @VintfStability enum FingerprintSensorType { - UNKNOWN = 0, - REAR = 1, - UNDER_DISPLAY_ULTRASONIC = 2, - UNDER_DISPLAY_OPTICAL = 3, - POWER_BUTTON = 4, - HOME_BUTTON = 5, + UNKNOWN, + REAR, + UNDER_DISPLAY_ULTRASONIC, + UNDER_DISPLAY_OPTICAL, + POWER_BUTTON, + HOME_BUTTON, } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl index f30585529d..4fdcefc8ff 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl @@ -46,7 +46,13 @@ interface ISession { void invalidateAuthenticatorId(); void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); void close(); + /** + * @deprecated use onPointerDownWithContext instead. + */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); + /** + * @deprecated use onPointerUpWithContext instead. + */ void onPointerUp(in int pointerId); void onUiReady(); android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); @@ -55,4 +61,6 @@ interface ISession { void onPointerDownWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + void onPointerCancelWithContext(in android.hardware.biometrics.fingerprint.PointerContext context); + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl index 999b324abd..d9bf0854ca 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/PointerContext.aidl @@ -35,12 +35,12 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @JavaDerive(equals=true) @VintfStability parcelable PointerContext { - int pointerId = -1; - float x = 0.000000f; - float y = 0.000000f; - float minor = 0.000000f; - float major = 0.000000f; - float orientation = 0.000000f; + int pointerId = (-1) /* -1 */; + float x = 0f; + float y = 0f; + float minor = 0f; + float major = 0f; + float orientation = 0f; boolean isAod = false; long time = 0; long gestureStart = 0; diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl index dc6a62de6b..965576e822 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -35,9 +35,13 @@ package android.hardware.biometrics.fingerprint; /* @hide */ @VintfStability parcelable SensorLocation { + /** + * @deprecated use the display field instead. This field was never used. + */ int displayId; int sensorLocationX; int sensorLocationY; int sensorRadius; String display = ""; + android.hardware.biometrics.fingerprint.SensorShape sensorShape = android.hardware.biometrics.fingerprint.SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl index a77d5f2eee..a97d819dba 100644 --- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -42,4 +42,5 @@ parcelable SensorProps { boolean supportsDetectInteraction; boolean halHandlesDisplayTouches; boolean halControlsIllumination; + @nullable android.hardware.biometrics.fingerprint.TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..f673b1c806 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@Backing(type="byte") @VintfStability +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..2e3ec4f574 --- /dev/null +++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.fingerprint; +/* @hide */ +@VintfStability +parcelable TouchDetectionParameters { + float targetSize = 1.0f; + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl index d3aa98a87d..2cdc196f41 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl @@ -98,4 +98,9 @@ enum AcquiredInfo { * However, RETRYING_CAPTURE must not be sent after ACQUIRED_GOOD is sent. */ RETRYING_CAPTURE, + + /** + * Fingerprint was lifted before the capture completed. + */ + LIFT_TOO_SOON, } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl index f4f7804f52..83e7bbc43f 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl @@ -420,6 +420,8 @@ interface ISession { * @param y The distance in pixels from the top edge of the display. * @param minor See android.view.MotionEvent#getTouchMinor * @param major See android.view.MotionEvent#getTouchMajor + * + * @deprecated use onPointerDownWithContext instead. */ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major); @@ -434,6 +436,8 @@ interface ISession { * ISession#enroll, ISession#detectInteraction. * * @param pointerId See android.view.MotionEvent#getPointerId + * + * @deprecated use onPointerUpWithContext instead. */ void onPointerUp(in int pointerId); @@ -469,15 +473,77 @@ interface ISession { /** See ISession#detectInteraction() */ ICancellationSignal detectInteractionWithContext(in OperationContext context); - /** See ISession#onPointerDown(int, int, int, float, float) */ + /** + * onPointerDownWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked erroneously by the framework for sensors + * of other types, the HAL must treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger entered the sensor area. This operation can be invoked + * regardless of the current state of the HAL. + * + * Note that for sensors which require illumination, for example + * FingerprintSensorType::UNDER_DISPLAY_OPTICAL, this is a good time to start illuminating. + * + * @param context See PointerContext + */ void onPointerDownWithContext(in PointerContext context); - /** See ISession#onPointerUp(int) */ + /** + * onPointerUpWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that a finger left the sensor area. This operation can be invoked regardless + * of the current state of the HAL. + * + * @param context See PointerContext + */ void onPointerUpWithContext(in PointerContext context); /** + * onContextChanged: + * * This may be called while an authenticate, detect interaction, or enrollment operation is * running when the context changes. */ void onContextChanged(in OperationContext context); + + /** + * onPointerCancelWithContext: + * + * This operation only applies to sensors that are configured as + * FingerprintSensorType::UNDER_DISPLAY_*. If invoked for sensors of other types, the HAL must + * treat this as a no-op and return immediately. + * + * Notifies the HAL that if there were fingers within the sensor area, they are no longer being + * tracked. The fingers may or may not still be on the sensor. This operation can be invoked + * regardless of the current state of the HAL. + * + * @param context See PointerContext + */ + void onPointerCancelWithContext(in PointerContext context); + + /** + * setIgnoreDisplayTouches: + * + * This operation only applies to sensors that have SensorProps#halHandlesDisplayTouches + * set to true. For all other sensors this is a no-op. + * + * Instructs the HAL whether to ignore display touches. This can be useful to avoid unintended + * fingerprint captures during certain UI interactions. For example, when entering a lockscreen + * PIN, some of the touches might overlap with the fingerprint sensor. Those touches should be + * ignored to avoid unintended authentication attempts. + * + * This flag must default to false when the HAL starts. + * + * The framework is responsible for both setting the flag to true and resetting it to false + * whenever it's appropriate. + * + * @param shouldIgnore whether the display touches should be ignored. + */ + void setIgnoreDisplayTouches(in boolean shouldIgnore); } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl index a065a7ce7b..fd8c7fc2d5 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorLocation.aidl @@ -15,13 +15,16 @@ */ package android.hardware.biometrics.fingerprint; + +import android.hardware.biometrics.fingerprint.SensorShape; + /** * @hide */ @VintfStability parcelable SensorLocation { /** - * Deprecated use the display field instead. This field was never used. + * @deprecated use the display field instead. This field was never used. */ int displayId; @@ -59,4 +62,10 @@ parcelable SensorLocation { * for each display from which the sensor is accessible from. */ String display = ""; + + /** + * The shape of the sensor if applicable. Most useful for the sensor of type + * SensorType::UNDER_DISPLAY_*. + */ + SensorShape sensorShape = SensorShape.CIRCLE; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl index d4e9ec6f38..853aae48ad 100644 --- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl @@ -19,6 +19,8 @@ package android.hardware.biometrics.fingerprint; import android.hardware.biometrics.common.CommonProps; import android.hardware.biometrics.fingerprint.FingerprintSensorType; import android.hardware.biometrics.fingerprint.SensorLocation; +import android.hardware.biometrics.fingerprint.TouchDetectionParameters; + /** * @hide */ @@ -72,4 +74,9 @@ parcelable SensorProps { * This value must be ignored for sensors that aren't optical UDFPS. */ boolean halControlsIllumination; + + /** + * Parameters used for fingerprint touch detection. + */ + @nullable TouchDetectionParameters touchDetectionParameters; } diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl new file mode 100644 index 0000000000..1279332ce0 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorShape.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; +/** + * This is most useful for sensors configured as FingerprintSensorType::UNDER_DISPLAY_OPTICAL, + * as it's used to compute the on-screen sensor boundaries for the touch detection algorithm. + * + * @hide + */ +@VintfStability +@Backing(type="byte") +enum SensorShape { + SQUARE, + CIRCLE, +} diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl new file mode 100644 index 0000000000..bf117a33e6 --- /dev/null +++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/TouchDetectionParameters.aidl @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.biometrics.fingerprint; + +/** + * @hide + */ +@VintfStability +parcelable TouchDetectionParameters { + /** + * The percentage of the sensor that is considered the target. Value is required to be within + * [0.0, 1.0]. The target area expands outwards from center matching the sensorShape. Some + * portion of the touch must be within the target to be considered a valid touch. + */ + float targetSize = 1.0f; + + /** + * The minimum percentage overlap needed on the sensor to be considered a valid touch. Value is + * required to be within [0.0, 1.0]. + */ + float minOverlap = 0.0f; +} diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp index be932246bd..7808a13d16 100644 --- a/biometrics/fingerprint/aidl/default/Fingerprint.cpp +++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp @@ -90,7 +90,8 @@ ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector* out) { navigationGuesture, detectInteraction, displayTouch, - controlIllumination}}; + controlIllumination, + std::nullopt}}; return ndk::ScopedAStatus::ok(); } diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp index 7ab5af3c4d..38d6a134e2 100644 --- a/biometrics/fingerprint/aidl/default/Session.cpp +++ b/biometrics/fingerprint/aidl/default/Session.cpp @@ -289,4 +289,12 @@ ndk::ScopedAStatus Session::onContextChanged(const common::OperationContext& /*c return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Session::onPointerCancelWithContext(const PointerContext& /*context*/) { + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus Session::setIgnoreDisplayTouches(bool /*shouldIgnore*/) { + return ndk::ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::biometrics::fingerprint diff --git a/biometrics/fingerprint/aidl/default/include/Session.h b/biometrics/fingerprint/aidl/default/include/Session.h index 104d819ff0..b596d9e2a9 100644 --- a/biometrics/fingerprint/aidl/default/include/Session.h +++ b/biometrics/fingerprint/aidl/default/include/Session.h @@ -97,6 +97,10 @@ class Session : public BnSession { ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override; + ndk::ScopedAStatus onPointerCancelWithContext(const PointerContext& context) override; + + ndk::ScopedAStatus setIgnoreDisplayTouches(bool shouldIgnore) override; + bool isClosed(); private: -- GitLab From 309d1c22ab6546f47959c4f7584a1661a76506e9 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 14 Feb 2023 02:57:17 +0000 Subject: [PATCH 010/376] Added LOCATION_CHARACTERIZATION to HAL layer. Bug: 269141226 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: Ia53508f032d905b8f211606238bb6c650f787d2b --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 8 ++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/LocationCharacterization.aidl | 46 ++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/LocationCharacterization.aidl | 73 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 14 ++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 12 files changed, 156 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 2335d6d564..f4104400d0 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -191,6 +191,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index a0911c5ca0..83781e0351 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -191,6 +191,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index e9670c1e97..c6363fe724 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -183,6 +183,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 2513e4ecd2..f847b2756a 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -183,6 +183,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.GLOVE_BOX_DOOR_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index ff601e0342..9af0eeee3e 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -57,6 +57,7 @@ using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; +using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; @@ -199,6 +200,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["VehiclePropertyChangeMode"] = std::make_unique>(); + mConstantParsersByType["LocationCharacterization"] = + std::make_unique>(); mConstantParsersByType["VehicleGear"] = std::make_unique>(); mConstantParsersByType["VehicleAreaWindow"] = std::make_unique>(); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 85a7486a40..5924c88857 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3129,6 +3129,14 @@ { "property": "VehicleProperty::VEHICLE_MAP_SERVICE" }, + { + "property": "VehicleProperty::LOCATION_CHARACTERIZATION", + "defaultValue": { + "int32Values": [ + "LocationCharacterization::RAW_GNSS_ONLY" + ] + } + }, { "property": "VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index fc0c8db1e4..7db4246333 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl new file mode 100644 index 0000000000..27abe417dc --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LocationCharacterization.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LocationCharacterization { + PRIOR_LOCATIONS = 0x1, + GYROSCOPE_FUSION = 0x2, + ACCELEROMETER_FUSION = 0x4, + COMPASS_FUSION = 0x8, + WHEEL_SPEED_FUSION = 0x10, + STEERING_ANGLE_FUSION = 0x20, + CAR_SPEED_FUSION = 0x40, + DEAD_RECKONED = 0x80, + RAW_GNSS_ONLY = 0x100, +} 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 a525ab0623..9c754e5f25 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 @@ -189,6 +189,7 @@ enum VehicleProperty { GLOVE_BOX_DOOR_POS = (((0x0BF0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518896 */, GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */, VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */, + LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl new file mode 100644 index 0000000000..e06df40c90 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LocationCharacterization.aidl @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used by LOCATION_CHARACTERIZATION to enumerate the supported bit flags. + * + * These flags are used to indicate to what transformations are performed on the + * GNSS data before the location data is sent, so that location processing + * algorithms can take into account prior fusion. + * + * This enum can be extended in future releases to include additional bit flags. + */ +@VintfStability +@Backing(type="int") +enum LocationCharacterization { + /** + * Prior location samples have been used to refine the raw GNSS data (e.g. a + * Kalman Filter). + */ + PRIOR_LOCATIONS = 0x1, + /** + * Gyroscope data has been used to refine the raw GNSS data. + */ + GYROSCOPE_FUSION = 0x2, + /** + * Accelerometer data has been used to refine the raw GNSS data. + */ + ACCELEROMETER_FUSION = 0x4, + /** + * Compass data has been used to refine the raw GNSS data. + */ + COMPASS_FUSION = 0x8, + /** + * Wheel speed has been used to refine the raw GNSS data. + */ + WHEEL_SPEED_FUSION = 0x10, + /** + * Steering angle has been used to refine the raw GNSS data. + */ + STEERING_ANGLE_FUSION = 0x20, + /** + * Car speed has been used to refine the raw GNSS data. + */ + CAR_SPEED_FUSION = 0x40, + /** + * Some effort is made to dead-reckon location. In particular, this means that + * relative changes in location have meaning when no GNSS satellite is + * available. + */ + DEAD_RECKONED = 0x80, + /** + * Location is based on GNSS satellite signals without sufficient fusion of + * other sensors for complete dead reckoning. This flag should be set when + * relative changes to location cannot be relied on when no GNSS satellite is + * available. + */ + RAW_GNSS_ONLY = 0x100, +} 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 b350f90a7e..1f535c4c0f 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2347,6 +2347,20 @@ enum VehicleProperty { */ VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000 + 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED + /** + * Characterization of inputs used for computing location. + * + * This property must indicate what (if any) data and sensor inputs are considered by the system + * when computing the vehicle's location that is shared with Android through the GNSS HAL. + * + * The value must return a collection of bit flags. The bit flags are defined in + * LocationCharacterization. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + LOCATION_CHARACTERIZATION = + 0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 51cc3765da..ddd8462f1f 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -498,6 +498,12 @@ void VtsHalAutomotiveVehicleTargetTest::verifyProperty(VehicleProperty propId, actualPropertyType); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) { + verifyProperty(VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 588b958ce1b50d42581e67a664b32e2f25f37712 Mon Sep 17 00:00:00 2001 From: Paul Colta Date: Thu, 23 Feb 2023 10:44:32 +0100 Subject: [PATCH 011/376] Handle portId out of bounds index Bug: 268631136 Test: m && m android.hardware.tv.cec@1.0-impl && m android.hardware.tv.cec@1.0 Change-Id: I454caf56c309aae9667afd0e58da453002458a80 --- tv/cec/1.0/default/HdmiCecDefault.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tv/cec/1.0/default/HdmiCecDefault.cpp b/tv/cec/1.0/default/HdmiCecDefault.cpp index 26ccb7d42e..2a5197cb4a 100644 --- a/tv/cec/1.0/default/HdmiCecDefault.cpp +++ b/tv/cec/1.0/default/HdmiCecDefault.cpp @@ -278,6 +278,10 @@ Return HdmiCecDefault::enableAudioReturnChannel(int32_t /*portId*/, bool / Return HdmiCecDefault::isConnected(int32_t portId) { uint16_t addr; + if (portId < 0 || portId >= mHdmiCecPorts.size()) { + LOG(ERROR) << "Port id is out of bounds, portId = " << portId; + return false; + } int ret = ioctl(mHdmiCecPorts[portId]->mCecFd, CEC_ADAP_G_PHYS_ADDR, &addr); if (ret) { LOG(ERROR) << "Is connected failed, Error = " << strerror(errno); -- GitLab From 7493bbc999eb653deb36773ca1ff1b6d5877806a Mon Sep 17 00:00:00 2001 From: Dorin Drimus Date: Thu, 23 Feb 2023 17:06:58 +0000 Subject: [PATCH 012/376] Fix VtsHalGraphicsComposer3_TargetTest / GetOverlaySupport Test case is for composer starting with version 2 API, but the test case doesn't check version, so it fails for version 1 API. Bug: 267565265 Test: 1. Push VtsHalGraphicsComposer3_TargetTest to device 2. Run VtsHalGraphicsComposer3_TargetTest Test Command: chmod 777 data/VtsHalGraphicsComposer3_TargetTest ./data/VtsHalGraphicsComposer3_TargetTest Change-Id: I7bf37061aba84dfdfea5fc9dda5a300a1e5ec680 --- .../aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 70c4e4cf39..4974e71636 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -874,6 +874,13 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayName) { } TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) { + const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion(); + ASSERT_TRUE(versionStatus.isOk()); + if (version == 1) { + GTEST_SUCCEED() << "Device does not support the new API for overlay support"; + return; + } + const auto& [status, properties] = mComposerClient->getOverlaySupport(); if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { -- GitLab From 39466b2f3a7134d69461ee8c160456d773ab9614 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 24 Feb 2023 19:50:51 -0800 Subject: [PATCH 013/376] audio: Add AudioOffloadMetadata and a method to update it AudioOffloadMetadata contains the same information as 'AUDIO_OFFLOAD_CODEC_*' framework parameters. It is updated via a new method IStreamOut.updateOffloadMetadata which only works for compressed offload streams. Bug: 270731693 Test: atest VtsHalAudioCoreTargetTest Change-Id: I6c8a8853f216438284082f79e3f57e511a2a1f06 --- audio/aidl/Android.bp | 9 ++-- .../audio/common/AudioOffloadMetadata.aidl | 42 ++++++++++++++++++ .../hardware/audio/core/IStreamOut.aidl | 1 + .../audio/common/AudioOffloadMetadata.aidl | 44 +++++++++++++++++++ .../hardware/audio/core/IStreamOut.aidl | 13 ++++++ audio/aidl/default/Stream.cpp | 35 +++++++++++++++ audio/aidl/default/include/core-impl/Stream.h | 4 ++ audio/aidl/vts/ModuleConfig.cpp | 2 +- .../vts/VtsHalAudioCoreModuleTargetTest.cpp | 37 ++++++++++++++-- automotive/audiocontrol/aidl/vts/Android.bp | 2 +- 10 files changed, 179 insertions(+), 10 deletions(-) create mode 100644 audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl create mode 100644 audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index e6b0cee401..2c91918d76 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -36,12 +36,13 @@ aidl_interface { "android.hardware.audio_defaults", ], srcs: [ + "android/hardware/audio/common/AudioOffloadMetadata.aidl", "android/hardware/audio/common/PlaybackTrackMetadata.aidl", "android/hardware/audio/common/RecordTrackMetadata.aidl", "android/hardware/audio/common/SinkMetadata.aidl", "android/hardware/audio/common/SourceMetadata.aidl", ], - frozen: true, + frozen: false, imports: [ "android.media.audio.common.types-V2", ], @@ -77,7 +78,7 @@ aidl_interface { } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_common = "android.hardware.audio.common-V1" +latest_android_hardware_audio_common = "android.hardware.audio.common-V2" // Modules that depend on android.hardware.audio.common directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -129,7 +130,7 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V1", + "android.hardware.audio.common-V2", "android.hardware.audio.core.sounddose-V1", "android.hardware.audio.effect-V1", "android.media.audio.common.types-V2", @@ -253,7 +254,7 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V1", + "android.hardware.audio.common-V2", "android.media.audio.common.types-V2", ], backend: { diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl new file mode 100644 index 0000000000..000504bd40 --- /dev/null +++ b/audio/aidl/aidl_api/android.hardware.audio.common/current/android/hardware/audio/common/AudioOffloadMetadata.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.audio.common; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable AudioOffloadMetadata { + int sampleRate; + android.media.audio.common.AudioChannelLayout channelMask; + int averageBitRatePerSecond; + int delayFrames; + int paddingFrames; +} diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl index 46acc1156e..ec3078efd7 100644 --- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl +++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IStreamOut.aidl @@ -36,6 +36,7 @@ package android.hardware.audio.core; interface IStreamOut { android.hardware.audio.core.IStreamCommon getStreamCommon(); void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata); + void updateOffloadMetadata(in android.hardware.audio.common.AudioOffloadMetadata offloadMetadata); float[] getHwVolume(); void setHwVolume(in float[] channelVolumes); float getAudioDescriptionMixLevel(); diff --git a/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl new file mode 100644 index 0000000000..588165824b --- /dev/null +++ b/audio/aidl/android/hardware/audio/common/AudioOffloadMetadata.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.audio.common; + +import android.media.audio.common.AudioChannelLayout; + +/** + * Dynamic metadata for offloaded compressed audio. + * For static metadata, see android.media.audio.common.AudioOffloadInfo. + */ +@JavaDerive(equals=true, toString=true) +@VintfStability +parcelable AudioOffloadMetadata { + int sampleRate; + AudioChannelLayout channelMask; + /** Average bit rate in bits per second. */ + int averageBitRatePerSecond; + /** + * Number of frames to be ignored at the beginning of the stream. + * The value must be non-negative. A value of 0 indicates no delay + * has to be applied. + */ + int delayFrames; + /** + * Number of frames to be ignored at the end of the stream. + * The value must be non-negative. A value of 0 indicates no padding + * has to be applied. + */ + int paddingFrames; +} diff --git a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl index 0e58addd7d..54c81621e1 100644 --- a/audio/aidl/android/hardware/audio/core/IStreamOut.aidl +++ b/audio/aidl/android/hardware/audio/core/IStreamOut.aidl @@ -16,6 +16,7 @@ package android.hardware.audio.core; +import android.hardware.audio.common.AudioOffloadMetadata; import android.hardware.audio.common.SourceMetadata; import android.hardware.audio.core.IStreamCommon; import android.media.audio.common.AudioDualMonoMode; @@ -48,6 +49,18 @@ interface IStreamOut { */ void updateMetadata(in SourceMetadata sourceMetadata); + /** + * Update offload metadata for a compressed stream. + * + * Updates the offload metadata initially provided at the stream creation. + * + * @param offloadMetadata Updated offload metadata. + * @throws EX_ILLEGAL_STATE If the stream is closed. + * @throws EX_ILLEGAL_ARGUMENT If the metadata contains invalid values. + * @throws EX_UNSUPPORTED_OPERATION If the stream is not for compressed offload. + */ + void updateOffloadMetadata(in AudioOffloadMetadata offloadMetadata); + const int HW_VOLUME_MIN = 0; const int HW_VOLUME_MAX = 1; /** diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp index 49ad2f2d74..193c793ba0 100644 --- a/audio/aidl/default/Stream.cpp +++ b/audio/aidl/default/Stream.cpp @@ -24,6 +24,7 @@ #include "core-impl/Module.h" #include "core-impl/Stream.h" +using aidl::android::hardware::audio::common::AudioOffloadMetadata; using aidl::android::hardware::audio::common::SinkMetadata; using aidl::android::hardware::audio::common::SourceMetadata; using aidl::android::media::audio::common::AudioDevice; @@ -785,6 +786,40 @@ StreamOut::StreamOut(const SourceMetadata& sourceMetadata, StreamContext&& conte LOG(DEBUG) << __func__; } +ndk::ScopedAStatus StreamOut::updateOffloadMetadata( + const AudioOffloadMetadata& in_offloadMetadata) { + LOG(DEBUG) << __func__; + if (isClosed()) { + LOG(ERROR) << __func__ << ": stream was closed"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); + } + if (!mOffloadInfo.has_value()) { + LOG(ERROR) << __func__ << ": not a compressed offload stream"; + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + } + if (in_offloadMetadata.sampleRate < 0) { + LOG(ERROR) << __func__ << ": invalid sample rate value: " << in_offloadMetadata.sampleRate; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + if (in_offloadMetadata.averageBitRatePerSecond < 0) { + LOG(ERROR) << __func__ + << ": invalid average BPS value: " << in_offloadMetadata.averageBitRatePerSecond; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + if (in_offloadMetadata.delayFrames < 0) { + LOG(ERROR) << __func__ + << ": invalid delay frames value: " << in_offloadMetadata.delayFrames; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + if (in_offloadMetadata.paddingFrames < 0) { + LOG(ERROR) << __func__ + << ": invalid padding frames value: " << in_offloadMetadata.paddingFrames; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + mOffloadMetadata = in_offloadMetadata; + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus StreamOut::getHwVolume(std::vector* _aidl_return) { LOG(DEBUG) << __func__; (void)_aidl_return; diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h index 0d4365a3ae..e9b1fbb847 100644 --- a/audio/aidl/default/include/core-impl/Stream.h +++ b/audio/aidl/default/include/core-impl/Stream.h @@ -463,6 +463,9 @@ class StreamOut : public StreamCommonImpl<::aidl::android::hardware::audio::comm return StreamCommonImpl<::aidl::android::hardware::audio::common::SourceMetadata>:: updateMetadata(in_sourceMetadata); } + ndk::ScopedAStatus updateOffloadMetadata( + const ::aidl::android::hardware::audio::common::AudioOffloadMetadata& + in_offloadMetadata) override; ndk::ScopedAStatus getHwVolume(std::vector* _aidl_return) override; ndk::ScopedAStatus setHwVolume(const std::vector& in_channelVolumes) override; ndk::ScopedAStatus getAudioDescriptionMixLevel(float* _aidl_return) override; @@ -500,6 +503,7 @@ class StreamOut : public StreamCommonImpl<::aidl::android::hardware::audio::comm offloadInfo); std::optional<::aidl::android::media::audio::common::AudioOffloadInfo> mOffloadInfo; + std::optional<::aidl::android::hardware::audio::common::AudioOffloadMetadata> mOffloadMetadata; public: using CreateInstance = std::function ModuleConfig::generateOffloadInfoIfNeeded( offloadInfo.base.sampleRate = portConfig.sampleRate.value().value; offloadInfo.base.channelMask = portConfig.channelMask.value(); offloadInfo.base.format = portConfig.format.value(); - offloadInfo.bitRatePerSecond = 256; // Arbitrary value. + offloadInfo.bitRatePerSecond = 256000; // Arbitrary value. offloadInfo.durationUs = std::chrono::microseconds(1min).count(); // Arbitrary value. offloadInfo.usage = AudioUsage::MEDIA; offloadInfo.encapsulationMode = AudioEncapsulationMode::NONE; diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp index 1222fd5d5a..5bcd0984bd 100644 --- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp @@ -53,6 +53,7 @@ #include "TestUtils.h" using namespace android; +using aidl::android::hardware::audio::common::AudioOffloadMetadata; using aidl::android::hardware::audio::common::PlaybackTrackMetadata; using aidl::android::hardware::audio::common::RecordTrackMetadata; using aidl::android::hardware::audio::common::SinkMetadata; @@ -400,8 +401,9 @@ void TestSetVendorParameters(Instance* inst, bool* isSupported) { // Can be used as a base for any test here, does not depend on the fixture GTest parameters. class AudioCoreModuleBase { public: - // The default buffer size is used mostly for negative tests. + // Default buffer sizes are used mostly for negative tests. static constexpr int kDefaultBufferSizeFrames = 256; + static constexpr int kDefaultLargeBufferSizeFrames = 48000; void SetUpImpl(const std::string& moduleName) { ASSERT_NO_FATAL_FAILURE(ConnectToService(moduleName)); @@ -2689,7 +2691,7 @@ TEST_P(AudioStreamOut, RequireOffloadInfo) { aidl::android::hardware::audio::core::IModule::OpenOutputStreamArguments args; args.portConfigId = portConfig.getId(); args.sourceMetadata = GenerateSourceMetadata(portConfig.get()); - args.bufferSizeFrames = kDefaultBufferSizeFrames; + args.bufferSizeFrames = kDefaultLargeBufferSizeFrames; aidl::android::hardware::audio::core::IModule::OpenOutputStreamReturn ret; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->openOutputStream(args, &ret)) << "when no offload info is provided for a compressed offload mix port"; @@ -2869,7 +2871,7 @@ TEST_P(AudioStreamOut, PlaybackRate) { const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port); ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; WithStream stream(portConfig.value()); - ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); + ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames)); bool isSupported = false; EXPECT_NO_FATAL_FAILURE(TestAccessors( stream.get(), &IStreamOut::getPlaybackRateParameters, @@ -2894,7 +2896,7 @@ TEST_P(AudioStreamOut, SelectPresentation) { const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port); ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; WithStream stream(portConfig.value()); - ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultBufferSizeFrames)); + ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames)); ndk::ScopedAStatus status; EXPECT_STATUS(kStatuses, status = stream.get()->selectPresentation(0, 0)); if (status.getExceptionCode() != EX_UNSUPPORTED_OPERATION) atLeastOneSupports = true; @@ -2904,6 +2906,33 @@ TEST_P(AudioStreamOut, SelectPresentation) { } } +TEST_P(AudioStreamOut, UpdateOffloadMetadata) { + const auto offloadMixPorts = + moduleConfig->getOffloadMixPorts(true /*attachedOnly*/, false /*singlePort*/); + if (offloadMixPorts.empty()) { + GTEST_SKIP() + << "No mix port for compressed offload that could be routed to attached devices"; + } + for (const auto& port : offloadMixPorts) { + const auto portConfig = moduleConfig->getSingleConfigForMixPort(false, port); + ASSERT_TRUE(portConfig.has_value()) << "No profiles specified for output mix port"; + WithStream stream(portConfig.value()); + ASSERT_NO_FATAL_FAILURE(stream.SetUp(module.get(), kDefaultLargeBufferSizeFrames)); + AudioOffloadMetadata validMetadata{ + .sampleRate = portConfig.value().sampleRate.value().value, + .channelMask = portConfig.value().channelMask.value(), + .averageBitRatePerSecond = 256000, + .delayFrames = 0, + .paddingFrames = 0}; + EXPECT_IS_OK(stream.get()->updateOffloadMetadata(validMetadata)); + AudioOffloadMetadata invalidMetadata{.sampleRate = -1, + .averageBitRatePerSecond = -1, + .delayFrames = -1, + .paddingFrames = -1}; + EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, stream.get()->updateOffloadMetadata(invalidMetadata)); + } +} + class StreamLogicDefaultDriver : public StreamLogicDriver { public: StreamLogicDefaultDriver(std::shared_ptr commands, size_t frameSizeBytes) diff --git a/automotive/audiocontrol/aidl/vts/Android.bp b/automotive/audiocontrol/aidl/vts/Android.bp index a9122ce2d6..cfc2a3e4ec 100644 --- a/automotive/audiocontrol/aidl/vts/Android.bp +++ b/automotive/audiocontrol/aidl/vts/Android.bp @@ -25,7 +25,6 @@ cc_test { name: "VtsAidlHalAudioControlTest", defaults: [ "latest_android_media_audio_common_types_cpp_static", - "latest_android_hardware_audio_common_cpp_static", "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", ], @@ -40,6 +39,7 @@ cc_test { ], static_libs: [ "android.hardware.automotive.audiocontrol-V3-cpp", + "android.hardware.audio.common-V1-cpp", "libgmock", ], test_suites: [ -- GitLab From 9af806fe06a92e67a86ede4b134ca1fec8abe0c6 Mon Sep 17 00:00:00 2001 From: Yuchen He Date: Thu, 2 Mar 2023 00:02:13 +0000 Subject: [PATCH 014/376] Fix epoll leaks: clean up file descriptor and epoll instance properly Bug: 262762412 Test: manual test Change-Id: Ia587f8ba0ce44234a7c00cd820db73258dba19b0 --- .../common/utils/default/DeviceFileReader.cpp | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/gnss/common/utils/default/DeviceFileReader.cpp b/gnss/common/utils/default/DeviceFileReader.cpp index dfc086a8b8..91e75eb460 100644 --- a/gnss/common/utils/default/DeviceFileReader.cpp +++ b/gnss/common/utils/default/DeviceFileReader.cpp @@ -32,40 +32,52 @@ void DeviceFileReader::getDataFromDeviceFile(const std::string& command, int mMi return; } - int mGnssFd = open(deviceFilePath.c_str(), O_RDWR | O_NONBLOCK); - - if (mGnssFd == -1) { + int gnss_fd, epoll_fd; + if ((gnss_fd = open(deviceFilePath.c_str(), O_RDWR | O_NONBLOCK)) == -1) { + return; + } + if (write(gnss_fd, command.c_str(), command.size()) <= 0) { + close(gnss_fd); return; } - int bytes_write = write(mGnssFd, command.c_str(), command.size()); - if (bytes_write <= 0) { - close(mGnssFd); + // Create an epoll instance. + if ((epoll_fd = epoll_create1(EPOLL_CLOEXEC)) < 0) { + close(gnss_fd); return; } + // Add file descriptor to epoll instance. struct epoll_event ev, events[1]; - ev.data.fd = mGnssFd; + memset(&ev, 0, sizeof(ev)); + ev.data.fd = gnss_fd; ev.events = EPOLLIN; - int epoll_fd = epoll_create1(0); - epoll_ctl(epoll_fd, EPOLL_CTL_ADD, mGnssFd, &ev); - int bytes_read = -1; - std::string inputStr = ""; - int epoll_ret = epoll_wait(epoll_fd, events, 1, mMinIntervalMs); + if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, gnss_fd, &ev) == -1) { + close(gnss_fd); + close(epoll_fd); + return; + } - if (epoll_ret == -1) { - close(mGnssFd); + // Wait for device file event. + if (epoll_wait(epoll_fd, events, 1, mMinIntervalMs) == -1) { + close(gnss_fd); + close(epoll_fd); return; } + + // Handle event and write data to string buffer. + int bytes_read = -1; + std::string inputStr = ""; while (true) { memset(inputBuffer, 0, INPUT_BUFFER_SIZE); - bytes_read = read(mGnssFd, &inputBuffer, INPUT_BUFFER_SIZE); + bytes_read = read(gnss_fd, &inputBuffer, INPUT_BUFFER_SIZE); if (bytes_read <= 0) { break; } s_buffer_ += std::string(inputBuffer, bytes_read); } - close(mGnssFd); + close(gnss_fd); + close(epoll_fd); // Trim end of file mark(\n\n\n\n). auto pos = s_buffer_.find("\n\n\n\n"); -- GitLab From 721a3638aba1b45258604e340fc00b1b08c94455 Mon Sep 17 00:00:00 2001 From: Zhanghao Wen Date: Fri, 6 Jan 2023 14:30:53 -0800 Subject: [PATCH 015/376] Update HAL comment of getReceivedSvTimeNs Added GPS L1C(P), BDS B1C(P) with value: CODE_LOCK(10 ms), STATE_2ND_CODE_LOCK(18000 ms), TOW_KNOWN(1 week). Added BDS B2AQ: Same as E5AQ Added IRNSS: Same as GPS L1 C/A Bug: 264588057 Test: comment only Change-Id: Ia452beb129b791116bf33a8feed6bb0d04238dd2 --- .../hardware/gnss/GnssMeasurement.aidl | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl index db724a49c8..925df1a010 100644 --- a/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssMeasurement.aidl @@ -133,50 +133,50 @@ parcelable GnssMeasurement { * zero to the value in the table. The state flag with the widest range indicates the range of * the received GNSS satellite time value. * - * +---------------------------+--------------------+-----+-----------+--------------------+------+ - * | |GPS/QZSS |GLNS |BDS |GAL |SBAS | - * +---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |State Flag |L1 |L5I |L5Q |L1OF |B1I |B1I |E1B |E1C |E5AQ |L1 | - * | |C/A | | | |(D1) |(D2)| | | |C/A | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_UNKNOWN |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_CODE_LOCK |1ms |1 ms |1 ms |1 ms |1 ms |1 ms|- |- |1 ms |1 ms | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SYMBOL_SYNC |20ms |10 ms |1 ms |10 ms|20 ms |2 ms|4 ms |4 ms |1 ms |2 ms | - * | |(opt.)| |(opt.)| |(opt.)| |(opt.)|(opt.)|(opt.)| | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BIT_SYNC |20 ms |20 ms |1 ms |20 ms|20 ms |- |8 ms |- |1 ms |4 ms | - * | | | |(opt.)| | | | | |(opt.)| | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SUBFRAME_SYNC |6s |6s |- |2 s |6 s |- |- |- |100 ms|- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_TOW_DECODED |1 week|- |- |1 day|1 week|- |1 week|- |- |1 week| - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_TOW_KNOWN |1 week|- |- |1 day|1 week|- |1 week|- |- |1 week| - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_STRING_SYNC |- |- |- |2 s |- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_TOD_DECODED |- |- |- |1 day|- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GLO_TOD_KNOWN |- |- |- |1 day|- |- |- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BDS_D2_BIT_SYNC |- |- |- |- |- |2 ms|- |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_BDS_D2_SUBFRAME_SYNC |- |- |- |- |- |600 |- |- |- |- | - * | | | | | | |ms | | | | | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1BC_CODE_LOCK |- |- |- |- |- |- |4 ms |4 ms |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1C_2ND_CODE_LOCK|- |- |- |- |- |- |- |100 ms|- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_2ND_CODE_LOCK |- |10 ms |20 ms |- |- |- |- |100 ms|100 ms|- | - * | | |(opt.)| | | | | |(opt.)| | | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_GAL_E1B_PAGE_SYNC |- |- |- |- |- |- |2 s |- |- |- | - * |---------------------------+------+------+------+-----+------+----+------+------+------+------+ - * |STATE_SBAS_SYNC |- |- |- |- |- |- |- |- |- |1s | - * +---------------------------+------+------+------+-----+------+----+------+------+------+------+ + * +---------------------------+---------------------------+-----+---------------------------+--------------------+------+------+ + * | |GPS/QZSS |GLNS |BDS |GAL |SBAS |IRNSS | + * +---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |State Flag |L1 |L1C |L5I |L5Q |L1OF |B1I |B1I |B1C |B2AQ |E1B |E1C |E5AQ |L1 |L5C | + * | |C/A |(P) | | | |(D1) |(D2) |(P) | | | | |C/A | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_UNKNOWN |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 |0 | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_CODE_LOCK |1ms |10 ms |1 ms |1 ms |1 ms |1 ms |1 ms |10 ms |1 ms |- |- |1 ms |1 ms |1ms | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SYMBOL_SYNC |- |- |10 ms |- |10 ms|- |2 ms |- |- |- |- |- |2 ms |- | + * | | | | | | | | | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BIT_SYNC |20 ms |- |20 ms |- |20 ms|20 ms |- |- |- |8 ms |- |- |4 ms |20 ms | + * | | | | | | | | | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SUBFRAME_SYNC |6s |- |6s |- |- |6 s |- |- |100 ms|- |- |100 ms|- |6s | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_TOW_DECODED |1 week|- |1 week|- |- |1 week|1 week|- |- |1 week|1 week|- |1 week|1 week| + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_TOW_KNOWN |1 week|1 week|1 week|1 week|- |1 week|1 week|1 week|1 week|1 week|1 week|1 week|1 week|1 week| + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_STRING_SYNC |- |- |- |- |2 s |- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_TOD_DECODED |- |- |- |- |1 day|- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GLO_TOD_KNOWN |- |- |- |- |1 day|- |- |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BDS_D2_BIT_SYNC |- |- |- |- |- |- |2 ms |- |- |- |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_BDS_D2_SUBFRAME_SYNC |- |- |- |- |- |- |600 |- |- |- |- |- |- |- | + * | | | | | | | |ms | | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1BC_CODE_LOCK |- |- |- |- |- |- |- |- |- |4 ms |4 ms |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1C_2ND_CODE_LOCK|- |- |- |- |- |- |- |- |- |- |100 ms|- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_2ND_CODE_LOCK |- |18000 |10 ms |20 ms |- |- |- |18000 |100 ms|- |- |100 ms|- |- | + * | | |ms | | | | | |ms | | | | | | | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_GAL_E1B_PAGE_SYNC |- |- |- |- |- |- |- |- |- |2 s |- |- |- |- | + * |---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ + * |STATE_SBAS_SYNC |- |- |- |- |- |- |- |- |- |- |- |- |1s |- | + * +---------------------------+------+------+------+------+-----+------+------+------+------+------+------+------+------+------+ * * Note: TOW Known refers to the case where TOW is possibly not decoded over the air but has * been determined from other sources. If TOW decoded is set then TOW Known must also be set. -- GitLab From 57ee54b31be70d30b20b9b856df46b8ca5b2961d Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Mon, 20 Mar 2023 13:49:25 +0900 Subject: [PATCH 016/376] Set min_sdk_version for the Widevine APEX Bug: 251299786 Test: build WV APEX with V and install it on U device Change-Id: I51e387769631bb6dd821911fdae78f36b04b86c2 --- drm/aidl/Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp index 6273a38a26..fb04d842ef 100644 --- a/drm/aidl/Android.bp +++ b/drm/aidl/Android.bp @@ -23,7 +23,7 @@ aidl_interface { sdk_version: "module_current", }, ndk: { - min_sdk_version: "current", + min_sdk_version: "UpsideDownCake", }, }, double_loadable: true, -- GitLab From ae7e4b0ee2ffac8104f75bbdb54f6753692ee0a5 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 7 Apr 2023 21:56:57 +0000 Subject: [PATCH 017/376] Disable radio satellite tests. This is causing conflicts with Android U finalization because when it lands, version 3 of radio doesn't exist in Android U yet. The radio interface should have already been frozen. This is a temporary change to land finalization, and we'll follow up to improve it later. Bug: 277379745 Test: finalization compiles, run test on cf Change-Id: I53ba9ee1a2657d3f18913f5fcce817105bb7f357 --- radio/aidl/vts/Android.bp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index f112d6d73a..c816ed4b95 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -58,9 +58,9 @@ cc_test { "radio_network_test.cpp", "radio_sap_callback.cpp", "radio_sap_test.cpp", - "radio_satellite_indication.cpp", - "radio_satellite_response.cpp", - "radio_satellite_test.cpp", + // "radio_satellite_indication.cpp", + // "radio_satellite_response.cpp", + // "radio_satellite_test.cpp", "radio_sim_indication.cpp", "radio_sim_response.cpp", "radio_sim_test.cpp", -- GitLab From 0331772902c70a2987bb583342eb2b241f1f24a9 Mon Sep 17 00:00:00 2001 From: Kevin Jeon Date: Thu, 13 Apr 2023 12:14:11 -0400 Subject: [PATCH 018/376] Add missing newline to health/wifi AIDL interfaces This change adds a missing newline character to the end of dump() for the default health and wifi int Add missing newline to health/wifi AIDL interfaces This change adds a missing newline character to the end of dump() for health and wifi. Test: Take a bugreport and verify that the "X was the duration of dumpsys Y" lines aren't preceded by the final line of the dump. Test: Run "dumpsys android.hardware.health.IHealth/default" and verify that the new line exists. Test: Run "dumpsys android.hardware.wifi.IWifi/default" and verify that the new line exists. Bug: 278081288 Change-Id: I173dd174b5bab808c6296f7163982393e60ba0c6 --- health/aidl/default/Health.cpp | 1 + wifi/aidl/default/wifi.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp index f401643cde..acdd3362b6 100644 --- a/health/aidl/default/Health.cpp +++ b/health/aidl/default/Health.cpp @@ -214,6 +214,7 @@ binder_status_t Health::dump(int fd, const char**, uint32_t) { } else { ::android::base::WriteStringToFd(res.getDescription(), fd); } + ::android::base::WriteStringToFd("\n", fd); fsync(fd); return STATUS_OK; diff --git a/wifi/aidl/default/wifi.cpp b/wifi/aidl/default/wifi.cpp index e30c38abcf..35f27e21d2 100644 --- a/wifi/aidl/default/wifi.cpp +++ b/wifi/aidl/default/wifi.cpp @@ -16,6 +16,7 @@ #include "wifi.h" +#include #include #include "aidl_return_util.h" @@ -88,6 +89,7 @@ binder_status_t Wifi::dump(int fd, const char** args, uint32_t numArgs) { if (!chip.get()) continue; chip->dump(fd, args, numArgs); } + ::android::base::WriteStringToFd("\n", fd); return STATUS_OK; } -- GitLab From 771b5c19f3517172682a90c0529ab4ff81f8ffa6 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 11 Apr 2023 21:27:15 +0000 Subject: [PATCH 019/376] Re-enable radio satellite tests. radio to V3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This moves everything to radio-V3. What happened was satellite-V1 was added with changes to the radio HAL in master. When radio-V2 was frozen on goog/master, this showed up as radio-V2 having backwards incompatible changes in goog/master. So I disabled the build files there. Now that radio-V2 is frozen, we can re-enable the usage of radio-V3 types in master (the VTS test was the only thing using these new types). In order to resolve this, I’ve moved all the radio libs over to V3. Ideally, we could have moved one service over at a time, as "satellite" support was needed. Though I’ve done this expecting other radio libs to change in V3, this will mean we don’t expect more radio .bp changes in Android V. One alternative to this would have been to change the other radio libs to import V3, but this is considered somewhat of a hack, and it would be guaranteed to break any vendor-owned builds. With the current change, vendor-owned build configs should still work as-is until they manually add satellite. Test: hal_implementation_test, vts_treble_vintf_vendor_test Bug: 277379745 Change-Id: Iedc3097a9db58c0539e4aa61d089ee9d1986d51f --- .../compatibility_matrix.8.xml | 10 ----- .../compatibility_matrix.9.xml | 18 ++++---- radio/aidl/Android.bp | 43 ++++++------------- radio/aidl/compat/libradiocompat/Android.bp | 18 ++++---- radio/aidl/compat/service/Android.bp | 18 ++++---- radio/aidl/vts/Android.bp | 26 +++++------ 6 files changed, 52 insertions(+), 81 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 314757f477..4ac95f58f4 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -491,16 +491,6 @@ slot3 - - android.hardware.radio.satellite - 1 - - IRadioSatellite - slot1 - slot2 - slot3 - - android.hardware.radio.ims.media 1 diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 4c24acd766..a4c6ea4c99 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -405,7 +405,7 @@ android.hardware.radio.config - 2 + 3 IRadioConfig default @@ -413,7 +413,7 @@ android.hardware.radio.data - 2 + 3 IRadioData slot1 @@ -423,7 +423,7 @@ android.hardware.radio.messaging - 2 + 3 IRadioMessaging slot1 @@ -433,7 +433,7 @@ android.hardware.radio.modem - 2 + 3 IRadioModem slot1 @@ -443,7 +443,7 @@ android.hardware.radio.network - 2 + 3 IRadioNetwork slot1 @@ -453,7 +453,7 @@ android.hardware.radio.sim - 2 + 3 IRadioSim slot1 @@ -473,7 +473,7 @@ android.hardware.radio.voice - 2 + 3 IRadioVoice slot1 @@ -483,7 +483,7 @@ android.hardware.radio.ims - 1 + 2 IRadioIms slot1 @@ -503,7 +503,7 @@ android.hardware.radio.ims.media - 1 + 2 IImsMedia default diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index d531d7bf22..72aaa0ffc5 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -12,7 +12,6 @@ aidl_interface { vendor_available: true, host_supported: true, srcs: ["android/hardware/radio/*.aidl"], - frozen: true, stability: "vintf", backend: { cpp: { @@ -41,9 +40,8 @@ aidl_interface { vendor_available: true, host_supported: true, srcs: ["android/hardware/radio/config/*.aidl"], - frozen: true, stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -72,7 +70,7 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/data/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -92,8 +90,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -102,7 +98,7 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/messaging/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -122,8 +118,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -132,7 +126,7 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/modem/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -152,8 +146,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -162,7 +154,7 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/network/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -182,8 +174,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -212,7 +202,6 @@ aidl_interface { }, ], frozen: true, - } aidl_interface { @@ -222,8 +211,8 @@ aidl_interface { srcs: ["android/hardware/radio/sim/*.aidl"], stability: "vintf", imports: [ - "android.hardware.radio-V2", - "android.hardware.radio.config-V2", + "android.hardware.radio-V3", + "android.hardware.radio.config-V3", ], backend: { cpp: { @@ -250,8 +239,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -260,7 +247,7 @@ aidl_interface { host_supported: true, srcs: ["android/hardware/radio/voice/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: true, @@ -280,8 +267,6 @@ aidl_interface { }, ], - frozen: true, - } aidl_interface { @@ -290,8 +275,8 @@ aidl_interface { srcs: ["android/hardware/radio/ims/media/*.aidl"], stability: "vintf", imports: [ - "android.hardware.radio-V2", - "android.hardware.radio.data-V2", + "android.hardware.radio-V3", + "android.hardware.radio.data-V3", ], backend: { cpp: { @@ -310,8 +295,6 @@ aidl_interface { ], }, ], - frozen: true, - } aidl_interface { @@ -319,7 +302,7 @@ aidl_interface { vendor_available: true, srcs: ["android/hardware/radio/ims/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: false, @@ -334,8 +317,6 @@ aidl_interface { imports: ["android.hardware.radio-V2"], }, ], - frozen: true, - } aidl_interface { @@ -343,7 +324,7 @@ aidl_interface { vendor_available: true, srcs: ["android/hardware/radio/satellite/*.aidl"], stability: "vintf", - imports: ["android.hardware.radio-V2"], + imports: ["android.hardware.radio-V3"], backend: { cpp: { enabled: false, diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index 9aecf78d38..f5000b91d0 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -31,21 +31,21 @@ cc_library { "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION", ], shared_libs: [ - "android.hardware.radio.config-V2-ndk", + "android.hardware.radio.config-V3-ndk", "android.hardware.radio.config@1.0", "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", - "android.hardware.radio.data-V2-ndk", - "android.hardware.radio.ims-V1-ndk", - "android.hardware.radio.ims.media-V1-ndk", - "android.hardware.radio.messaging-V2-ndk", - "android.hardware.radio.modem-V2-ndk", - "android.hardware.radio.network-V2-ndk", + "android.hardware.radio.data-V3-ndk", + "android.hardware.radio.ims-V2-ndk", + "android.hardware.radio.ims.media-V2-ndk", + "android.hardware.radio.messaging-V3-ndk", + "android.hardware.radio.modem-V3-ndk", + "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", "android.hardware.radio.satellite-V1-ndk", - "android.hardware.radio.sim-V2-ndk", - "android.hardware.radio.voice-V2-ndk", + "android.hardware.radio.sim-V3-ndk", + "android.hardware.radio.voice-V3-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 5d14c85f73..1a6ea48df9 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -34,21 +34,21 @@ cc_binary { ], shared_libs: [ "android.hardware.radio-library.compat", - "android.hardware.radio.config-V2-ndk", + "android.hardware.radio.config-V3-ndk", "android.hardware.radio.config@1.0", "android.hardware.radio.config@1.1", "android.hardware.radio.config@1.2", "android.hardware.radio.config@1.3", - "android.hardware.radio.data-V2-ndk", - "android.hardware.radio.ims-V1-ndk", - "android.hardware.radio.ims.media-V1-ndk", - "android.hardware.radio.messaging-V2-ndk", - "android.hardware.radio.modem-V2-ndk", - "android.hardware.radio.network-V2-ndk", + "android.hardware.radio.data-V3-ndk", + "android.hardware.radio.ims-V2-ndk", + "android.hardware.radio.ims.media-V2-ndk", + "android.hardware.radio.messaging-V3-ndk", + "android.hardware.radio.modem-V3-ndk", + "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", "android.hardware.radio.satellite-V1-ndk", - "android.hardware.radio.sim-V2-ndk", - "android.hardware.radio.voice-V2-ndk", + "android.hardware.radio.sim-V3-ndk", + "android.hardware.radio.voice-V3-ndk", "android.hardware.radio@1.0", "android.hardware.radio@1.1", "android.hardware.radio@1.2", diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index c816ed4b95..8301f103bc 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -58,9 +58,9 @@ cc_test { "radio_network_test.cpp", "radio_sap_callback.cpp", "radio_sap_test.cpp", - // "radio_satellite_indication.cpp", - // "radio_satellite_response.cpp", - // "radio_satellite_test.cpp", + "radio_satellite_indication.cpp", + "radio_satellite_response.cpp", + "radio_satellite_test.cpp", "radio_sim_indication.cpp", "radio_sim_response.cpp", "radio_sim_test.cpp", @@ -74,18 +74,18 @@ cc_test { "libvintf", ], static_libs: [ - "android.hardware.radio-V2-ndk", - "android.hardware.radio.config-V2-ndk", - "android.hardware.radio.data-V2-ndk", - "android.hardware.radio.ims-V1-ndk", - "android.hardware.radio.ims.media-V1-ndk", - "android.hardware.radio.messaging-V2-ndk", - "android.hardware.radio.modem-V2-ndk", - "android.hardware.radio.network-V2-ndk", + "android.hardware.radio-V3-ndk", + "android.hardware.radio.config-V3-ndk", + "android.hardware.radio.data-V3-ndk", + "android.hardware.radio.ims-V2-ndk", + "android.hardware.radio.ims.media-V2-ndk", + "android.hardware.radio.messaging-V3-ndk", + "android.hardware.radio.modem-V3-ndk", + "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", "android.hardware.radio.satellite-V1-ndk", - "android.hardware.radio.sim-V2-ndk", - "android.hardware.radio.voice-V2-ndk", + "android.hardware.radio.sim-V3-ndk", + "android.hardware.radio.voice-V3-ndk", ], test_suites: [ "general-tests", -- GitLab From 7afc209eb8b1f1d54208c601cb458f95712b1e2f Mon Sep 17 00:00:00 2001 From: Sungtak Lee Date: Wed, 19 Apr 2023 21:50:00 +0000 Subject: [PATCH 020/376] Revert "android.hardware.media.c2: Move to staging/" This reverts commit a8c9aa31730c0790045d2dd2f0f876261b44ad63. Bug: 254050314 Change-Id: Ia85af4e013529e104c84bc48f84a5daa89a5d9bf --- .../compatibility_matrix.9.xml | 9 +++ .../exclude/fcm_exclude.cpp | 4 -- {staging => media}/c2/aidl/Android.bp | 2 +- .../android/hardware/media/c2/BaseBlock.aidl | 39 +++++++++++ .../android/hardware/media/c2/Block.aidl | 40 +++++++++++ .../android/hardware/media/c2/Buffer.aidl | 39 +++++++++++ .../hardware/media/c2/FieldDescriptor.aidl | 62 +++++++++++++++++ .../android/hardware/media/c2/FieldId.aidl | 39 +++++++++++ .../media/c2/FieldSupportedValues.aidl | 41 ++++++++++++ .../media/c2/FieldSupportedValuesQuery.aidl | 44 +++++++++++++ .../c2/FieldSupportedValuesQueryResult.aidl | 39 +++++++++++ .../android/hardware/media/c2/FrameData.aidl | 47 +++++++++++++ .../android/hardware/media/c2/IComponent.aidl | 53 +++++++++++++++ .../media/c2/IComponentInterface.aidl | 38 +++++++++++ .../hardware/media/c2/IComponentListener.aidl | 53 +++++++++++++++ .../hardware/media/c2/IComponentStore.aidl | 66 +++++++++++++++++++ .../hardware/media/c2/IConfigurable.aidl | 48 ++++++++++++++ .../android/hardware/media/c2/InfoBuffer.aidl | 39 +++++++++++ .../hardware/media/c2/ParamDescriptor.aidl | 48 ++++++++++++++ .../android/hardware/media/c2/ParamField.aidl | 39 +++++++++++ .../hardware/media/c2/ParamFieldValues.aidl | 39 +++++++++++ .../android/hardware/media/c2/Params.aidl | 38 +++++++++++ .../hardware/media/c2/SettingResult.aidl | 53 +++++++++++++++ .../android/hardware/media/c2/Status.aidl | 52 +++++++++++++++ .../hardware/media/c2/StructDescriptor.aidl | 39 +++++++++++ .../hardware/media/c2/SurfaceSyncObj.aidl | 41 ++++++++++++ .../android/hardware/media/c2/ValueRange.aidl | 42 ++++++++++++ .../android/hardware/media/c2/Work.aidl | 42 ++++++++++++ .../android/hardware/media/c2/WorkBundle.aidl | 39 +++++++++++ .../hardware/media/c2/WorkOrdinal.aidl | 40 +++++++++++ .../android/hardware/media/c2/Worklet.aidl | 41 ++++++++++++ .../android/hardware/media/c2/BaseBlock.aidl | 1 + .../aidl/android/hardware/media/c2/Block.aidl | 1 + .../android/hardware/media/c2/Buffer.aidl | 1 + .../hardware/media/c2/FieldDescriptor.aidl | 3 + .../android/hardware/media/c2/FieldId.aidl | 1 + .../media/c2/FieldSupportedValues.aidl | 1 + .../media/c2/FieldSupportedValuesQuery.aidl | 2 + .../c2/FieldSupportedValuesQueryResult.aidl | 1 + .../android/hardware/media/c2/FrameData.aidl | 1 + .../android/hardware/media/c2/IComponent.aidl | 1 + .../media/c2/IComponentInterface.aidl | 1 + .../hardware/media/c2/IComponentListener.aidl | 3 + .../hardware/media/c2/IComponentStore.aidl | 4 ++ .../hardware/media/c2/IConfigurable.aidl | 2 + .../android/hardware/media/c2/InfoBuffer.aidl | 1 + .../hardware/media/c2/ParamDescriptor.aidl | 1 + .../android/hardware/media/c2/ParamField.aidl | 1 + .../hardware/media/c2/ParamFieldValues.aidl | 1 + .../android/hardware/media/c2/Params.aidl | 1 + .../hardware/media/c2/SettingResult.aidl | 2 + .../android/hardware/media/c2/Status.aidl | 1 + .../hardware/media/c2/StructDescriptor.aidl | 1 + .../hardware/media/c2/SurfaceSyncObj.aidl | 1 + .../android/hardware/media/c2/ValueRange.aidl | 1 + .../aidl/android/hardware/media/c2/Work.aidl | 1 + .../android/hardware/media/c2/WorkBundle.aidl | 1 + .../hardware/media/c2/WorkOrdinal.aidl | 1 + .../android/hardware/media/c2/Worklet.aidl | 1 + 59 files changed, 1288 insertions(+), 5 deletions(-) rename {staging => media}/c2/aidl/Android.bp (97%) create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/BaseBlock.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Block.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Buffer.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldDescriptor.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldId.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValues.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQuery.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FrameData.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentInterface.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentListener.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentStore.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/InfoBuffer.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamDescriptor.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamField.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamFieldValues.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Params.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SettingResult.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Status.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/StructDescriptor.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ValueRange.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Work.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkBundle.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkOrdinal.aidl create mode 100644 media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Worklet.aidl rename {staging => media}/c2/aidl/android/hardware/media/c2/BaseBlock.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Block.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Buffer.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FieldId.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl (97%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/FrameData.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/IComponent.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/IComponentListener.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/IComponentStore.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/IConfigurable.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/ParamField.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Params.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/SettingResult.aidl (98%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Status.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/ValueRange.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Work.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/WorkBundle.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl (99%) rename {staging => media}/c2/aidl/android/hardware/media/c2/Worklet.aidl (99%) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index a4c6ea4c99..53d2752155 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -364,6 +364,15 @@ vendor[0-9]*_software + + android.hardware.media.c2 + 1 + + IComponentStore + default[0-9]* + vendor[0-9]*_software + + android.hardware.memtrack 1 diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp index 3bc17864c8..f3374c3835 100644 --- a/compatibility_matrices/exclude/fcm_exclude.cpp +++ b/compatibility_matrices/exclude/fcm_exclude.cpp @@ -103,10 +103,6 @@ bool ShouldCheckMissingHalsInFcm(const std::string& package) { "android.hardware.thermal@1.0", "android.hardware.thermal@1.1", "android.hardware.wifi.offload@1.0", - - // Under hardware/interfaces/staging, still in development - // AIDL - "android.hardware.media.c2", }; auto package_has_prefix = [&](const std::string& prefix) { diff --git a/staging/c2/aidl/Android.bp b/media/c2/aidl/Android.bp similarity index 97% rename from staging/c2/aidl/Android.bp rename to media/c2/aidl/Android.bp index b9da7adb2c..56531db55b 100644 --- a/staging/c2/aidl/Android.bp +++ b/media/c2/aidl/Android.bp @@ -13,7 +13,6 @@ aidl_interface { name: "android.hardware.media.c2", vendor_available: true, double_loadable: true, - unstable: true, srcs: ["android/hardware/media/c2/*.aidl"], include_dirs: [ "frameworks/native/aidl/gui", @@ -22,6 +21,7 @@ aidl_interface { "android.hardware.common-V2", "android.hardware.media.bufferpool2-V1", ], + stability: "vintf", backend: { cpp: { enabled: false, diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/BaseBlock.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/BaseBlock.aidl new file mode 100644 index 0000000000..460ff97522 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/BaseBlock.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +union BaseBlock { + android.hardware.common.NativeHandle nativeBlock; + android.hardware.media.bufferpool2.BufferStatusMessage pooledBlock; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Block.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Block.aidl new file mode 100644 index 0000000000..7b3005e22d --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Block.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Block { + int index; + android.hardware.media.c2.Params meta; + android.hardware.common.NativeHandle fence; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Buffer.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Buffer.aidl new file mode 100644 index 0000000000..b632932cec --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Buffer.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Buffer { + android.hardware.media.c2.Params info; + android.hardware.media.c2.Block[] blocks; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldDescriptor.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldDescriptor.aidl new file mode 100644 index 0000000000..909476c39e --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldDescriptor.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable FieldDescriptor { + android.hardware.media.c2.FieldId fieldId; + android.hardware.media.c2.FieldDescriptor.Type type; + int structIndex; + int extent; + String name; + android.hardware.media.c2.FieldDescriptor.NamedValue[] namedValues; + @Backing(type="int") @VintfStability + enum Type { + NO_INIT = 0, + INT32, + UINT32, + CNTR32, + INT64, + UINT64, + CNTR64, + FLOAT, + STRING = 0x100, + BLOB, + STRUCT = 0x20000, + } + @VintfStability + parcelable NamedValue { + String name; + long value; + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldId.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldId.aidl new file mode 100644 index 0000000000..935b85dbbf --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldId.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable FieldId { + int offset; + int sizeBytes; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValues.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValues.aidl new file mode 100644 index 0000000000..69060bea1d --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValues.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +union FieldSupportedValues { + boolean empty; + android.hardware.media.c2.ValueRange range; + long[] values; + long[] flags; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQuery.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQuery.aidl new file mode 100644 index 0000000000..6a5fbe26de --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQuery.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable FieldSupportedValuesQuery { + android.hardware.media.c2.ParamField field; + android.hardware.media.c2.FieldSupportedValuesQuery.Type type; + @Backing(type="int") @VintfStability + enum Type { + POSSIBLE = 0, + CURRENT, + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl new file mode 100644 index 0000000000..187e3ebfeb --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable FieldSupportedValuesQueryResult { + android.hardware.media.c2.Status status; + android.hardware.media.c2.FieldSupportedValues values; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FrameData.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FrameData.aidl new file mode 100644 index 0000000000..07bfb7201a --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/FrameData.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable FrameData { + int flags; + android.hardware.media.c2.WorkOrdinal ordinal; + android.hardware.media.c2.Buffer[] buffers; + android.hardware.media.c2.Params configUpdate; + android.hardware.media.c2.InfoBuffer[] infoBuffers; + const int DROP_FRAME = (1 << 0) /* 1 */; + const int END_OF_STREAM = (1 << 1) /* 2 */; + const int DISCARD_FRAME = (1 << 2) /* 4 */; + const int FLAG_INCOMPLETE = (1 << 3) /* 8 */; + const int CODEC_CONFIG = (1 << 31) /* -2147483648 */; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl new file mode 100644 index 0000000000..7ed09afae7 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +interface IComponent { + android.hardware.common.NativeHandle configureVideoTunnel(in int avSyncHwId); + android.hardware.media.c2.IComponent.BlockPool createBlockPool(in int allocatorId); + void destroyBlockPool(in long blockPoolId); + void drain(in boolean withEos); + android.hardware.media.c2.WorkBundle flush(); + android.hardware.media.c2.IComponentInterface getInterface(); + void queue(in android.hardware.media.c2.WorkBundle workBundle); + void release(); + void reset(); + void setOutputSurface(in long blockPoolId, in android.view.Surface surface, in android.hardware.media.c2.SurfaceSyncObj syncObject); + void start(); + void stop(); + parcelable BlockPool { + long blockPoolId; + android.hardware.media.c2.IConfigurable configurable; + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentInterface.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentInterface.aidl new file mode 100644 index 0000000000..2350daeec2 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentInterface.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +interface IComponentInterface { + android.hardware.media.c2.IConfigurable getConfigurable(); +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentListener.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentListener.aidl new file mode 100644 index 0000000000..f6f2a6391c --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentListener.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +interface IComponentListener { + oneway void onError(in android.hardware.media.c2.Status status, in int errorCode); + oneway void onFramesRendered(in android.hardware.media.c2.IComponentListener.RenderedFrame[] renderedFrames); + oneway void onInputBuffersReleased(in android.hardware.media.c2.IComponentListener.InputBuffer[] inputBuffers); + oneway void onTripped(in android.hardware.media.c2.SettingResult[] settingResults); + oneway void onWorkDone(in android.hardware.media.c2.WorkBundle workBundle); + @VintfStability + parcelable InputBuffer { + long frameIndex; + int arrayIndex; + } + @VintfStability + parcelable RenderedFrame { + long bufferQueueId; + int slotId; + long timestampNs; + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentStore.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentStore.aidl new file mode 100644 index 0000000000..d1b59157d4 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponentStore.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +interface IComponentStore { + void copyBuffer(in android.hardware.media.c2.Buffer src, in android.hardware.media.c2.Buffer dst); + android.hardware.media.c2.IComponent createComponent(in String name, in android.hardware.media.c2.IComponentListener listener, in android.hardware.media.bufferpool2.IClientManager pool); + android.hardware.media.c2.IComponentInterface createInterface(in String name); + android.hardware.media.c2.IConfigurable getConfigurable(); + android.hardware.media.bufferpool2.IClientManager getPoolClientManager(); + android.hardware.media.c2.StructDescriptor[] getStructDescriptors(in int[] indices); + android.hardware.media.c2.IComponentStore.ComponentTraits[] listComponents(); + @VintfStability + parcelable ComponentTraits { + String name; + android.hardware.media.c2.IComponentStore.ComponentTraits.Domain domain; + android.hardware.media.c2.IComponentStore.ComponentTraits.Kind kind; + int rank; + String mediaType; + String[] aliases; + @Backing(type="int") @VintfStability + enum Kind { + OTHER = 0, + DECODER, + ENCODER, + } + @Backing(type="int") @VintfStability + enum Domain { + OTHER = 0, + VIDEO, + AUDIO, + IMAGE, + } + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl new file mode 100644 index 0000000000..32f5abdb51 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IConfigurable.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +interface IConfigurable { + android.hardware.media.c2.IConfigurable.ConfigResult config(in android.hardware.media.c2.Params inParams, in boolean mayBlock); + int getId(); + String getName(); + android.hardware.media.c2.Params query(in int[] indices, in boolean mayBlock); + android.hardware.media.c2.ParamDescriptor[] querySupportedParams(in int start, in int count); + android.hardware.media.c2.FieldSupportedValuesQueryResult[] querySupportedValues(in android.hardware.media.c2.FieldSupportedValuesQuery[] inFields, in boolean mayBlock); + @VintfStability + parcelable ConfigResult { + android.hardware.media.c2.Params params; + android.hardware.media.c2.SettingResult[] failures; + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/InfoBuffer.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/InfoBuffer.aidl new file mode 100644 index 0000000000..94cd77d925 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/InfoBuffer.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable InfoBuffer { + int index; + android.hardware.media.c2.Buffer buffer; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamDescriptor.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamDescriptor.aidl new file mode 100644 index 0000000000..6f0ac50bed --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamDescriptor.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable ParamDescriptor { + int index; + int attrib; + String name; + int[] dependencies; + const int ATTRIBUTE_REQUIRED = (1 << 0) /* 1 */; + const int ATTRIBUTE_PERSISTENT = (1 << 1) /* 2 */; + const int ATTRIBUTE_STRICT = (1 << 2) /* 4 */; + const int ATTRIBUTE_READ_ONLY = (1 << 3) /* 8 */; + const int ATTRIBUTE_HIDDEN = (1 << 4) /* 16 */; + const int ATTRIBUTE_INTERNAL = (1 << 5) /* 32 */; + const int ATTRIBUTE_CONST = (1 << 6) /* 64 */; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamField.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamField.aidl new file mode 100644 index 0000000000..13d252257e --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamField.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable ParamField { + int index; + android.hardware.media.c2.FieldId fieldId; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamFieldValues.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamFieldValues.aidl new file mode 100644 index 0000000000..5a2821cdb2 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ParamFieldValues.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable ParamFieldValues { + android.hardware.media.c2.ParamField paramOrField; + android.hardware.media.c2.FieldSupportedValues[] values; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Params.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Params.aidl new file mode 100644 index 0000000000..7d363c06b3 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Params.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Params { + byte[] params; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SettingResult.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SettingResult.aidl new file mode 100644 index 0000000000..07fc1f35aa --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SettingResult.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable SettingResult { + android.hardware.media.c2.SettingResult.Failure failure; + android.hardware.media.c2.ParamFieldValues field; + android.hardware.media.c2.ParamFieldValues[] conflicts; + @Backing(type="int") @VintfStability + enum Failure { + BAD_TYPE, + BAD_PORT, + BAD_INDEX, + READ_ONLY, + MISMATCH, + BAD_VALUE, + CONFLICT, + UNSUPPORTED, + INFO_BAD_VALUE, + INFO_CONFLICT, + } +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Status.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Status.aidl new file mode 100644 index 0000000000..8b430d29f2 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Status.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Status { + int status; + const int OK = 0; + const int BAD_VALUE = (-22) /* -22 */; + const int BAD_INDEX = (-75) /* -75 */; + const int CANNOT_DO = (-2147483646) /* -2147483646 */; + const int DUPLICATE = (-17) /* -17 */; + const int NOT_FOUND = (-2) /* -2 */; + const int BAD_STATE = (-38) /* -38 */; + const int BLOCKING = (-9930) /* -9930 */; + const int NO_MEMORY = (-12) /* -12 */; + const int REFUSED = (-1) /* -1 */; + const int TIMED_OUT = (-110) /* -110 */; + const int OMITTED = (-74) /* -74 */; + const int CORRUPTED = (-2147483648) /* -2147483648 */; + const int NO_INIT = (-19) /* -19 */; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/StructDescriptor.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/StructDescriptor.aidl new file mode 100644 index 0000000000..58268e0b92 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/StructDescriptor.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable StructDescriptor { + int type; + android.hardware.media.c2.FieldDescriptor[] fields; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl new file mode 100644 index 0000000000..1c9bf8d989 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable SurfaceSyncObj { + android.hardware.common.NativeHandle syncMemory; + long bqId; + int generationId; + long consumerUsage; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ValueRange.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ValueRange.aidl new file mode 100644 index 0000000000..db71ce044e --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/ValueRange.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable ValueRange { + long min; + long max; + long step; + long num; + long denom; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Work.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Work.aidl new file mode 100644 index 0000000000..a5343488f5 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Work.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Work { + byte[] chainInfo; + android.hardware.media.c2.FrameData input; + android.hardware.media.c2.Worklet[] worklets; + int workletsProcessed; + android.hardware.media.c2.Status result; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkBundle.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkBundle.aidl new file mode 100644 index 0000000000..84708a8556 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkBundle.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable WorkBundle { + android.hardware.media.c2.Work[] works; + android.hardware.media.c2.BaseBlock[] baseBlocks; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkOrdinal.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkOrdinal.aidl new file mode 100644 index 0000000000..2833df3a79 --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/WorkOrdinal.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable WorkOrdinal { + long timestampUs; + long frameIndex; + long customOrdinal; +} diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Worklet.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Worklet.aidl new file mode 100644 index 0000000000..a79abf202b --- /dev/null +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/Worklet.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.media.c2; +@VintfStability +parcelable Worklet { + int componentId; + byte[] tunings; + android.hardware.media.c2.SettingResult[] failures; + android.hardware.media.c2.FrameData output; +} diff --git a/staging/c2/aidl/android/hardware/media/c2/BaseBlock.aidl b/media/c2/aidl/android/hardware/media/c2/BaseBlock.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/BaseBlock.aidl rename to media/c2/aidl/android/hardware/media/c2/BaseBlock.aidl index 16e7653736..8b8b8e0e46 100644 --- a/staging/c2/aidl/android/hardware/media/c2/BaseBlock.aidl +++ b/media/c2/aidl/android/hardware/media/c2/BaseBlock.aidl @@ -25,6 +25,7 @@ import android.hardware.common.NativeHandle; * decoded data, codec-specific data, and other codec-related data are all sent * in the form of BaseBlocks. */ +@VintfStability union BaseBlock { /** * #nativeBlock is the opaque representation of a buffer. diff --git a/staging/c2/aidl/android/hardware/media/c2/Block.aidl b/media/c2/aidl/android/hardware/media/c2/Block.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/Block.aidl rename to media/c2/aidl/android/hardware/media/c2/Block.aidl index 4da849098e..34aa7b173f 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Block.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Block.aidl @@ -26,6 +26,7 @@ import android.hardware.media.c2.Params; * attributes may differ among `Block` objects that refer to the same * `BaseBlock` in the same `WorkBundle`. */ +@VintfStability parcelable Block { /** * Identity of a `BaseBlock` within a `WorkBundle`. This is an index into diff --git a/staging/c2/aidl/android/hardware/media/c2/Buffer.aidl b/media/c2/aidl/android/hardware/media/c2/Buffer.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/Buffer.aidl rename to media/c2/aidl/android/hardware/media/c2/Buffer.aidl index fe01b648a4..d2dcf2dfe0 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Buffer.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Buffer.aidl @@ -24,6 +24,7 @@ import android.hardware.media.c2.Params; * * This is a part of @ref FrameData. */ +@VintfStability parcelable Buffer { /** * Metadata associated with the buffer. diff --git a/staging/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl b/media/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl rename to media/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl index 3dd14cd0ed..a2774ec72e 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FieldDescriptor.aidl @@ -21,10 +21,12 @@ import android.hardware.media.c2.FieldId; /** * Description of a field inside a C2Param structure. */ +@VintfStability parcelable FieldDescriptor { /** * Possible types of the field. */ + @VintfStability @Backing(type="int") enum Type { NO_INIT = 0, @@ -53,6 +55,7 @@ parcelable FieldDescriptor { * Named value type. This is used for defining an enum value for a numeric * type. */ + @VintfStability parcelable NamedValue { /** * Name of the enum value. This must be unique for each enum value in diff --git a/staging/c2/aidl/android/hardware/media/c2/FieldId.aidl b/media/c2/aidl/android/hardware/media/c2/FieldId.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/FieldId.aidl rename to media/c2/aidl/android/hardware/media/c2/FieldId.aidl index c53f7a5a34..68bf058962 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FieldId.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FieldId.aidl @@ -22,6 +22,7 @@ package android.hardware.media.c2; * Within a given C2Param structure, each field is uniquely identified by @ref * FieldId. */ +@VintfStability parcelable FieldId { /** * Offset of the field in bytes. diff --git a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl rename to media/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl index 5f4ad2a921..6c2033b5d8 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValues.aidl @@ -26,6 +26,7 @@ import android.hardware.media.c2.ValueRange; * The intended type of values must be made clear in the context where * `FieldSupportedValues` is used. */ +@VintfStability union FieldSupportedValues { /** * No supported values diff --git a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl similarity index 97% rename from staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl rename to media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl index 33a8170688..bdaaef6b73 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQuery.aidl @@ -22,7 +22,9 @@ import android.hardware.media.c2.ParamField; * Query information for supported values of a field. This is used as input to * IConfigurable::querySupportedValues(). */ +@VintfStability parcelable FieldSupportedValuesQuery { + @VintfStability @Backing(type="int") enum Type { /** diff --git a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl rename to media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl index 133712a57e..b5c28c6d1c 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FieldSupportedValuesQueryResult.aidl @@ -23,6 +23,7 @@ import android.hardware.media.c2.Status; * This structure is used to hold the result from * IConfigurable::querySupportedValues(). */ +@VintfStability parcelable FieldSupportedValuesQueryResult { /** * Result of the query. Possible values are diff --git a/staging/c2/aidl/android/hardware/media/c2/FrameData.aidl b/media/c2/aidl/android/hardware/media/c2/FrameData.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/FrameData.aidl rename to media/c2/aidl/android/hardware/media/c2/FrameData.aidl index 81c76be278..15c1b6d434 100644 --- a/staging/c2/aidl/android/hardware/media/c2/FrameData.aidl +++ b/media/c2/aidl/android/hardware/media/c2/FrameData.aidl @@ -31,6 +31,7 @@ import android.hardware.media.c2.WorkOrdinal; * @note `FrameData` is the HIDL counterpart of `C2FrameData` in the Codec 2.0 * standard. */ +@VintfStability parcelable FrameData { /** List of frame flags */ /** diff --git a/staging/c2/aidl/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/IComponent.aidl rename to media/c2/aidl/android/hardware/media/c2/IComponent.aidl index bea4b70f88..b3390c3f4d 100644 --- a/staging/c2/aidl/android/hardware/media/c2/IComponent.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl @@ -32,6 +32,7 @@ import android.hardware.media.c2.SurfaceSyncObj; * All methods in `IComponent` must not block. If a method call cannot be * completed in a timely manner, it must throw `Status::TIMED_OUT`. */ +@VintfStability interface IComponent { /** * The reference object from framwork to HAL C2BlockPool. diff --git a/staging/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl b/media/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl rename to media/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl index 4589115098..9db81e6139 100644 --- a/staging/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponentInterface.aidl @@ -26,6 +26,7 @@ import android.hardware.media.c2.IConfigurable; * * An actual component exposes this interface via IComponent::getInterface(). */ +@VintfStability interface IComponentInterface { /** * Returns the @ref IConfigurable instance associated to this component diff --git a/staging/c2/aidl/android/hardware/media/c2/IComponentListener.aidl b/media/c2/aidl/android/hardware/media/c2/IComponentListener.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/IComponentListener.aidl rename to media/c2/aidl/android/hardware/media/c2/IComponentListener.aidl index 786c8f1651..75500b7271 100644 --- a/staging/c2/aidl/android/hardware/media/c2/IComponentListener.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponentListener.aidl @@ -23,11 +23,13 @@ import android.hardware.media.c2.WorkBundle; /** * Callback interface for handling notifications from @ref IComponent. */ +@VintfStability oneway interface IComponentListener { /** * Identifying information for an input buffer previously queued to the * component via IComponent::queue(). */ + @VintfStability parcelable InputBuffer { /** * This value comes from `Work::input.ordinal.frameIndex` in a `Work` @@ -43,6 +45,7 @@ oneway interface IComponentListener { /** * Information about rendering of a frame to a `Surface`. */ + @VintfStability parcelable RenderedFrame { /** * Id of the `BufferQueue` containing the rendered buffer. diff --git a/staging/c2/aidl/android/hardware/media/c2/IComponentStore.aidl b/media/c2/aidl/android/hardware/media/c2/IComponentStore.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/IComponentStore.aidl rename to media/c2/aidl/android/hardware/media/c2/IComponentStore.aidl index d332bd3a1c..1435a7e4bc 100644 --- a/staging/c2/aidl/android/hardware/media/c2/IComponentStore.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponentStore.aidl @@ -34,17 +34,21 @@ import android.hardware.media.c2.StructDescriptor; * @note This is an extension of version 1.1 of `IComponentStore`. The purpose * of the extension is to add support for blocking output buffer allocator. */ +@VintfStability interface IComponentStore { /** * Component traits. */ + @VintfStability parcelable ComponentTraits { + @VintfStability @Backing(type="int") enum Kind { OTHER = 0, DECODER, ENCODER, } + @VintfStability @Backing(type="int") enum Domain { OTHER = 0, diff --git a/staging/c2/aidl/android/hardware/media/c2/IConfigurable.aidl b/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/IConfigurable.aidl rename to media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl index 9f79576ff5..7fdb8259b8 100644 --- a/staging/c2/aidl/android/hardware/media/c2/IConfigurable.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IConfigurable.aidl @@ -28,6 +28,7 @@ import android.hardware.media.c2.SettingResult; * This interface must be supported in all states of the owning object, and must * not change the state of the owning object. */ +@VintfStability interface IConfigurable { /** * Return parcelable for config() interface. @@ -35,6 +36,7 @@ interface IConfigurable { * This includes the successful config settings along with the failure reasons of * the specified setting. */ + @VintfStability parcelable ConfigResult { Params params; SettingResult[] failures; diff --git a/staging/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl b/media/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl rename to media/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl index 7cfabcbc42..207c4d0c1a 100644 --- a/staging/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl +++ b/media/c2/aidl/android/hardware/media/c2/InfoBuffer.aidl @@ -23,6 +23,7 @@ import android.hardware.media.c2.Buffer; * * This is a part of @ref FrameData. */ +@VintfStability parcelable InfoBuffer { /** * A C2Param structure index. diff --git a/staging/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl b/media/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl rename to media/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl index 716c07e6a4..84c6acc7e4 100644 --- a/staging/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl +++ b/media/c2/aidl/android/hardware/media/c2/ParamDescriptor.aidl @@ -21,6 +21,7 @@ package android.hardware.media.c2; * * @ref ParamDescriptor is returned by IConfigurable::querySupportedParams(). */ +@VintfStability parcelable ParamDescriptor { /** The list of bit flags for attrib */ /** diff --git a/staging/c2/aidl/android/hardware/media/c2/ParamField.aidl b/media/c2/aidl/android/hardware/media/c2/ParamField.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/ParamField.aidl rename to media/c2/aidl/android/hardware/media/c2/ParamField.aidl index 94f737da33..64a46bbef5 100644 --- a/staging/c2/aidl/android/hardware/media/c2/ParamField.aidl +++ b/media/c2/aidl/android/hardware/media/c2/ParamField.aidl @@ -21,6 +21,7 @@ import android.hardware.media.c2.FieldId; /** * Reference to a field in a C2Param structure. */ +@VintfStability parcelable ParamField { /** * Index of the C2Param structure. diff --git a/staging/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl b/media/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl rename to media/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl index 4bb9a913a9..7b74c0ec34 100644 --- a/staging/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl +++ b/media/c2/aidl/android/hardware/media/c2/ParamFieldValues.aidl @@ -26,6 +26,7 @@ import android.hardware.media.c2.ParamField; * values object. This structure is used when reporting parameter configuration * failures and conflicts. */ +@VintfStability parcelable ParamFieldValues { /** * Reference to a field or a C2Param structure. diff --git a/staging/c2/aidl/android/hardware/media/c2/Params.aidl b/media/c2/aidl/android/hardware/media/c2/Params.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/Params.aidl rename to media/c2/aidl/android/hardware/media/c2/Params.aidl index 3c1a321122..53b512cf91 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Params.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Params.aidl @@ -30,6 +30,7 @@ package android.hardware.media.c2; * - 4 bytes: size of the C2Param object (unsigned 4-byte integer). * - (size - 8) bytes: data of the C2Param object. */ +@VintfStability parcelable Params { byte[] params; } diff --git a/staging/c2/aidl/android/hardware/media/c2/SettingResult.aidl b/media/c2/aidl/android/hardware/media/c2/SettingResult.aidl similarity index 98% rename from staging/c2/aidl/android/hardware/media/c2/SettingResult.aidl rename to media/c2/aidl/android/hardware/media/c2/SettingResult.aidl index a27014696c..c2b9574457 100644 --- a/staging/c2/aidl/android/hardware/media/c2/SettingResult.aidl +++ b/media/c2/aidl/android/hardware/media/c2/SettingResult.aidl @@ -22,10 +22,12 @@ import android.hardware.media.c2.ParamFieldValues; * Information describing the reason the parameter settings may fail, or may be * overridden. */ +@VintfStability parcelable SettingResult { /** * Failure code */ + @VintfStability @Backing(type="int") enum Failure { /** diff --git a/staging/c2/aidl/android/hardware/media/c2/Status.aidl b/media/c2/aidl/android/hardware/media/c2/Status.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/Status.aidl rename to media/c2/aidl/android/hardware/media/c2/Status.aidl index 660db57df3..58a24047e7 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Status.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Status.aidl @@ -19,6 +19,7 @@ package android.hardware.media.c2; /** * Common return values for Codec2 operations. */ +@VintfStability parcelable Status { /** * Operation completed successfully. diff --git a/staging/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl b/media/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl rename to media/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl index 5d6d2ebc42..00359041f0 100644 --- a/staging/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl +++ b/media/c2/aidl/android/hardware/media/c2/StructDescriptor.aidl @@ -22,6 +22,7 @@ import android.hardware.media.c2.FieldDescriptor; * Description of a C2Param structure. It consists of an index and a list of * `FieldDescriptor`s. */ +@VintfStability parcelable StructDescriptor { /** * Index of the structure. diff --git a/staging/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl b/media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl rename to media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl index 2e7330e90a..d20e10273f 100644 --- a/staging/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl +++ b/media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl @@ -22,6 +22,7 @@ import android.hardware.common.NativeHandle; * output buffers. This keeps # of dequeued buffers from Surface less than * configured max # of dequeued buffers all the time. */ +@VintfStability parcelable SurfaceSyncObj { /** * ASharedMemory for synchronization data. Layout is below diff --git a/staging/c2/aidl/android/hardware/media/c2/ValueRange.aidl b/media/c2/aidl/android/hardware/media/c2/ValueRange.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/ValueRange.aidl rename to media/c2/aidl/android/hardware/media/c2/ValueRange.aidl index 6707a25d9f..9abcb7da2b 100644 --- a/staging/c2/aidl/android/hardware/media/c2/ValueRange.aidl +++ b/media/c2/aidl/android/hardware/media/c2/ValueRange.aidl @@ -38,6 +38,7 @@ package android.hardware.media.c2; * The division in the formula may truncate the result if the data type of * these values is an integral type. */ +@VintfStability parcelable ValueRange { /** * Lower end of the range (inclusive). diff --git a/staging/c2/aidl/android/hardware/media/c2/Work.aidl b/media/c2/aidl/android/hardware/media/c2/Work.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/Work.aidl rename to media/c2/aidl/android/hardware/media/c2/Work.aidl index 07324795e0..4b8d696871 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Work.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Work.aidl @@ -34,6 +34,7 @@ import android.hardware.media.c2.Worklet; * * `Work` is a part of @ref WorkBundle. */ +@VintfStability parcelable Work { /** * Additional work chain info not part of this work. diff --git a/staging/c2/aidl/android/hardware/media/c2/WorkBundle.aidl b/media/c2/aidl/android/hardware/media/c2/WorkBundle.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/WorkBundle.aidl rename to media/c2/aidl/android/hardware/media/c2/WorkBundle.aidl index 79b4cdbc6a..2125fdab6c 100644 --- a/staging/c2/aidl/android/hardware/media/c2/WorkBundle.aidl +++ b/media/c2/aidl/android/hardware/media/c2/WorkBundle.aidl @@ -35,6 +35,7 @@ import android.hardware.media.c2.Work; * Codec 2.0 standard. The presence of #baseBlocks helps with minimizing the * data transferred over an IPC. */ +@VintfStability parcelable WorkBundle { /** * A list of Work items. diff --git a/staging/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl b/media/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl rename to media/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl index eb8b24427b..5708a90bc8 100644 --- a/staging/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl +++ b/media/c2/aidl/android/hardware/media/c2/WorkOrdinal.aidl @@ -31,6 +31,7 @@ package android.hardware.media.c2; * @note `WorkOrdinal` is the HIDL counterpart of `C2WorkOrdinalStruct` in the * Codec 2.0 standard. */ +@VintfStability parcelable WorkOrdinal { /** * Timestamp in microseconds. diff --git a/staging/c2/aidl/android/hardware/media/c2/Worklet.aidl b/media/c2/aidl/android/hardware/media/c2/Worklet.aidl similarity index 99% rename from staging/c2/aidl/android/hardware/media/c2/Worklet.aidl rename to media/c2/aidl/android/hardware/media/c2/Worklet.aidl index 04c59c1761..6b3ceac5a0 100644 --- a/staging/c2/aidl/android/hardware/media/c2/Worklet.aidl +++ b/media/c2/aidl/android/hardware/media/c2/Worklet.aidl @@ -28,6 +28,7 @@ import android.hardware.media.c2.SettingResult; * a @ref Work object for each expected output before calling * IComponent::queue(). */ +@VintfStability parcelable Worklet { /** * Component id. (Input) -- GitLab From 3586a8d1cc9061e66db96df082aa240c3ddf98f1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 1 May 2023 11:52:16 -0700 Subject: [PATCH 021/376] Add FakeVehicleStubUnitTest as presubmit. FakeVehicleStubUnitTest depends on the fake vhal config file, so it must be run as presubmit if we modify the config file. Test: Presubmit Bug: 279077869 Change-Id: If191cba503466a38a0bfdb9808d187affeaf2a62 --- automotive/vehicle/TEST_MAPPING | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index da8416cd73..02ad8bb953 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -43,6 +43,14 @@ "auto-presubmit": [ { "name": "VtsHalAutomotiveVehicle_TargetTest" + }, + { + "name": "CarServiceUnitTest", + "options" : [ + { + "include-filter": "com.android.car.hal.fakevhal.FakeVehicleStubUnitTest" + } + ] } ] } -- GitLab From bc785c63472be42d375ce88af81952aa673f3c2e Mon Sep 17 00:00:00 2001 From: Sungtak Lee Date: Sun, 23 Apr 2023 00:19:01 +0000 Subject: [PATCH 022/376] media.c2 aidl: Add decoder output allocator interface Bug: 254050314 Test: m Change-Id: Ia0a63c29bb1fceabf290647003865c2a788980ef --- media/c2/aidl/Android.bp | 2 +- .../android/hardware/media/c2/IComponent.aidl | 2 +- ...cObj.aidl => IGraphicBufferAllocator.aidl} | 25 +++- .../android/hardware/media/c2/IComponent.aidl | 23 ++-- .../media/c2/IGraphicBufferAllocator.aidl | 114 ++++++++++++++++++ .../hardware/media/c2/SurfaceSyncObj.aidl | 55 --------- 6 files changed, 142 insertions(+), 79 deletions(-) rename media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/{SurfaceSyncObj.aidl => IGraphicBufferAllocator.aidl} (72%) create mode 100644 media/c2/aidl/android/hardware/media/c2/IGraphicBufferAllocator.aidl delete mode 100644 media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl diff --git a/media/c2/aidl/Android.bp b/media/c2/aidl/Android.bp index 56531db55b..75d74ac5a5 100644 --- a/media/c2/aidl/Android.bp +++ b/media/c2/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { double_loadable: true, srcs: ["android/hardware/media/c2/*.aidl"], include_dirs: [ - "frameworks/native/aidl/gui", + "frameworks/base/core/java", ], imports: [ "android.hardware.common-V2", diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl index 7ed09afae7..1af66d0a0a 100644 --- a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl @@ -43,7 +43,7 @@ interface IComponent { void queue(in android.hardware.media.c2.WorkBundle workBundle); void release(); void reset(); - void setOutputSurface(in long blockPoolId, in android.view.Surface surface, in android.hardware.media.c2.SurfaceSyncObj syncObject); + void setDecoderOutputAllocator(in android.hardware.media.c2.IGraphicBufferAllocator allocator); void start(); void stop(); parcelable BlockPool { diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IGraphicBufferAllocator.aidl similarity index 72% rename from media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl rename to media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IGraphicBufferAllocator.aidl index 1c9bf8d989..da3d5ffed6 100644 --- a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/SurfaceSyncObj.aidl +++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IGraphicBufferAllocator.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,22 @@ package android.hardware.media.c2; @VintfStability -parcelable SurfaceSyncObj { - android.hardware.common.NativeHandle syncMemory; - long bqId; - int generationId; - long consumerUsage; +interface IGraphicBufferAllocator { + android.hardware.media.c2.IGraphicBufferAllocator.Allocation allocate(in android.hardware.media.c2.IGraphicBufferAllocator.Description desc); + boolean deallocate(in long id); + android.hardware.media.c2.IGraphicBufferAllocator.WaitableFds getWaitableFds(); + parcelable Allocation { + android.hardware.HardwareBuffer buffer; + ParcelFileDescriptor fence; + } + parcelable Description { + int width; + int height; + int format; + long usage; + } + parcelable WaitableFds { + ParcelFileDescriptor allocEvent; + ParcelFileDescriptor statusEvent; + } } diff --git a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl index b3390c3f4d..c880305302 100644 --- a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl +++ b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl @@ -17,12 +17,11 @@ package android.hardware.media.c2; import android.hardware.common.NativeHandle; -import android.view.Surface; import android.hardware.media.c2.IComponentInterface; import android.hardware.media.c2.IConfigurable; +import android.hardware.media.c2.IGraphicBufferAllocator; import android.hardware.media.c2.WorkBundle; -import android.hardware.media.c2.SurfaceSyncObj; /** * Interface for an AIDL Codec2 component. @@ -234,23 +233,15 @@ interface IComponent { void reset(); /** - * Starts using a surface for output with a synchronization object + * Specify an allocator for decoder output buffer from HAL. * - * This method must not block. - * - * @param blockPoolId Id of the `C2BlockPool` to be associated with the - * output surface. - * @param surface Output surface. - * @param syncObject synchronization object for buffer allocation between - * Framework and Component. - * @throws ServiceSpecificException with one of the following values: - * - `Status::CANNOT_DO` - The component does not support an output surface. - * - `Status::REFUSED` - The output surface cannot be accessed. - * - `Status::TIMED_OUT` - The operation cannot be finished in a timely manner. + * The method will be used once during the life-cycle of a codec instance. + * @param allocator Decoder output buffer allocator from the client + * @throws ServiceSpecificException with one of the following values + * - `Status::CANNOT_DO` - The component does not support allocating from the client. * - `Status::CORRUPTED` - Some unknown error occurred. */ - void setOutputSurface(in long blockPoolId, in Surface surface, - in SurfaceSyncObj syncObject); + void setDecoderOutputAllocator(in IGraphicBufferAllocator allocator); /** * Starts the component. diff --git a/media/c2/aidl/android/hardware/media/c2/IGraphicBufferAllocator.aidl b/media/c2/aidl/android/hardware/media/c2/IGraphicBufferAllocator.aidl new file mode 100644 index 0000000000..1c97214ada --- /dev/null +++ b/media/c2/aidl/android/hardware/media/c2/IGraphicBufferAllocator.aidl @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.media.c2; + +import android.hardware.HardwareBuffer; +import android.os.ParcelFileDescriptor; + +/** + * Interface for decoder output buffer allocator for HAL process + * + * A graphic buffer for decoder output is allocated by the interface. + */ +@VintfStability +interface IGraphicBufferAllocator { + /** + * A graphic buffer allocation. + * + * buffer is in android.hardware.HardwareBuffer. + * fence is provided in order to signal readiness of the buffer I/O inside + * underlying Graphics subsystem. This is called a sync fence throughout Android framework. + */ + parcelable Allocation { + HardwareBuffer buffer; + ParcelFileDescriptor fence; + } + + /** + * Parameters for a graphic buffer allocation. + * + * Refer to AHardwareBuffer_Desc(libnativewindow) for details. + */ + parcelable Description { + int width; + int height; + int format; + long usage; + } + + /** + * Allocate a graphic buffer. + * + * @param desc Allocation parameters. + * @return an android.hardware.HardwareBuffer which is basically same to + * AHardwareBuffer. If underlying grpahics system is blocked, c2::Status::Blocked + * will be returned. In this case getWaitableFds() will return file descriptors which + * can be used to construct a waitable object. The waitable object will be notified + * when underlying graphics system is unblocked + * @throws ServiceSpecificException with one of the following values: + * - `c2::Status::BAD_STATE` - The client is not in running states. + * - `c2::Status::BLOCKED` - Underlying graphics system is blocked. + * - `c2::Status::CORRUPTED` - Some unknown error occurred. + */ + Allocation allocate(in Description desc); + + /** + * De-allocate a graphic buffer by graphic buffer's unique id. + * + * @param id graphic buffer's unique id. See also AHardwareBuffer_getId(). + * @return {@code true} when de-allocate happened, {@code false} otherwise. + */ + boolean deallocate(in long id); + + /** + * Fds for waitable object events. + * + * Fds are created by eventfd() with semaphore mode. + * For allocEvent, An integer counter regarding dequeuable buffer count is maintained + * by client using read()/write() to the fd. The fd can be checked whether it is + * readable via poll(). When in readable status, the specified counter is positive + * so allocate/dequeue can happen. + * + * For statusEvent, the client can notify further allocation is not feasible. + * e.g.) life-cycle of the underlying allocator is ended. + * + * C2Fence object should be implemented based on this Fds. Thus, C2Fence can return + * either by allocation being ready or allocation being infeasible by the client status + * change. + */ + parcelable WaitableFds { + ParcelFileDescriptor allocEvent; + ParcelFileDescriptor statusEvent; + } + + /** + * Gets waiable file descriptors. + * + * Use this method once and cache it in order not to create unnecessary duplicated fds. + * The returned array will have two fds. + * + * If many waitable objects based on the same fd are competing, all watiable objects will be + * notified. After being notified, they should invoke allocate(). At least one of them can + * successfully allocate. Others not having an Allocation will have c2::Status::BLOCKED + * as return value. They should wait again via waitable objects based on the fds which are + * already returned from this interface. + * + * @return an fd array which will be wrapped to C2Fence and will be waited for + * until allocating is unblocked. + */ + WaitableFds getWaitableFds(); +} diff --git a/media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl b/media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl deleted file mode 100644 index d20e10273f..0000000000 --- a/media/c2/aidl/android/hardware/media/c2/SurfaceSyncObj.aidl +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.media.c2; - -import android.hardware.common.NativeHandle; -/** - * Surface(BufferQueue/IGBP) synchronization object regarding # of dequeued - * output buffers. This keeps # of dequeued buffers from Surface less than - * configured max # of dequeued buffers all the time. - */ -@VintfStability -parcelable SurfaceSyncObj { - /** - * ASharedMemory for synchronization data. Layout is below - * - * |lock(futex) 4bytes| - * |conditional_variable(futex) 4bytes| - * |# of max dequeable buffer 4bytes| - * |# of dequeued buffer 4bytes| - * |Status of the surface 4bytes| - * INIT = 0, Configuring surface is not finished. - * ACTIVE = 1, Surface is ready to allocate(dequeue). - * SWITCHING = 2, Switching to the new surface. It is blocked - * to allocate(dequeue) a buffer until switching - * completes. - */ - NativeHandle syncMemory; - /** - * BufferQueue id. - */ - long bqId; - /** - * Generation id. - */ - int generationId; - /** - * Consumer usage flags. See +ndk - * libnativewindow#AHardwareBuffer_UsageFlags for possible values. - */ - long consumerUsage; -} -- GitLab From a1efe7a0ddc67a931b435e268985e2e59a44a92a Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Tue, 2 May 2023 21:11:41 -0700 Subject: [PATCH 023/376] Clean up VtsHalRadioTargetTest Refactor class design so RadioServiceTest extends TestWithParam and each individual radio service test extends RadioServiceTest. Move setup and teardown logic common to all classes to RadioServiceTest. Add logs to print when each test starts/finishes to help debug issues. Remove unused imports and fix some typos. Change unique_lock to lock_guard in notify to prevent MTE errors. Test: atest VtsHalRadioTargetTest on fullmte build Bug: 263940636 Change-Id: I2f6844f07d4518c00d47f98e5e15bea0a809fa84 --- radio/aidl/vts/radio_aidl_hal_utils.cpp | 17 +++- radio/aidl/vts/radio_aidl_hal_utils.h | 12 ++- radio/aidl/vts/radio_config_test.cpp | 4 +- radio/aidl/vts/radio_config_utils.h | 5 +- radio/aidl/vts/radio_data_test.cpp | 8 +- radio/aidl/vts/radio_data_utils.h | 4 +- radio/aidl/vts/radio_ims_test.cpp | 4 +- radio/aidl/vts/radio_ims_utils.h | 4 +- radio/aidl/vts/radio_imsmedia_test.cpp | 5 +- radio/aidl/vts/radio_imsmedia_utils.h | 4 +- radio/aidl/vts/radio_messaging_test.cpp | 46 +-------- radio/aidl/vts/radio_messaging_utils.h | 4 +- radio/aidl/vts/radio_modem_test.cpp | 28 +----- radio/aidl/vts/radio_modem_utils.h | 4 +- radio/aidl/vts/radio_network_test.cpp | 53 ++-------- radio/aidl/vts/radio_network_utils.h | 4 +- radio/aidl/vts/radio_sap_test.cpp | 36 +++---- radio/aidl/vts/radio_satellite_test.cpp | 123 ++---------------------- radio/aidl/vts/radio_satellite_utils.h | 4 +- radio/aidl/vts/radio_sim_test.cpp | 50 +--------- radio/aidl/vts/radio_sim_utils.h | 4 +- radio/aidl/vts/radio_voice_test.cpp | 68 +------------ radio/aidl/vts/radio_voice_utils.h | 4 +- 23 files changed, 82 insertions(+), 413 deletions(-) diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp index f18da55c3f..64969dea73 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.cpp +++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp @@ -16,7 +16,6 @@ #define LOG_TAG "RadioTest" #include "radio_aidl_hal_utils.h" -#include #include "VtsCoreUtil.h" #include "radio_config_utils.h" #include "radio_sim_utils.h" @@ -144,11 +143,25 @@ bool isServiceValidForDeviceConfiguration(std::string& serviceName) { return true; } +void RadioServiceTest::SetUp() { + ALOGD("BEGIN %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); + count_ = 0; + serial = -1; +} + +void RadioServiceTest::TearDown() { + count_ = 0; + serial = -1; + ALOGD("END %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); +} + /* * Notify that the response message is received. */ void RadioServiceTest::notify(int receivedSerial) { - std::unique_lock lock(mtx_); + std::lock_guard lock(mtx_); if (serial == receivedSerial) { count_++; cv_.notify_one(); diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index 2e6c49caaf..906247e1a5 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -25,7 +25,6 @@ #include #include #include -#include using namespace aidl::android::hardware::radio; using aidl::android::hardware::radio::config::SimSlotStatus; @@ -135,14 +134,15 @@ bool isServiceValidForDeviceConfiguration(std::string& serviceName); /** * RadioServiceTest base class */ -class RadioServiceTest { +class RadioServiceTest : public ::testing::TestWithParam { protected: - std::mutex mtx_; - std::condition_variable cv_; std::shared_ptr radio_config; std::shared_ptr radio_sim; public: + void SetUp() override; + void TearDown() override; + /* Used as a mechanism to inform the test about data/event callback */ void notify(int receivedSerial); @@ -157,4 +157,8 @@ class RadioServiceTest { /* Update SIM slot status */ void updateSimSlotStatus(int physicalSlotId); + + private: + std::mutex mtx_; + std::condition_variable cv_; }; diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp index c979d28781..aed3b05b4f 100644 --- a/radio/aidl/vts/radio_config_test.cpp +++ b/radio/aidl/vts/radio_config_test.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include "radio_config_utils.h" @@ -22,6 +21,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioConfigTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); radio_config = IRadioConfig::fromBinder( @@ -31,8 +31,6 @@ void RadioConfigTest::SetUp() { radioRsp_config = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_config.get()); - count_ = 0; - radioInd_config = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_config.get()); diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h index 3db430db5f..f79aedbf9e 100644 --- a/radio/aidl/vts/radio_config_utils.h +++ b/radio/aidl/vts/radio_config_utils.h @@ -74,9 +74,10 @@ class RadioConfigIndication : public BnRadioConfigIndication { }; // The main test class for Radio AIDL Config. -class RadioConfigTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioConfigTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; + ndk::ScopedAStatus updateSimCardStatus(); /* Override updateSimSlotStatus in RadioServiceTest to not call setResponseFunctions */ void updateSimSlotStatus(); diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp index 3eedc146ff..0fb2fb404f 100644 --- a/radio/aidl/vts/radio_data_test.cpp +++ b/radio/aidl/vts/radio_data_test.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "radio_data_utils.h" @@ -25,6 +24,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioDataTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -39,8 +39,6 @@ void RadioDataTest::SetUp() { radioRsp_data = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_data.get()); - count_ = 0; - radioInd_data = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_data.get()); @@ -555,7 +553,6 @@ TEST_P(RadioDataTest, stopKeepalive) { * Test IRadioData.getDataCallList() for the response returned. */ TEST_P(RadioDataTest, getDataCallList) { - LOG(DEBUG) << "getDataCallList"; serial = GetRandomSerialNumber(); radio_data->getDataCallList(serial); @@ -569,14 +566,12 @@ TEST_P(RadioDataTest, getDataCallList) { radioRsp_data->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getDataCallList finished"; } /* * Test IRadioData.setDataAllowed() for the response returned. */ TEST_P(RadioDataTest, setDataAllowed) { - LOG(DEBUG) << "setDataAllowed"; serial = GetRandomSerialNumber(); bool allow = true; @@ -589,5 +584,4 @@ TEST_P(RadioDataTest, setDataAllowed) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_data->rspInfo.error); } - LOG(DEBUG) << "setDataAllowed finished"; } diff --git a/radio/aidl/vts/radio_data_utils.h b/radio/aidl/vts/radio_data_utils.h index fb91ef61d5..0959207cf6 100644 --- a/radio/aidl/vts/radio_data_utils.h +++ b/radio/aidl/vts/radio_data_utils.h @@ -100,13 +100,13 @@ class RadioDataIndication : public BnRadioDataIndication { }; // The main test class for Radio AIDL Data. -class RadioDataTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioDataTest : public RadioServiceTest { protected: /* Get current data call list */ ndk::ScopedAStatus getDataCallList(); public: - virtual void SetUp() override; + void SetUp() override; /* radio data service handle */ std::shared_ptr radio_data; diff --git a/radio/aidl/vts/radio_ims_test.cpp b/radio/aidl/vts/radio_ims_test.cpp index 289d3ed54d..1938e0a8b6 100644 --- a/radio/aidl/vts/radio_ims_test.cpp +++ b/radio/aidl/vts/radio_ims_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_ims_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioImsTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -37,8 +37,6 @@ void RadioImsTest::SetUp() { radioRsp_ims = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_ims.get()); - count_ = 0; - radioInd_ims = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_ims.get()); diff --git a/radio/aidl/vts/radio_ims_utils.h b/radio/aidl/vts/radio_ims_utils.h index 2bf80dc987..208c94b05c 100644 --- a/radio/aidl/vts/radio_ims_utils.h +++ b/radio/aidl/vts/radio_ims_utils.h @@ -76,12 +76,12 @@ class RadioImsIndication : public BnRadioImsIndication { }; // The main test class for Radio AIDL Ims. -class RadioImsTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioImsTest : public RadioServiceTest { protected: virtual void verifyError(RadioError resp); public: - virtual void SetUp() override; + void SetUp() override; /* radio ims service handle */ std::shared_ptr radio_ims; diff --git a/radio/aidl/vts/radio_imsmedia_test.cpp b/radio/aidl/vts/radio_imsmedia_test.cpp index 2b6f5ef8b7..425f6b4d6a 100644 --- a/radio/aidl/vts/radio_imsmedia_test.cpp +++ b/radio/aidl/vts/radio_imsmedia_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -25,10 +24,9 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioImsMediaTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); - ALOGD("Enter RadioImsMediaTest."); - radio_imsmedia = IImsMedia::fromBinder( ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); ASSERT_NE(nullptr, radio_imsmedia.get()); @@ -38,7 +36,6 @@ void RadioImsMediaTest::SetUp() { radio_imsmediasessionlistener = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radio_imsmediasessionlistener.get()); - count_ = 0; } TEST_P(RadioImsMediaTest, MOCallSuccess) { diff --git a/radio/aidl/vts/radio_imsmedia_utils.h b/radio/aidl/vts/radio_imsmedia_utils.h index 6143addd03..87f1b00a63 100644 --- a/radio/aidl/vts/radio_imsmedia_utils.h +++ b/radio/aidl/vts/radio_imsmedia_utils.h @@ -79,13 +79,13 @@ class ImsMediaSessionListener : public BnImsMediaSessionListener { }; /* The main test class for Radio AIDL ImsMedia. */ -class RadioImsMediaTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioImsMediaTest : public RadioServiceTest { protected: virtual void verifyError(RtpError inError); virtual ndk::ScopedAStatus triggerOpenSession(int32_t sessionId); public: - virtual void SetUp() override; + void SetUp() override; /* radio imsmedia service handle */ std::shared_ptr radio_imsmedia; diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp index 9f1718b1a0..4ab88d2d8a 100644 --- a/radio/aidl/vts/radio_messaging_test.cpp +++ b/radio/aidl/vts/radio_messaging_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_messaging_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioMessagingTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -37,8 +37,6 @@ void RadioMessagingTest::SetUp() { radioRsp_messaging = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_messaging.get()); - count_ = 0; - radioInd_messaging = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_messaging.get()); @@ -61,7 +59,6 @@ void RadioMessagingTest::SetUp() { * Test IRadioMessaging.sendSms() for the response returned. */ TEST_P(RadioMessagingTest, sendSms) { - LOG(DEBUG) << "sendSms"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -80,14 +77,12 @@ TEST_P(RadioMessagingTest, sendSms) { CHECK_GENERAL_ERROR)); EXPECT_EQ(0, radioRsp_messaging->sendSmsResult.errorCode); } - LOG(DEBUG) << "sendSms finished"; } /* * Test IRadioMessaging.sendSmsExpectMore() for the response returned. */ TEST_P(RadioMessagingTest, sendSmsExpectMore) { - LOG(DEBUG) << "sendSmsExpectMore"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -105,14 +100,12 @@ TEST_P(RadioMessagingTest, sendSmsExpectMore) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendSmsExpectMore finished"; } /* * Test IRadioMessaging.sendCdmaSms() for the response returned. */ TEST_P(RadioMessagingTest, sendCdmaSms) { - LOG(DEBUG) << "sendCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -151,7 +144,6 @@ TEST_P(RadioMessagingTest, sendCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendCdmaSms finished"; } /* @@ -202,7 +194,6 @@ TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) { * Test IRadioMessaging.setGsmBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, setGsmBroadcastConfig) { - LOG(DEBUG) << "setGsmBroadcastConfig"; serial = GetRandomSerialNumber(); // Create GsmBroadcastSmsConfigInfo #1 @@ -260,14 +251,12 @@ TEST_P(RadioMessagingTest, setGsmBroadcastConfig) { RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setGsmBroadcastConfig finished"; } /* * Test IRadioMessaging.getGsmBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, getGsmBroadcastConfig) { - LOG(DEBUG) << "getGsmBroadcastConfig"; serial = GetRandomSerialNumber(); radio_messaging->getGsmBroadcastConfig(serial); @@ -282,14 +271,12 @@ TEST_P(RadioMessagingTest, getGsmBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getGsmBroadcastConfig finished"; } /* * Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) { - LOG(DEBUG) << "setCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); CdmaBroadcastSmsConfigInfo cbSmsConfig; @@ -310,14 +297,12 @@ TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaBroadcastConfig finished"; } /* * Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) { - LOG(DEBUG) << "getCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); radio_messaging->getCdmaBroadcastConfig(serial); @@ -330,14 +315,12 @@ TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCdmaBroadcastConfig finished"; } /* * Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned. */ TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) { - LOG(DEBUG) << "setCdmaBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -352,14 +335,12 @@ TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaBroadcastActivation finished"; } /* * Test IRadioMessaging.setGsmBroadcastActivation() for the response returned. */ TEST_P(RadioMessagingTest, setGsmBroadcastActivation) { - LOG(DEBUG) << "setGsmBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -376,14 +357,12 @@ TEST_P(RadioMessagingTest, setGsmBroadcastActivation) { RadioError::INVALID_STATE, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setGsmBroadcastActivation finished"; } /* * Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) { - LOG(DEBUG) << "acknowledgeLastIncomingGsmSms"; serial = GetRandomSerialNumber(); bool success = true; @@ -399,14 +378,12 @@ TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeLastIncomingGsmSms finished"; } /* * Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { - LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu"; serial = GetRandomSerialNumber(); bool success = true; std::string ackPdu = ""; @@ -422,14 +399,12 @@ TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) { {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished"; } /* * Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned. */ TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) { - LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAck @@ -448,14 +423,12 @@ TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms finished"; } /* * Test IRadioMessaging.sendImsSms() for the response returned. */ TEST_P(RadioMessagingTest, sendImsSms) { - LOG(DEBUG) << "sendImsSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -482,7 +455,7 @@ TEST_P(RadioMessagingTest, sendImsSms) { cdmaSmsMessage.bearerData = (std::vector){15, 0, 3, 32, 3, 16, 1, 8, 16, 53, 76, 68, 6, 51, 106, 0}; - // Creata an ImsSmsMessage + // Create an ImsSmsMessage ImsSmsMessage msg; msg.tech = RadioTechnologyFamily::THREE_GPP2; msg.retry = false; @@ -500,14 +473,12 @@ TEST_P(RadioMessagingTest, sendImsSms) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_messaging->rspInfo.error, {RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendImsSms finished"; } /* * Test IRadioMessaging.getSmscAddress() for the response returned. */ TEST_P(RadioMessagingTest, getSmscAddress) { - LOG(DEBUG) << "getSmscAddress"; serial = GetRandomSerialNumber(); radio_messaging->getSmscAddress(serial); @@ -522,14 +493,12 @@ TEST_P(RadioMessagingTest, getSmscAddress) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getSmscAddress finished"; } /* * Test IRadioMessaging.setSmscAddress() for the response returned. */ TEST_P(RadioMessagingTest, setSmscAddress) { - LOG(DEBUG) << "setSmscAddress"; serial = GetRandomSerialNumber(); std::string address = std::string("smscAddress"); @@ -545,14 +514,12 @@ TEST_P(RadioMessagingTest, setSmscAddress) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setSmscAddress finished"; } /* * Test IRadioMessaging.writeSmsToSim() for the response returned. */ TEST_P(RadioMessagingTest, writeSmsToSim) { - LOG(DEBUG) << "writeSmsToSim"; serial = GetRandomSerialNumber(); SmsWriteArgs smsWriteArgs; smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD; @@ -573,14 +540,12 @@ TEST_P(RadioMessagingTest, writeSmsToSim) { RadioError::NETWORK_NOT_READY, RadioError::NO_RESOURCES, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "writeSmsToSim finished"; } /* * Test IRadioMessaging.deleteSmsOnSim() for the response returned. */ TEST_P(RadioMessagingTest, deleteSmsOnSim) { - LOG(DEBUG) << "deleteSmsOnSim"; serial = GetRandomSerialNumber(); int index = 1; @@ -598,14 +563,12 @@ TEST_P(RadioMessagingTest, deleteSmsOnSim) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "deleteSmsOnSim finished"; } /* * Test IRadioMessaging.writeSmsToRuim() for the response returned. */ TEST_P(RadioMessagingTest, writeSmsToRuim) { - LOG(DEBUG) << "writeSmsToRuim"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -651,14 +614,12 @@ TEST_P(RadioMessagingTest, writeSmsToRuim) { RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "writeSmsToRuim finished"; } /* * Test IRadioMessaging.deleteSmsOnRuim() for the response returned. */ TEST_P(RadioMessagingTest, deleteSmsOnRuim) { - LOG(DEBUG) << "deleteSmsOnRuim"; serial = GetRandomSerialNumber(); int index = 1; @@ -704,14 +665,12 @@ TEST_P(RadioMessagingTest, deleteSmsOnRuim) { RadioError::MODEM_ERR, RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "deleteSmsOnRuim finished"; } /* * Test IRadioMessaging.reportSmsMemoryStatus() for the response returned. */ TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { - LOG(DEBUG) << "reportSmsMemoryStatus"; serial = GetRandomSerialNumber(); bool available = true; @@ -727,5 +686,4 @@ TEST_P(RadioMessagingTest, reportSmsMemoryStatus) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "reportSmsMemoryStatus finished"; } diff --git a/radio/aidl/vts/radio_messaging_utils.h b/radio/aidl/vts/radio_messaging_utils.h index 7b66192679..3bd8346575 100644 --- a/radio/aidl/vts/radio_messaging_utils.h +++ b/radio/aidl/vts/radio_messaging_utils.h @@ -132,9 +132,9 @@ class RadioMessagingIndication : public BnRadioMessagingIndication { }; // The main test class for Radio AIDL Messaging. -class RadioMessagingTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioMessagingTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio messaging service handle */ std::shared_ptr radio_messaging; diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp index 67747a882f..c48a46104a 100644 --- a/radio/aidl/vts/radio_modem_test.cpp +++ b/radio/aidl/vts/radio_modem_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_modem_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioModemTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -37,8 +37,6 @@ void RadioModemTest::SetUp() { radioRsp_modem = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_modem.get()); - count_ = 0; - radioInd_modem = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_modem.get()); @@ -154,7 +152,6 @@ TEST_P(RadioModemTest, getModemStackStatus) { * Test IRadioModem.getBasebandVersion() for the response returned. */ TEST_P(RadioModemTest, getBasebandVersion) { - LOG(DEBUG) << "getBasebandVersion"; serial = GetRandomSerialNumber(); radio_modem->getBasebandVersion(serial); @@ -165,14 +162,12 @@ TEST_P(RadioModemTest, getBasebandVersion) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); } - LOG(DEBUG) << "getBasebandVersion finished"; } /* * Test IRadioModem.getDeviceIdentity() for the response returned. */ TEST_P(RadioModemTest, getDeviceIdentity) { - LOG(DEBUG) << "getDeviceIdentity"; serial = GetRandomSerialNumber(); radio_modem->getDeviceIdentity(serial); @@ -184,7 +179,6 @@ TEST_P(RadioModemTest, getDeviceIdentity) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::EMPTY_RECORD})); } - LOG(DEBUG) << "getDeviceIdentity finished"; } /* @@ -198,7 +192,6 @@ TEST_P(RadioModemTest, getImei) { ALOGI("Skipped the test since getImei is not supported on version < 2"); GTEST_SKIP(); } - LOG(DEBUG) << "getImei"; serial = GetRandomSerialNumber(); radio_modem->getImei(serial); @@ -210,14 +203,12 @@ TEST_P(RadioModemTest, getImei) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::EMPTY_RECORD})); } - LOG(DEBUG) << "getImei finished"; } /* * Test IRadioModem.nvReadItem() for the response returned. */ TEST_P(RadioModemTest, nvReadItem) { - LOG(DEBUG) << "nvReadItem"; serial = GetRandomSerialNumber(); radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25); @@ -229,14 +220,12 @@ TEST_P(RadioModemTest, nvReadItem) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvReadItem finished"; } /* * Test IRadioModem.nvWriteItem() for the response returned. */ TEST_P(RadioModemTest, nvWriteItem) { - LOG(DEBUG) << "nvWriteItem"; serial = GetRandomSerialNumber(); NvWriteItem item; memset(&item, 0, sizeof(item)); @@ -251,14 +240,12 @@ TEST_P(RadioModemTest, nvWriteItem) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvWriteItem finished"; } /* * Test IRadioModem.nvWriteCdmaPrl() for the response returned. */ TEST_P(RadioModemTest, nvWriteCdmaPrl) { - LOG(DEBUG) << "nvWriteCdmaPrl"; serial = GetRandomSerialNumber(); std::vector prl = {1, 2, 3, 4, 5}; @@ -271,14 +258,12 @@ TEST_P(RadioModemTest, nvWriteCdmaPrl) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "nvWriteCdmaPrl finished"; } /* * Test IRadioModem.nvResetConfig() for the response returned. */ TEST_P(RadioModemTest, nvResetConfig) { - LOG(DEBUG) << "nvResetConfig"; serial = GetRandomSerialNumber(); radio_modem->nvResetConfig(serial, ResetNvType::FACTORY_RESET); @@ -292,14 +277,12 @@ TEST_P(RadioModemTest, nvResetConfig) { } // wait until modem reset finishes sleep(10); - LOG(DEBUG) << "nvResetConfig finished"; } /* * Test IRadioModem.getHardwareConfig() for the response returned. */ TEST_P(RadioModemTest, getHardwareConfig) { - LOG(DEBUG) << "getHardwareConfig"; serial = GetRandomSerialNumber(); radio_modem->getHardwareConfig(serial); @@ -311,7 +294,6 @@ TEST_P(RadioModemTest, getHardwareConfig) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getHardwareConfig finished"; } /* @@ -337,7 +319,6 @@ TEST_P(RadioModemTest, DISABLED_requestShutdown) { * Test IRadioModem.getRadioCapability() for the response returned. */ TEST_P(RadioModemTest, getRadioCapability) { - LOG(DEBUG) << "getRadioCapability"; serial = GetRandomSerialNumber(); radio_modem->getRadioCapability(serial); @@ -348,14 +329,12 @@ TEST_P(RadioModemTest, getRadioCapability) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_modem->rspInfo.error); } - LOG(DEBUG) << "getRadioCapability finished"; } /* * Test IRadioModem.setRadioCapability() for the response returned. */ TEST_P(RadioModemTest, setRadioCapability) { - LOG(DEBUG) << "setRadioCapability"; serial = GetRandomSerialNumber(); RadioCapability rc; memset(&rc, 0, sizeof(rc)); @@ -371,14 +350,12 @@ TEST_P(RadioModemTest, setRadioCapability) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setRadioCapability finished"; } /* * Test IRadioModem.getModemActivityInfo() for the response returned. */ TEST_P(RadioModemTest, getModemActivityInfo) { - LOG(DEBUG) << "getModemActivityInfo"; serial = GetRandomSerialNumber(); radio_modem->getModemActivityInfo(serial); @@ -390,14 +367,12 @@ TEST_P(RadioModemTest, getModemActivityInfo) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "getModemActivityInfo finished"; } /* * Test IRadioModem.sendDeviceState() for the response returned. */ TEST_P(RadioModemTest, sendDeviceState) { - LOG(DEBUG) << "sendDeviceState"; serial = GetRandomSerialNumber(); radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true); @@ -411,5 +386,4 @@ TEST_P(RadioModemTest, sendDeviceState) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "sendDeviceState finished"; } diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h index d2f5a104bc..d47bdeb921 100644 --- a/radio/aidl/vts/radio_modem_utils.h +++ b/radio/aidl/vts/radio_modem_utils.h @@ -112,9 +112,9 @@ class RadioModemIndication : public BnRadioModemIndication { }; // The main test class for Radio AIDL Modem. -class RadioModemTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioModemTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio modem service handle */ std::shared_ptr radio_modem; diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 0344dd6acc..e5da05032f 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "radio_network_utils.h" @@ -25,6 +24,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioNetworkTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -39,8 +39,6 @@ void RadioNetworkTest::SetUp() { radioRsp_network = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_network.get()); - count_ = 0; - radioInd_network = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_network.get()); @@ -1665,7 +1663,6 @@ TEST_P(RadioNetworkTest, getImsRegistrationState) { * Test IRadioNetwork.getOperator() for the response returned. */ TEST_P(RadioNetworkTest, getOperator) { - LOG(DEBUG) << "getOperator"; serial = GetRandomSerialNumber(); radio_network->getOperator(serial); @@ -1676,14 +1673,12 @@ TEST_P(RadioNetworkTest, getOperator) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getOperator finished"; } /* * Test IRadioNetwork.getNetworkSelectionMode() for the response returned. */ TEST_P(RadioNetworkTest, getNetworkSelectionMode) { - LOG(DEBUG) << "getNetworkSelectionMode"; serial = GetRandomSerialNumber(); radio_network->getNetworkSelectionMode(serial); @@ -1694,14 +1689,12 @@ TEST_P(RadioNetworkTest, getNetworkSelectionMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getNetworkSelectionMode finished"; } /* * Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned. */ TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) { - LOG(DEBUG) << "setNetworkSelectionModeAutomatic"; serial = GetRandomSerialNumber(); radio_network->setNetworkSelectionModeAutomatic(serial); @@ -1715,14 +1708,12 @@ TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) { RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setNetworkSelectionModeAutomatic finished"; } /* * Test IRadioNetwork.getAvailableNetworks() for the response returned. */ TEST_P(RadioNetworkTest, getAvailableNetworks) { - LOG(DEBUG) << "getAvailableNetworks"; serial = GetRandomSerialNumber(); radio_network->getAvailableNetworks(serial); @@ -1738,14 +1729,12 @@ TEST_P(RadioNetworkTest, getAvailableNetworks) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getAvailableNetworks finished"; } /* * Test IRadioNetwork.setBandMode() for the response returned. */ TEST_P(RadioNetworkTest, setBandMode) { - LOG(DEBUG) << "setBandMode"; serial = GetRandomSerialNumber(); radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA); @@ -1757,14 +1746,12 @@ TEST_P(RadioNetworkTest, setBandMode) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setBandMode finished"; } /* * Test IRadioNetwork.setLocationUpdates() for the response returned. */ TEST_P(RadioNetworkTest, setLocationUpdates) { - LOG(DEBUG) << "setLocationUpdates"; serial = GetRandomSerialNumber(); radio_network->setLocationUpdates(serial, true); @@ -1776,14 +1763,12 @@ TEST_P(RadioNetworkTest, setLocationUpdates) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "setLocationUpdates finished"; } /* * Test IRadioNetwork.setCdmaRoamingPreference() for the response returned. */ TEST_P(RadioNetworkTest, setCdmaRoamingPreference) { - LOG(DEBUG) << "setCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK); @@ -1796,14 +1781,12 @@ TEST_P(RadioNetworkTest, setCdmaRoamingPreference) { radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setCdmaRoamingPreference finished"; } /* * Test IRadioNetwork.getCdmaRoamingPreference() for the response returned. */ TEST_P(RadioNetworkTest, getCdmaRoamingPreference) { - LOG(DEBUG) << "getCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio_network->getCdmaRoamingPreference(serial); @@ -1817,14 +1800,12 @@ TEST_P(RadioNetworkTest, getCdmaRoamingPreference) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCdmaRoamingPreference finished"; } /* * Test IRadioNetwork.getVoiceRadioTechnology() for the response returned. */ TEST_P(RadioNetworkTest, getVoiceRadioTechnology) { - LOG(DEBUG) << "getVoiceRadioTechnology"; serial = GetRandomSerialNumber(); radio_network->getVoiceRadioTechnology(serial); @@ -1835,14 +1816,12 @@ TEST_P(RadioNetworkTest, getVoiceRadioTechnology) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_network->rspInfo.error); } - LOG(DEBUG) << "getVoiceRadioTechnology finished"; } /* * Test IRadioNetwork.setCellInfoListRate() for the response returned. */ TEST_P(RadioNetworkTest, setCellInfoListRate) { - LOG(DEBUG) << "setCellInfoListRate"; serial = GetRandomSerialNumber(); radio_network->setCellInfoListRate(serial, 10); @@ -1854,14 +1833,12 @@ TEST_P(RadioNetworkTest, setCellInfoListRate) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setCellInfoListRate finished"; } /* * Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned. */ TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { - LOG(DEBUG) << "supplyNetworkDepersonalization"; serial = GetRandomSerialNumber(); radio_network->supplyNetworkDepersonalization(serial, std::string("test")); @@ -1876,7 +1853,6 @@ TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) { RadioError::INVALID_SIM_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR})); } - LOG(DEBUG) << "supplyNetworkDepersonalization finished"; } /* @@ -1891,7 +1867,6 @@ TEST_P(RadioNetworkTest, setEmergencyMode) { GTEST_SKIP(); } - LOG(DEBUG) << "setEmergencyMode"; serial = GetRandomSerialNumber(); radio_network->setEmergencyMode(serial, EmergencyMode::EMERGENCY_WWAN); @@ -1907,8 +1882,6 @@ TEST_P(RadioNetworkTest, setEmergencyMode) { // exit emergency mode for other tests serial = GetRandomSerialNumber(); radio_network->exitEmergencyMode(serial); - - LOG(DEBUG) << "setEmergencyMode finished"; } /* @@ -1924,7 +1897,6 @@ TEST_P(RadioNetworkTest, triggerEmergencyNetworkScan) { GTEST_SKIP(); } - LOG(DEBUG) << "triggerEmergencyNetworkScan"; serial = GetRandomSerialNumber(); EmergencyNetworkScanTrigger scanRequest; @@ -1940,7 +1912,6 @@ TEST_P(RadioNetworkTest, triggerEmergencyNetworkScan) { radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, RadioError::INVALID_ARGUMENTS})); - LOG(DEBUG) << "triggerEmergencyNetworkScan finished"; } /* @@ -1955,7 +1926,6 @@ TEST_P(RadioNetworkTest, cancelEmergencyNetworkScan) { GTEST_SKIP(); } - LOG(DEBUG) << "cancelEmergencyNetworkScan"; serial = GetRandomSerialNumber(); radio_network->cancelEmergencyNetworkScan(serial, true); @@ -1963,11 +1933,9 @@ TEST_P(RadioNetworkTest, cancelEmergencyNetworkScan) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, - RadioError::MODEM_ERR})); - LOG(DEBUG) << "cancelEmergencyNetworkScan finished"; + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); } /* @@ -1982,7 +1950,6 @@ TEST_P(RadioNetworkTest, exitEmergencyMode) { GTEST_SKIP(); } - LOG(DEBUG) << "exitEmergencyMode"; serial = GetRandomSerialNumber(); radio_network->exitEmergencyMode(serial); @@ -1990,11 +1957,9 @@ TEST_P(RadioNetworkTest, exitEmergencyMode) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - ASSERT_TRUE(CheckAnyOfErrors( - radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, - RadioError::MODEM_ERR})); - LOG(DEBUG) << "exitEmergencyMode finished"; + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, + RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); } /* @@ -2073,7 +2038,6 @@ TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) { GTEST_SKIP(); } - LOG(DEBUG) << "setNullCipherAndIntegrityEnabled"; serial = GetRandomSerialNumber(); radio_network->setNullCipherAndIntegrityEnabled(serial, false); @@ -2084,7 +2048,6 @@ TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); - LOG(DEBUG) << "setNullCipherAndIntegrityEnabled finished"; } /** @@ -2100,7 +2063,6 @@ TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { GTEST_SKIP(); } - LOG(DEBUG) << "isNullCipherAndIntegrityEnabled"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = radio_network->isNullCipherAndIntegrityEnabled(serial); @@ -2113,5 +2075,4 @@ TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); - LOG(DEBUG) << "isNullCipherAndIntegrityEnabled finished"; } diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 601f04435b..8f8f6b070f 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -229,9 +229,9 @@ class RadioNetworkIndication : public BnRadioNetworkIndication { }; // The main test class for Radio AIDL Network. -class RadioNetworkTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioNetworkTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* radio network service handle */ std::shared_ptr radio_network; diff --git a/radio/aidl/vts/radio_sap_test.cpp b/radio/aidl/vts/radio_sap_test.cpp index c94379c934..9a1c145576 100644 --- a/radio/aidl/vts/radio_sap_test.cpp +++ b/radio/aidl/vts/radio_sap_test.cpp @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include + #include #include "radio_sap_utils.h" @@ -22,9 +22,13 @@ #define TIMEOUT_PERIOD 40 void SapTest::SetUp() { + ALOGD("BEGIN %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); + count = 0; + serial = -1; std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { - LOG(DEBUG) << "Skipped the test due to device configuration."; + ALOGI("Skipped the test due to device configuration."); GTEST_SKIP(); } sap = ISap::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService(serviceName.c_str()))); @@ -33,13 +37,16 @@ void SapTest::SetUp() { sapCb = ndk::SharedRefBase::make(*this); ASSERT_NE(sapCb.get(), nullptr); - count = 0; - ndk::ScopedAStatus res = sap->setCallback(sapCb); ASSERT_OK(res) << res; } -void SapTest::TearDown() {} +void SapTest::TearDown() { + count_ = 0; + serial = -1; + ALOGD("END %s#%s", ::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name(), + ::testing::UnitTest::GetInstance()->current_test_info()->name()); +} ::testing::AssertionResult SapTest::CheckAnyOfErrors(SapResultCode err, std::vector errors) { @@ -52,9 +59,9 @@ void SapTest::TearDown() {} } void SapTest::notify(int receivedSerial) { - std::unique_lock lock(mtx); - count++; + std::lock_guard lock(mtx); if (serial == receivedSerial) { + count++; cv.notify_one(); } } @@ -78,7 +85,6 @@ std::cv_status SapTest::wait() { * Test ISap.connectReq() for the response returned. */ TEST_P(SapTest, connectReq) { - LOG(DEBUG) << "connectReq"; serial = GetRandomSerialNumber(); int32_t maxMsgSize = 100; @@ -97,7 +103,6 @@ TEST_P(SapTest, connectReq) { * Test ISap.disconnectReq() for the response returned */ TEST_P(SapTest, disconnectReq) { - LOG(DEBUG) << "disconnectReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->disconnectReq(serial); @@ -105,14 +110,12 @@ TEST_P(SapTest, disconnectReq) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(sapCb->sapResponseSerial, serial); - LOG(DEBUG) << "disconnectReq finished"; } /* * Test ISap.apduReq() for the response returned. */ TEST_P(SapTest, apduReq) { - LOG(DEBUG) << "apduReq"; serial = GetRandomSerialNumber(); SapApduType sapApduType = SapApduType::APDU; std::vector command = {}; @@ -128,14 +131,12 @@ TEST_P(SapTest, apduReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "apduReq finished"; } /* * Test ISap.transferAtrReq() for the response returned. */ TEST_P(SapTest, transferAtrReq) { - LOG(DEBUG) << "transferAtrReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->transferAtrReq(serial); @@ -148,14 +149,12 @@ TEST_P(SapTest, transferAtrReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "transferAtrReq finished"; } /* * Test ISap.powerReq() for the response returned. */ TEST_P(SapTest, powerReq) { - LOG(DEBUG) << "powerReq"; serial = GetRandomSerialNumber(); bool state = true; @@ -170,14 +169,12 @@ TEST_P(SapTest, powerReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::CARD_ALREADY_POWERED_ON, SapResultCode::SUCCESS})); - LOG(DEBUG) << "powerReq finished"; } /* * Test ISap.resetSimReq() for the response returned. */ TEST_P(SapTest, resetSimReq) { - LOG(DEBUG) << "resetSimReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->resetSimReq(serial); @@ -191,14 +188,12 @@ TEST_P(SapTest, resetSimReq) { {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "resetSimReq finished"; } /* * Test ISap.transferCardReaderStatusReq() for the response returned. */ TEST_P(SapTest, transferCardReaderStatusReq) { - LOG(DEBUG) << "transferCardReaderStatusReq"; serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = sap->transferCardReaderStatusReq(serial); @@ -210,14 +205,12 @@ TEST_P(SapTest, transferCardReaderStatusReq) { ASSERT_TRUE(CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE, SapResultCode::SUCCESS})); - LOG(DEBUG) << "transferCardReaderStatusReq finished"; } /* * Test ISap.setTransferProtocolReq() for the response returned. */ TEST_P(SapTest, setTransferProtocolReq) { - LOG(DEBUG) << "setTransferProtocolReq"; serial = GetRandomSerialNumber(); SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0; @@ -229,5 +222,4 @@ TEST_P(SapTest, setTransferProtocolReq) { ASSERT_TRUE(CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::NOT_SUPPORTED, SapResultCode::SUCCESS})); - LOG(DEBUG) << "setTransferProtocolReq finished"; } diff --git a/radio/aidl/vts/radio_satellite_test.cpp b/radio/aidl/vts/radio_satellite_test.cpp index b0358b3b0d..b646ef615a 100644 --- a/radio/aidl/vts/radio_satellite_test.cpp +++ b/radio/aidl/vts/radio_satellite_test.cpp @@ -15,7 +15,6 @@ */ #include -#include #include #include "radio_satellite_utils.h" @@ -23,6 +22,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(((ret).isOk())) void RadioSatelliteTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -30,6 +30,11 @@ void RadioSatelliteTest::SetUp() { GTEST_SKIP(); } + if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { + ALOGI("Skipping test because satellite is not supported in device."); + GTEST_SKIP(); + } + satellite = IRadioSatellite::fromBinder( ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); ASSERT_NE(nullptr, satellite.get()); @@ -37,8 +42,6 @@ void RadioSatelliteTest::SetUp() { rsp_satellite = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, rsp_satellite.get()); - count_ = 0; - ind_satellite = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, ind_satellite.get()); @@ -54,13 +57,6 @@ void RadioSatelliteTest::SetUp() { * Test IRadioSatellite.getCapabilities() for the response returned. */ TEST_P(RadioSatelliteTest, getCapabilities) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getCapabilities because satellite is not supported in device"); - return; - } else { - ALOGI("Running getCapabilities because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getCapabilities(serial); ASSERT_OK(res); @@ -84,13 +80,6 @@ TEST_P(RadioSatelliteTest, getCapabilities) { * Test IRadioSatellite.setPower() for the response returned. */ TEST_P(RadioSatelliteTest, setPower) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping setPower because satellite is not supported in device"); - return; - } else { - ALOGI("Running setPower because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->setPower(serial, true); ASSERT_OK(res); @@ -114,13 +103,6 @@ TEST_P(RadioSatelliteTest, setPower) { * Test IRadioSatellite.getPowerSate() for the response returned. */ TEST_P(RadioSatelliteTest, getPowerSate) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getPowerSate because satellite is not supported in device"); - return; - } else { - ALOGI("Running getPowerSate because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getPowerState(serial); ASSERT_OK(res); @@ -128,7 +110,7 @@ TEST_P(RadioSatelliteTest, getPowerSate) { EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - ALOGI("getPowerSate, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); + ALOGI("getPowerState, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); ASSERT_TRUE(CheckAnyOfErrors( rsp_satellite->rspInfo.error, @@ -144,13 +126,6 @@ TEST_P(RadioSatelliteTest, getPowerSate) { * Test IRadioSatellite.provisionService() for the response returned. */ TEST_P(RadioSatelliteTest, provisionService) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping provisionService because satellite is not supported in device"); - return; - } else { - ALOGI("Running provisionService because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); std::string imei = "imei"; std::string msisdn = "msisdn"; @@ -204,13 +179,6 @@ TEST_P(RadioSatelliteTest, provisionService) { * Test IRadioSatellite.addAllowedSatelliteContacts() for the response returned. */ TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping addAllowedSatelliteContacts because satellite is not supported in device"); - return; - } else { - ALOGI("Running addAllowedSatelliteContacts because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); const std::vector contacts = {"contact 1", "contact 2"}; ndk::ScopedAStatus res = satellite->addAllowedSatelliteContacts(serial, contacts); @@ -236,13 +204,6 @@ TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) { RadioError::MODEM_ERR, RadioError::NETWORK_ERR, RadioError::NETWORK_NOT_READY, - RadioError::NETWORK_REJECT, - RadioError::NETWORK_TIMEOUT, - RadioError::NO_MEMORY, - RadioError::NO_NETWORK_FOUND, - RadioError::NO_RESOURCES, - RadioError::NO_SATELLITE_SIGNAL, - RadioError::NO_SUBSCRIPTION, RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE, RadioError::OPERATION_NOT_ALLOWED, RadioError::RADIO_NOT_AVAILABLE, @@ -260,14 +221,6 @@ TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) { * Test IRadioSatellite.removeAllowedSatelliteContacts() for the response returned. */ TEST_P(RadioSatelliteTest, removeAllowedSatelliteContacts) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping removeAllowedSatelliteContacts because satellite is not supported in " - "device"); - return; - } else { - ALOGI("Running removeAllowedSatelliteContacts because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); const std::vector contacts = {"contact 1", "contact 2"}; ndk::ScopedAStatus res = satellite->removeAllowedSatelliteContacts(serial, contacts); @@ -317,13 +270,6 @@ TEST_P(RadioSatelliteTest, removeAllowedSatelliteContacts) { * Test IRadioSatellite.sendMessages() for the response returned. */ TEST_P(RadioSatelliteTest, sendMessages) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping sendMessages because satellite is not supported in device"); - return; - } else { - ALOGI("Running sendMessages because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); const std::vector messages = {"message 1", "message 2"}; std::string destination = "0123456789"; @@ -380,13 +326,6 @@ TEST_P(RadioSatelliteTest, sendMessages) { * Test IRadioSatellite.getPendingMessages() for the response returned. */ TEST_P(RadioSatelliteTest, getPendingMessages) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getPendingMessages because satellite is not supported in device"); - return; - } else { - ALOGI("Running getPendingMessages because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getPendingMessages(serial); ASSERT_OK(res); @@ -440,13 +379,6 @@ TEST_P(RadioSatelliteTest, getPendingMessages) { * Test IRadioSatellite.getSatelliteMode() for the response returned. */ TEST_P(RadioSatelliteTest, getSatelliteMode) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getSatelliteMode because satellite is not supported in device"); - return; - } else { - ALOGI("Running getSatelliteMode because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getSatelliteMode(serial); ASSERT_OK(res); @@ -470,13 +402,6 @@ TEST_P(RadioSatelliteTest, getSatelliteMode) { * Test IRadioSatellite.setIndicationFilter() for the response returned. */ TEST_P(RadioSatelliteTest, setIndicationFilter) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping setIndicationFilter because satellite is not supported in device"); - return; - } else { - ALOGI("Running setIndicationFilter because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->setIndicationFilter(serial, 0); ASSERT_OK(res); @@ -501,14 +426,6 @@ TEST_P(RadioSatelliteTest, setIndicationFilter) { * Test IRadioSatellite.startSendingSatellitePointingInfo() for the response returned. */ TEST_P(RadioSatelliteTest, startSendingSatellitePointingInfo) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping startSendingSatellitePointingInfo because satellite is not supported in " - "device"); - return; - } else { - ALOGI("Running startSendingSatellitePointingInfo because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->startSendingSatellitePointingInfo(serial); ASSERT_OK(res); @@ -533,14 +450,6 @@ TEST_P(RadioSatelliteTest, startSendingSatellitePointingInfo) { * Test IRadioSatellite.stopSatelliteLocationUpdate() for the response returned. */ TEST_P(RadioSatelliteTest, stopSatelliteLocationUpdate) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping stopSendingSatellitePointingInfo because satellite is not supported in " - "device"); - return; - } else { - ALOGI("Running stopSendingSatellitePointingInfo because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->stopSendingSatellitePointingInfo(serial); ASSERT_OK(res); @@ -565,14 +474,6 @@ TEST_P(RadioSatelliteTest, stopSatelliteLocationUpdate) { * Test IRadioSatellite.getMaxCharactersPerTextMessage() for the response returned. */ TEST_P(RadioSatelliteTest, getMaxCharactersPerTextMessage) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getMaxCharactersPerTextMessage because satellite is not supported in " - "device"); - return; - } else { - ALOGI("Running getMaxCharactersPerTextMessage because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getMaxCharactersPerTextMessage(serial); ASSERT_OK(res); @@ -597,14 +498,6 @@ TEST_P(RadioSatelliteTest, getMaxCharactersPerTextMessage) { * Test IRadioSatellite.getTimeForNextSatelliteVisibility() for the response returned. */ TEST_P(RadioSatelliteTest, getTimeForNextSatelliteVisibility) { - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping getTimeForNextSatelliteVisibility because satellite is not supported in " - "device"); - return; - } else { - ALOGI("Running getTimeForNextSatelliteVisibility because satellite is supported in device"); - } - serial = GetRandomSerialNumber(); ndk::ScopedAStatus res = satellite->getTimeForNextSatelliteVisibility(serial); ASSERT_OK(res); @@ -623,4 +516,4 @@ TEST_P(RadioSatelliteTest, getTimeForNextSatelliteVisibility) { RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, RadioError::SYSTEM_ERR})); -} \ No newline at end of file +} diff --git a/radio/aidl/vts/radio_satellite_utils.h b/radio/aidl/vts/radio_satellite_utils.h index 2b07ec5543..a0fdc7e599 100644 --- a/radio/aidl/vts/radio_satellite_utils.h +++ b/radio/aidl/vts/radio_satellite_utils.h @@ -113,9 +113,9 @@ class RadioSatelliteIndication : public BnRadioSatelliteIndication { }; // The main test class for AIDL Satellite. -class RadioSatelliteTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioSatelliteTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* Radio Satellite service handle */ std::shared_ptr satellite; diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp index f65714229c..d90658893b 100644 --- a/radio/aidl/vts/radio_sim_test.cpp +++ b/radio/aidl/vts/radio_sim_test.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include "radio_sim_utils.h" @@ -24,6 +23,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioSimTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -38,8 +38,6 @@ void RadioSimTest::SetUp() { radioRsp_sim = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_sim.get()); - count_ = 0; - radioInd_sim = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_sim.get()); @@ -481,19 +479,16 @@ TEST_P(RadioSimTest, setAllowedCarriers) { * Test IRadioSim.getIccCardStatus() for the response returned. */ TEST_P(RadioSimTest, getIccCardStatus) { - LOG(DEBUG) << "getIccCardStatus"; EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.imsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS); - LOG(DEBUG) << "getIccCardStatus finished"; } /* * Test IRadioSim.supplyIccPinForApp() for the response returned */ TEST_P(RadioSimTest, supplyIccPinForApp) { - LOG(DEBUG) << "supplyIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -513,14 +508,12 @@ TEST_P(RadioSimTest, supplyIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } - LOG(DEBUG) << "supplyIccPinForApp finished"; } /* * Test IRadioSim.supplyIccPukForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPukForApp) { - LOG(DEBUG) << "supplyIccPukForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -540,14 +533,12 @@ TEST_P(RadioSimTest, supplyIccPukForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); } } - LOG(DEBUG) << "supplyIccPukForApp finished"; } /* * Test IRadioSim.supplyIccPin2ForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPin2ForApp) { - LOG(DEBUG) << "supplyIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -568,14 +559,12 @@ TEST_P(RadioSimTest, supplyIccPin2ForApp) { RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); } } - LOG(DEBUG) << "supplyIccPin2ForApp finished"; } /* * Test IRadioSim.supplyIccPuk2ForApp() for the response returned. */ TEST_P(RadioSimTest, supplyIccPuk2ForApp) { - LOG(DEBUG) << "supplyIccPuk2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -595,14 +584,12 @@ TEST_P(RadioSimTest, supplyIccPuk2ForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::INVALID_SIM_STATE})); } } - LOG(DEBUG) << "supplyIccPuk2ForApp finished"; } /* * Test IRadioSim.changeIccPinForApp() for the response returned. */ TEST_P(RadioSimTest, changeIccPinForApp) { - LOG(DEBUG) << "changeIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -622,14 +609,12 @@ TEST_P(RadioSimTest, changeIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } - LOG(DEBUG) << "changeIccPinForApp finished"; } /* * Test IRadioSim.changeIccPin2ForApp() for the response returned. */ TEST_P(RadioSimTest, changeIccPin2ForApp) { - LOG(DEBUG) << "changeIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -650,14 +635,12 @@ TEST_P(RadioSimTest, changeIccPin2ForApp) { RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_PUK2})); } } - LOG(DEBUG) << "changeIccPin2ForApp finished"; } /* * Test IRadioSim.getImsiForApp() for the response returned. */ TEST_P(RadioSimTest, getImsiForApp) { - LOG(DEBUG) << "getImsiForApp"; serial = GetRandomSerialNumber(); // Check success returned while getting imsi for 3GPP and 3GPP2 apps only @@ -681,14 +664,12 @@ TEST_P(RadioSimTest, getImsiForApp) { } } } - LOG(DEBUG) << "getImsiForApp finished"; } /* * Test IRadioSim.iccIoForApp() for the response returned. */ TEST_P(RadioSimTest, iccIoForApp) { - LOG(DEBUG) << "iccIoForApp"; serial = GetRandomSerialNumber(); for (int i = 0; i < (int)cardStatus.applications.size(); i++) { @@ -708,14 +689,12 @@ TEST_P(RadioSimTest, iccIoForApp) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); } - LOG(DEBUG) << "iccIoForApp finished"; } /* * Test IRadioSim.iccTransmitApduBasicChannel() for the response returned. */ TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { - LOG(DEBUG) << "iccTransmitApduBasicChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -725,14 +704,12 @@ TEST_P(RadioSimTest, iccTransmitApduBasicChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - LOG(DEBUG) << "iccTransmitApduBasicChannel finished"; } /* * Test IRadioSim.iccOpenLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccOpenLogicalChannel) { - LOG(DEBUG) << "iccOpenLogicalChannel"; serial = GetRandomSerialNumber(); int p2 = 0x04; // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested. @@ -742,14 +719,12 @@ TEST_P(RadioSimTest, iccOpenLogicalChannel) { EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); } - LOG(DEBUG) << "iccOpenLogicalChannel finished"; } /* * Test IRadioSim.iccCloseLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccCloseLogicalChannel) { - LOG(DEBUG) << "iccCloseLogicalChannel"; serial = GetRandomSerialNumber(); // Try closing invalid channel and check INVALID_ARGUMENTS returned as error radio_sim->iccCloseLogicalChannel(serial, 0); @@ -758,7 +733,6 @@ TEST_P(RadioSimTest, iccCloseLogicalChannel) { EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error); - LOG(DEBUG) << "iccCloseLogicalChannel finished"; } /* @@ -773,7 +747,6 @@ TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) { " iccCloseLogicalChannelWithSessionInfo is not supported on version < 2"); GTEST_SKIP(); } - LOG(DEBUG) << "iccCloseLogicalChannelWithSessionInfo"; serial = GetRandomSerialNumber(); SessionInfo info; memset(&info, 0, sizeof(info)); @@ -787,14 +760,12 @@ TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) { EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp_sim->rspInfo.error); - LOG(DEBUG) << "iccCloseLogicalChannelWithSessionInfo finished"; } /* * Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned. */ TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { - LOG(DEBUG) << "iccTransmitApduLogicalChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -804,14 +775,12 @@ TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) { EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_sim->rspInfo.type); EXPECT_EQ(serial, radioRsp_sim->rspInfo.serial); - LOG(DEBUG) << "iccTransmitApduLogicalChannel finished"; } /* * Test IRadioSim.requestIccSimAuthentication() for the response returned. */ TEST_P(RadioSimTest, requestIccSimAuthentication) { - LOG(DEBUG) << "requestIccSimAuthentication"; serial = GetRandomSerialNumber(); // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS @@ -826,7 +795,6 @@ TEST_P(RadioSimTest, requestIccSimAuthentication) { radioRsp_sim->rspInfo.error, {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "requestIccSimAuthentication finished"; } /* @@ -880,7 +848,6 @@ TEST_P(RadioSimTest, setFacilityLockForApp) { * Test IRadioSim.getCdmaSubscription() for the response returned. */ TEST_P(RadioSimTest, getCdmaSubscription) { - LOG(DEBUG) << "getCdmaSubscription"; serial = GetRandomSerialNumber(); radio_sim->getCdmaSubscription(serial); @@ -893,14 +860,12 @@ TEST_P(RadioSimTest, getCdmaSubscription) { radioRsp_sim->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getCdmaSubscription finished"; } /* * Test IRadioSim.getCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioSimTest, getCdmaSubscriptionSource) { - LOG(DEBUG) << "getCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio_sim->getCdmaSubscriptionSource(serial); @@ -913,14 +878,12 @@ TEST_P(RadioSimTest, getCdmaSubscriptionSource) { radioRsp_sim->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "getCdmaSubscriptionSource finished"; } /* * Test IRadioSim.setCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioSimTest, setCdmaSubscriptionSource) { - LOG(DEBUG) << "setCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM); @@ -934,14 +897,12 @@ TEST_P(RadioSimTest, setCdmaSubscriptionSource) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCdmaSubscriptionSource finished"; } /* * Test IRadioSim.setUiccSubscription() for the response returned. */ TEST_P(RadioSimTest, setUiccSubscription) { - LOG(DEBUG) << "setUiccSubscription"; serial = GetRandomSerialNumber(); SelectUiccSub item; memset(&item, 0, sizeof(item)); @@ -958,14 +919,12 @@ TEST_P(RadioSimTest, setUiccSubscription) { RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setUiccSubscription finished"; } /* * Test IRadioSim.sendEnvelope() for the response returned. */ TEST_P(RadioSimTest, sendEnvelope) { - LOG(DEBUG) << "sendEnvelope"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -983,14 +942,12 @@ TEST_P(RadioSimTest, sendEnvelope) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendEnvelope finished"; } /* * Test IRadioSim.sendTerminalResponseToSim() for the response returned. */ TEST_P(RadioSimTest, sendTerminalResponseToSim) { - LOG(DEBUG) << "sendTerminalResponseToSim"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -1008,14 +965,12 @@ TEST_P(RadioSimTest, sendTerminalResponseToSim) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendTerminalResponseToSim finished"; } /* * Test IRadioSim.reportStkServiceIsRunning() for the response returned. */ TEST_P(RadioSimTest, reportStkServiceIsRunning) { - LOG(DEBUG) << "reportStkServiceIsRunning"; serial = GetRandomSerialNumber(); radio_sim->reportStkServiceIsRunning(serial); @@ -1028,7 +983,6 @@ TEST_P(RadioSimTest, reportStkServiceIsRunning) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_sim->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "reportStkServiceIsRunning finished"; } /* @@ -1036,7 +990,6 @@ TEST_P(RadioSimTest, reportStkServiceIsRunning) { * string. */ TEST_P(RadioSimTest, sendEnvelopeWithStatus) { - LOG(DEBUG) << "sendEnvelopeWithStatus"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -1054,5 +1007,4 @@ TEST_P(RadioSimTest, sendEnvelopeWithStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendEnvelopeWithStatus finished"; } diff --git a/radio/aidl/vts/radio_sim_utils.h b/radio/aidl/vts/radio_sim_utils.h index 71c7eb82c1..7cbcc58fd1 100644 --- a/radio/aidl/vts/radio_sim_utils.h +++ b/radio/aidl/vts/radio_sim_utils.h @@ -194,9 +194,9 @@ class RadioSimIndication : public BnRadioSimIndication { }; // The main test class for Radio AIDL SIM. -class RadioSimTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioSimTest : public RadioServiceTest { public: - virtual void SetUp() override; + void SetUp() override; /* Override updateSimCardStatus in RadioServiceTest to not call setResponseFunctions */ void updateSimCardStatus(); diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp index 249ee63dee..397c417efa 100644 --- a/radio/aidl/vts/radio_voice_test.cpp +++ b/radio/aidl/vts/radio_voice_test.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include "radio_voice_utils.h" @@ -24,6 +23,7 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) void RadioVoiceTest::SetUp() { + RadioServiceTest::SetUp(); std::string serviceName = GetParam(); if (!isServiceValidForDeviceConfiguration(serviceName)) { @@ -38,8 +38,6 @@ void RadioVoiceTest::SetUp() { radioRsp_voice = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioRsp_voice.get()); - count_ = 0; - radioInd_voice = ndk::SharedRefBase::make(*this); ASSERT_NE(nullptr, radioInd_voice.get()); @@ -324,7 +322,6 @@ TEST_P(RadioVoiceTest, getClip) { * Test IRadioVoice.getTtyMode() for the response returned. */ TEST_P(RadioVoiceTest, getTtyMode) { - LOG(DEBUG) << "getTtyMode"; serial = GetRandomSerialNumber(); radio_voice->getTtyMode(serial); @@ -335,14 +332,12 @@ TEST_P(RadioVoiceTest, getTtyMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "getTtyMode finished"; } /* * Test IRadioVoice.setTtyMode() for the response returned. */ TEST_P(RadioVoiceTest, setTtyMode) { - LOG(DEBUG) << "setTtyMode"; serial = GetRandomSerialNumber(); radio_voice->setTtyMode(serial, TtyMode::OFF); @@ -353,14 +348,12 @@ TEST_P(RadioVoiceTest, setTtyMode) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "setTtyMode finished"; } /* * Test IRadioVoice.setPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) { - LOG(DEBUG) << "setPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio_voice->setPreferredVoicePrivacy(serial, true); @@ -372,14 +365,12 @@ TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "setPreferredVoicePrivacy finished"; } /* * Test IRadioVoice.getPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) { - LOG(DEBUG) << "getPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio_voice->getPreferredVoicePrivacy(serial); @@ -391,14 +382,12 @@ TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } - LOG(DEBUG) << "getPreferredVoicePrivacy finished"; } /* * Test IRadioVoice.exitEmergencyCallbackMode() for the response returned. */ TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) { - LOG(DEBUG) << "exitEmergencyCallbackMode"; serial = GetRandomSerialNumber(); radio_voice->exitEmergencyCallbackMode(serial); @@ -411,14 +400,12 @@ TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) { radioRsp_voice->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } - LOG(DEBUG) << "exitEmergencyCallbackMode finished"; } /* * Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned. */ TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) { - LOG(DEBUG) << "handleStkCallSetupRequestFromSim"; serial = GetRandomSerialNumber(); bool accept = false; @@ -434,14 +421,12 @@ TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "handleStkCallSetupRequestFromSim finished"; } /* * Test IRadioVoice.dial() for the response returned. */ TEST_P(RadioVoiceTest, dial) { - LOG(DEBUG) << "dial"; serial = GetRandomSerialNumber(); Dial dialInfo; @@ -463,14 +448,12 @@ TEST_P(RadioVoiceTest, dial) { RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "dial finished"; } /* * Test IRadioVoice.hangup() for the response returned. */ TEST_P(RadioVoiceTest, hangup) { - LOG(DEBUG) << "hangup"; serial = GetRandomSerialNumber(); radio_voice->hangup(serial, 1); @@ -484,14 +467,12 @@ TEST_P(RadioVoiceTest, hangup) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangup finished"; } /* * Test IRadioVoice.hangupWaitingOrBackground() for the response returned. */ TEST_P(RadioVoiceTest, hangupWaitingOrBackground) { - LOG(DEBUG) << "hangupWaitingOrBackground"; serial = GetRandomSerialNumber(); radio_voice->hangupWaitingOrBackground(serial); @@ -504,14 +485,12 @@ TEST_P(RadioVoiceTest, hangupWaitingOrBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangupWaitingOrBackground finished"; } /* * Test IRadioVoice.hangupForegroundResumeBackground() for the response returned. */ TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) { - LOG(DEBUG) << "hangupForegroundResumeBackground"; serial = GetRandomSerialNumber(); radio_voice->hangupForegroundResumeBackground(serial); @@ -524,14 +503,12 @@ TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "hangupForegroundResumeBackground finished"; } /* * Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned. */ TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) { - LOG(DEBUG) << "switchWaitingOrHoldingAndActive"; serial = GetRandomSerialNumber(); radio_voice->switchWaitingOrHoldingAndActive(serial); @@ -544,14 +521,12 @@ TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "switchWaitingOrHoldingAndActive finished"; } /* * Test IRadioVoice.conference() for the response returned. */ TEST_P(RadioVoiceTest, conference) { - LOG(DEBUG) << "conference"; serial = GetRandomSerialNumber(); radio_voice->conference(serial); @@ -564,14 +539,12 @@ TEST_P(RadioVoiceTest, conference) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "conference finished"; } /* * Test IRadioVoice.rejectCall() for the response returned. */ TEST_P(RadioVoiceTest, rejectCall) { - LOG(DEBUG) << "rejectCall"; serial = GetRandomSerialNumber(); radio_voice->rejectCall(serial); @@ -584,14 +557,12 @@ TEST_P(RadioVoiceTest, rejectCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "rejectCall finished"; } /* * Test IRadioVoice.getLastCallFailCause() for the response returned. */ TEST_P(RadioVoiceTest, getLastCallFailCause) { - LOG(DEBUG) << "getLastCallFailCause"; serial = GetRandomSerialNumber(); radio_voice->getLastCallFailCause(serial); @@ -603,14 +574,12 @@ TEST_P(RadioVoiceTest, getLastCallFailCause) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getLastCallFailCause finished"; } /* * Test IRadioVoice.getCallForwardStatus() for the response returned. */ TEST_P(RadioVoiceTest, getCallForwardStatus) { - LOG(DEBUG) << "getCallForwardStatus"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -627,14 +596,12 @@ TEST_P(RadioVoiceTest, getCallForwardStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCallForwardStatus finished"; } /* * Test IRadioVoice.setCallForward() for the response returned. */ TEST_P(RadioVoiceTest, setCallForward) { - LOG(DEBUG) << "setCallForward"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -651,14 +618,12 @@ TEST_P(RadioVoiceTest, setCallForward) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCallForward finished"; } /* * Test IRadioVoice.getCallWaiting() for the response returned. */ TEST_P(RadioVoiceTest, getCallWaiting) { - LOG(DEBUG) << "getCallWaiting"; serial = GetRandomSerialNumber(); radio_voice->getCallWaiting(serial, 1); @@ -672,14 +637,12 @@ TEST_P(RadioVoiceTest, getCallWaiting) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "getCallWaiting finished"; } /* * Test IRadioVoice.setCallWaiting() for the response returned. */ TEST_P(RadioVoiceTest, setCallWaiting) { - LOG(DEBUG) << "setCallWaiting"; serial = GetRandomSerialNumber(); radio_voice->setCallWaiting(serial, true, 1); @@ -693,14 +656,12 @@ TEST_P(RadioVoiceTest, setCallWaiting) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setCallWaiting finished"; } /* * Test IRadioVoice.acceptCall() for the response returned. */ TEST_P(RadioVoiceTest, acceptCall) { - LOG(DEBUG) << "acceptCall"; serial = GetRandomSerialNumber(); radio_voice->acceptCall(serial); @@ -713,14 +674,12 @@ TEST_P(RadioVoiceTest, acceptCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "acceptCall finished"; } /* * Test IRadioVoice.separateConnection() for the response returned. */ TEST_P(RadioVoiceTest, separateConnection) { - LOG(DEBUG) << "separateConnection"; serial = GetRandomSerialNumber(); radio_voice->separateConnection(serial, 1); @@ -734,14 +693,12 @@ TEST_P(RadioVoiceTest, separateConnection) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "separateConnection finished"; } /* * Test IRadioVoice.explicitCallTransfer() for the response returned. */ TEST_P(RadioVoiceTest, explicitCallTransfer) { - LOG(DEBUG) << "explicitCallTransfer"; serial = GetRandomSerialNumber(); radio_voice->explicitCallTransfer(serial); @@ -754,14 +711,12 @@ TEST_P(RadioVoiceTest, explicitCallTransfer) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "explicitCallTransfer finished"; } /* * Test IRadioVoice.sendCdmaFeatureCode() for the response returned. */ TEST_P(RadioVoiceTest, sendCdmaFeatureCode) { - LOG(DEBUG) << "sendCdmaFeatureCode"; serial = GetRandomSerialNumber(); radio_voice->sendCdmaFeatureCode(serial, std::string()); @@ -776,14 +731,12 @@ TEST_P(RadioVoiceTest, sendCdmaFeatureCode) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendCdmaFeatureCode finished"; } /* * Test IRadioVoice.sendDtmf() for the response returned. */ TEST_P(RadioVoiceTest, sendDtmf) { - LOG(DEBUG) << "sendDtmf"; serial = GetRandomSerialNumber(); radio_voice->sendDtmf(serial, "1"); @@ -798,14 +751,12 @@ TEST_P(RadioVoiceTest, sendDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendDtmf finished"; } /* * Test IRadioVoice.startDtmf() for the response returned. */ TEST_P(RadioVoiceTest, startDtmf) { - LOG(DEBUG) << "startDtmf"; serial = GetRandomSerialNumber(); radio_voice->startDtmf(serial, "1"); @@ -820,14 +771,12 @@ TEST_P(RadioVoiceTest, startDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "startDtmf finished"; } /* * Test IRadioVoice.stopDtmf() for the response returned. */ TEST_P(RadioVoiceTest, stopDtmf) { - LOG(DEBUG) << "stopDtmf"; serial = GetRandomSerialNumber(); radio_voice->stopDtmf(serial); @@ -841,14 +790,12 @@ TEST_P(RadioVoiceTest, stopDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "stopDtmf finished"; } /* * Test IRadioVoice.setMute() for the response returned. */ TEST_P(RadioVoiceTest, setMute) { - LOG(DEBUG) << "setMute"; serial = GetRandomSerialNumber(); radio_voice->setMute(serial, true); @@ -861,14 +808,12 @@ TEST_P(RadioVoiceTest, setMute) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "setMute finished"; } /* * Test IRadioVoice.getMute() for the response returned. */ TEST_P(RadioVoiceTest, getMute) { - LOG(DEBUG) << "getMute"; serial = GetRandomSerialNumber(); radio_voice->getMute(serial); @@ -879,14 +824,12 @@ TEST_P(RadioVoiceTest, getMute) { if (cardStatus.cardState == CardStatus::STATE_ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp_voice->rspInfo.error); } - LOG(DEBUG) << "getMute finished"; } /* * Test IRadioVoice.sendBurstDtmf() for the response returned. */ TEST_P(RadioVoiceTest, sendBurstDtmf) { - LOG(DEBUG) << "sendBurstDtmf"; serial = GetRandomSerialNumber(); radio_voice->sendBurstDtmf(serial, "1", 0, 0); @@ -900,14 +843,12 @@ TEST_P(RadioVoiceTest, sendBurstDtmf) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendBurstDtmf finished"; } /* * Test IRadioVoice.sendUssd() for the response returned. */ TEST_P(RadioVoiceTest, sendUssd) { - LOG(DEBUG) << "sendUssd"; serial = GetRandomSerialNumber(); radio_voice->sendUssd(serial, std::string("test")); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -920,14 +861,12 @@ TEST_P(RadioVoiceTest, sendUssd) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "sendUssd finished"; } /* * Test IRadioVoice.cancelPendingUssd() for the response returned. */ TEST_P(RadioVoiceTest, cancelPendingUssd) { - LOG(DEBUG) << "cancelPendingUssd"; serial = GetRandomSerialNumber(); radio_voice->cancelPendingUssd(serial); @@ -941,14 +880,12 @@ TEST_P(RadioVoiceTest, cancelPendingUssd) { {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } - LOG(DEBUG) << "cancelPendingUssd finished"; } /* * Test IRadioVoice.isVoNrEnabled() for the response returned. */ TEST_P(RadioVoiceTest, isVoNrEnabled) { - LOG(DEBUG) << "isVoNrEnabled"; serial = GetRandomSerialNumber(); radio_voice->isVoNrEnabled(serial); @@ -958,14 +895,12 @@ TEST_P(RadioVoiceTest, isVoNrEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); - LOG(DEBUG) << "isVoNrEnabled finished"; } /* * Test IRadioVoice.setVoNrEnabled() for the response returned. */ TEST_P(RadioVoiceTest, setVoNrEnabled) { - LOG(DEBUG) << "setVoNrEnabled"; serial = GetRandomSerialNumber(); radio_voice->setVoNrEnabled(serial, true); @@ -975,5 +910,4 @@ TEST_P(RadioVoiceTest, setVoNrEnabled) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_voice->rspInfo.error, {RadioError::REQUEST_NOT_SUPPORTED, RadioError::NONE})); - LOG(DEBUG) << "setVoNrEnabled finished"; } diff --git a/radio/aidl/vts/radio_voice_utils.h b/radio/aidl/vts/radio_voice_utils.h index 0c3df7fbbf..dda6c6572a 100644 --- a/radio/aidl/vts/radio_voice_utils.h +++ b/radio/aidl/vts/radio_voice_utils.h @@ -183,7 +183,7 @@ class RadioVoiceIndication : public BnRadioVoiceIndication { }; // The main test class for Radio AIDL Voice. -class RadioVoiceTest : public ::testing::TestWithParam, public RadioServiceTest { +class RadioVoiceTest : public RadioServiceTest { protected: /* Clear Potential Established Calls */ virtual ndk::ScopedAStatus clearPotentialEstablishedCalls(); @@ -192,7 +192,7 @@ class RadioVoiceTest : public ::testing::TestWithParam, public Radi std::shared_ptr radioInd_network; public: - virtual void SetUp() override; + void SetUp() override; /* radio voice service handle */ std::shared_ptr radio_voice; -- GitLab From dc67668dcb17b6e353ed309ec07f186a11f4f109 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Sat, 6 May 2023 01:28:00 -0700 Subject: [PATCH 024/376] Add @hide and @JavaDerive(toString) for IRadio AIDL Add @hide for all classes Add @JavaDerive(toString=true) for classes that are missing it Fix AIDL formatting issues Bug: 280900995 Test: build Change-Id: I812fbadd9da272b604ff3dcd6828952bc55239e9 --- .../hardware/radio/config/IRadioConfig.aidl | 1 + .../radio/config/IRadioConfigIndication.aidl | 1 + .../radio/config/IRadioConfigResponse.aidl | 1 + .../config/MultipleEnabledProfilesMode.aidl | 1 + .../radio/config/PhoneCapability.aidl | 1 + .../hardware/radio/config/SimPortInfo.aidl | 1 + .../hardware/radio/config/SimSlotStatus.aidl | 1 + .../radio/config/SlotPortMapping.aidl | 1 + .../hardware/radio/data/ApnAuthType.aidl | 1 + .../android/hardware/radio/data/ApnTypes.aidl | 31 ++++++------- .../radio/data/DataCallFailCause.aidl | 13 +++--- .../hardware/radio/data/DataProfileInfo.aidl | 1 + .../radio/data/DataRequestReason.aidl | 1 + .../radio/data/DataThrottlingAction.aidl | 1 + .../android/hardware/radio/data/EpsQos.aidl | 1 + .../hardware/radio/data/IRadioData.aidl | 1 + .../radio/data/IRadioDataIndication.aidl | 1 + .../radio/data/IRadioDataResponse.aidl | 1 + .../hardware/radio/data/KeepaliveRequest.aidl | 1 + .../hardware/radio/data/KeepaliveStatus.aidl | 1 + .../hardware/radio/data/LinkAddress.aidl | 1 + .../android/hardware/radio/data/NrQos.aidl | 5 ++- .../android/hardware/radio/data/OsAppId.aidl | 1 + .../hardware/radio/data/PcoDataInfo.aidl | 1 + .../hardware/radio/data/PdpProtocolType.aidl | 3 +- .../hardware/radio/data/PortRange.aidl | 1 + .../android/hardware/radio/data/Qos.aidl | 1 + .../hardware/radio/data/QosBandwidth.aidl | 1 + .../hardware/radio/data/QosFilter.aidl | 3 +- .../radio/data/QosFilterIpsecSpi.aidl | 1 + .../radio/data/QosFilterIpv6FlowLabel.aidl | 1 + .../radio/data/QosFilterTypeOfService.aidl | 1 + .../hardware/radio/data/QosSession.aidl | 1 + .../radio/data/RouteSelectionDescriptor.aidl | 3 +- .../radio/data/SetupDataCallResult.aidl | 1 + .../hardware/radio/data/SliceInfo.aidl | 1 + .../hardware/radio/data/SlicingConfig.aidl | 1 + .../radio/data/TrafficDescriptor.aidl | 1 + .../android/hardware/radio/data/UrspRule.aidl | 1 + .../hardware/radio/ims/media/AmrMode.aidl | 3 +- .../hardware/radio/ims/media/AmrParams.aidl | 3 +- .../hardware/radio/ims/media/AnbrMode.aidl | 1 + .../hardware/radio/ims/media/CallQuality.aidl | 3 +- .../hardware/radio/ims/media/CodecMode.aidl | 1 + .../hardware/radio/ims/media/CodecParams.aidl | 3 +- .../radio/ims/media/CodecSpecificParams.aidl | 3 +- .../hardware/radio/ims/media/CodecType.aidl | 3 +- .../hardware/radio/ims/media/DtmfParams.aidl | 3 +- .../radio/ims/media/EvsBandwidth.aidl | 3 +- .../hardware/radio/ims/media/EvsMode.aidl | 3 +- .../hardware/radio/ims/media/EvsParams.aidl | 3 +- .../hardware/radio/ims/media/IImsMedia.aidl | 1 + .../radio/ims/media/IImsMediaListener.aidl | 1 + .../radio/ims/media/IImsMediaSession.aidl | 1 + .../ims/media/IImsMediaSessionListener.aidl | 1 + .../radio/ims/media/LocalEndPoint.aidl | 3 +- .../radio/ims/media/MediaDirection.aidl | 3 +- .../radio/ims/media/MediaQualityStatus.aidl | 3 +- .../ims/media/MediaQualityThreshold.aidl | 3 +- .../hardware/radio/ims/media/RtcpConfig.aidl | 3 +- .../ims/media/RtcpXrReportBlockType.aidl | 3 +- .../hardware/radio/ims/media/RtpAddress.aidl | 3 +- .../hardware/radio/ims/media/RtpConfig.aidl | 3 +- .../hardware/radio/ims/media/RtpError.aidl | 3 +- .../radio/ims/media/RtpHeaderExtension.aidl | 3 +- .../radio/ims/media/RtpSessionParams.aidl | 3 +- .../radio/ims/ConnectionFailureInfo.aidl | 1 + .../hardware/radio/ims/EpsFallbackReason.aidl | 1 + .../android/hardware/radio/ims/IRadioIms.aidl | 1 + .../radio/ims/IRadioImsIndication.aidl | 1 + .../hardware/radio/ims/IRadioImsResponse.aidl | 1 + .../android/hardware/radio/ims/ImsCall.aidl | 1 + .../radio/ims/ImsDeregistrationReason.aidl | 1 + .../hardware/radio/ims/ImsRegistration.aidl | 9 ++-- .../radio/ims/ImsRegistrationState.aidl | 1 + .../radio/ims/ImsStreamDirection.aidl | 1 + .../hardware/radio/ims/ImsStreamType.aidl | 3 +- .../hardware/radio/ims/ImsTrafficType.aidl | 1 + .../android/hardware/radio/ims/SrvccCall.aidl | 1 + .../hardware/radio/ims/SuggestedAction.aidl | 1 + .../messaging/CdmaBroadcastSmsConfigInfo.aidl | 1 + .../hardware/radio/messaging/CdmaSmsAck.aidl | 1 + .../radio/messaging/CdmaSmsAddress.aidl | 1 + .../radio/messaging/CdmaSmsMessage.aidl | 1 + .../radio/messaging/CdmaSmsSubaddress.aidl | 1 + .../radio/messaging/CdmaSmsWriteArgs.aidl | 1 + .../messaging/GsmBroadcastSmsConfigInfo.aidl | 1 + .../radio/messaging/GsmSmsMessage.aidl | 1 + .../radio/messaging/IRadioMessaging.aidl | 1 + .../messaging/IRadioMessagingIndication.aidl | 1 + .../messaging/IRadioMessagingResponse.aidl | 1 + .../radio/messaging/ImsSmsMessage.aidl | 1 + .../radio/messaging/SendSmsResult.aidl | 1 + .../messaging/SmsAcknowledgeFailCause.aidl | 1 + .../radio/messaging/SmsWriteArgs.aidl | 1 + .../radio/modem/ActivityStatsInfo.aidl | 1 + .../modem/ActivityStatsTechSpecificInfo.aidl | 1 + .../hardware/radio/modem/DeviceStateType.aidl | 1 + .../hardware/radio/modem/HardwareConfig.aidl | 1 + .../radio/modem/HardwareConfigModem.aidl | 1 + .../radio/modem/HardwareConfigSim.aidl | 1 + .../hardware/radio/modem/IRadioModem.aidl | 1 + .../radio/modem/IRadioModemIndication.aidl | 1 + .../radio/modem/IRadioModemResponse.aidl | 1 + .../hardware/radio/modem/ImeiInfo.aidl | 1 + .../android/hardware/radio/modem/NvItem.aidl | 1 + .../hardware/radio/modem/NvWriteItem.aidl | 1 + .../hardware/radio/modem/RadioCapability.aidl | 1 + .../hardware/radio/modem/RadioState.aidl | 1 + .../hardware/radio/modem/ResetNvType.aidl | 1 + .../network/AccessTechnologySpecificInfo.aidl | 1 + .../hardware/radio/network/BarringInfo.aidl | 1 + .../network/BarringTypeSpecificInfo.aidl | 1 + .../network/Cdma2000RegistrationInfo.aidl | 3 +- .../radio/network/CdmaRoamingType.aidl | 1 + .../radio/network/CdmaSignalStrength.aidl | 1 + .../radio/network/CellConnectionStatus.aidl | 1 + .../hardware/radio/network/CellIdentity.aidl | 1 + .../radio/network/CellIdentityCdma.aidl | 1 + .../radio/network/CellIdentityGsm.aidl | 1 + .../radio/network/CellIdentityLte.aidl | 1 + .../radio/network/CellIdentityNr.aidl | 1 + .../radio/network/CellIdentityTdscdma.aidl | 1 + .../radio/network/CellIdentityWcdma.aidl | 1 + .../hardware/radio/network/CellInfo.aidl | 1 + .../hardware/radio/network/CellInfoCdma.aidl | 1 + .../hardware/radio/network/CellInfoGsm.aidl | 1 + .../hardware/radio/network/CellInfoLte.aidl | 1 + .../hardware/radio/network/CellInfoNr.aidl | 1 + .../network/CellInfoRatSpecificInfo.aidl | 1 + .../radio/network/CellInfoTdscdma.aidl | 1 + .../hardware/radio/network/CellInfoWcdma.aidl | 1 + .../network/ClosedSubscriberGroupInfo.aidl | 1 + .../hardware/radio/network/Domain.aidl | 5 ++- .../hardware/radio/network/EmergencyMode.aidl | 1 + .../network/EmergencyNetworkScanTrigger.aidl | 1 + .../radio/network/EmergencyRegResult.aidl | 1 + .../radio/network/EmergencyScanType.aidl | 1 + .../hardware/radio/network/EutranBands.aidl | 1 + .../radio/network/EutranRegistrationInfo.aidl | 5 ++- .../radio/network/EvdoSignalStrength.aidl | 1 + .../hardware/radio/network/GeranBands.aidl | 1 + .../radio/network/GsmSignalStrength.aidl | 1 + .../hardware/radio/network/IRadioNetwork.aidl | 1 + .../network/IRadioNetworkIndication.aidl | 1 + .../radio/network/IRadioNetworkResponse.aidl | 1 + .../radio/network/IndicationFilter.aidl | 17 ++++---- .../hardware/radio/network/LceDataInfo.aidl | 1 + .../radio/network/LinkCapacityEstimate.aidl | 1 + .../radio/network/LteSignalStrength.aidl | 1 + .../hardware/radio/network/LteVopsInfo.aidl | 1 + .../radio/network/NetworkScanRequest.aidl | 1 + .../radio/network/NetworkScanResult.aidl | 1 + .../hardware/radio/network/NgranBands.aidl | 1 + .../network/NrDualConnectivityState.aidl | 1 + .../hardware/radio/network/NrIndicators.aidl | 1 + .../radio/network/NrSignalStrength.aidl | 1 + .../hardware/radio/network/NrVopsInfo.aidl | 1 + .../hardware/radio/network/OperatorInfo.aidl | 1 + .../radio/network/PhoneRestrictedState.aidl | 1 + .../radio/network/PhysicalChannelConfig.aidl | 1 + .../network/PhysicalChannelConfigBand.aidl | 1 + .../radio/network/RadioAccessSpecifier.aidl | 1 + .../network/RadioAccessSpecifierBands.aidl | 1 + .../hardware/radio/network/RadioBandMode.aidl | 1 + .../hardware/radio/network/RegState.aidl | 1 + .../radio/network/RegStateResult.aidl | 1 + .../radio/network/RegistrationFailCause.aidl | 1 + .../radio/network/SignalStrength.aidl | 1 + .../radio/network/SignalThresholdInfo.aidl | 1 + .../radio/network/SuppSvcNotification.aidl | 1 + .../radio/network/TdscdmaSignalStrength.aidl | 1 + .../hardware/radio/network/UsageSetting.aidl | 1 + .../hardware/radio/network/UtranBands.aidl | 1 + .../radio/network/WcdmaSignalStrength.aidl | 1 + .../radio/satellite/IRadioSatellite.aidl | 1 + .../satellite/IRadioSatelliteIndication.aidl | 1 + .../satellite/IRadioSatelliteResponse.aidl | 1 + .../radio/satellite/IndicationFilter.aidl | 1 + .../radio/satellite/NTRadioTechnology.aidl | 1 + .../radio/satellite/PointingInfo.aidl | 1 + .../satellite/SatelliteCapabilities.aidl | 1 + .../radio/satellite/SatelliteFeature.aidl | 1 + .../radio/satellite/SatelliteMode.aidl | 1 + .../android/hardware/radio/sim/AppStatus.aidl | 1 + .../hardware/radio/sim/CardPowerState.aidl | 1 + .../hardware/radio/sim/CardStatus.aidl | 1 + .../android/hardware/radio/sim/Carrier.aidl | 1 + .../radio/sim/CarrierRestrictions.aidl | 1 + .../radio/sim/CdmaSubscriptionSource.aidl | 1 + .../android/hardware/radio/sim/IRadioSim.aidl | 1 + .../radio/sim/IRadioSimIndication.aidl | 1 + .../hardware/radio/sim/IRadioSimResponse.aidl | 1 + .../android/hardware/radio/sim/IccIo.aidl | 1 + .../hardware/radio/sim/IccIoResult.aidl | 1 + .../radio/sim/ImsiEncryptionInfo.aidl | 1 + .../hardware/radio/sim/PbReceivedStatus.aidl | 1 + .../hardware/radio/sim/PersoSubstate.aidl | 1 + .../hardware/radio/sim/PhonebookCapacity.aidl | 1 + .../radio/sim/PhonebookRecordInfo.aidl | 1 + .../android/hardware/radio/sim/PinState.aidl | 1 + .../hardware/radio/sim/SelectUiccSub.aidl | 1 + .../hardware/radio/sim/SessionInfo.aidl | 1 + .../android/hardware/radio/sim/SimApdu.aidl | 1 + .../radio/sim/SimLockMultiSimPolicy.aidl | 1 + .../hardware/radio/sim/SimRefreshResult.aidl | 1 + .../hardware/radio/voice/AudioQuality.aidl | 1 + .../android/hardware/radio/voice/Call.aidl | 1 + .../hardware/radio/voice/CallForwardInfo.aidl | 1 + .../hardware/radio/voice/CdmaCallWaiting.aidl | 1 + .../radio/voice/CdmaDisplayInfoRecord.aidl | 1 + .../radio/voice/CdmaInformationRecord.aidl | 1 + .../voice/CdmaLineControlInfoRecord.aidl | 1 + .../radio/voice/CdmaNumberInfoRecord.aidl | 1 + .../radio/voice/CdmaOtaProvisionStatus.aidl | 1 + .../CdmaRedirectingNumberInfoRecord.aidl | 1 + .../radio/voice/CdmaSignalInfoRecord.aidl | 1 + .../voice/CdmaT53AudioControlInfoRecord.aidl | 1 + .../radio/voice/CdmaT53ClirInfoRecord.aidl | 1 + .../android/hardware/radio/voice/CfData.aidl | 1 + .../hardware/radio/voice/ClipStatus.aidl | 1 + .../android/hardware/radio/voice/Dial.aidl | 1 + .../radio/voice/EmergencyCallRouting.aidl | 1 + .../hardware/radio/voice/EmergencyNumber.aidl | 9 ++-- .../radio/voice/EmergencyServiceCategory.aidl | 15 ++++--- .../hardware/radio/voice/IRadioVoice.aidl | 1 + .../radio/voice/IRadioVoiceIndication.aidl | 1 + .../radio/voice/IRadioVoiceResponse.aidl | 1 + .../radio/voice/LastCallFailCause.aidl | 1 + .../radio/voice/LastCallFailCauseInfo.aidl | 1 + .../hardware/radio/voice/SrvccState.aidl | 1 + .../hardware/radio/voice/SsInfoData.aidl | 1 + .../radio/voice/StkCcUnsolSsResult.aidl | 19 ++++---- .../android/hardware/radio/voice/TtyMode.aidl | 1 + .../hardware/radio/voice/UssdModeType.aidl | 1 + .../android/hardware/radio/voice/UusInfo.aidl | 1 + .../android/hardware/radio/AccessNetwork.aidl | 1 + .../hardware/radio/RadioAccessFamily.aidl | 43 ++++++++++--------- .../android/hardware/radio/RadioConst.aidl | 3 +- .../android/hardware/radio/RadioError.aidl | 1 + .../hardware/radio/RadioIndicationType.aidl | 1 + .../hardware/radio/RadioResponseInfo.aidl | 1 + .../radio/RadioResponseInfoModem.aidl | 1 + .../hardware/radio/RadioResponseType.aidl | 1 + .../hardware/radio/RadioTechnology.aidl | 1 + .../hardware/radio/RadioTechnologyFamily.aidl | 1 + .../android/hardware/radio/AccessNetwork.aidl | 1 + .../hardware/radio/RadioAccessFamily.aidl | 1 + .../android/hardware/radio/RadioConst.aidl | 1 + .../android/hardware/radio/RadioError.aidl | 1 + .../hardware/radio/RadioIndicationType.aidl | 1 + .../hardware/radio/RadioResponseInfo.aidl | 1 + .../radio/RadioResponseInfoModem.aidl | 1 + .../hardware/radio/RadioResponseType.aidl | 1 + .../hardware/radio/RadioTechnology.aidl | 1 + .../hardware/radio/RadioTechnologyFamily.aidl | 1 + .../hardware/radio/config/IRadioConfig.aidl | 1 + .../radio/config/IRadioConfigIndication.aidl | 1 + .../radio/config/IRadioConfigResponse.aidl | 1 + .../config/MultipleEnabledProfilesMode.aidl | 1 + .../radio/config/PhoneCapability.aidl | 1 + .../hardware/radio/config/SimPortInfo.aidl | 1 + .../hardware/radio/config/SimSlotStatus.aidl | 1 + .../radio/config/SlotPortMapping.aidl | 1 + .../hardware/radio/data/ApnAuthType.aidl | 1 + .../android/hardware/radio/data/ApnTypes.aidl | 1 + .../radio/data/DataCallFailCause.aidl | 1 + .../hardware/radio/data/DataProfileInfo.aidl | 1 + .../radio/data/DataRequestReason.aidl | 1 + .../radio/data/DataThrottlingAction.aidl | 1 + .../android/hardware/radio/data/EpsQos.aidl | 1 + .../hardware/radio/data/IRadioData.aidl | 1 + .../radio/data/IRadioDataIndication.aidl | 1 + .../radio/data/IRadioDataResponse.aidl | 1 + .../hardware/radio/data/KeepaliveRequest.aidl | 1 + .../hardware/radio/data/KeepaliveStatus.aidl | 1 + .../hardware/radio/data/LinkAddress.aidl | 1 + .../android/hardware/radio/data/NrQos.aidl | 1 + .../android/hardware/radio/data/OsAppId.aidl | 1 + .../hardware/radio/data/PcoDataInfo.aidl | 1 + .../hardware/radio/data/PdpProtocolType.aidl | 1 + .../hardware/radio/data/PortRange.aidl | 1 + .../aidl/android/hardware/radio/data/Qos.aidl | 1 + .../hardware/radio/data/QosBandwidth.aidl | 1 + .../hardware/radio/data/QosFilter.aidl | 1 + .../radio/data/QosFilterIpsecSpi.aidl | 1 + .../radio/data/QosFilterIpv6FlowLabel.aidl | 1 + .../radio/data/QosFilterTypeOfService.aidl | 1 + .../hardware/radio/data/QosSession.aidl | 1 + .../radio/data/RouteSelectionDescriptor.aidl | 1 + .../radio/data/SetupDataCallResult.aidl | 1 + .../hardware/radio/data/SliceInfo.aidl | 1 + .../hardware/radio/data/SlicingConfig.aidl | 1 + .../radio/data/TrafficDescriptor.aidl | 1 + .../android/hardware/radio/data/UrspRule.aidl | 1 + .../radio/ims/ConnectionFailureInfo.aidl | 2 +- .../hardware/radio/ims/EpsFallbackReason.aidl | 1 + .../android/hardware/radio/ims/IRadioIms.aidl | 13 +++--- .../radio/ims/IRadioImsIndication.aidl | 1 + .../hardware/radio/ims/IRadioImsResponse.aidl | 6 +-- .../android/hardware/radio/ims/ImsCall.aidl | 2 +- .../radio/ims/ImsDeregistrationReason.aidl | 1 + .../hardware/radio/ims/ImsRegistration.aidl | 1 + .../radio/ims/ImsRegistrationState.aidl | 3 +- .../radio/ims/ImsStreamDirection.aidl | 1 + .../hardware/radio/ims/ImsStreamType.aidl | 2 + .../hardware/radio/ims/ImsTrafficType.aidl | 3 +- .../android/hardware/radio/ims/SrvccCall.aidl | 2 +- .../hardware/radio/ims/SuggestedAction.aidl | 1 + .../hardware/radio/ims/media/AmrMode.aidl | 6 ++- .../hardware/radio/ims/media/AmrParams.aidl | 2 + .../hardware/radio/ims/media/AnbrMode.aidl | 1 + .../hardware/radio/ims/media/CallQuality.aidl | 2 + .../hardware/radio/ims/media/CodecMode.aidl | 1 + .../hardware/radio/ims/media/CodecParams.aidl | 2 + .../radio/ims/media/CodecSpecificParams.aidl | 2 + .../hardware/radio/ims/media/CodecType.aidl | 2 + .../hardware/radio/ims/media/DtmfParams.aidl | 2 + .../radio/ims/media/EvsBandwidth.aidl | 7 ++- .../hardware/radio/ims/media/EvsMode.aidl | 6 ++- .../hardware/radio/ims/media/EvsParams.aidl | 2 + .../hardware/radio/ims/media/IImsMedia.aidl | 2 +- .../radio/ims/media/IImsMediaListener.aidl | 1 + .../radio/ims/media/IImsMediaSession.aidl | 1 + .../ims/media/IImsMediaSessionListener.aidl | 1 + .../radio/ims/media/LocalEndPoint.aidl | 2 + .../radio/ims/media/MediaDirection.aidl | 2 + .../radio/ims/media/MediaQualityStatus.aidl | 2 + .../ims/media/MediaQualityThreshold.aidl | 2 + .../hardware/radio/ims/media/RtcpConfig.aidl | 2 + .../ims/media/RtcpXrReportBlockType.aidl | 21 +++++---- .../hardware/radio/ims/media/RtpAddress.aidl | 2 + .../hardware/radio/ims/media/RtpConfig.aidl | 2 + .../hardware/radio/ims/media/RtpError.aidl | 2 + .../radio/ims/media/RtpHeaderExtension.aidl | 6 ++- .../radio/ims/media/RtpSessionParams.aidl | 2 + .../messaging/CdmaBroadcastSmsConfigInfo.aidl | 1 + .../hardware/radio/messaging/CdmaSmsAck.aidl | 1 + .../radio/messaging/CdmaSmsAddress.aidl | 1 + .../radio/messaging/CdmaSmsMessage.aidl | 1 + .../radio/messaging/CdmaSmsSubaddress.aidl | 1 + .../radio/messaging/CdmaSmsWriteArgs.aidl | 1 + .../messaging/GsmBroadcastSmsConfigInfo.aidl | 1 + .../radio/messaging/GsmSmsMessage.aidl | 1 + .../radio/messaging/IRadioMessaging.aidl | 1 + .../messaging/IRadioMessagingIndication.aidl | 1 + .../messaging/IRadioMessagingResponse.aidl | 1 + .../radio/messaging/ImsSmsMessage.aidl | 1 + .../radio/messaging/SendSmsResult.aidl | 1 + .../messaging/SmsAcknowledgeFailCause.aidl | 1 + .../radio/messaging/SmsWriteArgs.aidl | 1 + .../radio/modem/ActivityStatsInfo.aidl | 1 + .../modem/ActivityStatsTechSpecificInfo.aidl | 1 + .../hardware/radio/modem/DeviceStateType.aidl | 1 + .../hardware/radio/modem/HardwareConfig.aidl | 1 + .../radio/modem/HardwareConfigModem.aidl | 1 + .../radio/modem/HardwareConfigSim.aidl | 1 + .../hardware/radio/modem/IRadioModem.aidl | 3 +- .../radio/modem/IRadioModemIndication.aidl | 1 + .../radio/modem/IRadioModemResponse.aidl | 3 +- .../hardware/radio/modem/ImeiInfo.aidl | 23 +++++----- .../android/hardware/radio/modem/NvItem.aidl | 5 ++- .../hardware/radio/modem/NvWriteItem.aidl | 5 ++- .../hardware/radio/modem/RadioCapability.aidl | 1 + .../hardware/radio/modem/RadioState.aidl | 1 + .../hardware/radio/modem/ResetNvType.aidl | 5 ++- .../network/AccessTechnologySpecificInfo.aidl | 1 + .../hardware/radio/network/BarringInfo.aidl | 1 + .../network/BarringTypeSpecificInfo.aidl | 1 + .../network/Cdma2000RegistrationInfo.aidl | 1 + .../radio/network/CdmaRoamingType.aidl | 1 + .../radio/network/CdmaSignalStrength.aidl | 1 + .../radio/network/CellConnectionStatus.aidl | 1 + .../hardware/radio/network/CellIdentity.aidl | 1 + .../radio/network/CellIdentityCdma.aidl | 1 + .../radio/network/CellIdentityGsm.aidl | 1 + .../radio/network/CellIdentityLte.aidl | 1 + .../radio/network/CellIdentityNr.aidl | 1 + .../radio/network/CellIdentityTdscdma.aidl | 1 + .../radio/network/CellIdentityWcdma.aidl | 1 + .../hardware/radio/network/CellInfo.aidl | 1 + .../hardware/radio/network/CellInfoCdma.aidl | 1 + .../hardware/radio/network/CellInfoGsm.aidl | 1 + .../hardware/radio/network/CellInfoLte.aidl | 1 + .../hardware/radio/network/CellInfoNr.aidl | 1 + .../network/CellInfoRatSpecificInfo.aidl | 1 + .../radio/network/CellInfoTdscdma.aidl | 1 + .../hardware/radio/network/CellInfoWcdma.aidl | 1 + .../network/ClosedSubscriberGroupInfo.aidl | 1 + .../hardware/radio/network/Domain.aidl | 1 + .../hardware/radio/network/EmergencyMode.aidl | 1 + .../network/EmergencyNetworkScanTrigger.aidl | 3 +- .../radio/network/EmergencyRegResult.aidl | 1 + .../radio/network/EmergencyScanType.aidl | 1 + .../hardware/radio/network/EutranBands.aidl | 1 + .../radio/network/EutranRegistrationInfo.aidl | 1 + .../radio/network/EvdoSignalStrength.aidl | 1 + .../hardware/radio/network/GeranBands.aidl | 1 + .../radio/network/GsmSignalStrength.aidl | 1 + .../hardware/radio/network/IRadioNetwork.aidl | 1 + .../network/IRadioNetworkIndication.aidl | 3 +- .../radio/network/IRadioNetworkResponse.aidl | 1 + .../radio/network/IndicationFilter.aidl | 1 + .../hardware/radio/network/LceDataInfo.aidl | 1 + .../radio/network/LinkCapacityEstimate.aidl | 1 + .../radio/network/LteSignalStrength.aidl | 1 + .../hardware/radio/network/LteVopsInfo.aidl | 1 + .../radio/network/NetworkScanRequest.aidl | 1 + .../radio/network/NetworkScanResult.aidl | 1 + .../hardware/radio/network/NgranBands.aidl | 1 + .../network/NrDualConnectivityState.aidl | 1 + .../hardware/radio/network/NrIndicators.aidl | 1 + .../radio/network/NrSignalStrength.aidl | 1 + .../hardware/radio/network/NrVopsInfo.aidl | 1 + .../hardware/radio/network/OperatorInfo.aidl | 1 + .../radio/network/PhoneRestrictedState.aidl | 1 + .../radio/network/PhysicalChannelConfig.aidl | 1 + .../network/PhysicalChannelConfigBand.aidl | 1 + .../radio/network/RadioAccessSpecifier.aidl | 1 + .../network/RadioAccessSpecifierBands.aidl | 1 + .../hardware/radio/network/RadioBandMode.aidl | 1 + .../hardware/radio/network/RegState.aidl | 1 + .../radio/network/RegStateResult.aidl | 1 + .../radio/network/RegistrationFailCause.aidl | 1 + .../radio/network/SignalStrength.aidl | 1 + .../radio/network/SignalThresholdInfo.aidl | 1 + .../radio/network/SuppSvcNotification.aidl | 1 + .../radio/network/TdscdmaSignalStrength.aidl | 1 + .../hardware/radio/network/UsageSetting.aidl | 1 + .../hardware/radio/network/UtranBands.aidl | 1 + .../radio/network/WcdmaSignalStrength.aidl | 1 + .../radio/satellite/IRadioSatellite.aidl | 1 + .../satellite/IRadioSatelliteIndication.aidl | 1 + .../satellite/IRadioSatelliteResponse.aidl | 1 + .../radio/satellite/IndicationFilter.aidl | 1 + .../radio/satellite/NTRadioTechnology.aidl | 1 + .../radio/satellite/PointingInfo.aidl | 1 + .../satellite/SatelliteCapabilities.aidl | 1 + .../radio/satellite/SatelliteFeature.aidl | 1 + .../radio/satellite/SatelliteMode.aidl | 1 + .../android/hardware/radio/sim/AppStatus.aidl | 1 + .../hardware/radio/sim/CardPowerState.aidl | 1 + .../hardware/radio/sim/CardStatus.aidl | 1 + .../android/hardware/radio/sim/Carrier.aidl | 1 + .../radio/sim/CarrierRestrictions.aidl | 13 +++--- .../radio/sim/CdmaSubscriptionSource.aidl | 1 + .../android/hardware/radio/sim/IRadioSim.aidl | 1 + .../radio/sim/IRadioSimIndication.aidl | 1 + .../hardware/radio/sim/IRadioSimResponse.aidl | 1 + .../android/hardware/radio/sim/IccIo.aidl | 1 + .../hardware/radio/sim/IccIoResult.aidl | 1 + .../radio/sim/ImsiEncryptionInfo.aidl | 1 + .../hardware/radio/sim/PbReceivedStatus.aidl | 1 + .../hardware/radio/sim/PersoSubstate.aidl | 1 + .../hardware/radio/sim/PhonebookCapacity.aidl | 1 + .../radio/sim/PhonebookRecordInfo.aidl | 1 + .../android/hardware/radio/sim/PinState.aidl | 1 + .../hardware/radio/sim/SelectUiccSub.aidl | 1 + .../hardware/radio/sim/SessionInfo.aidl | 1 + .../android/hardware/radio/sim/SimApdu.aidl | 1 + .../radio/sim/SimLockMultiSimPolicy.aidl | 1 + .../hardware/radio/sim/SimRefreshResult.aidl | 1 + .../hardware/radio/voice/AudioQuality.aidl | 1 + .../android/hardware/radio/voice/Call.aidl | 1 + .../hardware/radio/voice/CallForwardInfo.aidl | 1 + .../hardware/radio/voice/CdmaCallWaiting.aidl | 1 + .../radio/voice/CdmaDisplayInfoRecord.aidl | 1 + .../radio/voice/CdmaInformationRecord.aidl | 3 +- .../voice/CdmaLineControlInfoRecord.aidl | 1 + .../radio/voice/CdmaNumberInfoRecord.aidl | 1 + .../radio/voice/CdmaOtaProvisionStatus.aidl | 1 + .../CdmaRedirectingNumberInfoRecord.aidl | 1 + .../radio/voice/CdmaSignalInfoRecord.aidl | 1 + .../voice/CdmaT53AudioControlInfoRecord.aidl | 1 + .../radio/voice/CdmaT53ClirInfoRecord.aidl | 1 + .../android/hardware/radio/voice/CfData.aidl | 1 + .../hardware/radio/voice/ClipStatus.aidl | 1 + .../android/hardware/radio/voice/Dial.aidl | 1 + .../radio/voice/EmergencyCallRouting.aidl | 1 + .../hardware/radio/voice/EmergencyNumber.aidl | 1 + .../radio/voice/EmergencyServiceCategory.aidl | 1 + .../hardware/radio/voice/IRadioVoice.aidl | 1 + .../radio/voice/IRadioVoiceIndication.aidl | 1 + .../radio/voice/IRadioVoiceResponse.aidl | 1 + .../radio/voice/LastCallFailCause.aidl | 1 + .../radio/voice/LastCallFailCauseInfo.aidl | 1 + .../hardware/radio/voice/SrvccState.aidl | 1 + .../hardware/radio/voice/SsInfoData.aidl | 1 + .../radio/voice/StkCcUnsolSsResult.aidl | 1 + .../android/hardware/radio/voice/TtyMode.aidl | 1 + .../hardware/radio/voice/UssdModeType.aidl | 1 + .../android/hardware/radio/voice/UusInfo.aidl | 1 + 492 files changed, 684 insertions(+), 161 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl index a48a89b458..0f5e7e4f77 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl @@ -40,6 +40,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @VintfStability interface IRadioConfig { oneway void getHalDeviceCapabilities(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl index 994e337c04..9189f9062f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @VintfStability interface IRadioConfigIndication { oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus); diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl index 038b0aeb58..348aa348bf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @VintfStability interface IRadioConfigResponse { oneway void getHalDeviceCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1); diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl index 74017e407a..41c42016c2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum MultipleEnabledProfilesMode { NONE, diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl index db3a4c65f3..3648866a13 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PhoneCapability { byte maxActiveData; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl index b5d31ada35..ede318931a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SimPortInfo { String iccId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl index c264dfd3cf..e84e7d45bd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SimSlotStatus { int cardState; diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl index 31271eed8d..5278e79f1c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.config; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SlotPortMapping { int physicalSlotId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl index a33ad6e338..eed81701b8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnAuthType { NO_PAP_NO_CHAP, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl index 45d22c853f..d2d31377b9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl @@ -32,22 +32,23 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ApnTypes { NONE = 0, - DEFAULT = (1 << 0), - MMS = (1 << 1), - SUPL = (1 << 2), - DUN = (1 << 3), - HIPRI = (1 << 4), - FOTA = (1 << 5), - IMS = (1 << 6), - CBS = (1 << 7), - IA = (1 << 8), - EMERGENCY = (1 << 9), - MCX = (1 << 10), - XCAP = (1 << 11), - VSIM = (1 << 12), - BIP = (1 << 13), - ENTERPRISE = (1 << 14), + DEFAULT = (1 << 0) /* 1 */, + MMS = (1 << 1) /* 2 */, + SUPL = (1 << 2) /* 4 */, + DUN = (1 << 3) /* 8 */, + HIPRI = (1 << 4) /* 16 */, + FOTA = (1 << 5) /* 32 */, + IMS = (1 << 6) /* 64 */, + CBS = (1 << 7) /* 128 */, + IA = (1 << 8) /* 256 */, + EMERGENCY = (1 << 9) /* 512 */, + MCX = (1 << 10) /* 1024 */, + XCAP = (1 << 11) /* 2048 */, + VSIM = (1 << 12) /* 4096 */, + BIP = (1 << 13) /* 8192 */, + ENTERPRISE = (1 << 14) /* 16384 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl index 8a3fd4f4cd..009b428273 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataCallFailCause { NONE = 0, @@ -101,12 +102,12 @@ enum DataCallFailCause { OEM_DCFAILCAUSE_13 = 0x100D, OEM_DCFAILCAUSE_14 = 0x100E, OEM_DCFAILCAUSE_15 = 0x100F, - VOICE_REGISTRATION_FAIL = (-1), - DATA_REGISTRATION_FAIL = (-2), - SIGNAL_LOST = (-3), - PREF_RADIO_TECH_CHANGED = (-4), - RADIO_POWER_OFF = (-5), - TETHERED_CALL_ACTIVE = (-6), + VOICE_REGISTRATION_FAIL = (-1) /* -1 */, + DATA_REGISTRATION_FAIL = (-2) /* -2 */, + SIGNAL_LOST = (-3) /* -3 */, + PREF_RADIO_TECH_CHANGED = (-4) /* -4 */, + RADIO_POWER_OFF = (-5) /* -5 */, + TETHERED_CALL_ACTIVE = (-6) /* -6 */, ERROR_UNSPECIFIED = 0xffff, LLC_SNDCP = 0x19, ACTIVATION_REJECTED_BCM_VIOLATION = 0x30, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl index 0136fa4a5a..bd44275f14 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable DataProfileInfo { int profileId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl index 0ddaff1662..98ae53a080 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DataRequestReason { NORMAL = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl index e80a764046..e1fedb86c0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum DataThrottlingAction { NO_DATA_THROTTLING, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl index 5b9aaa0b1e..3a3f41d98e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EpsQos { int qci; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl index 7b572f1f8e..3888c627e7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @VintfStability interface IRadioData { oneway void allocatePduSessionId(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl index 0ffa1f7ddf..6057d6af07 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @VintfStability interface IRadioDataIndication { oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList); diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl index 4edc17d4ad..dc44454f3f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @VintfStability interface IRadioDataResponse { oneway void acknowledgeRequest(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl index 592a54a90c..789ee863f2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable KeepaliveRequest { int type; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl index 82b0fc8ec1..404b44a3e0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable KeepaliveStatus { int sessionHandle; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl index 77d637b9b9..bef4c736f8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LinkAddress { String address; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl index be859b79de..22bbe42933 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NrQos { int fiveQi; @@ -42,8 +43,8 @@ parcelable NrQos { * @deprecated use averagingWindowMillis; */ char averagingWindowMs; - int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN; + int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN /* -1 */; const byte FLOW_ID_RANGE_MIN = 1; const byte FLOW_ID_RANGE_MAX = 63; - const int AVERAGING_WINDOW_UNKNOWN = (-1); + const int AVERAGING_WINDOW_UNKNOWN = (-1) /* -1 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl index 8595d5206d..e4bbf79126 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable OsAppId { byte[] osAppId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl index 033b12f4ee..ea7529cb34 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PcoDataInfo { int cid; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl index d1c4a62a31..3a7f82d401 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl @@ -32,9 +32,10 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PdpProtocolType { - UNKNOWN = (-1), + UNKNOWN = (-1) /* -1 */, IP = 0, IPV6 = 1, IPV4V6 = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl index 470a9c11b3..45e2dc9687 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PortRange { int start; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl index ca06e4112b..4dac56c5d9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability union Qos { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl index 6d4b7a9f49..b59dee0d40 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable QosBandwidth { int maxBitrateKbps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl index de45cc5f32..a3208d9b6c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable QosFilter { String[] localAddresses; @@ -47,7 +48,7 @@ parcelable QosFilter { const byte DIRECTION_DOWNLINK = 0; const byte DIRECTION_UPLINK = 1; const byte DIRECTION_BIDIRECTIONAL = 2; - const byte PROTOCOL_UNSPECIFIED = (-1); + const byte PROTOCOL_UNSPECIFIED = (-1) /* -1 */; const byte PROTOCOL_TCP = 6; const byte PROTOCOL_UDP = 17; const byte PROTOCOL_ESP = 50; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl index 4b75340276..50b52a4957 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability union QosFilterIpsecSpi { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl index 3fb34ea375..4913dcf07b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability union QosFilterIpv6FlowLabel { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl index fa85b5acc3..4f0d2605e1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability union QosFilterTypeOfService { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl index bbfdd2d48c..89010a9feb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable QosSession { int qosSessionId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl index d83df81a38..8864c246d6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RouteSelectionDescriptor { byte precedence; @@ -39,7 +40,7 @@ parcelable RouteSelectionDescriptor { byte sscMode; android.hardware.radio.data.SliceInfo[] sliceInfo; String[] dnn; - const byte SSC_MODE_UNKNOWN = (-1); + const byte SSC_MODE_UNKNOWN = (-1) /* -1 */; const byte SSC_MODE_1 = 1; const byte SSC_MODE_2 = 2; const byte SSC_MODE_3 = 3; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl index 83f9db61ac..6ae626eab7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SetupDataCallResult { android.hardware.radio.data.DataCallFailCause cause; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl index efe48165ee..60df402a81 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SliceInfo { byte sliceServiceType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl index b00febebaf..4d28737134 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SlicingConfig { android.hardware.radio.data.UrspRule[] urspRules; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl index d7b0654970..dc474a2d1d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable TrafficDescriptor { @nullable String dnn; diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl index 7002fd118c..6850f6a049 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.data; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable UrspRule { int precedence; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl index 37e3b256f3..36a538cdb4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AmrMode { AMR_MODE_0 = (1 << 0) /* 1 */, AMR_MODE_1 = (1 << 1) /* 2 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl index 36edb7f8c4..dcf0dd1775 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable AmrParams { android.hardware.radio.ims.media.AmrMode amrMode; boolean octetAligned; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl index c108c07033..eca7b9323c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable AnbrMode { android.hardware.radio.ims.media.CodecMode anbrUplinkMode; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl index fff6e1c3c2..594a39faee 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable CallQuality { int downlinkCallQualityLevel; int uplinkCallQualityLevel; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl index 0e9140f023..644321cd3f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @JavaDerive(toString=true) @VintfStability union CodecMode { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl index 3da2dbd9ef..6eefb347c4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable CodecParams { android.hardware.radio.ims.media.CodecType codecType; byte rxPayloadTypeNumber; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl index 08e3f0f15e..7e5722f935 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability union CodecSpecificParams { android.hardware.radio.ims.media.AmrParams amr; android.hardware.radio.ims.media.EvsParams evs; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl index e4193cd6a2..98463b184b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CodecType { AMR = (1 << 0) /* 1 */, AMR_WB = (1 << 1) /* 2 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl index 5523fd87ca..f420fa71d2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable DtmfParams { byte rxPayloadTypeNumber; byte txPayloadTypeNumber; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl index db3eb2941a..d8c77bdccc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EvsBandwidth { NONE = 0, NARROW_BAND = (1 << 0) /* 1 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl index fb1f14da3a..1a593890fd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EvsMode { EVS_MODE_0 = (1 << 0) /* 1 */, EVS_MODE_1 = (1 << 1) /* 2 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl index 735eb082ab..deb53af54a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable EvsParams { android.hardware.radio.ims.media.EvsBandwidth bandwidth; android.hardware.radio.ims.media.EvsMode evsMode; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl index 30793e5eb2..190d25b61c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @VintfStability interface IImsMedia { oneway void setListener(in android.hardware.radio.ims.media.IImsMediaListener mediaListener); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl index 40f7107cdf..9b7a392edd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @VintfStability interface IImsMediaListener { oneway void onOpenSessionSuccess(int sessionId, android.hardware.radio.ims.media.IImsMediaSession session); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl index ea9f3a4282..45c8002723 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @VintfStability interface IImsMediaSession { oneway void setListener(in android.hardware.radio.ims.media.IImsMediaSessionListener sessionListener); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl index cb221df830..5ec9c18718 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; +/* @hide */ @VintfStability interface IImsMediaSessionListener { oneway void onModifySessionResponse(in android.hardware.radio.ims.media.RtpConfig config, android.hardware.radio.ims.media.RtpError error); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl index 6ec51569af..1095f01ea1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable LocalEndPoint { ParcelFileDescriptor rtpFd; ParcelFileDescriptor rtcpFd; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl index 0e9eaee31b..5410f2ade0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum MediaDirection { NO_FLOW = 0, RTP_TX = (1 << 0) /* 1 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl index 4accf5315b..da6e751243 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable MediaQualityStatus { int rtpInactivityTimeMillis; int rtcpInactivityTimeMillis; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl index 31cf3739a7..ecc379c071 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable MediaQualityThreshold { int[] rtpInactivityTimerMillis; int rtcpInactivityTimerMillis; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl index 6a76d85cd8..0bc41547fa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable RtcpConfig { String canonicalName; int transmitPort; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl index 289c810b87..714442cce6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RtcpXrReportBlockType { RTCPXR_NONE = 0, RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl index 35357d179a..dd7f4661f7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable RtpAddress { String ipAddress; int portNumber; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl index 8a826f6b5f..472ec35010 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable RtpConfig { int direction; android.hardware.radio.AccessNetwork accessNetwork; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl index 41b0aeb287..97dacf1804 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RtpError { NONE = 0, INVALID_PARAM = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl index 83b8a314e3..06207ee4d3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable RtpHeaderExtension { int localId; byte[] data; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl index 13a7487f73..4107432676 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims.media; -@VintfStability +/* @hide */ +@JavaDerive(toString=true) @VintfStability parcelable RtpSessionParams { byte pTimeMillis; int maxPtimeMillis; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl index 90e75f96e1..421f752010 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ConnectionFailureInfo { android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl index ebea9034ec..75099e7f1a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EpsFallbackReason { NO_NETWORK_TRIGGER = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl index 4df870969d..6018a4b904 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @VintfStability interface IRadioIms { oneway void setSrvccCallInfo(int serial, in android.hardware.radio.ims.SrvccCall[] srvccCalls); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl index ef6b4cc9ca..c754af3806 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @VintfStability interface IRadioImsIndication { oneway void onConnectionSetupFailure(in android.hardware.radio.RadioIndicationType type, int token, in android.hardware.radio.ims.ConnectionFailureInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl index 053ba46864..fbb1bfc66c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @VintfStability interface IRadioImsResponse { oneway void setSrvccCallInfoResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl index 6e14830012..3895d75d6e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ImsCall { int index; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl index b04e5598c7..5b5bd405f5 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ImsDeregistrationReason { REASON_SIM_REMOVED = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl index be5e0045e3..66d81650fb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ImsRegistration { android.hardware.radio.ims.ImsRegistrationState regState; @@ -39,8 +40,8 @@ parcelable ImsRegistration { android.hardware.radio.ims.SuggestedAction suggestedAction; int capabilities; const int IMS_MMTEL_CAPABILITY_NONE = 0; - const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0); - const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1); - const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2); - const int IMS_RCS_CAPABILITIES = (1 << 3); + const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0) /* 1 */; + const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1) /* 2 */; + const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2) /* 4 */; + const int IMS_RCS_CAPABILITIES = (1 << 3) /* 8 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl index 6302b4798d..01ae565d79 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ImsRegistrationState { NOT_REGISTERED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl index cf2e4f1d89..efc35511bc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ImsStreamDirection { UPLINK = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl index 10c477f938..853f4b5c0e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl @@ -32,7 +32,8 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; -@Backing(type="int") @VintfStability +/* @hide */ +@Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ImsStreamType { AUDIO = 1, VIDEO = 2, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl index b1a0b770cd..4eeda9db07 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ImsTrafficType { EMERGENCY, diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl index 5119b0ff02..21645dae0a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SrvccCall { int index; diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl index bbe170e445..120e7e82ca 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.ims; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SuggestedAction { NONE, diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl index 39e2be2f63..abfb308bf9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaBroadcastSmsConfigInfo { int serviceCategory; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl index befdbdefb6..ee8371c686 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAck { boolean errorClass; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl index ab29c775dd..7382b1fd3b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSmsAddress { int digitMode; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl index 867596c81b..0e98f4b844 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSmsMessage { int teleserviceId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl index d67fe8c577..a0e3991910 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSmsSubaddress { int subaddressType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl index b0a7f98dc6..d6292e7b2e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSmsWriteArgs { int status; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl index 46604cabe6..1ccba8614e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable GsmBroadcastSmsConfigInfo { int fromServiceId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl index 4df7fd2508..bdd7d0c396 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable GsmSmsMessage { String smscPdu; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl index dfec59ae45..bf5fde5045 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @VintfStability interface IRadioMessaging { oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu); diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl index 8f7824f515..389fb2659a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @VintfStability interface IRadioMessagingIndication { oneway void cdmaNewSms(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.CdmaSmsMessage msg); diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl index c3af7a684c..9b10464837 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @VintfStability interface IRadioMessagingResponse { oneway void acknowledgeIncomingGsmSmsWithPduResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl index 85f62b781d..40b9ddbb40 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ImsSmsMessage { android.hardware.radio.RadioTechnologyFamily tech; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl index 32f7a5cb71..3f1d120a99 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SendSmsResult { int messageRef; diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl index d061c9ea17..6aeda3ef4b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SmsAcknowledgeFailCause { MEMORY_CAPACITY_EXCEEDED = 0xD3, diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl index 489cc07068..a294b47767 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.messaging; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SmsWriteArgs { int status; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl index 7e22ee046e..c834342e75 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ActivityStatsInfo { int sleepModeTimeMs; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl index 08ed9a529e..b44ab71e3f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ActivityStatsTechSpecificInfo { android.hardware.radio.AccessNetwork rat; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl index acc0b22bb8..1159f93b51 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum DeviceStateType { POWER_SAVE_MODE, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl index 3a0ec2514b..2d814efbe2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable HardwareConfig { int type; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl index 62bb160fc4..d453cb01c3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable HardwareConfigModem { int rilModel; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl index 5810982975..4c2e31b82a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable HardwareConfigSim { String modemUuid; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl index 8546be789b..bd8ba4734b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @VintfStability interface IRadioModem { oneway void enableModem(in int serial, in boolean on); diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl index 514ff9a03e..20066f852a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @VintfStability interface IRadioModemIndication { oneway void hardwareConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.HardwareConfig[] configs); diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl index 5955439666..b9ef51b342 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @VintfStability interface IRadioModemResponse { oneway void acknowledgeRequest(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl index f8776ec412..a2df30ddfa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ImeiInfo { android.hardware.radio.modem.ImeiInfo.ImeiType type; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl index b80d7acde1..f97b9a2017 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl @@ -33,6 +33,7 @@ package android.hardware.radio.modem; /** + * @hide * @deprecated NV APIs are deprecated starting from Android U. */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl index 6a786bc419..c38ceb779a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl @@ -33,6 +33,7 @@ package android.hardware.radio.modem; /** + * @hide * @deprecated NV APIs are deprecated starting from Android U. */ @JavaDerive(toString=true) @VintfStability diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl index f2e2858590..bc3cfccde4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RadioCapability { int session; diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl index 57f29410c5..3383fa4a97 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioState { OFF = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl index 37622b1312..b4208b7754 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.modem; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ResetNvType { RELOAD, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl index 28d886256d..667a8a770a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability union AccessTechnologySpecificInfo { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl index e105b39101..67c9349e9e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable BarringInfo { int serviceType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl index a81363339e..03369b91d4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable BarringTypeSpecificInfo { int factor; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl index 927f9ac695..bc9c0baa24 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -32,13 +32,14 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable Cdma2000RegistrationInfo { boolean cssSupported; int roamingIndicator; int systemIsInPrl; int defaultRoamingIndicator; - const int PRL_INDICATOR_NOT_REGISTERED = (-1); + const int PRL_INDICATOR_NOT_REGISTERED = (-1) /* -1 */; const int PRL_INDICATOR_NOT_IN_PRL = 0; const int PRL_INDICATOR_IN_PRL = 1; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl index 2a4db70cab..84532e3842 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaRoamingType { HOME_NETWORK, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl index e2f97bf98f..94430a8760 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSignalStrength { int dbm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl index 5ce3b3e613..3775a40e08 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CellConnectionStatus { NONE, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl index 2ee92dee29..ba27b39527 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability union CellIdentity { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl index d659a2891c..63571bb533 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityCdma { int networkId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl index d3193be072..5040f205b8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityGsm { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl index 2ae7b43e2d..be7821d2d4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityLte { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl index b30af506d8..6f4f9a030a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityNr { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl index e99d14771c..864a886553 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityTdscdma { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl index 12001fcd67..4e762777b9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellIdentityWcdma { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl index 467c6b77cc..6bb31b0278 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfo { boolean registered; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl index e3bf46b918..6d76a26b82 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoCdma { android.hardware.radio.network.CellIdentityCdma cellIdentityCdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl index 84dcd07d72..2074c2fee0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoGsm { android.hardware.radio.network.CellIdentityGsm cellIdentityGsm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl index 221340b06a..aa3b31080b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoLte { android.hardware.radio.network.CellIdentityLte cellIdentityLte; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl index b392c1d2c7..a8f49afd67 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoNr { android.hardware.radio.network.CellIdentityNr cellIdentityNr; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl index 4ab0640b29..fd3239dbd8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability union CellInfoRatSpecificInfo { android.hardware.radio.network.CellInfoGsm gsm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl index 138b35ce62..1a03f341d6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoTdscdma { android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl index cf7b135c63..d02824d9a7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CellInfoWcdma { android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl index fe734c8f78..b9e6f82f17 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ClosedSubscriberGroupInfo { boolean csgIndication; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl index 6b022b6955..0de7e20855 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl @@ -32,8 +32,9 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum Domain { - CS = (1 << 0), - PS = (1 << 1), + CS = (1 << 0) /* 1 */, + PS = (1 << 1) /* 2 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl index 071e6b5012..c5b067e38b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyMode { EMERGENCY_WWAN = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl index 2797affc01..471c7a0a93 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EmergencyNetworkScanTrigger { android.hardware.radio.AccessNetwork[] accessNetwork; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl index 7d99a53c7b..3b8083dacc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EmergencyRegResult { android.hardware.radio.AccessNetwork accessNetwork; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl index 5e86c76a43..0681a73005 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyScanType { NO_PREFERENCE = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl index 57fac3f5d7..82257ecffe 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EutranBands { BAND_1 = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl index 90e342a9b7..bb34fe10d7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -32,14 +32,15 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EutranRegistrationInfo { android.hardware.radio.network.LteVopsInfo lteVopsInfo; android.hardware.radio.network.NrIndicators nrIndicators; android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType; int extraInfo; - const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0); - const int EXTRA_SMS_ONLY = (1 << 1); + const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0) /* 1 */; + const int EXTRA_SMS_ONLY = (1 << 1) /* 2 */; enum AttachResultType { NONE, EPS_ONLY, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl index 7c567119f8..e97e17dab3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EvdoSignalStrength { int dbm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl index 135935ff8f..ee0d419060 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum GeranBands { BAND_T380 = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl index 2b53b39317..65847ef93f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable GsmSignalStrength { int signalStrength; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl index 382ddd846c..cbc1e30fbd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @VintfStability interface IRadioNetwork { oneway void getAllowedNetworkTypesBitmap(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl index 0f017ea8ba..05a36ef7aa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @VintfStability interface IRadioNetworkIndication { oneway void barringInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos); diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl index bfe8fa3f67..c86bebcf1d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @VintfStability interface IRadioNetworkResponse { oneway void acknowledgeRequest(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl index 00ba3469c7..7847fbe4c3 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl @@ -32,15 +32,16 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum IndicationFilter { NONE = 0, - ALL = (~0), - SIGNAL_STRENGTH = (1 << 0), - FULL_NETWORK_STATE = (1 << 1), - DATA_CALL_DORMANCY_CHANGED = (1 << 2), - LINK_CAPACITY_ESTIMATE = (1 << 3), - PHYSICAL_CHANNEL_CONFIG = (1 << 4), - REGISTRATION_FAILURE = (1 << 5), - BARRING_INFO = (1 << 6), + ALL = (~0) /* -1 */, + SIGNAL_STRENGTH = (1 << 0) /* 1 */, + FULL_NETWORK_STATE = (1 << 1) /* 2 */, + DATA_CALL_DORMANCY_CHANGED = (1 << 2) /* 4 */, + LINK_CAPACITY_ESTIMATE = (1 << 3) /* 8 */, + PHYSICAL_CHANNEL_CONFIG = (1 << 4) /* 16 */, + REGISTRATION_FAILURE = (1 << 5) /* 32 */, + BARRING_INFO = (1 << 6) /* 64 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl index 27b16c11fb..6dc6d3ecc6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LceDataInfo { int lastHopCapacityKbps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl index 5707b8e990..3fc4b5c5cd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LinkCapacityEstimate { int downlinkCapacityKbps; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl index b5b8579305..eb2ca28e13 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LteSignalStrength { int signalStrength; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl index 6d8dd4e83a..f8d3aa1907 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LteVopsInfo { boolean isVopsSupported; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl index 6039740167..60eaf777a1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NetworkScanRequest { int type; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl index 4e392d0c5c..695a194485 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NetworkScanResult { int status; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl index 590469076a..fb939df072 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NgranBands { BAND_1 = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl index 62c2a56c8d..7af15a7ca8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum NrDualConnectivityState { ENABLE = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl index 88429f6f38..efcd6d3047 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NrIndicators { boolean isEndcAvailable; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl index 7d6ab8234a..11e7356a44 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NrSignalStrength { int ssRsrp; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl index e5a0a700ca..61146aa6e2 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable NrVopsInfo { byte vopsSupported; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl index 034150e61f..abe2bea223 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable OperatorInfo { String alphaLong; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl index 4e3e39eab0..44cab0e000 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PhoneRestrictedState { NONE = 0x00, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl index 928c6b728c..7d64f7e92e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PhysicalChannelConfig { android.hardware.radio.network.CellConnectionStatus status; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl index efc64a6930..2e50e67627 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability union PhysicalChannelConfigBand { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl index 1566bb5224..8229207359 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RadioAccessSpecifier { android.hardware.radio.AccessNetwork accessNetwork; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl index a6ac12a28a..9ba420e891 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability union RadioAccessSpecifierBands { boolean noinit; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl index 74696fbfbf..6058e30696 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioBandMode { BAND_MODE_UNSPECIFIED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl index 711c9ac3a6..f11b91114c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegState { NOT_REG_MT_NOT_SEARCHING_OP = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl index f0a03aea4f..625d9702c8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RegStateResult { android.hardware.radio.network.RegState regState; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl index 8acf8ab22d..56f516d532 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RegistrationFailCause { NONE = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl index 1c50190947..da7db9a2ae 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SignalStrength { android.hardware.radio.network.GsmSignalStrength gsm; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl index 744eed7ec5..77b4831359 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SignalThresholdInfo { int signalMeasurement; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl index b62c71bd37..5192eaea07 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SuppSvcNotification { boolean isMT; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl index d74c950bde..fe209e5c77 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable TdscdmaSignalStrength { int signalStrength; diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl index 3ca16b5eaa..a6f4d132ae 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UsageSetting { VOICE_CENTRIC = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl index 8be3da28f3..977afe3d98 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UtranBands { BAND_1 = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl index 91125271d2..b765ab6ddc 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.network; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable WcdmaSignalStrength { int signalStrength; diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl index a00e4f5ed0..0c7408ad81 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @VintfStability interface IRadioSatellite { oneway void addAllowedSatelliteContacts(in int serial, in String[] contacts); diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl index 6a03f266b9..36ec5f37ec 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @VintfStability interface IRadioSatelliteIndication { oneway void onMessagesTransferComplete(in android.hardware.radio.RadioIndicationType type, in boolean complete); diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl index f6614b1b4f..bf9b9e6a9b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @VintfStability interface IRadioSatelliteResponse { oneway void acknowledgeRequest(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl index 5aa573933b..b9df1f513b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum IndicationFilter { NONE = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl index 29de55f6c8..f05baaa8a6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum NTRadioTechnology { NB_IOT_NTN = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl index dcfce349ee..1ada88a035 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PointingInfo { float satelliteAzimuthDegrees; diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl index 407a9d1b5a..e0af71ac6c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SatelliteCapabilities { android.hardware.radio.satellite.NTRadioTechnology[] supportedRadioTechnologies; diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl index 315359d888..e79e572b3c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SatelliteFeature { SOS_SMS = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl index 1cf6a2c9e9..a1ce566507 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.satellite; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SatelliteMode { POWERED_OFF = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl index 8a41fb9d90..898b616a2c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable AppStatus { int appType; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl index 6bc3919fb2..066777aa5f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CardPowerState { POWER_DOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl index 46cb7becb2..1a9d621390 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CardStatus { int cardState; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl index cc56888f31..24fff2ee7c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable Carrier { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl index 3700de3143..84cdf5d1a7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CarrierRestrictions { android.hardware.radio.sim.Carrier[] allowedCarriers; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl index 080aa5ed27..13b06e7fdb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaSubscriptionSource { RUIM_SIM, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl index 901b2519f6..1728e41010 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @VintfStability interface IRadioSim { oneway void areUiccApplicationsEnabled(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl index d4371b8e69..a74b65acad 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @VintfStability interface IRadioSimIndication { oneway void carrierInfoForImsiEncryption(in android.hardware.radio.RadioIndicationType info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl index d7c2100fd6..c653847706 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @VintfStability interface IRadioSimResponse { oneway void acknowledgeRequest(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl index 5a312dc4fd..661518d2eb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable IccIo { int command; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl index 6c6bde2012..1e418cd2ab 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable IccIoResult { int sw1; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl index 05e71cd102..40722e5f79 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable ImsiEncryptionInfo { String mcc; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl index 5e96fc6f22..aaf9f3eb50 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="byte") @JavaDerive(toString=true) @VintfStability enum PbReceivedStatus { PB_RECEIVED_OK = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl index dc1d960631..795230892c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PersoSubstate { UNKNOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl index 7531c9638a..b02068712e 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PhonebookCapacity { int maxAdnRecords; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl index 2e96a4bf54..1a6943bd53 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable PhonebookRecordInfo { int recordId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl index 663ea734bf..924929b450 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum PinState { UNKNOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl index 02121e632c..57ca2a5b14 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SelectUiccSub { int slot; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl index 1329141f22..5c81e3d77a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SessionInfo { int sessionId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl index c391e5af34..45f6e48168 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SimApdu { int sessionId; diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index d59fcab886..5a5e8ac11d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SimLockMultiSimPolicy { NO_MULTISIM_POLICY, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl index 69bf4767d3..81ba510c2f 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.sim; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SimRefreshResult { int type; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl index 1ab29029b9..8725c7fb5d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AudioQuality { UNSPECIFIED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl index 10d2ee751b..b45a45b110 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable Call { int state; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl index 8e7aaab565..51c87584ef 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CallForwardInfo { int status; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl index 310f9a0fac..0b36be4eba 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaCallWaiting { String number; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl index b6b562c028..300b03f6da 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaDisplayInfoRecord { String alphaBuf; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl index 24ae775479..2f7f5f05c9 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaInformationRecord { int name; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl index e34b3937b4..4e4a7ee7b7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaLineControlInfoRecord { byte lineCtrlPolarityIncluded; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl index aeb0347d67..c3b0d5a442 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaNumberInfoRecord { String number; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl index fad384172b..ae35fbad52 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum CdmaOtaProvisionStatus { SPL_UNLOCKED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl index b61b91b34f..93c7c6b065 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaRedirectingNumberInfoRecord { android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl index 6c7b264476..69447b433a 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaSignalInfoRecord { boolean isPresent; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl index 438231cbad..69d79aa43b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaT53AudioControlInfoRecord { byte upLink; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl index 1b254f56a0..83b6fb9af7 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CdmaT53ClirInfoRecord { byte cause; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl index 7e799c7b03..fc811f2d73 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CfData { android.hardware.radio.voice.CallForwardInfo[] cfInfo; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl index a34149ad1b..c38c8012fb 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ClipStatus { CLIP_PROVISIONED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl index 2b2e7590bc..26041f0620 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable Dial { String address; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl index 4e1dfc09fa..3099a20626 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyCallRouting { UNKNOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl index ac3867e72e..2129f397e0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable EmergencyNumber { String number; @@ -40,8 +41,8 @@ parcelable EmergencyNumber { int categories; String[] urns; int sources; - const int SOURCE_NETWORK_SIGNALING = (1 << 0); - const int SOURCE_SIM = (1 << 1); - const int SOURCE_MODEM_CONFIG = (1 << 2); - const int SOURCE_DEFAULT = (1 << 3); + const int SOURCE_NETWORK_SIGNALING = (1 << 0) /* 1 */; + const int SOURCE_SIM = (1 << 1) /* 2 */; + const int SOURCE_MODEM_CONFIG = (1 << 2) /* 4 */; + const int SOURCE_DEFAULT = (1 << 3) /* 8 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl index 0a70d2de95..819baf89f1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -32,14 +32,15 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum EmergencyServiceCategory { UNSPECIFIED = 0, - POLICE = (1 << 0), - AMBULANCE = (1 << 1), - FIRE_BRIGADE = (1 << 2), - MARINE_GUARD = (1 << 3), - MOUNTAIN_RESCUE = (1 << 4), - MIEC = (1 << 5), - AIEC = (1 << 6), + POLICE = (1 << 0) /* 1 */, + AMBULANCE = (1 << 1) /* 2 */, + FIRE_BRIGADE = (1 << 2) /* 4 */, + MARINE_GUARD = (1 << 3) /* 8 */, + MOUNTAIN_RESCUE = (1 << 4) /* 16 */, + MIEC = (1 << 5) /* 32 */, + AIEC = (1 << 6) /* 64 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl index 603b1d67aa..d0a9451a36 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @VintfStability interface IRadioVoice { oneway void acceptCall(in int serial); diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl index 189ed43cf9..4614ee1b39 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @VintfStability interface IRadioVoiceIndication { oneway void callRing(in android.hardware.radio.RadioIndicationType type, in boolean isGsm, in android.hardware.radio.voice.CdmaSignalInfoRecord record); diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl index 7acc0446dd..46927c2f81 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @VintfStability interface IRadioVoiceResponse { oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info); diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl index 7d546233f1..0cac135621 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum LastCallFailCause { UNOBTAINABLE_NUMBER = 1, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl index 221acf7306..151adf21d6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable LastCallFailCauseInfo { android.hardware.radio.voice.LastCallFailCause causeCode; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl index 4b5c216081..981ba025be 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum SrvccState { HANDOVER_STARTED, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl index f18b404605..24365dc233 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable SsInfoData { int[] ssInfo; diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl index 75f3de5495..999f47c8d4 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable StkCcUnsolSsResult { int serviceType; @@ -72,13 +73,13 @@ parcelable StkCcUnsolSsResult { const int TELESERVICE_TYPE_SMS_SERVICES = 4; const int TELESERVICE_TYPE_ALL_TELESERVICES_EXCEPT_SMS = 5; const int SUPP_SERVICE_CLASS_NONE = 0; - const int SUPP_SERVICE_CLASS_VOICE = (1 << 0); - const int SUPP_SERVICE_CLASS_DATA = (1 << 1); - const int SUPP_SERVICE_CLASS_FAX = (1 << 2); - const int SUPP_SERVICE_CLASS_SMS = (1 << 3); - const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4); - const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5); - const int SUPP_SERVICE_CLASS_PACKET = (1 << 6); - const int SUPP_SERVICE_CLASS_PAD = (1 << 7); - const int SUPP_SERVICE_CLASS_MAX = (1 << 7); + const int SUPP_SERVICE_CLASS_VOICE = (1 << 0) /* 1 */; + const int SUPP_SERVICE_CLASS_DATA = (1 << 1) /* 2 */; + const int SUPP_SERVICE_CLASS_FAX = (1 << 2) /* 4 */; + const int SUPP_SERVICE_CLASS_SMS = (1 << 3) /* 8 */; + const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4) /* 16 */; + const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5) /* 32 */; + const int SUPP_SERVICE_CLASS_PACKET = (1 << 6) /* 64 */; + const int SUPP_SERVICE_CLASS_PAD = (1 << 7) /* 128 */; + const int SUPP_SERVICE_CLASS_MAX = (1 << 7) /* 128 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl index e432e65093..41ff6b8109 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum TtyMode { OFF, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl index 424e73fc35..9e80f03149 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum UssdModeType { NOTIFY, diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl index 931376014c..3c84c8d97b 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio.voice; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable UusInfo { int uusType; diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl index 964165149d..73a267b6d0 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum AccessNetwork { UNKNOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl index aa55cd77d9..1298ab0f4c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl @@ -32,30 +32,31 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioAccessFamily { - UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN), - GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS), - EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE), - UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS), - IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A), - IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B), - ONE_X_RTT = (1 << android.hardware.radio.RadioTechnology.ONE_X_RTT), - EVDO_0 = (1 << android.hardware.radio.RadioTechnology.EVDO_0), - EVDO_A = (1 << android.hardware.radio.RadioTechnology.EVDO_A), - HSDPA = (1 << android.hardware.radio.RadioTechnology.HSDPA), - HSUPA = (1 << android.hardware.radio.RadioTechnology.HSUPA), - HSPA = (1 << android.hardware.radio.RadioTechnology.HSPA), - EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B), - EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD), - LTE = (1 << android.hardware.radio.RadioTechnology.LTE), - HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP), - GSM = (1 << android.hardware.radio.RadioTechnology.GSM), - TD_SCDMA = (1 << android.hardware.radio.RadioTechnology.TD_SCDMA), - IWLAN = (1 << android.hardware.radio.RadioTechnology.IWLAN), + UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN) /* 1 */, + GPRS = (1 << android.hardware.radio.RadioTechnology.GPRS) /* 2 */, + EDGE = (1 << android.hardware.radio.RadioTechnology.EDGE) /* 4 */, + UMTS = (1 << android.hardware.radio.RadioTechnology.UMTS) /* 8 */, + IS95A = (1 << android.hardware.radio.RadioTechnology.IS95A) /* 16 */, + IS95B = (1 << android.hardware.radio.RadioTechnology.IS95B) /* 32 */, + ONE_X_RTT = (1 << android.hardware.radio.RadioTechnology.ONE_X_RTT) /* 64 */, + EVDO_0 = (1 << android.hardware.radio.RadioTechnology.EVDO_0) /* 128 */, + EVDO_A = (1 << android.hardware.radio.RadioTechnology.EVDO_A) /* 256 */, + HSDPA = (1 << android.hardware.radio.RadioTechnology.HSDPA) /* 512 */, + HSUPA = (1 << android.hardware.radio.RadioTechnology.HSUPA) /* 1024 */, + HSPA = (1 << android.hardware.radio.RadioTechnology.HSPA) /* 2048 */, + EVDO_B = (1 << android.hardware.radio.RadioTechnology.EVDO_B) /* 4096 */, + EHRPD = (1 << android.hardware.radio.RadioTechnology.EHRPD) /* 8192 */, + LTE = (1 << android.hardware.radio.RadioTechnology.LTE) /* 16384 */, + HSPAP = (1 << android.hardware.radio.RadioTechnology.HSPAP) /* 32768 */, + GSM = (1 << android.hardware.radio.RadioTechnology.GSM) /* 65536 */, + TD_SCDMA = (1 << android.hardware.radio.RadioTechnology.TD_SCDMA) /* 131072 */, + IWLAN = (1 << android.hardware.radio.RadioTechnology.IWLAN) /* 262144 */, /** * @deprecated use LTE instead. */ - LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA), - NR = (1 << android.hardware.radio.RadioTechnology.NR), + LTE_CA = (1 << android.hardware.radio.RadioTechnology.LTE_CA) /* 524288 */, + NR = (1 << android.hardware.radio.RadioTechnology.NR) /* 1048576 */, } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl index 448c0bb5c1..970cd1e0c8 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl @@ -32,10 +32,11 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RadioConst { const int MAX_RILDS = 3; const int MAX_UUID_LENGTH = 64; const int CARD_MAX_APPS = 8; - const int P2_CONSTANT_NO_P2 = (-1); + const int P2_CONSTANT_NO_P2 = (-1) /* -1 */; } diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl index b9db56c778..781c9f61ef 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioError { NONE = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl index 58b35a5723..316f92f876 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioIndicationType { UNSOLICITED, diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl index b2a7a062f9..f03a73bfb1 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RadioResponseInfo { android.hardware.radio.RadioResponseType type; diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl index 37ed7bb230..2e0c315426 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @JavaDerive(toString=true) @VintfStability parcelable RadioResponseInfoModem { android.hardware.radio.RadioResponseType type; diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl index 1ee62bd94c..8bdb45bfdf 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioResponseType { SOLICITED, diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl index b6af5aabf2..7c6a657bcd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnology { UNKNOWN, diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl index 2af7e535da..85e9850cad 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.radio; +/* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum RadioTechnologyFamily { THREE_GPP, diff --git a/radio/aidl/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/android/hardware/radio/AccessNetwork.aidl index 2885642e83..4099f83f04 100644 --- a/radio/aidl/android/hardware/radio/AccessNetwork.aidl +++ b/radio/aidl/android/hardware/radio/AccessNetwork.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl index edf33ba7cc..9ab4583c08 100644 --- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl +++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl @@ -18,6 +18,7 @@ package android.hardware.radio; import android.hardware.radio.RadioTechnology; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioConst.aidl b/radio/aidl/android/hardware/radio/RadioConst.aidl index 6591ef16a2..7b923b984a 100644 --- a/radio/aidl/android/hardware/radio/RadioConst.aidl +++ b/radio/aidl/android/hardware/radio/RadioConst.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RadioConst { diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl index 4d44559ee1..e95d72508b 100644 --- a/radio/aidl/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/android/hardware/radio/RadioError.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl index 2dcc492a1c..594b14787b 100644 --- a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl +++ b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl index f70a3fe457..25195aaa2f 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio; import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseType; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RadioResponseInfo { diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl index 13abfb991f..286f397607 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl @@ -19,6 +19,7 @@ package android.hardware.radio; import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseType; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RadioResponseInfoModem { diff --git a/radio/aidl/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/android/hardware/radio/RadioResponseType.aidl index cd4a305d4b..000f478384 100644 --- a/radio/aidl/android/hardware/radio/RadioResponseType.aidl +++ b/radio/aidl/android/hardware/radio/RadioResponseType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl index 4b51152ac4..7ae428bac6 100644 --- a/radio/aidl/android/hardware/radio/RadioTechnology.aidl +++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl index a2b989d18d..4b5498cc07 100644 --- a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl +++ b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl @@ -16,6 +16,7 @@ package android.hardware.radio; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl index 85c2ceee26..1075ef7235 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl @@ -28,6 +28,7 @@ import android.hardware.radio.config.IRadioConfigIndication; import android.hardware.radio.config.IRadioConfigResponse; import android.hardware.radio.config.SlotPortMapping; +/** @hide */ @VintfStability oneway interface IRadioConfig { /** diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl index abf55f1f80..ed2366bbad 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.config.SimSlotStatus; /** * Interface declaring unsolicited radio config indications. + * @hide */ @VintfStability oneway interface IRadioConfigIndication { diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl index 0d36bbd016..cb3533e434 100644 --- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl +++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.config.SimSlotStatus; /** * Interface declaring response functions to solicited radio config requests. + * @hide */ @VintfStability oneway interface IRadioConfigResponse { diff --git a/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl index b18ea0e710..1d9b66e586 100644 --- a/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl +++ b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.config; * Multiple Enabled Profiles(MEP) mode is the jointly supported MEP mode. As per section 3.4.1.1 of * GSMA spec SGP.22 v3.0,there are 3 supported MEP modes: MEP-A1, MEP-A2 and MEP-B. * If there is no jointly supported MEP mode, supported MEP mode is set to NONE. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl index 8e4f3380cb..35d6b5d86d 100644 --- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl +++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.config; * Phone capability which describes the data connection capability of modem. * It's used to evaluate possible phone config change, for example from single * SIM device to multi-SIM device. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl index db247191ad..f57963967b 100644 --- a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl +++ b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.config; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SimPortInfo { diff --git a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl index 6a36d5e83b..34f98c56bb 100644 --- a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl +++ b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.config; import android.hardware.radio.config.MultipleEnabledProfilesMode; import android.hardware.radio.config.SimPortInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SimSlotStatus { diff --git a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl index c78afcbc5f..30cca50503 100644 --- a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl +++ b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.config; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SlotPortMapping { diff --git a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl index a4116db172..1d1d851a8d 100644 --- a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl +++ b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl index ed1256d744..366570abb0 100644 --- a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl +++ b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl index 071ce55c49..e015e8eec9 100644 --- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl index ea4e751fce..613387f83c 100644 --- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.data.ApnAuthType; import android.hardware.radio.data.PdpProtocolType; import android.hardware.radio.data.TrafficDescriptor; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable DataProfileInfo { diff --git a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl index 44b47f84ec..b16081d8ec 100644 --- a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl +++ b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl index e4ee444207..a762e346d0 100644 --- a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl +++ b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @Backing(type="byte") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/android/hardware/radio/data/EpsQos.aidl index 8965d6eb5d..42eee32240 100644 --- a/radio/aidl/android/hardware/radio/data/EpsQos.aidl +++ b/radio/aidl/android/hardware/radio/data/EpsQos.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.data.QosBandwidth; /** * LTE/EPS Quality of Service parameters as per 3gpp spec 24.301 sec 9.9.4.3. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl index 0171d39b42..519d4257d4 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl @@ -34,6 +34,7 @@ import android.hardware.radio.data.TrafficDescriptor; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioDataResponse and IRadioDataIndication. + * @hide */ @VintfStability oneway interface IRadioData { diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl index 938c695fd4..c3fdcaa60d 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.data.SlicingConfig; /** * Interface declaring unsolicited radio indications for data APIs. + * @hide */ @VintfStability oneway interface IRadioDataIndication { diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl index 06c83c1e92..b7148449e7 100644 --- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl +++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.SlicingConfig; /** * Interface declaring response functions to solicited radio requests for data APIs. + * @hide */ @VintfStability oneway interface IRadioDataResponse { diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl index c720de0547..1838f2eca5 100644 --- a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl +++ b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable KeepaliveRequest { diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl index 0b829c4a4d..162fc37b48 100644 --- a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl +++ b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable KeepaliveStatus { diff --git a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl index 12a7637a59..957973d796 100644 --- a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl +++ b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; /** * Describes a data link address for mobile data connection. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/NrQos.aidl b/radio/aidl/android/hardware/radio/data/NrQos.aidl index 4078fdccc6..f636e6b12f 100644 --- a/radio/aidl/android/hardware/radio/data/NrQos.aidl +++ b/radio/aidl/android/hardware/radio/data/NrQos.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.data.QosBandwidth; /** * 5G Quality of Service parameters as per 3gpp spec 24.501 sec 9.11.4.12 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/android/hardware/radio/data/OsAppId.aidl index 88e7832af0..ae38cf3991 100644 --- a/radio/aidl/android/hardware/radio/data/OsAppId.aidl +++ b/radio/aidl/android/hardware/radio/data/OsAppId.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; /** * This struct represents the OsId + OsAppId as defined in TS 24.526 Section 5.2 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl index 38a821fb85..a487bb3389 100644 --- a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable PcoDataInfo { diff --git a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl index 792a503a7d..27e541d8a3 100644 --- a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl +++ b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; /** * Specifies the type of packet data protocol which is defined in TS 27.007 section 10.1.1. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/data/PortRange.aidl b/radio/aidl/android/hardware/radio/data/PortRange.aidl index 5c83ca4e64..7326966049 100644 --- a/radio/aidl/android/hardware/radio/data/PortRange.aidl +++ b/radio/aidl/android/hardware/radio/data/PortRange.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.data; * Defines range of ports. start and end are the first and last port numbers (inclusive) in the * range. Both start and end are in PORT_RANGE_MIN to PORT_RANGE_MAX range. A single port shall * be represented by the same start and end value. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/Qos.aidl b/radio/aidl/android/hardware/radio/data/Qos.aidl index d9ab9e70b9..e98d030cb1 100644 --- a/radio/aidl/android/hardware/radio/data/Qos.aidl +++ b/radio/aidl/android/hardware/radio/data/Qos.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.NrQos; /** * EPS or NR QOS parameters + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl index e841548089..f2eca4136c 100644 --- a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl +++ b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable QosBandwidth { diff --git a/radio/aidl/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/android/hardware/radio/data/QosFilter.aidl index f5dc7ec9c6..4a2b61dd3a 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilter.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilter.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.data.QosFilterTypeOfService; /** * See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl index 5059c28c17..83c4fe1b52 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) union QosFilterIpsecSpi { diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl index 6f149348c4..4591174207 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) union QosFilterIpv6FlowLabel { diff --git a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl index f5770a42ae..8d27399964 100644 --- a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl +++ b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.data; +/** @hide */ @VintfStability @JavaDerive(toString=true) union QosFilterTypeOfService { diff --git a/radio/aidl/android/hardware/radio/data/QosSession.aidl b/radio/aidl/android/hardware/radio/data/QosSession.aidl index 770b124fe1..1a8eb2c881 100644 --- a/radio/aidl/android/hardware/radio/data/QosSession.aidl +++ b/radio/aidl/android/hardware/radio/data/QosSession.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.QosFilter; /** * QOS session associated with a dedicated bearer + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl index 14b0ffcb34..4e9e954db3 100644 --- a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.SliceInfo; /** * This struct represents a single route selection descriptor as defined in 3GPP TS 24.526. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl index fee54aceaa..b8f01c0cb7 100644 --- a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl +++ b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.data.QosSession; import android.hardware.radio.data.SliceInfo; import android.hardware.radio.data.TrafficDescriptor; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SetupDataCallResult { diff --git a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl index 7ad7fc36a4..809b8e0722 100644 --- a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl +++ b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.data; /** * This struct represents a S-NSSAI as defined in 3GPP TS 24.501. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl index e94b58c257..47ac41eb84 100644 --- a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl +++ b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.UrspRule; /** * This struct represents the current slicing configuration. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl index 2c117a5de2..098c77abe1 100644 --- a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl +++ b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.data.OsAppId; * This struct represents a traffic descriptor. A valid struct must have at least one of the * optional values present. This is based on the definition of traffic descriptor in * TS 24.526 Section 5.2. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/android/hardware/radio/data/UrspRule.aidl index 0499edd1e2..f2028b49c1 100644 --- a/radio/aidl/android/hardware/radio/data/UrspRule.aidl +++ b/radio/aidl/android/hardware/radio/data/UrspRule.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.data.TrafficDescriptor; /** * This struct represents a single URSP rule as defined in 3GPP TS 24.526. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl index 70faa1e2e9..c96f59f337 100644 --- a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl +++ b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl @@ -16,10 +16,10 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ConnectionFailureInfo { - @VintfStability @Backing(type="int") enum ConnectionFailureReason { diff --git a/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl index 670638b029..5300fbeeef 100644 --- a/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl +++ b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl index bd661a7224..05d60355b4 100644 --- a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl +++ b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl @@ -34,6 +34,7 @@ import android.hardware.radio.ims.SrvccCall; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioImsResponse and IRadioImsIndication. + * @hide */ @VintfStability oneway interface IRadioIms { @@ -90,9 +91,8 @@ oneway interface IRadioIms { * * Response function is IRadioImsResponse.startImsTrafficResponse() */ - void startImsTraffic(int serial, int token, - ImsTrafficType imsTrafficType, AccessNetwork accessNetworkType, - ImsCall.Direction trafficDirection); + void startImsTraffic(int serial, int token, ImsTrafficType imsTrafficType, + AccessNetwork accessNetworkType, ImsCall.Direction trafficDirection); /** * Indicates IMS traffic has been stopped. @@ -123,8 +123,8 @@ oneway interface IRadioIms { * @param radioImsResponse Object containing response functions * @param radioImsIndication Object containing radio indications */ - void setResponseFunctions(in IRadioImsResponse radioImsResponse, - in IRadioImsIndication radioImsIndication); + void setResponseFunctions( + in IRadioImsResponse radioImsResponse, in IRadioImsIndication radioImsIndication); /** * Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114. @@ -138,7 +138,8 @@ oneway interface IRadioIms { * * Response function is IRadioImsResponse.sendAnbrQueryResponse() */ - void sendAnbrQuery(int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond); + void sendAnbrQuery( + int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond); /** * Provides a list of IMS call information to radio. diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl index d123d07b90..58e30cec42 100644 --- a/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl +++ b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.ims.ImsStreamType; /** * Interface declaring unsolicited radio indications for ims APIs. + * @hide */ @VintfStability oneway interface IRadioImsIndication { diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl index ff516cc8f1..b8a5a94ae2 100644 --- a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl +++ b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl @@ -21,10 +21,10 @@ import android.hardware.radio.ims.ConnectionFailureInfo; /** * Interface declaring response functions to solicited radio requests for ims APIs. + * @hide */ @VintfStability oneway interface IRadioImsResponse { - /** * @param info Response info struct containing response type, serial no. and error * @@ -73,8 +73,8 @@ oneway interface IRadioImsResponse { * RadioError:INVALID_ARGUMENTS * RadioError:NO_RESOURCES */ - void startImsTrafficResponse(in RadioResponseInfo info, - in @nullable ConnectionFailureInfo failureInfo); + void startImsTrafficResponse( + in RadioResponseInfo info, in @nullable ConnectionFailureInfo failureInfo); /** * @param info Response info struct containing response type, serial no. and error diff --git a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl index b71682fae3..427c1f5340 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl @@ -18,10 +18,10 @@ package android.hardware.radio.ims; import android.hardware.radio.AccessNetwork; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ImsCall { - @Backing(type="int") enum CallType { NORMAL, diff --git a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl index eac8db4437..acfe51cd99 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl index 662f9e9a56..5158386c8e 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.AccessNetwork; import android.hardware.radio.ims.ImsRegistrationState; import android.hardware.radio.ims.SuggestedAction; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ImsRegistration { diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl index fd5c0fa930..187cb38529 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") @@ -25,4 +26,4 @@ enum ImsRegistrationState { /** IMS is successfully registered */ REGISTERED, -} \ No newline at end of file +} diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl index c0cea32230..42ce1bd491 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl index c12a0c120f..b88dc601be 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl @@ -16,8 +16,10 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum ImsStreamType { /** Media Stream Type - Audio **/ AUDIO = 1, diff --git a/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl index 5a824c0d54..5af43f9279 100644 --- a/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl +++ b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") @@ -40,4 +41,4 @@ enum ImsTrafficType { /** Ut/XCAP (XML Configuration Access Protocol) */ UT_XCAP -} \ No newline at end of file +} diff --git a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl index 38e6cdbd54..16858f96ce 100644 --- a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl +++ b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl @@ -16,10 +16,10 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SrvccCall { - @VintfStability @Backing(type="int") enum CallType { diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl index 2d12ed628c..443042d0a4 100644 --- a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl +++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.ims; +/** @hide */ @VintfStability @JavaDerive(toString=true) @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl index 66d8ef096b..dc2a16279b 100644 --- a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl @@ -16,9 +16,13 @@ package android.hardware.radio.ims.media; -/** AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 */ +/** + * AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 + * @hide + */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum AmrMode { /** 4.75 kbps for AMR / 6.6 kbps for AMR-WB */ AMR_MODE_0 = 1 << 0, diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl index 4ed3a24d66..9d7ab058d9 100644 --- a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl @@ -18,7 +18,9 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.AmrMode; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable AmrParams { /** mode-set: AMR codec mode to represent the bit rate */ AmrMode amrMode; diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl index f758cd47cc..af6f92f7a5 100644 --- a/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.CodecMode; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable AnbrMode { diff --git a/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl index a8f7b16181..dcf96231f5 100644 --- a/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable CallQuality { /** * downlink CallQualityLevel for a given ongoing call diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl index aa1b3a4cf1..6858ef44e3 100644 --- a/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.AmrMode; import android.hardware.radio.ims.media.EvsMode; +/** @hide */ @VintfStability @JavaDerive(toString=true) union CodecMode { diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl index 0aa5505816..74de6ecae6 100644 --- a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl @@ -19,7 +19,9 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.CodecSpecificParams; import android.hardware.radio.ims.media.CodecType; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable CodecParams { /** Negotiated codec type */ CodecType codecType; diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl index 4410c81bb7..86dcea0ca1 100644 --- a/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl @@ -19,7 +19,9 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.AmrParams; import android.hardware.radio.ims.media.EvsParams; +/** @hide */ @VintfStability +@JavaDerive(toString=true) union CodecSpecificParams { AmrParams amr; EvsParams evs; diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl index 31218e328e..99fbac4fda 100644 --- a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl @@ -16,8 +16,10 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum CodecType { /** Adaptive Multi-Rate */ AMR = 1 << 0, diff --git a/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl index a7dcb0dc94..d2926f0dda 100644 --- a/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable DtmfParams { /** * Dynamic payload type number to be used for DTMF RTP packets received. diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl index 8278514bf3..279c489927 100644 --- a/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl @@ -15,9 +15,14 @@ */ package android.hardware.radio.ims.media; -/** EVS Speech codec bandwidths, See 3gpp spec 26.441 Table 1 */ + +/** + * EVS Speech codec bandwidths, See 3gpp spec 26.441 Table 1 + * @hide + */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum EvsBandwidth { NONE = 0, NARROW_BAND = 1 << 0, diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl index 95bd6c7117..12d981bfc8 100644 --- a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl @@ -16,9 +16,13 @@ package android.hardware.radio.ims.media; -/** EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 */ +/** + * EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 + * @hide + */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum EvsMode { /** 6.6 kbps for EVS AMR-WB IO */ EVS_MODE_0 = 1 << 0, diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl index d138c8387a..52c3bf91a6 100644 --- a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl @@ -19,7 +19,9 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.EvsBandwidth; import android.hardware.radio.ims.media.EvsMode; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable EvsParams { /** EVS codec bandwidth */ EvsBandwidth bandwidth; diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl index ecf137030a..0af86c7df3 100644 --- a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl @@ -23,10 +23,10 @@ import android.hardware.radio.ims.media.RtpError; /** * This interface is used by IMS media framework to talk to RTP stack located in another processor. + * @hide */ @VintfStability oneway interface IImsMedia { - /** * Set the listener functions for receiving notifications from the RTP stack. * diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl index 228acb77d9..371edd2037 100644 --- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.ims.media.RtpError; /** * Interface declaring listener functions for unsolicited IMS media notifications. + * @hide */ @VintfStability oneway interface IImsMediaListener { diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl index ec2fa2b3cd..deb741b64f 100644 --- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.ims.media.RtpHeaderExtension; /** * Session specific interface used by IMS media framework to talk to the vendor RTP stack. + * @hide */ @VintfStability oneway interface IImsMediaSession { diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl index 8341da2bb1..442c018b83 100644 --- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.ims.media.RtpHeaderExtension; /** * Interface declaring listener functions for unsolicited IMS media notifications per session. + * @hide */ @VintfStability oneway interface IImsMediaSessionListener { diff --git a/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl index 2bd48c6fd7..29f25bbb82 100644 --- a/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl @@ -18,7 +18,9 @@ package android.hardware.radio.ims.media; import android.os.ParcelFileDescriptor; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable LocalEndPoint { /** Socket file descriptor for RTP traffic */ ParcelFileDescriptor rtpFd; diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl index e5c34c7c1b..4ae36dfb8b 100644 --- a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl @@ -26,9 +26,11 @@ package android.hardware.radio.ims.media; * Receive-Only : RTP_RX | RTCP_TX | RTCP_RX - eg. Remote Hold. * Send-Receive : RTP_TX | RTP_RX | RTCP_TX | RTCP_RX - eg. Active call. * Send-Only : RTP_TX | RTCP_TX | RTCP_RX - eg. Simplex call, voice mail, etc + * @hide */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum MediaDirection { /** * No RTP/RTCP flow in either direction. The implementation diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl index b99e501522..b617f91168 100644 --- a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable MediaQualityStatus { /** * Rtp inactivity observed as per threshold set by diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl index bf98928ef0..25473d0408 100644 --- a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable MediaQualityThreshold { /** Array including threshold values in milliseconds for monitoring RTP inactivity */ int[] rtpInactivityTimerMillis; diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl index 98bbfc6aeb..9cb3c0e595 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable RtcpConfig { /** Canonical name that will be sent to all session participants */ String canonicalName; diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl index 7f6839a6bc..88180d7151 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl @@ -16,25 +16,28 @@ package android.hardware.radio.ims.media; -/** RTP Control Protocol Extended Reports (RTCP XR) Blocks, See RFC 3611 section 4 */ - +/** + * RTP Control Protocol Extended Reports (RTCP XR) Blocks, See RFC 3611 section 4 + * @hide + */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RtcpXrReportBlockType { /** Disable RTCP XR */ RTCPXR_NONE = 0, /** Loss RLE Report Block */ - RTCPXR_LOSS_RLE_REPORT_BLOCK = 1 << 0, + RTCPXR_LOSS_RLE_REPORT_BLOCK = 1 << 0, /** Duplicate RLE Report Block */ - RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 1 << 1, + RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 1 << 1, /** Packet Receipt Times Report Block */ - RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 1 << 2, + RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 1 << 2, /** Receiver Reference Time Report Block */ - RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 1 << 3, + RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 1 << 3, /** DLRR Report Block */ - RTCPXR_DLRR_REPORT_BLOCK = 1 << 4, + RTCPXR_DLRR_REPORT_BLOCK = 1 << 4, /** Statistics Summary Report Block */ - RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 1 << 5, + RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 1 << 5, /** VoIP Metrics Report Block */ - RTCPXR_VOIP_METRICS_REPORT_BLOCK = 1 << 6, + RTCPXR_VOIP_METRICS_REPORT_BLOCK = 1 << 6, } diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl index 2db73a3fbd..c17e4b24c5 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl @@ -16,7 +16,9 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable RtpAddress { /** Point to point IP address */ String ipAddress; diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl index f93b1125aa..3c5c4dd756 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl @@ -22,7 +22,9 @@ import android.hardware.radio.ims.media.RtcpConfig; import android.hardware.radio.ims.media.RtpAddress; import android.hardware.radio.ims.media.RtpSessionParams; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable RtpConfig { /** Media flow direction. The bitfield of MediaDirection(s) */ int direction; diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl index 11a3468da2..84f972f37f 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl @@ -16,8 +16,10 @@ package android.hardware.radio.ims.media; +/** @hide */ @VintfStability @Backing(type="int") +@JavaDerive(toString=true) enum RtpError { /** Success */ NONE = 0, diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl index 76b13dc629..19e855a353 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl @@ -16,8 +16,12 @@ package android.hardware.radio.ims.media; -/** RTP Header Extensions, see RFC 8285 */ +/** + * RTP Header Extensions, see RFC 8285 + * @hide + */ @VintfStability +@JavaDerive(toString=true) parcelable RtpHeaderExtension { /** Local identifier */ int localId; diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl index f93c52c088..ae5c7e6557 100644 --- a/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl +++ b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl @@ -19,7 +19,9 @@ package android.hardware.radio.ims.media; import android.hardware.radio.ims.media.CodecParams; import android.hardware.radio.ims.media.DtmfParams; +/** @hide */ @VintfStability +@JavaDerive(toString=true) parcelable RtpSessionParams { /** * ptime: Recommended length of time in milliseconds represented by the media diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl index 4173f156a2..35a6a8d9b4 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaBroadcastSmsConfigInfo { diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl index 85ef692a86..2544ab5cf0 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSmsAck { diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl index 8e521df0c1..a7ad233565 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSmsAddress { diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl index d4fb26f411..51388b6f6f 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.messaging; import android.hardware.radio.messaging.CdmaSmsAddress; import android.hardware.radio.messaging.CdmaSmsSubaddress; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSmsMessage { diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl index 18e5837085..19d84ffb35 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSmsSubaddress { diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl index 41919857dc..897ec80ce9 100644 --- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.messaging; import android.hardware.radio.messaging.CdmaSmsMessage; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSmsWriteArgs { diff --git a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl index 5138c3c0d3..b4ab51860d 100644 --- a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl +++ b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.messaging; /** * Which types of Cell Broadcast Message (CBM) are to be received by the ME + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl index b256c9a8bc..9a1a7b9713 100644 --- a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable GsmSmsMessage { diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl index 8bd84a301a..44818ff209 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl @@ -35,6 +35,7 @@ import android.hardware.radio.messaging.SmsWriteArgs; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioMessagingResponse and IRadioMessagingIndication. + * @hide */ @VintfStability oneway interface IRadioMessaging { diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl index 8834cd91c0..a177c2cbdd 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.messaging.CdmaSmsMessage; /** * Interface declaring unsolicited radio indications for messaging APIs. + * @hide */ @VintfStability oneway interface IRadioMessagingIndication { diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl index 8cbc869d33..84c34ca478 100644 --- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl +++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.messaging.SendSmsResult; /** * Interface declaring response functions to solicited radio requests for messaging APIs. + * @hide */ @VintfStability oneway interface IRadioMessagingResponse { diff --git a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl index d4be04460d..5f9f82b7e3 100644 --- a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl +++ b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioTechnologyFamily; import android.hardware.radio.messaging.CdmaSmsMessage; import android.hardware.radio.messaging.GsmSmsMessage; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ImsSmsMessage { diff --git a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl index 80e059c5fb..ea93727034 100644 --- a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SendSmsResult { diff --git a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl index eb15bf1129..6f529ebfb1 100644 --- a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl index 6eef9417d7..64ce606617 100644 --- a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl +++ b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.messaging; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SmsWriteArgs { diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl index b2a56d470d..db77c51be8 100644 --- a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl +++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.ActivityStatsTechSpecificInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ActivityStatsInfo { diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl index fcc2df20e9..7ca4021bf8 100644 --- a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; import android.hardware.radio.AccessNetwork; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ActivityStatsTechSpecificInfo { diff --git a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl index ad0d59cdf7..c1f4cd6b53 100644 --- a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl +++ b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl index 8eb1f2d1a9..323e5c94cd 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.HardwareConfigModem; import android.hardware.radio.modem.HardwareConfigSim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable HardwareConfig { diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl index f5e2c278e4..1ba3562e62 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.modem; import android.hardware.radio.RadioTechnology; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable HardwareConfigModem { diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl index c82bc6e444..a5747c1a16 100644 --- a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl +++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable HardwareConfigSim { diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl index 2011c53e13..0d51584259 100644 --- a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl +++ b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl @@ -31,6 +31,7 @@ import android.hardware.radio.modem.ResetNvType; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioModemResponse and IRadioModemIndication. + * @hide */ @VintfStability oneway interface IRadioModem { @@ -244,5 +245,5 @@ oneway interface IRadioModem { * * Response function is IRadioModemResponse.getImeiResponse() */ - void getImei(in int serial); + void getImei(in int serial); } diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl index c61de99cd6..4b98277125 100644 --- a/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl +++ b/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.modem.RadioState; /** * Interface declaring unsolicited radio indications for modem APIs. + * @hide */ @VintfStability oneway interface IRadioModemIndication { diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl index fd4bffb659..b6946f3d1f 100644 --- a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl +++ b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl @@ -19,11 +19,12 @@ package android.hardware.radio.modem; import android.hardware.radio.RadioResponseInfo; import android.hardware.radio.modem.ActivityStatsInfo; import android.hardware.radio.modem.HardwareConfig; -import android.hardware.radio.modem.RadioCapability; import android.hardware.radio.modem.ImeiInfo; +import android.hardware.radio.modem.RadioCapability; /** * Interface declaring response functions to solicited radio requests for modem APIs. + * @hide */ @VintfStability oneway interface IRadioModemResponse { diff --git a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl index 2d25bb71c1..6d33505233 100644 --- a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl +++ b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl @@ -18,26 +18,25 @@ package android.hardware.radio.modem; /** * ImeiInfo to encapsulate the IMEI information from modem + * @hide */ - @VintfStability @JavaDerive(toString=true) parcelable ImeiInfo { - @VintfStability @Backing(type="int") /** * ImeiType enum is used identify the IMEI as primary or secondary as mentioned in GSMA TS.37 */ enum ImeiType { - /** - * This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM - * device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8. - * A single SIM with one IMEI must by default set that IMEI with this type. - */ - PRIMARY = 1, - /** This is not the primary IMEI of the device */ - SECONDARY = 2, + /** + * This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM + * device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8. + * A single SIM with one IMEI must by default set that IMEI with this type. + */ + PRIMARY = 1, + /** This is not the primary IMEI of the device */ + SECONDARY = 2, } /** Primary or secondary IMEI as mentioned in GSMA spec TS.37 */ @@ -48,8 +47,8 @@ parcelable ImeiInfo { * SIM activations or swaps. */ String imei; - /** + /** * IMEI software version, see 3gpp spec 23.003 section 6. */ String svn; -} \ No newline at end of file +} diff --git a/radio/aidl/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/android/hardware/radio/modem/NvItem.aidl index 310b1ad601..b405137f56 100644 --- a/radio/aidl/android/hardware/radio/modem/NvItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvItem.aidl @@ -16,7 +16,10 @@ package android.hardware.radio.modem; -/** @deprecated NV APIs are deprecated starting from Android U. */ +/** + * @deprecated NV APIs are deprecated starting from Android U. + * @hide + */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl index 6472f23d78..c57253b76b 100644 --- a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl +++ b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl @@ -18,7 +18,10 @@ package android.hardware.radio.modem; import android.hardware.radio.modem.NvItem; -/** @deprecated NV APIs are deprecated starting from Android U. */ +/** + * @deprecated NV APIs are deprecated starting from Android U. + * @hide + */ @VintfStability @JavaDerive(toString=true) parcelable NvWriteItem { diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl index 16cba09248..9781595862 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RadioCapability { diff --git a/radio/aidl/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/android/hardware/radio/modem/RadioState.aidl index dedad25483..c36dbe08e4 100644 --- a/radio/aidl/android/hardware/radio/modem/RadioState.aidl +++ b/radio/aidl/android/hardware/radio/modem/RadioState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.modem; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl index 6476fe8704..e290a52635 100644 --- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl +++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl @@ -16,7 +16,10 @@ package android.hardware.radio.modem; -/** Note: This will be deprecated along with nvResetConfig in Android U. */ +/** + * Note: This will be deprecated along with nvResetConfig in Android U. + * @hide + */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl index 8b95ced7e8..9c48a8d838 100644 --- a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.Cdma2000RegistrationInfo; import android.hardware.radio.network.EutranRegistrationInfo; import android.hardware.radio.network.NrVopsInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) union AccessTechnologySpecificInfo { diff --git a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl index 2759406689..f12e35c093 100644 --- a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.BarringTypeSpecificInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable BarringInfo { diff --git a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl index 3db3bf36a5..b4a3bdfcf6 100644 --- a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable BarringTypeSpecificInfo { diff --git a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl index b06fabb542..91b85004c7 100644 --- a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable Cdma2000RegistrationInfo { diff --git a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl index 2fea519a2a..0bb7c0410a 100644 --- a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl +++ b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl index 1286f67fc9..ae7aa93236 100644 --- a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl index da36ff06f0..3bc19e1670 100644 --- a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl +++ b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl index e34866b2f4..6142087680 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.network.CellIdentityWcdma; /** * A union representing the CellIdentity of a single cell. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl index 5bb26c1c94..b93988fd2e 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.OperatorInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellIdentityCdma { diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl index 60f42b652d..bc02adc28d 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.OperatorInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellIdentityGsm { diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl index bfa58acf05..27c25809b5 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.ClosedSubscriberGroupInfo; import android.hardware.radio.network.EutranBands; import android.hardware.radio.network.OperatorInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellIdentityLte { diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl index d51a18ec90..419284567f 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.network.OperatorInfo; /** * The CellIdentity structure should be reported once for each element of the PLMN-IdentityInfoList * broadcast in SIB1 CellAccessRelatedInfo as per 3GPP TS 38.331 Section 6.3.2. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl index f6e790f64f..33ffc6f610 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.ClosedSubscriberGroupInfo; import android.hardware.radio.network.OperatorInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellIdentityTdscdma { diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl index a76509b3dc..b6e328a2f4 100644 --- a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.ClosedSubscriberGroupInfo; import android.hardware.radio.network.OperatorInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellIdentityWcdma { diff --git a/radio/aidl/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfo.aidl index 161ac718a6..4895326db4 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellConnectionStatus; import android.hardware.radio.network.CellInfoRatSpecificInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfo { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl index 5408104209..0a2bc54213 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.network.CdmaSignalStrength; import android.hardware.radio.network.CellIdentityCdma; import android.hardware.radio.network.EvdoSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoCdma { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl index cadcd913d0..db84510885 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellIdentityGsm; import android.hardware.radio.network.GsmSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoGsm { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl index 443a6689a7..3d9b2f3073 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellIdentityLte; import android.hardware.radio.network.LteSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoLte { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl index 6b3d4f4ec9..61591a931a 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellIdentityNr; import android.hardware.radio.network.NrSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoNr { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl index 76e92a4b3e..10a4a5f993 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.network.CellInfoNr; import android.hardware.radio.network.CellInfoTdscdma; import android.hardware.radio.network.CellInfoWcdma; +/** @hide */ @VintfStability @JavaDerive(toString=true) union CellInfoRatSpecificInfo { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl index fb9c984b47..ff0fff3121 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellIdentityTdscdma; import android.hardware.radio.network.TdscdmaSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoTdscdma { diff --git a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl index 2d6a2e55d9..c38e306dbf 100644 --- a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl +++ b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.CellIdentityWcdma; import android.hardware.radio.network.WcdmaSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CellInfoWcdma { diff --git a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl index a2d82d76cf..d61c1dc685 100644 --- a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable ClosedSubscriberGroupInfo { diff --git a/radio/aidl/android/hardware/radio/network/Domain.aidl b/radio/aidl/android/hardware/radio/network/Domain.aidl index be5f3204a1..bb169bda41 100644 --- a/radio/aidl/android/hardware/radio/network/Domain.aidl +++ b/radio/aidl/android/hardware/radio/network/Domain.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl index 25031a9790..7a2ed9c2a3 100644 --- a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl +++ b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl index 0a22e4c93a..ea4bfebb6e 100644 --- a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl +++ b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl @@ -18,9 +18,10 @@ package android.hardware.radio.network; import android.hardware.radio.AccessNetwork; import android.hardware.radio.network.EmergencyScanType; +/** @hide */ @VintfStability @JavaDerive(toString=true) -parcelable EmergencyNetworkScanTrigger{ +parcelable EmergencyNetworkScanTrigger { /** * Access network to be prioritized during emergency scan. The 1st entry has the highest * priority. diff --git a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl index 2215149995..af2750ee07 100644 --- a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl +++ b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl @@ -19,6 +19,7 @@ import android.hardware.radio.AccessNetwork; import android.hardware.radio.network.Domain; import android.hardware.radio.network.RegState; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable EmergencyRegResult { diff --git a/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl index 72c54903c1..efa6c02c9a 100644 --- a/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl +++ b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/android/hardware/radio/network/EutranBands.aidl index 72e76e3eff..969a1b7446 100644 --- a/radio/aidl/android/hardware/radio/network/EutranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/EutranBands.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; /** * EUTRAN bands up to V16.4.0 + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl index b986944214..fb319c1454 100644 --- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.LteVopsInfo; import android.hardware.radio.network.NrIndicators; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable EutranRegistrationInfo { diff --git a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl index c3b3898b1f..fc7cc1b92b 100644 --- a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable EvdoSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/android/hardware/radio/network/GeranBands.aidl index 0e5b7b20a4..29d829fde3 100644 --- a/radio/aidl/android/hardware/radio/network/GeranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/GeranBands.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl index 796f80fde1..d569cf75fd 100644 --- a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable GsmSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index f22cdb0f12..e4c385670d 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -37,6 +37,7 @@ import android.hardware.radio.network.UsageSetting; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioNetworkResponse and IRadioNetworkIndication. + * @hide */ @VintfStability oneway interface IRadioNetwork { diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl index 47d932d909..2c6f4e70a5 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl @@ -21,16 +21,17 @@ import android.hardware.radio.RadioTechnology; import android.hardware.radio.network.BarringInfo; import android.hardware.radio.network.CellIdentity; import android.hardware.radio.network.CellInfo; +import android.hardware.radio.network.EmergencyRegResult; import android.hardware.radio.network.LinkCapacityEstimate; import android.hardware.radio.network.NetworkScanResult; import android.hardware.radio.network.PhoneRestrictedState; import android.hardware.radio.network.PhysicalChannelConfig; import android.hardware.radio.network.SignalStrength; import android.hardware.radio.network.SuppSvcNotification; -import android.hardware.radio.network.EmergencyRegResult; /** * Interface declaring unsolicited radio indications for network APIs. + * @hide */ @VintfStability oneway interface IRadioNetworkIndication { diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index 457b5b9149..db37a0e649 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -33,6 +33,7 @@ import android.hardware.radio.network.UsageSetting; /** * Interface declaring response functions to solicited radio requests for network APIs. + * @hide */ @VintfStability oneway interface IRadioNetworkResponse { diff --git a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl index 9cab28d1e3..7b95273ee3 100644 --- a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl +++ b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl index fdbdc2b455..c855b18ae7 100644 --- a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable LceDataInfo { diff --git a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl index 6461719cc1..0aea27cb31 100644 --- a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl +++ b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable LinkCapacityEstimate { diff --git a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl index 2d97c4565e..21d3ec7157 100644 --- a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable LteSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl index fb3b986fed..a320acb120 100644 --- a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; /** * Type to define the LTE specific network capabilities for voice over PS including emergency and * normal voice calls. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl index ae173c7eac..37f2cf1fab 100644 --- a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl +++ b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; import android.hardware.radio.network.RadioAccessSpecifier; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable NetworkScanRequest { diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl index 6d83f74690..4465046cbb 100644 --- a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl +++ b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.RadioError; import android.hardware.radio.network.CellInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable NetworkScanResult { diff --git a/radio/aidl/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/android/hardware/radio/network/NgranBands.aidl index 53c7a3d4e7..a87a0d1376 100644 --- a/radio/aidl/android/hardware/radio/network/NgranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/NgranBands.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; /** * NGRAN bands up to V16.5.0 + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl index e293dff818..00e19fe29f 100644 --- a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl +++ b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; /** * NR Dual connectivity state + * @hide */ @VintfStability @Backing(type="byte") diff --git a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl index 32cc964007..214272c9a4 100644 --- a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl +++ b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; /** * The parameters of NR 5G Non-Standalone. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl index 30ae067ec0..65daf36a5c 100644 --- a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable NrSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl index 197f401e7e..71961a3e08 100644 --- a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; /** * Type to define the NR specific network capabilities for voice over PS including emergency and * normal voice calls. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl index 56f4dcad36..36dbadf94d 100644 --- a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable OperatorInfo { diff --git a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl index 23ae3b1a82..de3527c2ca 100644 --- a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl +++ b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl index 9996953dcb..ecb946333d 100644 --- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl +++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioTechnology; import android.hardware.radio.network.CellConnectionStatus; import android.hardware.radio.network.PhysicalChannelConfigBand; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable PhysicalChannelConfig { diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl index 707a032494..aa0e9b256a 100644 --- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl +++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.GeranBands; import android.hardware.radio.network.NgranBands; import android.hardware.radio.network.UtranBands; +/** @hide */ @VintfStability @JavaDerive(toString=true) union PhysicalChannelConfigBand { diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl index 85042489a9..b3cee47e27 100644 --- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; import android.hardware.radio.AccessNetwork; import android.hardware.radio.network.RadioAccessSpecifierBands; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RadioAccessSpecifier { diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl index 38afee5693..4bf694ab0b 100644 --- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.network.GeranBands; import android.hardware.radio.network.NgranBands; import android.hardware.radio.network.UtranBands; +/** @hide */ @VintfStability @JavaDerive(toString=true) union RadioAccessSpecifierBands { diff --git a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl index 45c4a516db..364a562490 100644 --- a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl +++ b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/RegState.aidl b/radio/aidl/android/hardware/radio/network/RegState.aidl index bdba4c4a78..de2d5f67a8 100644 --- a/radio/aidl/android/hardware/radio/network/RegState.aidl +++ b/radio/aidl/android/hardware/radio/network/RegState.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.network; * Please note that registration state UNKNOWN is treated as "out of service" in Android telephony. * Registration state REG_DENIED must be returned if Location Update Reject (with cause 17 - Network * Failure) is received repeatedly from the network, to facilitate "managed roaming". + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl index f1d2972fc9..57a73c0b26 100644 --- a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl +++ b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl @@ -22,6 +22,7 @@ import android.hardware.radio.network.CellIdentity; import android.hardware.radio.network.RegState; import android.hardware.radio.network.RegistrationFailCause; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable RegStateResult { diff --git a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl index 9549f2e841..2955f9658d 100644 --- a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl +++ b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.network; /** * Call fail causes for Circuit-switched service enumerated in 3GPP TS 24.008, 10.5.3.6 and * 10.5.147. Additional detail is available in 3GPP TS 24.008 Annex G. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl index ddb45822b7..5fed522d6a 100644 --- a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.network.NrSignalStrength; import android.hardware.radio.network.TdscdmaSignalStrength; import android.hardware.radio.network.WcdmaSignalStrength; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl index 0a8e9ceee7..e440a64858 100644 --- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl +++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.AccessNetwork; /** * Contains the threshold values of each signal measurement type. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl index d4229e1b1a..3b8c8b2171 100644 --- a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl +++ b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SuppSvcNotification { diff --git a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl index ec9ca6bb69..4afdd0f404 100644 --- a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable TdscdmaSignalStrength { diff --git a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl index 5a714a436d..0b6cfdd20d 100644 --- a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl +++ b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl @@ -21,6 +21,7 @@ package android.hardware.radio.network; * *

Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221 * Annex A. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/android/hardware/radio/network/UtranBands.aidl index a0fd427c28..8478b6607c 100644 --- a/radio/aidl/android/hardware/radio/network/UtranBands.aidl +++ b/radio/aidl/android/hardware/radio/network/UtranBands.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.network; /** * UTRAN bands up to V15.0.0 + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl index 7595c0542e..ace89ed7a9 100644 --- a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl +++ b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.network; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable WcdmaSignalStrength { diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl index 87f13a655e..749f49f07c 100644 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl +++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl @@ -27,6 +27,7 @@ import android.hardware.radio.satellite.SatelliteFeature; * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. + * @hide */ @VintfStability oneway interface IRadioSatellite { diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl index f1d97476d4..2a2fb95221 100644 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl +++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.satellite.SatelliteMode; /** * Interface declaring unsolicited radio indications for satellite APIs. + * @hide */ @VintfStability oneway interface IRadioSatelliteIndication { diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl index e81edaa997..2bef3d2d8d 100644 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl +++ b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl @@ -23,6 +23,7 @@ import android.hardware.radio.satellite.SatelliteMode; /** * Interface declaring response functions to solicited radio requests for satellite APIs. + * @hide */ @VintfStability oneway interface IRadioSatelliteResponse { diff --git a/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl index 1a65bee594..16bd10dfef 100644 --- a/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl +++ b/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.satellite; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl b/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl index 39b2b0054f..f1618957b4 100644 --- a/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl +++ b/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.satellite; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl b/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl index 8496a598a7..9f12d7aa12 100644 --- a/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl +++ b/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.satellite; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable PointingInfo { diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl index 01e64aa67f..29eb63546f 100644 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl +++ b/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.satellite; import android.hardware.radio.satellite.NTRadioTechnology; import android.hardware.radio.satellite.SatelliteFeature; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SatelliteCapabilities { diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl index 0e33998357..6284ec89a8 100644 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl +++ b/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.satellite; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl index 349fd9e0fd..b764d0efdd 100644 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl +++ b/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.satellite; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl index c072f6a321..7fe8e40c9e 100644 --- a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.sim; import android.hardware.radio.sim.PersoSubstate; import android.hardware.radio.sim.PinState; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable AppStatus { diff --git a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl index f8b5922c3b..2598dcb19f 100644 --- a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl +++ b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl index 1419c51de6..043bfa4d20 100644 --- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl @@ -21,6 +21,7 @@ import android.hardware.radio.config.SlotPortMapping; import android.hardware.radio.sim.AppStatus; import android.hardware.radio.sim.PinState; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CardStatus { diff --git a/radio/aidl/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/android/hardware/radio/sim/Carrier.aidl index d25214f542..8b27088578 100644 --- a/radio/aidl/android/hardware/radio/sim/Carrier.aidl +++ b/radio/aidl/android/hardware/radio/sim/Carrier.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable Carrier { diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl index edbec2c4f8..d5e0c43f82 100644 --- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; import android.hardware.radio.sim.Carrier; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CarrierRestrictions { @@ -25,12 +26,12 @@ parcelable CarrierRestrictions { @Backing(type="int") /** This enum defines the carrier restriction status values */ enum CarrierRestrictionStatus { - /** - * Carrier restriction status value is unknown, used in cases where modem is dependent on - * external module to know about the lock status and the module hasn’t yet provided the lock - * status. For example, when the lock status is maintained on a cloud server and device has - * just booted after out of box and not yet connected to the internet. - */ + /** + * Carrier restriction status value is unknown, used in cases where modem is dependent on + * external module to know about the lock status and the module hasn’t yet provided the lock + * status. For example, when the lock status is maintained on a cloud server and device has + * just booted after out of box and not yet connected to the internet. + */ UNKNOWN = 0, /** There is no carrier restriction on the device */ NOT_RESTRICTED = 1, diff --git a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl index 6aa6926c27..4c6c1efbbe 100644 --- a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl +++ b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl index 3823a718b5..14536647ed 100644 --- a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl +++ b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl @@ -37,6 +37,7 @@ import android.hardware.radio.sim.SimLockMultiSimPolicy; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioSimResponse and IRadioSimIndication. + * @hide */ @VintfStability oneway interface IRadioSim { diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl index a13904099d..fc6355d425 100644 --- a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl +++ b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl @@ -24,6 +24,7 @@ import android.hardware.radio.sim.SimRefreshResult; /** * Interface declaring unsolicited radio indications for SIM APIs. + * @hide */ @VintfStability oneway interface IRadioSimIndication { diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl index 90f172f802..48253d4e43 100644 --- a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl +++ b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl @@ -27,6 +27,7 @@ import android.hardware.radio.sim.SimLockMultiSimPolicy; /** * Interface declaring response functions to solicited radio requests for SIM APIs. + * @hide */ @VintfStability oneway interface IRadioSimResponse { diff --git a/radio/aidl/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/android/hardware/radio/sim/IccIo.aidl index f173c8e6c7..0877b7a4e0 100644 --- a/radio/aidl/android/hardware/radio/sim/IccIo.aidl +++ b/radio/aidl/android/hardware/radio/sim/IccIo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable IccIo { diff --git a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl index efcbbda039..ac89698ba9 100644 --- a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl +++ b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable IccIoResult { diff --git a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl index ba1dda5c59..b31b081ae5 100644 --- a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl +++ b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; /** * Carrier specific Information sent by the carrier, which will be used to encrypt IMSI and IMPI. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl index b1385a4d88..f9414a80e7 100644 --- a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl +++ b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.sim; /** * Enum representing the status of the received PB indication. + * @hide */ @VintfStability @Backing(type="byte") diff --git a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl index f85c84bb64..4da86c51ba 100644 --- a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl +++ b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.sim; /** * Additional personalization categories in addition to those specified in 3GPP TS 22.022 and * 3GPP2 C.S0068-0. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl index 97c3dba2ff..2212fda966 100644 --- a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl +++ b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable PhonebookCapacity { diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl index c4db0e6608..1653c31877 100644 --- a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl +++ b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.sim; /** * Phonebook-record-information specified by EF_ADN (Abbreviated dialing numbers) record of SIM * as per 3GPP spec 31.102 v15 Section-4.4.2.3. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/PinState.aidl b/radio/aidl/android/hardware/radio/sim/PinState.aidl index 85048bbb77..f5f3108056 100644 --- a/radio/aidl/android/hardware/radio/sim/PinState.aidl +++ b/radio/aidl/android/hardware/radio/sim/PinState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl index 553404bdf4..70a219191a 100644 --- a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl +++ b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SelectUiccSub { diff --git a/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl index 9e3e8ed04d..585118a89c 100644 --- a/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl +++ b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SessionInfo { diff --git a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl index 9799f2bc7a..d0e3c39608 100644 --- a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SimApdu { diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 6490d5118d..18f97f798f 100644 --- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl index 69aff668c2..943f1d2bc7 100644 --- a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.sim; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SimRefreshResult { diff --git a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl index dc4717297a..334ae3da8a 100644 --- a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl +++ b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; /** * Audio codec which is used on GSM, UMTS, and CDMA. These values must be opaque to the Android * framework. Only for display. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/voice/Call.aidl b/radio/aidl/android/hardware/radio/voice/Call.aidl index b09d7a015d..ee0b025bb3 100644 --- a/radio/aidl/android/hardware/radio/voice/Call.aidl +++ b/radio/aidl/android/hardware/radio/voice/Call.aidl @@ -19,6 +19,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.AudioQuality; import android.hardware.radio.voice.UusInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable Call { diff --git a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl index c4143b9f9f..9b4ecd9a8e 100644 --- a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * See also com.android.internal.telephony.gsm.CallForwardInfo + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl index 4d447d7675..d97b3193d3 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CdmaSignalInfoRecord; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaCallWaiting { diff --git a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl index 522f7ae643..7e5a68d729 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl @@ -22,6 +22,7 @@ package android.hardware.radio.voice; * the form: display_tag, display_len, and display_len occurrences of the char field if the * display_tag is not 10000000 or 10000001. To save space, the records are stored consecutively in * a byte buffer. The display_tag, display_len and chari fields are all 1 byte. + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl index 1a4f1b37e0..f5c656b526 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl @@ -24,10 +24,11 @@ import android.hardware.radio.voice.CdmaSignalInfoRecord; import android.hardware.radio.voice.CdmaT53AudioControlInfoRecord; import android.hardware.radio.voice.CdmaT53ClirInfoRecord; -@VintfStability /** * Max length of CdmaInformationRecords[] is CDMA_MAX_NUMBER_OF_INFO_RECS + * @hide */ +@VintfStability @JavaDerive(toString=true) parcelable CdmaInformationRecord { const int CDMA_MAX_NUMBER_OF_INFO_RECS = 10; diff --git a/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl index 8bfc5f77dc..15c22a08b2 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * Line Control Information Record as defined in C.S0005 section 3.7.5.15 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl index 9084b257d5..b04e273711 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl @@ -20,6 +20,7 @@ package android.hardware.radio.voice; * Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2 * Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3 * Connected Number Info Rec as defined in C.S0005 section 3.7.5.4 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl index 81fb003b7e..b6444abab2 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl index 5c9e2f22d9..691712e321 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CdmaNumberInfoRecord; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CdmaRedirectingNumberInfoRecord { diff --git a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl index 3334475d4f..4302ba48a2 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl index 9795cf01ec..44ac2b4320 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * T53 Audio Control Information Record + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl index 5ccd251bd5..564d7614b4 100644 --- a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl +++ b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * T53 CLIR Information Record + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/CfData.aidl b/radio/aidl/android/hardware/radio/voice/CfData.aidl index 8f4c22711a..84304f4a8c 100644 --- a/radio/aidl/android/hardware/radio/voice/CfData.aidl +++ b/radio/aidl/android/hardware/radio/voice/CfData.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.CallForwardInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable CfData { diff --git a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl index 4021471734..0a2ea2cd5d 100644 --- a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl +++ b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/Dial.aidl b/radio/aidl/android/hardware/radio/voice/Dial.aidl index ca028ad949..a874181fac 100644 --- a/radio/aidl/android/hardware/radio/voice/Dial.aidl +++ b/radio/aidl/android/hardware/radio/voice/Dial.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.UusInfo; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable Dial { diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl index d623346256..9f8993d311 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * Indicates how the implementation should handle the emergency call if it is required by Android. + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl index e380ce8874..30f29a92ea 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl @@ -37,6 +37,7 @@ package android.hardware.radio.voice; * 3gpp 23.167, Section 6 - Functional description; * 3gpp 24.503, Section 5.1.6.8.1 - General; * RFC 5031 + * @hide */ @VintfStability @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl index a4ac7aa2f5..80f873acbd 100644 --- a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl +++ b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl @@ -31,6 +31,7 @@ package android.hardware.radio.voice; * services are associated with this emergency number. * * Reference: 3gpp 22.101, Section 10 - Emergency Calls + * @hide */ @VintfStability @Backing(type="int") diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl index c05d2378af..bf9b9cba1b 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl @@ -30,6 +30,7 @@ import android.hardware.radio.voice.TtyMode; * duration of a method call. If clients provide colliding serials (including passing the same * serial to different methods), multiple responses (one for each method call) must still be served. * setResponseFunctions must work with IRadioVoiceResponse and IRadioVoiceIndication. + * @hide */ @VintfStability oneway interface IRadioVoice { diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl index 437fef6c59..9de6364546 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl @@ -28,6 +28,7 @@ import android.hardware.radio.voice.UssdModeType; /** * Interface declaring unsolicited radio indications for voice APIs. + * @hide */ @VintfStability oneway interface IRadioVoiceIndication { diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl index 39e3aced92..21264dffd2 100644 --- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl +++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl @@ -25,6 +25,7 @@ import android.hardware.radio.voice.TtyMode; /** * Interface declaring response functions to solicited radio requests for voice APIs. + * @hide */ @VintfStability oneway interface IRadioVoiceResponse { diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl index 5c8c81929c..9a381976d5 100644 --- a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl index 078722af60..4ed17d2ae9 100644 --- a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; import android.hardware.radio.voice.LastCallFailCause; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable LastCallFailCauseInfo { diff --git a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl index 08eb877ef7..923518dc15 100644 --- a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl +++ b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl index b944bf4f84..c965a7dd6d 100644 --- a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl +++ b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable SsInfoData { diff --git a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl index 798227575e..9fe402427c 100644 --- a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl +++ b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl @@ -20,6 +20,7 @@ import android.hardware.radio.RadioError; import android.hardware.radio.voice.CfData; import android.hardware.radio.voice.SsInfoData; +/** @hide */ @VintfStability @JavaDerive(toString=true) parcelable StkCcUnsolSsResult { diff --git a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl index e8dd7236aa..b9203e1e5f 100644 --- a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl +++ b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl index cece4bd3ed..d43462efd9 100644 --- a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl +++ b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl @@ -16,6 +16,7 @@ package android.hardware.radio.voice; +/** @hide */ @VintfStability @Backing(type="int") @JavaDerive(toString=true) diff --git a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl index 220a8fc7e6..5d499ca2d6 100644 --- a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl +++ b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl @@ -18,6 +18,7 @@ package android.hardware.radio.voice; /** * User-to-User Signaling Information defined in 3GPP 23.087 v8.0 + * @hide */ @VintfStability @JavaDerive(toString=true) -- GitLab From fc01bfdd2867bbcf82de8f930004928a01020e1a Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Tue, 16 May 2023 11:10:00 +0800 Subject: [PATCH 025/376] Replace the function 'OnRcpReset()' with 'HardwareReset()' The lastest OpenThread source code has removed the function 'OnRcpReset()' and added the function 'HardwareReset()'. This CL replaces the function 'OnRcpReset()' with 'HardwareReset()'. Bug: b/281629567 Change-Id: I9e77970903656e7c7b66078fb5a380f6630d639b --- staging/threadnetwork/aidl/default/thread_chip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/threadnetwork/aidl/default/thread_chip.cpp b/staging/threadnetwork/aidl/default/thread_chip.cpp index 38abad4ab5..9bd729d57e 100644 --- a/staging/threadnetwork/aidl/default/thread_chip.cpp +++ b/staging/threadnetwork/aidl/default/thread_chip.cpp @@ -170,7 +170,7 @@ ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_fr } ndk::ScopedAStatus ThreadChip::reset() { - mInterface.OnRcpReset(); + mInterface.HardwareReset(); ALOGI("reset()"); return ndk::ScopedAStatus::ok(); } -- GitLab From 2371bc8191fa18e5dc6807f1d7c64c4c87ba81c2 Mon Sep 17 00:00:00 2001 From: Paul Colta Date: Mon, 15 May 2023 10:18:18 +0200 Subject: [PATCH 026/376] HDMICEC: Out of Bounds Write in sendMessage in HdmiCec.cpp Bug: 278243594 Test: m && m android.hardware.tv.cec@1.0 && m android.hardware.tv.cec@1.0-service && atest VtsHalTvCecV1_0TargetTest Change-Id: I2989f66f41172b345e3047218e138358c18b8644 --- tv/cec/1.0/default/HdmiCec.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/cec/1.0/default/HdmiCec.cpp b/tv/cec/1.0/default/HdmiCec.cpp index 74de785e81..f05f610d4c 100644 --- a/tv/cec/1.0/default/HdmiCec.cpp +++ b/tv/cec/1.0/default/HdmiCec.cpp @@ -307,6 +307,9 @@ Return HdmiCec::getPhysicalAddress(getPhysicalAddress_cb _hidl_cb) { } Return HdmiCec::sendMessage(const CecMessage& message) { + if (message.body.size() > CEC_MESSAGE_BODY_MAX_LENGTH) { + return SendMessageResult::FAIL; + } cec_message_t legacyMessage { .initiator = static_cast(message.initiator), .destination = static_cast(message.destination), -- GitLab From acb8fb6242767a3eea25605720881b0070753512 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Tue, 2 May 2023 22:03:00 +0000 Subject: [PATCH 027/376] Add fuzzer for AIDL broadcast radio Refactored Android.bp file and added fuzzer for default AIDL broadcast radio HAL. Bug: 246857025 Test: SANITIZE_TARGET=address make android.hardware.broadcastradio-service.default_fuzzer cd ${ANDROID_PRODUCT_OUT} adb root && adb sync data adb shell /data/fuzz/x86_64/android.hardware.broadcastradio-service.default_fuzzer/vendor/android.hardware.broadcastradio-service.default_fuzzer --test_env=ENABLE_BLAZE_TEST_FUZZING=1 --test_arg=--minloglevel=0 Change-Id: I443fe6fccccb51626e6a58819f3f28ce11b0bff8 --- broadcastradio/aidl/default/Android.bp | 68 +++++++++++++++++++++----- broadcastradio/aidl/default/fuzzer.cpp | 39 +++++++++++++++ 2 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 broadcastradio/aidl/default/fuzzer.cpp diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp index 720aa8a6fd..1d1bef71cb 100644 --- a/broadcastradio/aidl/default/Android.bp +++ b/broadcastradio/aidl/default/Android.bp @@ -23,32 +23,74 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } +cc_defaults { + name: "BroadcastRadioHalDefaults", + static_libs: [ + "android.hardware.broadcastradio@common-utils-aidl-lib", + "android.hardware.broadcastradio@common-utils-lib", + ], + shared_libs: [ + "android.hardware.broadcastradio-V1-ndk", + "libbase", + "libbinder_ndk", + "liblog", + "libcutils", + ], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + ], +} + cc_binary { name: "android.hardware.broadcastradio-service.default", relative_install_path: "hw", init_rc: ["broadcastradio-default.rc"], vintf_fragments: ["broadcastradio-default.xml"], vendor: true, - cflags: [ - "-Wall", - "-Wextra", - "-Werror", + defaults: [ + "BroadcastRadioHalDefaults", ], srcs: [ - "BroadcastRadio.cpp", "main.cpp", + ], + static_libs: [ + "DefaultBroadcastRadioHal", + ], +} + +cc_library { + name: "DefaultBroadcastRadioHal", + vendor: true, + export_include_dirs: ["."], + defaults: [ + "BroadcastRadioHalDefaults", + ], + srcs: [ + "BroadcastRadio.cpp", "VirtualProgram.cpp", "VirtualRadio.cpp", ], - static_libs: [ - "android.hardware.broadcastradio@common-utils-aidl-lib", - "android.hardware.broadcastradio@common-utils-lib", +} + +cc_fuzz { + name: "android.hardware.broadcastradio-service.default_fuzzer", + vendor: true, + defaults: [ + "BroadcastRadioHalDefaults", + "service_fuzzer_defaults", ], - shared_libs: [ + static_libs: [ + "DefaultBroadcastRadioHal", "android.hardware.broadcastradio-V1-ndk", - "libbase", - "libbinder_ndk", - "liblog", - "libcutils", ], + srcs: [ + "fuzzer.cpp", + ], + fuzz_config: { + cc: [ + "xuweilin@google.com", + ], + }, } diff --git a/broadcastradio/aidl/default/fuzzer.cpp b/broadcastradio/aidl/default/fuzzer.cpp new file mode 100644 index 0000000000..d5354329d2 --- /dev/null +++ b/broadcastradio/aidl/default/fuzzer.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include "BroadcastRadio.h" +#include "VirtualRadio.h" + +using ::aidl::android::hardware::broadcastradio::BroadcastRadio; +using ::aidl::android::hardware::broadcastradio::VirtualRadio; +using ::android::fuzzService; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + const VirtualRadio& amFmRadioMock = VirtualRadio::getAmFmRadio(); + std::shared_ptr amFmRadio = + ::ndk::SharedRefBase::make(amFmRadioMock); + const VirtualRadio& dabRadioMock = VirtualRadio::getDabRadio(); + std::shared_ptr dabRadio = + ::ndk::SharedRefBase::make(dabRadioMock); + + std::vector binder_services = {amFmRadio->asBinder(), dabRadio->asBinder()}; + + fuzzService(binder_services, FuzzedDataProvider(data, size)); + + return 0; +} -- GitLab From c9b499fd730109076d0c408c4cc4eb8e3cda124e Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 23 May 2023 16:28:28 +0900 Subject: [PATCH 028/376] Mark fingerprint HAL as updatable-via-apex This means that the HAL instances can be served by APEX. Bug: 279674662 Test: m nothing Change-Id: I76938ffa99d3c518483c022314b3f18749e18deb --- compatibility_matrices/compatibility_matrix.9.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 2beb274d7f..aaec0b4022 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -122,7 +122,7 @@ default - + android.hardware.biometrics.fingerprint 3 -- GitLab From 7af7ad0c8770e13c3b77abe81c2ba48a2927b531 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Wed, 10 May 2023 17:05:00 +0900 Subject: [PATCH 029/376] Add virtual fingerprint HAL APEX This moves the virtual fingerprint HAL into a vendor apex: com.android.hardware.biometrics.fingerprint.virtual. Bug: 279674662 Test: follow README.md to test the virtual FP HAL Change-Id: I4664a3805b9444c87b0ac31a84ec10fb47d9580e --- .../fingerprint/aidl/default/Android.bp | 14 +++- biometrics/fingerprint/aidl/default/README.md | 6 ++ .../fingerprint/aidl/default/apex/Android.bp | 73 ++++++++++++++++++ ...e.biometrics.fingerprint.virtual.avbpubkey | Bin 0 -> 1032 bytes ...ardware.biometrics.fingerprint.virtual.pem | 52 +++++++++++++ ...ardware.biometrics.fingerprint.virtual.pk8 | Bin 0 -> 2374 bytes ...re.biometrics.fingerprint.virtual.x509.pem | 35 +++++++++ .../aidl/default/apex/file_contexts | 3 + .../aidl/default/apex/manifest.json | 4 + 9 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 biometrics/fingerprint/aidl/default/apex/Android.bp create mode 100644 biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey create mode 100644 biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem create mode 100644 biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 create mode 100644 biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.x509.pem create mode 100644 biometrics/fingerprint/aidl/default/apex/file_contexts create mode 100644 biometrics/fingerprint/aidl/default/apex/manifest.json diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp index 16302eb9af..3bb3f3a944 100644 --- a/biometrics/fingerprint/aidl/default/Android.bp +++ b/biometrics/fingerprint/aidl/default/Android.bp @@ -11,8 +11,8 @@ cc_binary { name: "android.hardware.biometrics.fingerprint-service.example", vendor: true, relative_install_path: "hw", - init_rc: ["fingerprint-example.rc"], - vintf_fragments: ["fingerprint-example.xml"], + init_rc: [":fingerprint-example.rc"], + vintf_fragments: [":fingerprint-example.xml"], local_include_dirs: ["include"], srcs: [ "FakeLockoutTracker.cpp", @@ -142,3 +142,13 @@ sysprop_library { property_owner: "Vendor", vendor: true, } + +filegroup { + name: "fingerprint-example.rc", + srcs: ["fingerprint-example.rc"], +} + +filegroup { + name: "fingerprint-example.xml", + srcs: ["fingerprint-example.xml"], +} diff --git a/biometrics/fingerprint/aidl/default/README.md b/biometrics/fingerprint/aidl/default/README.md index 49b6c9dc0d..823cd18f43 100644 --- a/biometrics/fingerprint/aidl/default/README.md +++ b/biometrics/fingerprint/aidl/default/README.md @@ -14,6 +14,12 @@ following to your device's `.mk` file to include it: PRODUCT_PACKAGES_DEBUG += android.hardware.biometrics.fingerprint-service.example ``` +or add the following to include it as an apex: + +``` +PRODUCT_PACKAGES_DEBUG += com.android.hardware.biometrics.fingerprint.virtual +``` + The virtual HAL will be ignored if a real HAL is also installed on the target device. Set the `biometric_virtual_enabled` settings and reboot the device to switch to the virtual HAL. Unset it and reboot again to switch back. diff --git a/biometrics/fingerprint/aidl/default/apex/Android.bp b/biometrics/fingerprint/aidl/default/apex/Android.bp new file mode 100644 index 0000000000..ad36ae2aad --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/Android.bp @@ -0,0 +1,73 @@ +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +apex_key { + name: "com.android.hardware.biometrics.fingerprint.virtual.key", + public_key: "com.android.hardware.biometrics.fingerprint.virtual.avbpubkey", + private_key: "com.android.hardware.biometrics.fingerprint.virtual.pem", +} + +android_app_certificate { + name: "com.android.hardware.biometrics.fingerprint.virtual.certificate", + certificate: "com.android.hardware.biometrics.fingerprint.virtual", +} + +apex { + name: "com.android.hardware.biometrics.fingerprint.virtual", + manifest: "manifest.json", + file_contexts: "file_contexts", + key: "com.android.hardware.biometrics.fingerprint.virtual.key", + certificate: ":com.android.hardware.biometrics.fingerprint.virtual.certificate", + updatable: false, + use_vndk_as_stable: true, + vendor: true, + + binaries: [ + "android.hardware.biometrics.fingerprint-service.example", + ], + prebuilts: [ + // init_rc + "fingerprint-example-apex.rc", + // vintf_fragment + "fingerprint-example-apex.xml", + ], + + overrides: [ + "android.hardware.biometrics.fingerprint-service.example", + ], +} + +genrule { + name: "gen-fingerprint-example-apex.rc", + srcs: [":fingerprint-example.rc"], + out: ["fingerprint-example-apex.rc"], + cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.fingerprint.virtual/bin/@' $(in) > $(out)", +} + +prebuilt_etc { + name: "fingerprint-example-apex.rc", + src: ":gen-fingerprint-example-apex.rc", + installable: false, +} + +prebuilt_etc { + name: "fingerprint-example-apex.xml", + src: ":fingerprint-example.xml", + sub_dir: "vintf", + installable: false, +} diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.avbpubkey new file mode 100644 index 0000000000000000000000000000000000000000..9f2334a9a2a2575d1d39a97a969a6d55010649ca GIT binary patch literal 1032 zcmV+j1o!&@01yDlu*l=^qoA?O3?^TWf;U+F&b=ystFqRxY%42YTPHKu%;B-nVm@srBUC)$pHnaq*PqhP5U{cE0fAy_yy+XN5wZXCi zpTfdR7h>y)@l5R7$H=q)qZngJ(VlnWU$5z%OnKcKH}o z4U1$%L8rV;cmRjnT>)>z4gf}?FC|vEzM^WC$m_Juk)CpsxL$9Z!o?RUIKVg+4Ix>I z7XfQ6dT&4tYuSLOv;Vekx z1p@byAjfs|e=J{H2!s7VLE!sYmN}5l*B>QZE0C@Veu8*?ZMWCv4y6Oa5Op``&N9#o zd6jNm5AXBHf7<6BH!4yc|J4#l=UZfgpic7{`wyT9I{v!m5q$K10B<*kV!VM{vNN=A=Q+Mz}7O{nl6d*;bT4T zfHtKLQA0Hqy6u=NPceNFh_#p)8yf#Z5#p;_ki+E@aDi9CnkfY}2*Iwwia;-#qm_MD z!76V~D4rxV-IKewM_S_=U7jz-%=~7E{K!_gduDz{2eSQ!hlHDqeWIJTScR=yVWrI# z0m)JE+1Z`_ps`h}C0{QTwFl9+`ja!?Ny_+yx^oIguuUXmbIMgJKoU{>V8SQgrt%RD zL)2`8bTE3wN)v+|0b-0W6=|Ap6`ys~f{IXyu0_`O($Wp)>Bep~m^XGLEtF-%A3|YO zmCaCZ-rd=(pG_gDtg;t@l$wB2KWH1p8{2Zt$mges9_2T9&c# z-x+{?ImY775W69A|2p;_UZ&z*ZpK;xWa3Q8zehnrF z7mNbv*R@Voaq)U2q`%MEDAwOUHL+XkvHHp;=kdXq#(S_|c~|82qqccSrtXZ4k30lu C-}Q$8 literal 0 HcmV?d00001 diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem new file mode 100644 index 0000000000..14eb288d39 --- /dev/null +++ b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDwo6CxzAwmX46C +N1j8zr0qf6uy1rDkG5r1s4faDNX/ThYpd69DWbVGf22yFO3KY3B+TmqKU+B0SiqY +MHQjXc+UcTa0BKtPtQNSYFLK13/1rW69QrlLtcGyAp/CwksXYuuJ8Uzs28nQ5A+z +fh6Vfsla9tUWDeWtN4oehmOwZ0ZKPBAKKocB5W+YJoIkdVnzkiOnWawk8Wn7a1N0 +jN5wFDO/99De+rTzYgKvV3Xb68H2UrIei4TW4wEpMZuDRUfbPlrSkJpdf+hYKKLb +AkotUrwA1znYR3U9t0GIHwZ5sp+OQTCkTfJMg2c+Bpmkp3TAL24LdvkYVA2LZERB +p7xNeACH210Bb8QOAEaiLyVWuL6iapXI67TOkZ5yk7heb5zCxRcpOMA4FQ0hWYoX +AWstem9ADWvZgKe0BFGx7lhp5YmdBCzdNv0za3Va9EATJ0wgy4qMpZu3yjDPE9bq +gdb3BQL3kiDHdfR/LF9bCIP9QEHg+1mWOZDO1x8lXCuQrgp+gnh9bbfX5g6lA8IQ +dTfozjLQC3mVbl0P7/PIf9rnHjcqUh3/1RJH51tkgqBO8xn7D6AIOv665hI+O319 +PU4j26vLSfEu624IjEDK/gcgacuoYl3H3LMI5a2JIWFLOtpKRo9P2qFF702o8B97 +5slGDYnxpAAnEQQADuRYgDalDlFDNQIDAQABAoICABe7k4wleydHslbeXYzlWNu5 +prXnHaAJpvFHiQT00iAxU9c4IhVq4gl3ZNq03LTitMQIONK2rgLaE7RZxwJ77I6P +0dzUPw8H47F6pX+y3EBfH/ZTf9HbNaS4RIhhQCWo0GEU5sjPbmqHK5NAw4Rr8jDh ++icILNg2C42yJF/P96s3nD9cbV8/ARAI8DnnRv1SMuj825DzLEgrEBqFECUOoQH0 +T2nGYRVF28zuO8X6TPFdu4puqSXGUqV86oD6UrlpP2zX7Rl+lWwoadNeuPEaYUdV +8rMFbScujSx/HtTezISroj/6HgT0yrhfz0RhbY7MvrYrwCppk8JlG6Q8BkK/rJGI +lGw7nKIp43Tl8T2Rzw0I1dPwxCLMJuVErUclznN7lq25akG5XRwBAUQQE6nHO3GL +jh7eFW7rEcpUBEKYTK1ZA8QrWGUW3WittDqZ6VQU/ZudVoTcgbW3YpUYq5z76O4u +B6tqlmNtQfIi3LBh8CD19SIjV6KKVa0s++ArQEu/DWzmHWh/STZZk4b1DSdFYqm0 +zgylOVUfpcG10OxPOdvMEsA0VoXxxwl6Hx3DSEX6VxOQvBSkwhu+gw8u2keOsIYZ +Ha2OxtG5FiEQqSa8YNN/0NDdOp1eEyqvdvT7o51cqHHPvlyhk7XL0AguErCtGggn +TZ3rsUChlauG9GbJ4nOBAoIBAQD+ceJpOkMuw04dhIY5of3CcTTKGWdt2/9SP9PU +ZORC6ywBhRORQBhyVZIERmxfJUGsmePHeIEQ5L8IniUDRTCKrL+J2bR8NdYZfvCJ +9cYD2gjXmikFabKn6mkQz7JXjSr3Vamx2ueKuYqfo72aHVvhFv6Hi/ulbUPPZ15c +gVo0iU5GRt/1XNyTksSiSKRyxXJYWqg5GD2JQ92Zbo5a5LhulC7wFF39jyfTe7K2 +mfrCI7dr+A0WtiTpbRH9EIU8CseIBgIEDTgMAxbBdUZpF8pecIAy0MLFefLA+8CK +RN+8AI+HRHybjvuonOAfeEtQyyknzycxh20dyrd3FvBj40NBAoIBAQDyHCRuNwXA +twETiysx1XStaoODLQkPxSqdFIBD+tfVR+E/3blVXkdrFfrTcr8NGdcgsJgQgYWr +h9OENizcHg75gX6wdo3qYGQdZZxws/dQbNylObFYNkyFQrD1vkQzjZl5O4DaRJC7 +6YbJrrXZ44dgZoMo/M8nyNU5yaLvoOf4GV4bSiEfsx/MxWK7x6rCcpw9jpm+yQlB +9NblSgWzfg0hmcRBn6haC3q45walBYGTVJfzTOMgn5bUmMxKqKlCXvp20BPLdclQ +5Y14OqkqhnFeHpBSJ7iVI9BBy2nAsyk37NvYVg7mN8fGiWbCqurIrbPRGSCdohGr +wY7zOVd1hmb1AoIBAGPhVJ0177VlmT5hDUeGXVR8l9pVipJHb7xbrc2MJUZXhpi6 +Imo8HNyU1pKzCkt3Foaoig99MDzvbkX1vlXATUPCeBWmzgCMKZUsjUO6pJZSenIX +485qJWVg0Ql2Xm2bzqf0in50jbuZBd+QqRbcO3rqSdPvkULo11uNGi95320MERvp +KnTolPWhAWsq1NLwyuf//lUbPNyrNUvLaDop2nQd2ycG97ZXAa00u3yOiS64UoIh +hxHJQkgXNp5+Y66kFJtCsHvirIOams4qOQ979UaJJunLpQlby30R1gzw6FqmZbEV +o0x1HjicDCaOVBJNDcTAvoPkw2KUdtxattafGYECggEBAPICm4/oREHdLKBCjszj +mBv4yrkG/XXcGrql0YkiZzj0/v3+PtJMyYsLj4xpuPv5hodQvtBRCDLsNMyF8tWc +3k8d2GvANh/AdpLEDVrDKkYka3Jldxa8QEU84vLiW/5EXtNGXYjQ3PRZfLiBgZnp +zFraXeVMwC3+nNWE7vAloXrosJ8KvI2ZWgIwlH8sGU8BjZgiwSBqiGx7t4u/MG+5 +Yprhv8HxPDG2I9hMZuHx3RJOjw1PIAJuRDEDA8LlUTvdAPRfDkpk1PWeYIl76blu +Zkg0uQLGXcYG5JfAI1fSPzN9+kwHyiDqRTH6CtQwUTyEFajAO1AWvx82/hO2j+wU +izkCggEANyPfsBjEUIZjwBuaHajm/tkcQAo3F4EgIkb1XR/EnfaaJp4I9S6hJ0vv +5/fQtASn+JHjuIRk5l7g9N7lU+W+SiPvSxm1zZv8zLkqJpbKpMh7VIxT9joZ3E3/ +rzRLL60zYJ42hdulSFLoO1qCMErifBiTIwIZu7p6qKRH4+vqappb9QTPPlyAFFT6 +3UJfs49HGqd6gTyN7TSNxaya+ZBaLgSXhmExY/OtZazQn/iJl/dYpyYvmJdzNpd+ +XELU0IUcKivJaueCqK8NfEqfHz28GHdAkwHd0CzGnciF4tn9K2Sg8+X9jISk/Usx +qHAY4JU3ldxQzDUZCz5VCz372pgXkQ== +-----END PRIVATE KEY----- diff --git a/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 b/biometrics/fingerprint/aidl/default/apex/com.android.hardware.biometrics.fingerprint.virtual.pk8 new file mode 100644 index 0000000000000000000000000000000000000000..ab5982030e466f2b32c7553b489407da3224eec3 GIT binary patch literal 2374 zcmV-M3Ay$#f(b$b0RS)!1_>&LNQUwEHHuzC;|Zh0)heo0K%6Az%bY= zI`E|ow~_GJwQ!OF1B(ipUO~NAM1d>ZzpL(v3XE*`?hUXrz!NdS`9bNZoubpVR@H@l z7wwhza)QhKA5t~QT5G&NNU?A0e8N%LGi=yh2faK()Mxf(VlXk0Qi+T?tO(CC&Xi>O z4azFaC1VWo28OMw=_|JI8Z@a<7@4DaD@3DeII08?Qm=Y63(~iDdOpg{bXM2KrTWyA z^>sfAgBWD`gn*GvzYpjo%5~MLSubIVWyYU|2!>R%@XjT{@^9vA zG_p^BZ0qA7=m%A)^4Y-x@08 zVicO4$1SNe4N0r5MnjyC08jFSXBdA!0^R}1l&t`pQX#pN-{+3zc`h=1f!83vL_<9y z2(vb(t^K9@8CoNLB3&-=9sSNNHsG?|i|n{o=BbOY9a3j77#M{ZofVmCtlAWS7PoH_ z(OTt^_S=GF}*#GBA>@O7(yMJ2SMwlwB_3!{nD+5TdahRYT66w(})E_2}#3@ z+X%^$HE_GpQ3Fzef!?iGaZIe;sP0IfD&=&>yN zI%c3i5L0kNgF|xThq&O{XrJ1dJWvI6X*G2co)z+XI&iX)>jDD-009Dm0suGWfW2&r zy(o%zFUJsq+YXG6H33?YDm90gM#$u4`zwp^PmL6`D(7;^=MTSsb@19WUmt)F{zu{{H>d{Ia%`cHzA$3m{ zCzur7XQJ1|0PqJXR}{3>3U1IfSp_v{Y%01ZxY#a;^Q4Frg?Hg=y{o8CocuH+ye?3$gs9Z4(P99L2kCq)mE_UqLqX1?d%}YmcNFBG%TI( z*!M`G>6sJ;c^YSljOt2v3LqlhBg7(FRwjjAXh%&vyL#wOWa$dx5$OBOPq@}L4+Z7n zss$$Ak2vNjof4-rLWMX8JhII0}s-%$)49J|xcY#8UB2q}jH)Dmz9_#MALM?J)v^0RaHjThuSDoX)9_ z#S^!OYN*WSyi+?BzE0F63cx!bBr=lvBKFreQ*vkq`bkE zm7D#z5})qJb(>vO1oN*Yy~(Rz!SQMMeSbw>-eXb8^Z|MDm6(=u!yu4#vdILr0^=}6 zu4$edD%Kk_Y9kq6$k1)SjoUZLW-|}z>P=c%=i)y1n<@=Gwoo}C11y27=ZQJi%}KK+ z?%94b9EdVn)M`}APB!ki?e#I!-;#2x?4y*W4EHQ<2j(@0Iy>2#w41W>YCD8asS>!3 zJ?Ibk7OQYtbzcc7k-*>EL){d^`iBh{X!-FEPEQtMZe!=uN<7m7f&l>l>3Zt|+Z#qC zr*>hBeU!#B=3PvXXu}F1UjF8zG|;E3*i*bcn~!7?_9Nz&UPM0Z8`W+Ywm)I#WvS0hw>8=V>6MZ+tADVE!-53eM&BZnt>hj{+rZ_D*A8Lh zDl1357A3s=^cT%}cPx7N>$|TJ9ZbEqr^mLG{<1(@i)BQtNZUOO)goan1*nO%9P{`; z&u#|?xdQQOiXYYo-dARQkgn(tB{**J9dZ+GKS2LR2ptaR!GO3Z;5V#9>2g7oil?!- z+D8QG{*UE;4L-MI3nmGRe?ketM%q7V<~qu^gyw*)$IXU;hLFdJ0)hbmU<3?MOpF!4 z-tTO=8XDNtLv6;zjB{;0)kI67@PMeZ@KLO-363>m%BCNuL7`SfOG~Z^KOCSj^L~kE zfZnVvnF-*je_x=)c1$QS`2`r=qoGdtMwp9^_iK|px@xh*WOWD+B^P<`DA@!~dSqj$C=x2Gf1HY!=`DDw`C6gA7NM7*0(ZqMTNj(`3yPsVq-vf!*ww(kqqz*? zud%Cj453+dcf`T@Sm@yOyNPn&vYwfAJA|q9`St|D9NsrBeWj{PdO)uf@7(y^$xo;n zAORu|6|r^$fZ_8S*LFQyKzyL!cy*-{GA7R4IqV+MPY9^9DmCqU0)hbmdqdIRXdX5q z6X%2oNc_sj1gI@b@PkNAUfJZDHNX=^zNj{_ulGDQW{mx)Rg7Xw^+oZj=Jm!7iO`)? z0)%jyu`mb+jR;wP`9yV}qp^92+ZTy*xNHIgl2C@5 zxnb2#RDVU~4DBKj*&N%r|)UC|H$N>o2sxaoH?uqcBRo-$m%tvS**}3Jv zZH>Xx{hF^6ZVWlFCT4as@X;qkrjYhXcZo1K4jo^B%Yr$IG%DVceV!m$L58mP9LOvN zxmVWqaMF`ed21wtd9%jZ4&map&U64A-+)O=cg@y0hcx2AH?yqGa_mG Date: Thu, 25 May 2023 22:07:04 +0000 Subject: [PATCH 030/376] [VTS 2.3] Add length check before reading blob Adding a length check prevents the read() from reading outside the bounds and prevents OOB crash. Test: atest VtsHalGraphicsComposerV2_3TargetTest && atest VtsHalGraphicsComposerV2_4TargetTest BUG: 252764300 Change-Id: I6231e340a925127f9c32ccb76768286f7292df58 --- .../utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h index f1d61f84c2..42996dd4b6 100644 --- a/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h +++ b/graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerCommandEngine.h @@ -82,7 +82,7 @@ class ComposerCommandEngine : public V2_2::hal::ComposerCommandEngine { std::vector metadata; - for (size_t i = 0; i < numBlobs; i++) { + for (size_t i = 0; i < numBlobs && length >= 2; i++) { IComposerClient::PerFrameMetadataKey key = static_cast(readSigned()); uint32_t blobSize = read(); -- GitLab From 6357434a65deeee000ede699398cdfeb58535a15 Mon Sep 17 00:00:00 2001 From: Yixiao Luo Date: Fri, 26 May 2023 15:24:03 -0700 Subject: [PATCH 031/376] Add native handle validation to TV Input HAL AIDL VTS Bug: 282862884 Test: VtsHalTvInputTargetTest Change-Id: I803b54e5b52a00ab845ef7ba4d5cec5bb8bd89ca --- .../vts/functional/VtsHalTvInputTargetTest.cpp | 16 ++++++++++++++++ .../vts/functional/VtsHalTvInputTargetTest.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp index 6433305ba3..8d3395b8d2 100644 --- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp @@ -134,6 +134,19 @@ int32_t TvInputAidlTest::getNumNotIn(vector& nums) { return result; } +bool TvInputAidlTest::isValidHandle(NativeHandle& handle) { + if (handle.fds.empty()) { + return false; + } + for (size_t i = 0; i < handle.fds.size(); i++) { + int fd = handle.fds[i].get(); + if (fcntl(fd, F_GETFL) < 0) { + return false; + } + } + return true; +} + /* * GetStreamConfigTest: * Calls updateStreamConfigurations() for each existing device @@ -168,6 +181,8 @@ TEST_P(TvInputAidlTest, OpenAndCloseStreamTest) { ALOGD("OpenAndCloseStreamTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); + ASSERT_TRUE(isValidHandle(handle)); + ALOGD("OpenAndCloseStreamTest: close stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->closeStream(device_id, stream_id).isOk()); @@ -268,6 +283,7 @@ TEST_P(TvInputAidlTest, OpenAnOpenedStreamsTest) { ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk()); + ASSERT_TRUE(isValidHandle(handle)); ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id); ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).getServiceSpecificError() == diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h index 832b27ce44..7e66a88a32 100644 --- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include @@ -84,6 +85,9 @@ class TvInputAidlTest : public testing::TestWithParam { */ int32_t getNumNotIn(vector& nums); + /* Checks if a native handle contains valid file descriptor(s). */ + bool isValidHandle(NativeHandle& handle); + protected: shared_ptr tv_input_; shared_ptr tv_input_callback_; -- GitLab From c7a880719e825288142452422d80fccd315b3807 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 26 May 2023 23:40:02 +0000 Subject: [PATCH 032/376] [HIDL composer] Verify key & value sizes are within the data size range Sizes when invalid can cause OOB reads and causes the crash Test: atest VtsHalGraphicsComposerV2_1TargetTest && atest VtsHalGraphicsComposerV2_2TargetTest && atest VtsHalGraphicsComposerV2_3TargetTest && atest VtsHalGraphicsComposerV2_4TargetTest go/wm-smoke test BUG: 252995613 Change-Id: I77e472851236eba2b8418034144c9cc8237c7143 --- .../composer-command-buffer/2.1/ComposerCommandBuffer.h | 6 +++++- .../hal/include/composer-hal/2.4/ComposerCommandEngine.h | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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 499d3b96e3..336d15dc6c 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 @@ -679,6 +679,10 @@ class CommandReaderBase { uint32_t read() { return mData[mDataRead++]; } + bool isReadSizeValid(uint32_t size) const { + return mDataRead * sizeof(uint32_t) + size <= mDataSize; + } + int32_t readSigned() { int32_t val; memcpy(&val, &mData[mDataRead++], sizeof(val)); @@ -760,7 +764,7 @@ class CommandReaderBase { std::unique_ptr mData; uint32_t mDataRead; - private: + private: std::unique_ptr mQueue; uint32_t mDataMaxSize; diff --git a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h index 697d6b8a6b..3b5ce5a70b 100644 --- a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h +++ b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h @@ -90,6 +90,9 @@ class ComposerCommandEngine : public V2_3::hal::ComposerCommandEngine { } const uint32_t keySize = read(); + if (!isReadSizeValid(keySize)) { + return false; + } std::string key; key.resize(keySize); readBlob(keySize, key.data()); @@ -97,6 +100,9 @@ class ComposerCommandEngine : public V2_3::hal::ComposerCommandEngine { const bool mandatory = read(); const uint32_t valueSize = read(); + if (!isReadSizeValid(valueSize)) { + return false; + } std::vector value(valueSize); readBlob(valueSize, value.data()); -- GitLab From 41dd7f18fc42efe8e5b1f6cb2db47f1e2d90632c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 7 Jun 2023 13:25:43 -0700 Subject: [PATCH 033/376] Add generate_vehicle_property_enums repo hook. This repo hook will check whether the generated enum definition files require update if VehicleProperty.aidl is updated and prompt user to run generate_annotation_enums.py if requires update. The repo hook will do nothing if the preupload files does not contain VehicleProperty.aidl file. Test: Manual test Bug: 286286188 Change-Id: Iea1fdb26d8a76c5aff346ca5cb38ed145fe957d7 --- PREUPLOAD.cfg | 1 + .../tools/generate_annotation_enums.py | 159 +++++++++++++----- 2 files changed, 114 insertions(+), 46 deletions(-) mode change 100644 => 100755 automotive/vehicle/tools/generate_annotation_enums.py diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index 2116e21c5a..de7aa354bd 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -10,3 +10,4 @@ aidl_format = true aosp_hook_confirmationui = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} confirmationui aosp_hook_gatekeeper = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} gatekeeper aosp_hook_keymaster = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} keymaster +generate_vehicle_property_enums = ${REPO_ROOT}/hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py --android_build_top ${REPO_ROOT} --preupload_files ${PREUPLOAD_FILES} --check_only diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py old mode 100644 new mode 100755 index c36cbb015e..06e9745fa6 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -23,29 +23,33 @@ Usage: $ python generate_annotation_enums.py """ +import argparse +import filecmp import os import re import sys - -PROP_AIDL_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/" + - "automotive/vehicle/VehicleProperty.aidl") -CHANGE_MODE_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" + - "ChangeModeForVehicleProperty.h") -ACCESS_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" + - "AccessForVehicleProperty.h") -CHANGE_MODE_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" + - "ChangeModeForVehicleProperty.java") -ACCESS_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" + - "AccessForVehicleProperty.java") - -TAB = " " -RE_ENUM_START = re.compile("\s*enum VehicleProperty \{") -RE_ENUM_END = re.compile("\s*\}\;") -RE_COMMENT_BEGIN = re.compile("\s*\/\*\*?") -RE_COMMENT_END = re.compile("\s*\*\/") -RE_CHANGE_MODE = re.compile("\s*\* @change_mode (\S+)\s*") -RE_ACCESS = re.compile("\s*\* @access (\S+)\s*") -RE_VALUE = re.compile("\s*(\w+)\s*=(.*)") +import tempfile + +PROP_AIDL_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/' + + 'automotive/vehicle/VehicleProperty.aidl') +CHANGE_MODE_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' + + 'ChangeModeForVehicleProperty.h') +ACCESS_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' + + 'AccessForVehicleProperty.h') +CHANGE_MODE_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' + + 'ChangeModeForVehicleProperty.java') +ACCESS_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' + + 'AccessForVehicleProperty.java') +SCRIPT_PATH = 'hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py' + +TAB = ' ' +RE_ENUM_START = re.compile('\s*enum VehicleProperty \{') +RE_ENUM_END = re.compile('\s*\}\;') +RE_COMMENT_BEGIN = re.compile('\s*\/\*\*?') +RE_COMMENT_END = re.compile('\s*\*\/') +RE_CHANGE_MODE = re.compile('\s*\* @change_mode (\S+)\s*') +RE_ACCESS = re.compile('\s*\* @access (\S+)\s*') +RE_VALUE = re.compile('\s*(\w+)\s*=(.*)') LICENSE = """/* * Copyright (C) 2022 The Android Open Source Project @@ -195,23 +199,23 @@ class Converter: match = RE_VALUE.match(line) if match: prop_name = match.group(1) - if prop_name == "INVALID": + if prop_name == 'INVALID': continue if not annotation: - print("No @" + self.name + " annotation for property: " + prop_name) - sys.exit(1) + raise Exception( + 'No @' + self.name + ' annotation for property: ' + prop_name) if id != 0: - content += "\n" + content += '\n' if cpp: - annotation = annotation.replace(".", "::") - content += (TAB + TAB + "{VehicleProperty::" + prop_name + ", " + - annotation + "},") + annotation = annotation.replace('.', '::') + content += (TAB + TAB + '{VehicleProperty::' + prop_name + ', ' + + annotation + '},') else: - content += (TAB + TAB + "Map.entry(VehicleProperty." + prop_name + ", " + - annotation + "),") + content += (TAB + TAB + 'Map.entry(VehicleProperty.' + prop_name + ', ' + + annotation + '),') id += 1 - # Remove the additional "," at the end for the Java file. + # Remove the additional ',' at the end for the Java file. if not cpp: content = content[:-1] @@ -221,25 +225,88 @@ class Converter: f.write(content) +def createTempFile(): + f = tempfile.NamedTemporaryFile(delete=False); + f.close(); + return f.name + + def main(): - android_top = os.environ['ANDROID_BUILD_TOP'] + parser = argparse.ArgumentParser( + description='Generate Java and C++ enums based on annotations in VehicleProperty.aidl') + parser.add_argument('--android_build_top', required=False, help='Path to ANDROID_BUILD_TOP') + parser.add_argument('--preupload_files', nargs='+', required=False, help='modified files') + parser.add_argument('--check_only', required=False, action='store_true', + help='only check whether the generated files need update') + args = parser.parse_args(); + android_top = None + output_folder = None + if args.android_build_top: + android_top = args.android_build_top + vehiclePropertyUpdated = False + for preuload_file in args.preupload_files: + if preuload_file.endswith('VehicleProperty.aidl'): + vehiclePropertyUpdated = True + break + if not vehiclePropertyUpdated: + return + else: + android_top = os.environ['ANDROID_BUILD_TOP'] if not android_top: - print("ANDROID_BUILD_TOP is not in envorinmental variable, please run source and lunch " + - "at the android root") + print('ANDROID_BUILD_TOP is not in envorinmental variable, please run source and lunch ' + + 'at the android root') aidl_file = os.path.join(android_top, PROP_AIDL_FILE_PATH) - change_mode_cpp_output = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH); - access_cpp_output = os.path.join(android_top, ACCESS_CPP_FILE_PATH); - change_mode_java_output = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH); - access_java_output = os.path.join(android_top, ACCESS_JAVA_FILE_PATH); - - c = Converter("change_mode", RE_CHANGE_MODE); - c.convert(aidl_file, change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, True) - c.convert(aidl_file, change_mode_java_output, CHANGE_MODE_JAVA_HEADER, CHANGE_MODE_JAVA_FOOTER, False) - c = Converter("access", RE_ACCESS) - c.convert(aidl_file, access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True) - c.convert(aidl_file, access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False) - -if __name__ == "__main__": + change_mode_cpp_file = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH); + access_cpp_file = os.path.join(android_top, ACCESS_CPP_FILE_PATH); + change_mode_java_file = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH); + access_java_file = os.path.join(android_top, ACCESS_JAVA_FILE_PATH); + temp_files = [] + + if not args.check_only: + change_mode_cpp_output = change_mode_cpp_file + access_cpp_output = access_cpp_file + change_mode_java_output = change_mode_java_file + access_java_output = access_java_file + else: + change_mode_cpp_output = createTempFile() + temp_files.append(change_mode_cpp_output) + access_cpp_output = createTempFile() + temp_files.append(access_cpp_output) + change_mode_java_output = createTempFile() + temp_files.append(change_mode_java_output) + access_java_output = createTempFile() + temp_files.append(access_java_output) + + try: + c = Converter('change_mode', RE_CHANGE_MODE); + c.convert(aidl_file, change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, + True) + c.convert(aidl_file, change_mode_java_output, CHANGE_MODE_JAVA_HEADER, + CHANGE_MODE_JAVA_FOOTER, False) + c = Converter('access', RE_ACCESS) + c.convert(aidl_file, access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True) + c.convert(aidl_file, access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False) + + if not args.check_only: + return + + if ((not filecmp.cmp(change_mode_cpp_output, change_mode_cpp_file)) or + (not filecmp.cmp(change_mode_java_output, change_mode_java_file)) or + (not filecmp.cmp(access_cpp_output, access_cpp_file)) or + (not filecmp.cmp(access_java_output, access_java_file))): + print('The generated enum files for VehicleProperty.aidl requires update, ') + print('Run \npython ' + android_top + '/' + SCRIPT_PATH) + sys.exit(1) + except Exception as e: + print('Error parsing VehicleProperty.aidl') + print(e) + sys.exit(1) + finally: + for file in temp_files: + os.remove(file) + + +if __name__ == '__main__': main() \ No newline at end of file -- GitLab From b044d98115f19fa6d1e430fd6065a372153f8680 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Fri, 9 Jun 2023 16:09:12 +0800 Subject: [PATCH 034/376] remove the Thread Network HAL from the stage folder The Thread Network HAL is going to be added to the AOSP. The implementation of the Thread Network HAL under the staging folder is no longer needed. This commit removes the unstable Thread Network HAL. Bug: 283905423 Test: Build Change-Id: I7e4bf260c03dd0500725fec068747e3b3d05820c --- staging/threadnetwork/OWNERS | 5 - staging/threadnetwork/README.md | 12 -- staging/threadnetwork/aidl/Android.bp | 26 --- .../hardware/threadnetwork/IThreadChip.aidl | 88 -------- .../threadnetwork/IThreadChipCallback.aidl | 30 --- staging/threadnetwork/aidl/default/Android.bp | 63 ------ ...roid.hardware.threadnetwork-service.sim.rc | 3 - staging/threadnetwork/aidl/default/main.cpp | 30 --- .../threadnetwork/aidl/default/service.cpp | 90 -------- .../threadnetwork/aidl/default/service.hpp | 42 ---- .../aidl/default/thread_chip.cpp | 197 ------------------ .../aidl/default/thread_chip.hpp | 68 ------ staging/threadnetwork/aidl/default/utils.cpp | 34 --- staging/threadnetwork/aidl/vts/Android.bp | 47 ----- .../vts/VtsHalThreadNetworkTargetTest.cpp | 149 ------------- 15 files changed, 884 deletions(-) delete mode 100644 staging/threadnetwork/OWNERS delete mode 100644 staging/threadnetwork/README.md delete mode 100644 staging/threadnetwork/aidl/Android.bp delete mode 100644 staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl delete mode 100644 staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl delete mode 100644 staging/threadnetwork/aidl/default/Android.bp delete mode 100644 staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc delete mode 100644 staging/threadnetwork/aidl/default/main.cpp delete mode 100644 staging/threadnetwork/aidl/default/service.cpp delete mode 100644 staging/threadnetwork/aidl/default/service.hpp delete mode 100644 staging/threadnetwork/aidl/default/thread_chip.cpp delete mode 100644 staging/threadnetwork/aidl/default/thread_chip.hpp delete mode 100644 staging/threadnetwork/aidl/default/utils.cpp delete mode 100644 staging/threadnetwork/aidl/vts/Android.bp delete mode 100644 staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp diff --git a/staging/threadnetwork/OWNERS b/staging/threadnetwork/OWNERS deleted file mode 100644 index 037215d70f..0000000000 --- a/staging/threadnetwork/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Bug component: 1203089 - -wgtdkp@google.com -xyk@google.com -zhanglongxia@google.com diff --git a/staging/threadnetwork/README.md b/staging/threadnetwork/README.md deleted file mode 100644 index 12104e5f4d..0000000000 --- a/staging/threadnetwork/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Staging threadnetwork HAL interface - -The directory includes the unstable/unreleased version of `hardware/interfaces/threadnetwork` -code which should **NOT** be used in production. But vendors may start verifying their hardware -with the HAL interface. - -This directory will be cleaned up when the stable Thread HAL interface is added in -`hardware/interfaces/threadnetwork` by version `V` or later. - -More information about _Thread_: -- https://www.threadgroup.org -- https://openthread.io diff --git a/staging/threadnetwork/aidl/Android.bp b/staging/threadnetwork/aidl/Android.bp deleted file mode 100644 index b59d6da3f5..0000000000 --- a/staging/threadnetwork/aidl/Android.bp +++ /dev/null @@ -1,26 +0,0 @@ -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -aidl_interface { - name: "android.hardware.threadnetwork", - host_supported: true, - vendor_available: true, - - srcs: [ - "android/hardware/threadnetwork/*.aidl", - ], - - unstable: true, - - backend: { - ndk: { - enabled: true, - }, - }, -} diff --git a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl b/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl deleted file mode 100644 index 3c57149324..0000000000 --- a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.threadnetwork; - -import android.hardware.threadnetwork.IThreadChipCallback; - -/** - * Controls a Thread radio chip on the device. - */ - -interface IThreadChip { - /** - * The operation failed for the internal error. - */ - const int ERROR_FAILED = 1; - - /** - * Insufficient buffers available to send frames. - */ - const int ERROR_NO_BUFS = 2; - - /** - * Service is busy and could not service the operation. - */ - const int ERROR_BUSY = 3; - - /** - * This method initializes the Thread HAL instance. If open completes - * successfully, then the Thread HAL instance is ready to accept spinel - * messages through sendSpinelFrame() API. - * - * @param callback A IThreadChipCallback callback instance. If multiple - * callbacks are passed in, the open() will return ERROR_BUSY. - * - * @throws EX_ILLEGAL_ARGUMENT if the callback handle is invalid (for example, it is null). - * @throws ServiceSpecificException with one of the following values: - * - ERROR_FAILED The interface cannot be opened due to an internal error. - * - ERROR_BUSY This interface is in use. - */ - void open(in IThreadChipCallback callback); - - /** - * Close the Thread HAL instance. Must free all resources. - * - * @throws EX_ILLEGAL_STATE if the Thread HAL instance is not opened. - * - */ - void close(); - - /** - * This method resets the Thread HAL internal state. The callback registered by - * `open()` won’t be reset and the resource allocated by `open()` won’t be free. - * - */ - void reset(); - - /** - * This method sends a spinel frame to the Thread HAL. - * - * This method should block until the frame is sent out successfully or - * the method throws errors immediately. - * - * Spinel Protocol: - * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h - * - * @param frame The spinel frame to be sent. - * - * @throws ServiceSpecificException with one of the following values: - * - ERROR_FAILED The Thread HAL failed to send the frame for an internal reason. - * - ERROR_NO_BUFS Insufficient buffer space to send the frame. - * - ERROR_BUSY The Thread HAL is busy. - */ - void sendSpinelFrame(in byte[] frame); -} diff --git a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl b/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl deleted file mode 100644 index a0fe88cf8d..0000000000 --- a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.threadnetwork; - -interface IThreadChipCallback { - /** - * This method is called when a spinel frame is received. Thread network - * will process the received spinel frame. - * - * Spinel Protocol: - * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h - * - * @param frame The received spinel frame. - */ - oneway void onReceiveSpinelFrame(in byte[] frame); -} diff --git a/staging/threadnetwork/aidl/default/Android.bp b/staging/threadnetwork/aidl/default/Android.bp deleted file mode 100644 index 8fc22ad538..0000000000 --- a/staging/threadnetwork/aidl/default/Android.bp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -cc_defaults { - name: "threadnetwork_service_default", - vendor: true, - relative_install_path: "hw", - - shared_libs: [ - "android.hardware.threadnetwork-ndk", - "libbase", - "libbinder_ndk", - "libcutils", - "liblog", - "libutils", - ], - - static_libs: [ - "openthread-common", - "openthread-hdlc", - "openthread-platform", - "openthread-posix", - "openthread-url", - ], - - srcs: [ - "main.cpp", - "service.cpp", - "thread_chip.cpp", - "utils.cpp", - ], -} - -cc_binary { - name: "android.hardware.threadnetwork-service.sim", - defaults: ["threadnetwork_service_default"], - init_rc: ["android.hardware.threadnetwork-service.sim.rc"], -} - -cc_binary { - name: "android.hardware.threadnetwork-service", - defaults: ["threadnetwork_service_default"], -} diff --git a/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc b/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc deleted file mode 100644 index 2fb409cd93..0000000000 --- a/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc +++ /dev/null @@ -1,3 +0,0 @@ -service vendor.threadnetwork_hal /vendor/bin/hw/android.hardware.threadnetwork-service.sim spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=1 - class hal - user thread_network diff --git a/staging/threadnetwork/aidl/default/main.cpp b/staging/threadnetwork/aidl/default/main.cpp deleted file mode 100644 index b6c8bbb7ba..0000000000 --- a/staging/threadnetwork/aidl/default/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "service.hpp" - -int main(int argc, char* argv[]) { - CHECK_GT(argc, 1); - aidl::android::hardware::threadnetwork::Service service(&argv[1], argc - 1); - - ALOGI("Thread Network HAL is running"); - - service.startLoop(); - return EXIT_FAILURE; // should not reach -} diff --git a/staging/threadnetwork/aidl/default/service.cpp b/staging/threadnetwork/aidl/default/service.cpp deleted file mode 100644 index 8047214f24..0000000000 --- a/staging/threadnetwork/aidl/default/service.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "service.hpp" - -#include -#include -#include -#include - -#include "thread_chip.hpp" - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -Service::Service(char* urls[], int numUrls) : mBinderFd(-1) { - int fd; - - CHECK_NE(urls, nullptr); - CHECK_GT(numUrls, 0); - - for (int i = 0; i < numUrls; i++) { - auto threadChip = ndk::SharedRefBase::make(i, urls[i]); - CHECK_NE(threadChip, nullptr); - mThreadChips.push_back(std::move(threadChip)); - } - - binder_status_t status = ABinderProcess_setupPolling(&fd); - CHECK_EQ(status, ::STATUS_OK); - CHECK_GE(fd, 0); - mBinderFd.reset(fd); -} - -void Service::Update(otSysMainloopContext& context) { - FD_SET(mBinderFd.get(), &context.mReadFdSet); - context.mMaxFd = std::max(context.mMaxFd, mBinderFd.get()); -} - -void Service::Process(const otSysMainloopContext& context) { - if (FD_ISSET(mBinderFd.get(), &context.mReadFdSet)) { - ABinderProcess_handlePolledCommands(); - } -} - -void Service::startLoop(void) { - const struct timeval kPollTimeout = {1, 0}; - otSysMainloopContext context; - int rval; - - ot::Posix::Mainloop::Manager::Get().Add(*this); - - while (true) { - context.mMaxFd = -1; - context.mTimeout = kPollTimeout; - - FD_ZERO(&context.mReadFdSet); - FD_ZERO(&context.mWriteFdSet); - FD_ZERO(&context.mErrorFdSet); - - ot::Posix::Mainloop::Manager::Get().Update(context); - - rval = select(context.mMaxFd + 1, &context.mReadFdSet, &context.mWriteFdSet, - &context.mErrorFdSet, &context.mTimeout); - - if (rval >= 0) { - ot::Posix::Mainloop::Manager::Get().Process(context); - } else if (errno != EINTR) { - ALOGE("select() failed: %s", strerror(errno)); - break; - } - } -} -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/service.hpp b/staging/threadnetwork/aidl/default/service.hpp deleted file mode 100644 index 6e6e86845a..0000000000 --- a/staging/threadnetwork/aidl/default/service.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "mainloop.hpp" -#include "thread_chip.hpp" - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -class Service : public ot::Posix::Mainloop::Source { - public: - Service(char* urls[], int numUrls); - - void Update(otSysMainloopContext& context) override; - void Process(const otSysMainloopContext& context) override; - void startLoop(void); - - private: - ::android::base::unique_fd mBinderFd; - std::vector> mThreadChips; -}; -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/thread_chip.cpp b/staging/threadnetwork/aidl/default/thread_chip.cpp deleted file mode 100644 index 9bd729d57e..0000000000 --- a/staging/threadnetwork/aidl/default/thread_chip.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "thread_chip.hpp" - -#include -#include -#include -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -static ndk::ScopedAStatus errorStatus(int32_t error, const char* message) { - return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(error, message)); -} - -ThreadChip::ThreadChip(uint8_t id, char* url) - : mUrl(), - mInterface(handleReceivedFrame, this, mRxFrameBuffer), - mRxFrameBuffer(), - mCallback(nullptr) { - const std::string name(std::string() + IThreadChip::descriptor + "/chip" + std::to_string(id)); - binder_status_t status; - - ALOGI("ServiceName: %s, Url: %s", name.c_str(), url); - CHECK_EQ(mUrl.Init(url), 0); - status = AServiceManager_addService(asBinder().get(), name.c_str()); - CHECK_EQ(status, STATUS_OK); - - mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient( - AIBinder_DeathRecipient_new(ThreadChip::onBinderDied)); - AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), ThreadChip::onBinderUnlinked); -} - -ThreadChip::~ThreadChip() { - AIBinder_DeathRecipient_delete(mDeathRecipient.get()); -} - -void ThreadChip::onBinderDied(void* context) { - reinterpret_cast(context)->onBinderDied(); -} - -void ThreadChip::onBinderDied(void) { - ALOGW("Thread Network HAL client is dead."); -} - -void ThreadChip::onBinderUnlinked(void* context) { - reinterpret_cast(context)->onBinderUnlinked(); -} - -void ThreadChip::onBinderUnlinked(void) { - ALOGW("ThreadChip binder is unlinked."); - deinitChip(); -} - -void ThreadChip::handleReceivedFrame(void* context) { - reinterpret_cast(context)->handleReceivedFrame(); -} - -void ThreadChip::handleReceivedFrame(void) { - if (mCallback != nullptr) { - mCallback->onReceiveSpinelFrame(std::vector( - mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength())); - } - - mRxFrameBuffer.DiscardFrame(); -} - -ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& in_callback) { - ndk::ScopedAStatus status = initChip(in_callback); - - if (status.isOk()) { - AIBinder_linkToDeath(in_callback->asBinder().get(), mDeathRecipient.get(), this); - ALOGI("Open IThreadChip successfully."); - } else { - ALOGW("Open IThreadChip failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::initChip(const std::shared_ptr& in_callback) { - if (in_callback == nullptr) { - return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); - } else if (mCallback == nullptr) { - if (mInterface.Init(mUrl) != OT_ERROR_NONE) { - return errorStatus(ERROR_FAILED, "Failed to initialize the interface"); - } - - mCallback = in_callback; - ot::Posix::Mainloop::Manager::Get().Add(*this); - return ndk::ScopedAStatus::ok(); - } else { - return errorStatus(ERROR_BUSY, "Interface is already opened"); - } -} - -ndk::ScopedAStatus ThreadChip::close() { - ndk::ScopedAStatus status; - std::shared_ptr callback = mCallback; - - status = deinitChip(); - if (status.isOk()) { - if (callback != nullptr) { - AIBinder_unlinkToDeath(callback->asBinder().get(), mDeathRecipient.get(), this); - } - - ALOGI("Close IThreadChip successfully"); - } else { - ALOGW("Close IThreadChip failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::deinitChip() { - if (mCallback != nullptr) { - mInterface.Deinit(); - ot::Posix::Mainloop::Manager::Get().Remove(*this); - mCallback = nullptr; - return ndk::ScopedAStatus::ok(); - } - - return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); -} - -ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_frame) { - ndk::ScopedAStatus status; - otError error; - - if (mCallback == nullptr) { - status = errorStatus(ERROR_FAILED, "The interface is not open"); - } else { - error = mInterface.SendFrame(reinterpret_cast(in_frame.data()), - in_frame.size()); - if (error == OT_ERROR_NONE) { - status = ndk::ScopedAStatus::ok(); - } else if (error == OT_ERROR_NO_BUFS) { - status = errorStatus(ERROR_NO_BUFS, "Insufficient buffer space to send"); - } else if (error == OT_ERROR_BUSY) { - status = errorStatus(ERROR_BUSY, "The interface is busy"); - } else { - status = errorStatus(ERROR_FAILED, "Failed to send the spinel frame"); - } - } - - if (!status.isOk()) { - ALOGW("Send spinel frame failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::reset() { - mInterface.HardwareReset(); - ALOGI("reset()"); - return ndk::ScopedAStatus::ok(); -} - -void ThreadChip::Update(otSysMainloopContext& context) { - if (mCallback != nullptr) { - mInterface.UpdateFdSet(context.mReadFdSet, context.mWriteFdSet, context.mMaxFd, - context.mTimeout); - } -} - -void ThreadChip::Process(const otSysMainloopContext& context) { - struct RadioProcessContext radioContext; - - if (mCallback != nullptr) { - radioContext.mReadFdSet = &context.mReadFdSet; - radioContext.mWriteFdSet = &context.mWriteFdSet; - mInterface.Process(radioContext); - } -} -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/thread_chip.hpp b/staging/threadnetwork/aidl/default/thread_chip.hpp deleted file mode 100644 index da5cba7585..0000000000 --- a/staging/threadnetwork/aidl/default/thread_chip.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "hdlc_interface.hpp" -#include "lib/spinel/spinel_interface.hpp" -#include "mainloop.hpp" - -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { - public: - ThreadChip(uint8_t id, char* url); - ~ThreadChip(); - - ndk::ScopedAStatus open(const std::shared_ptr& in_callback) override; - ndk::ScopedAStatus close() override; - ndk::ScopedAStatus sendSpinelFrame(const std::vector& in_frame) override; - ndk::ScopedAStatus reset() override; - void Update(otSysMainloopContext& context) override; - void Process(const otSysMainloopContext& context) override; - - private: - static void onBinderDied(void* context); - void onBinderDied(void); - static void onBinderUnlinked(void* context); - void onBinderUnlinked(void); - static void handleReceivedFrame(void* context); - void handleReceivedFrame(void); - - ndk::ScopedAStatus initChip(const std::shared_ptr& in_callback); - ndk::ScopedAStatus deinitChip(); - - ot::Url::Url mUrl; - ot::Posix::HdlcInterface mInterface; - ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer; - std::shared_ptr mCallback; - ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; -}; - -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/utils.cpp b/staging/threadnetwork/aidl/default/utils.cpp deleted file mode 100644 index d3b4062ee3..0000000000 --- a/staging/threadnetwork/aidl/default/utils.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -void otLogCritPlat(const char* format, ...) { - va_list args; - - va_start(args, format); - __android_log_vprint(ANDROID_LOG_FATAL, LOG_TAG, format, args); - va_end(args); -} - -void otLogWarnPlat(const char* format, ...) { - va_list args; - - va_start(args, format); - __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args); - va_end(args); -} diff --git a/staging/threadnetwork/aidl/vts/Android.bp b/staging/threadnetwork/aidl/vts/Android.bp deleted file mode 100644 index e2609ed1b5..0000000000 --- a/staging/threadnetwork/aidl/vts/Android.bp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -cc_test { - name: "VtsHalThreadNetworkTargetTest", - defaults: [ - "VtsHalTargetTestDefaults", - "use_libaidlvintf_gtest_helper_static", - ], - srcs: [ - "VtsHalThreadNetworkTargetTest.cpp", - ], - - shared_libs: [ - "libbinder", - "libbinder_ndk", - ], - static_libs: [ - "android.hardware.threadnetwork-ndk", - ], - test_suites: [ - "general-tests", - "vts", - ], -} diff --git a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp deleted file mode 100644 index 3e43f9c8b7..0000000000 --- a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "ThreadNetworkHalTargetTest" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using aidl::android::hardware::threadnetwork::BnThreadChipCallback; -using aidl::android::hardware::threadnetwork::IThreadChip; -using android::ProcessState; -using ndk::ScopedAStatus; -using ndk::SpAIBinder; - -namespace { -constexpr static int kCallbackTimeoutMs = 5000; -} // namespace - -class ThreadChipCallback : public BnThreadChipCallback { - public: - ThreadChipCallback(const std::function&)>& on_spinel_message_cb) - : on_spinel_message_cb_(on_spinel_message_cb) {} - - ScopedAStatus onReceiveSpinelFrame(const std::vector& in_aFrame) { - on_spinel_message_cb_(in_aFrame); - return ScopedAStatus::ok(); - } - - private: - std::function&)> on_spinel_message_cb_; -}; - -class ThreadNetworkAidl : public testing::TestWithParam { - public: - virtual void SetUp() override { - std::string serviceName = GetParam(); - - ALOGI("serviceName: %s", serviceName.c_str()); - - thread_chip = IThreadChip::fromBinder( - SpAIBinder(AServiceManager_waitForService(serviceName.c_str()))); - ASSERT_NE(thread_chip, nullptr); - } - - virtual void TearDown() override { thread_chip->close(); } - - std::shared_ptr thread_chip; -}; - -TEST_P(ThreadNetworkAidl, Open) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_EQ(thread_chip->open(callback).getServiceSpecificError(), IThreadChip::ERROR_BUSY); -} - -TEST_P(ThreadNetworkAidl, Close) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->close().isOk()); - EXPECT_EQ(thread_chip->close().getExceptionCode(), EX_ILLEGAL_STATE); -} - -TEST_P(ThreadNetworkAidl, Reset) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->reset().isOk()); -} - -TEST_P(ThreadNetworkAidl, SendSpinelFrame) { - const uint8_t kCmdOffset = 2; - const uint8_t kMajorVersionOffset = 3; - const uint8_t kMinorVersionOffset = 4; - const std::vector kGetSpinelProtocolVersion({0x81, 0x02, 0x01}); - const std::vector kGetSpinelProtocolVersionResponse({0x81, 0x06, 0x01, 0x04, 0x03}); - uint8_t min_major_version = kGetSpinelProtocolVersionResponse[kMajorVersionOffset]; - uint8_t min_minor_version = kGetSpinelProtocolVersionResponse[kMinorVersionOffset]; - uint8_t major_version; - uint8_t minor_version; - std::promise open_cb_promise; - std::future open_cb_future{open_cb_promise.get_future()}; - std::shared_ptr callback; - std::vector received_frame; - std::chrono::milliseconds timeout{kCallbackTimeoutMs}; - - callback = ndk::SharedRefBase::make( - [&](const std::vector& in_aFrame) { - if (in_aFrame.size() == kGetSpinelProtocolVersionResponse.size() && - in_aFrame[kCmdOffset] == kGetSpinelProtocolVersionResponse[kCmdOffset]) { - major_version = in_aFrame[kMajorVersionOffset]; - minor_version = in_aFrame[kMinorVersionOffset]; - open_cb_promise.set_value(); - } - }); - - ASSERT_NE(callback, nullptr); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - - EXPECT_TRUE(thread_chip->sendSpinelFrame(kGetSpinelProtocolVersion).isOk()); - EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready); - - EXPECT_GE(major_version, min_major_version); - if (major_version == min_major_version) { - EXPECT_GE(minor_version, min_minor_version); - } -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThreadNetworkAidl); -INSTANTIATE_TEST_SUITE_P( - Thread, ThreadNetworkAidl, - testing::ValuesIn(android::getAidlHalInstanceNames(IThreadChip::descriptor)), - android::PrintInstanceNameToString); - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - ProcessState::self()->setThreadPoolMaxThreadCount(1); - ProcessState::self()->startThreadPool(); - return RUN_ALL_TESTS(); -} -- GitLab From fc489cac9e1286b3f3ccd2cf4097654271901401 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 9 Jun 2023 16:46:49 -0400 Subject: [PATCH 035/376] Add ChromaSiting VERTICAL & BOTH Bug: 221248303 Test: make Change-Id: Ib5a3db2b580c1a063ae176ba3718cdd3ed7e1e9c --- graphics/common/aidl/Android.bp | 2 +- .../hardware/graphics/common/BufferUsage.aidl | 48 ++++---- .../graphics/common/ChromaSiting.aidl | 2 + .../hardware/graphics/common/Dataspace.aidl | 116 +++++++++--------- .../hardware/graphics/common/PixelFormat.aidl | 64 +++++----- .../common/PlaneLayoutComponentType.aidl | 16 +-- .../hardware/graphics/common/Transform.aidl | 10 +- .../graphics/common/ChromaSiting.aidl | 8 ++ 8 files changed, 138 insertions(+), 128 deletions(-) diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 02334e85c2..142c7c17be 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -43,7 +43,7 @@ aidl_interface { enabled: true, }, }, - frozen: true, + frozen: false, versions_with_info: [ { version: "1", diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl index d3ab44f2ce..d42a6d57b8 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl @@ -35,31 +35,31 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="long") @VintfStability enum BufferUsage { - CPU_READ_MASK = 15, + CPU_READ_MASK = 0xf, CPU_READ_NEVER = 0, CPU_READ_RARELY = 2, CPU_READ_OFTEN = 3, - CPU_WRITE_MASK = 240, - CPU_WRITE_NEVER = 0, - CPU_WRITE_RARELY = 32, - CPU_WRITE_OFTEN = 48, - GPU_TEXTURE = 256, - GPU_RENDER_TARGET = 512, - COMPOSER_OVERLAY = 2048, - COMPOSER_CLIENT_TARGET = 4096, - PROTECTED = 16384, - COMPOSER_CURSOR = 32768, - VIDEO_ENCODER = 65536, - CAMERA_OUTPUT = 131072, - CAMERA_INPUT = 262144, - RENDERSCRIPT = 1048576, - VIDEO_DECODER = 4194304, - SENSOR_DIRECT_DATA = 8388608, - GPU_DATA_BUFFER = 16777216, - GPU_CUBE_MAP = 33554432, - GPU_MIPMAP_COMPLETE = 67108864, - HW_IMAGE_ENCODER = 134217728, - FRONT_BUFFER = 4294967296, - VENDOR_MASK = -268435456, - VENDOR_MASK_HI = -281474976710656, + CPU_WRITE_MASK = (0xf << 4) /* 240 */, + CPU_WRITE_NEVER = (0 << 4) /* 0 */, + CPU_WRITE_RARELY = (2 << 4) /* 32 */, + CPU_WRITE_OFTEN = (3 << 4) /* 48 */, + GPU_TEXTURE = (1 << 8) /* 256 */, + GPU_RENDER_TARGET = (1 << 9) /* 512 */, + COMPOSER_OVERLAY = (1 << 11) /* 2048 */, + COMPOSER_CLIENT_TARGET = (1 << 12) /* 4096 */, + PROTECTED = (1 << 14) /* 16384 */, + COMPOSER_CURSOR = (1 << 15) /* 32768 */, + VIDEO_ENCODER = (1 << 16) /* 65536 */, + CAMERA_OUTPUT = (1 << 17) /* 131072 */, + CAMERA_INPUT = (1 << 18) /* 262144 */, + RENDERSCRIPT = (1 << 20) /* 1048576 */, + VIDEO_DECODER = (1 << 22) /* 4194304 */, + SENSOR_DIRECT_DATA = (1 << 23) /* 8388608 */, + GPU_DATA_BUFFER = (1 << 24) /* 16777216 */, + GPU_CUBE_MAP = (1 << 25) /* 33554432 */, + GPU_MIPMAP_COMPLETE = (1 << 26) /* 67108864 */, + HW_IMAGE_ENCODER = (1 << 27) /* 134217728 */, + FRONT_BUFFER = (1L << 32) /* 4294967296 */, + VENDOR_MASK = (0xf << 28) /* -268435456 */, + VENDOR_MASK_HI = ((1L * 0xffff) << 48) /* -281474976710656 */, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl index b8af644604..784fc1798a 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl @@ -39,4 +39,6 @@ enum ChromaSiting { UNKNOWN = 1, SITED_INTERSTITIAL = 2, COSITED_HORIZONTAL = 3, + COSITED_VERTICAL = 4, + COSITED_BOTH = 5, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl index 563b6c1ac4..d9ff5aabed 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl @@ -35,65 +35,65 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="int") @VintfStability enum Dataspace { - UNKNOWN = 0, - ARBITRARY = 1, + UNKNOWN = 0x0, + ARBITRARY = 0x1, STANDARD_SHIFT = 16, - STANDARD_MASK = 4128768, - STANDARD_UNSPECIFIED = 0, - STANDARD_BT709 = 65536, - STANDARD_BT601_625 = 131072, - STANDARD_BT601_625_UNADJUSTED = 196608, - STANDARD_BT601_525 = 262144, - STANDARD_BT601_525_UNADJUSTED = 327680, - STANDARD_BT2020 = 393216, - STANDARD_BT2020_CONSTANT_LUMINANCE = 458752, - STANDARD_BT470M = 524288, - STANDARD_FILM = 589824, - STANDARD_DCI_P3 = 655360, - STANDARD_ADOBE_RGB = 720896, + STANDARD_MASK = (63 << 16) /* 4128768 */, + STANDARD_UNSPECIFIED = (0 << 16) /* 0 */, + STANDARD_BT709 = (1 << 16) /* 65536 */, + STANDARD_BT601_625 = (2 << 16) /* 131072 */, + STANDARD_BT601_625_UNADJUSTED = (3 << 16) /* 196608 */, + STANDARD_BT601_525 = (4 << 16) /* 262144 */, + STANDARD_BT601_525_UNADJUSTED = (5 << 16) /* 327680 */, + STANDARD_BT2020 = (6 << 16) /* 393216 */, + STANDARD_BT2020_CONSTANT_LUMINANCE = (7 << 16) /* 458752 */, + STANDARD_BT470M = (8 << 16) /* 524288 */, + STANDARD_FILM = (9 << 16) /* 589824 */, + STANDARD_DCI_P3 = (10 << 16) /* 655360 */, + STANDARD_ADOBE_RGB = (11 << 16) /* 720896 */, TRANSFER_SHIFT = 22, - TRANSFER_MASK = 130023424, - TRANSFER_UNSPECIFIED = 0, - TRANSFER_LINEAR = 4194304, - TRANSFER_SRGB = 8388608, - TRANSFER_SMPTE_170M = 12582912, - TRANSFER_GAMMA2_2 = 16777216, - TRANSFER_GAMMA2_6 = 20971520, - TRANSFER_GAMMA2_8 = 25165824, - TRANSFER_ST2084 = 29360128, - TRANSFER_HLG = 33554432, + TRANSFER_MASK = (31 << 22) /* 130023424 */, + TRANSFER_UNSPECIFIED = (0 << 22) /* 0 */, + TRANSFER_LINEAR = (1 << 22) /* 4194304 */, + TRANSFER_SRGB = (2 << 22) /* 8388608 */, + TRANSFER_SMPTE_170M = (3 << 22) /* 12582912 */, + TRANSFER_GAMMA2_2 = (4 << 22) /* 16777216 */, + TRANSFER_GAMMA2_6 = (5 << 22) /* 20971520 */, + TRANSFER_GAMMA2_8 = (6 << 22) /* 25165824 */, + TRANSFER_ST2084 = (7 << 22) /* 29360128 */, + TRANSFER_HLG = (8 << 22) /* 33554432 */, RANGE_SHIFT = 27, - RANGE_MASK = 939524096, - RANGE_UNSPECIFIED = 0, - RANGE_FULL = 134217728, - RANGE_LIMITED = 268435456, - RANGE_EXTENDED = 402653184, - SRGB_LINEAR = 138477568, - SCRGB_LINEAR = 406913024, - SRGB = 142671872, - SCRGB = 411107328, - JFIF = 146931712, - BT601_625 = 281149440, - BT601_525 = 281280512, - BT709 = 281083904, - DCI_P3_LINEAR = 139067392, - DCI_P3 = 155844608, - DISPLAY_P3_LINEAR = 139067392, - DISPLAY_P3 = 143261696, - ADOBE_RGB = 151715840, - BT2020_LINEAR = 138805248, - BT2020 = 147193856, - BT2020_PQ = 163971072, - DEPTH = 4096, - SENSOR = 4097, - BT2020_ITU = 281411584, - BT2020_ITU_PQ = 298188800, - BT2020_ITU_HLG = 302383104, - BT2020_HLG = 168165376, - DISPLAY_BT2020 = 142999552, - DYNAMIC_DEPTH = 4098, - JPEG_APP_SEGMENTS = 4099, - HEIF = 4100, - JPEG_R = 4101, - BT709_FULL_RANGE = 146866176, + RANGE_MASK = (7 << 27) /* 939524096 */, + RANGE_UNSPECIFIED = (0 << 27) /* 0 */, + RANGE_FULL = (1 << 27) /* 134217728 */, + RANGE_LIMITED = (2 << 27) /* 268435456 */, + RANGE_EXTENDED = (3 << 27) /* 402653184 */, + SRGB_LINEAR = (((1 << 16) | (1 << 22)) | (1 << 27)) /* 138477568 */, + SCRGB_LINEAR = (((1 << 16) | (1 << 22)) | (3 << 27)) /* 406913024 */, + SRGB = (((1 << 16) | (2 << 22)) | (1 << 27)) /* 142671872 */, + SCRGB = (((1 << 16) | (2 << 22)) | (3 << 27)) /* 411107328 */, + JFIF = (((2 << 16) | (3 << 22)) | (1 << 27)) /* 146931712 */, + BT601_625 = (((2 << 16) | (3 << 22)) | (2 << 27)) /* 281149440 */, + BT601_525 = (((4 << 16) | (3 << 22)) | (2 << 27)) /* 281280512 */, + BT709 = (((1 << 16) | (3 << 22)) | (2 << 27)) /* 281083904 */, + DCI_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DCI_P3 = (((10 << 16) | (5 << 22)) | (1 << 27)) /* 155844608 */, + DISPLAY_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, + DISPLAY_P3 = (((10 << 16) | (2 << 22)) | (1 << 27)) /* 143261696 */, + ADOBE_RGB = (((11 << 16) | (4 << 22)) | (1 << 27)) /* 151715840 */, + BT2020_LINEAR = (((6 << 16) | (1 << 22)) | (1 << 27)) /* 138805248 */, + BT2020 = (((6 << 16) | (3 << 22)) | (1 << 27)) /* 147193856 */, + BT2020_PQ = (((6 << 16) | (7 << 22)) | (1 << 27)) /* 163971072 */, + DEPTH = 0x1000, + SENSOR = 0x1001, + BT2020_ITU = (((6 << 16) | (3 << 22)) | (2 << 27)) /* 281411584 */, + BT2020_ITU_PQ = (((6 << 16) | (7 << 22)) | (2 << 27)) /* 298188800 */, + BT2020_ITU_HLG = (((6 << 16) | (8 << 22)) | (2 << 27)) /* 302383104 */, + BT2020_HLG = (((6 << 16) | (8 << 22)) | (1 << 27)) /* 168165376 */, + DISPLAY_BT2020 = (((6 << 16) | (2 << 22)) | (1 << 27)) /* 142999552 */, + DYNAMIC_DEPTH = 0x1002, + JPEG_APP_SEGMENTS = 0x1003, + HEIF = 0x1004, + JPEG_R = 0x1005, + BT709_FULL_RANGE = (((1 << 16) | (3 << 22)) | (1 << 27)) /* 146866176 */, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl index 68857e816f..ed84a44b4f 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl @@ -36,36 +36,36 @@ package android.hardware.graphics.common; @Backing(type="int") @VintfStability enum PixelFormat { UNSPECIFIED = 0, - RGBA_8888 = 1, - RGBX_8888 = 2, - RGB_888 = 3, - RGB_565 = 4, - BGRA_8888 = 5, - YCBCR_422_SP = 16, - YCRCB_420_SP = 17, - YCBCR_422_I = 20, - RGBA_FP16 = 22, - RAW16 = 32, - BLOB = 33, - IMPLEMENTATION_DEFINED = 34, - YCBCR_420_888 = 35, - RAW_OPAQUE = 36, - RAW10 = 37, - RAW12 = 38, - RGBA_1010102 = 43, - Y8 = 538982489, - Y16 = 540422489, - YV12 = 842094169, - DEPTH_16 = 48, - DEPTH_24 = 49, - DEPTH_24_STENCIL_8 = 50, - DEPTH_32F = 51, - DEPTH_32F_STENCIL_8 = 52, - STENCIL_8 = 53, - YCBCR_P010 = 54, - HSV_888 = 55, - R_8 = 56, - R_16_UINT = 57, - RG_1616_UINT = 58, - RGBA_10101010 = 59, + RGBA_8888 = 0x1, + RGBX_8888 = 0x2, + RGB_888 = 0x3, + RGB_565 = 0x4, + BGRA_8888 = 0x5, + YCBCR_422_SP = 0x10, + YCRCB_420_SP = 0x11, + YCBCR_422_I = 0x14, + RGBA_FP16 = 0x16, + RAW16 = 0x20, + BLOB = 0x21, + IMPLEMENTATION_DEFINED = 0x22, + YCBCR_420_888 = 0x23, + RAW_OPAQUE = 0x24, + RAW10 = 0x25, + RAW12 = 0x26, + RGBA_1010102 = 0x2B, + Y8 = 0x20203859, + Y16 = 0x20363159, + YV12 = 0x32315659, + DEPTH_16 = 0x30, + DEPTH_24 = 0x31, + DEPTH_24_STENCIL_8 = 0x32, + DEPTH_32F = 0x33, + DEPTH_32F_STENCIL_8 = 0x34, + STENCIL_8 = 0x35, + YCBCR_P010 = 0x36, + HSV_888 = 0x37, + R_8 = 0x38, + R_16_UINT = 0x39, + RG_1616_UINT = 0x3a, + RGBA_10101010 = 0x3b, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl index 8ba93811a4..e3067515fd 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl @@ -35,12 +35,12 @@ package android.hardware.graphics.common; /* @hide */ @Backing(type="long") @VintfStability enum PlaneLayoutComponentType { - Y = 1, - CB = 2, - CR = 4, - R = 1024, - G = 2048, - B = 4096, - RAW = 1048576, - A = 1073741824, + Y = (1 << 0) /* 1 */, + CB = (1 << 1) /* 2 */, + CR = (1 << 2) /* 4 */, + R = (1 << 10) /* 1024 */, + G = (1 << 11) /* 2048 */, + B = (1 << 12) /* 4096 */, + RAW = (1 << 20) /* 1048576 */, + A = (1 << 30) /* 1073741824 */, } diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl index 986d089027..dbed57dae6 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl @@ -36,9 +36,9 @@ package android.hardware.graphics.common; @Backing(type="int") @VintfStability enum Transform { NONE = 0, - FLIP_H = 1, - FLIP_V = 2, - ROT_90 = 4, - ROT_180 = 3, - ROT_270 = 7, + FLIP_H = (1 << 0) /* 1 */, + FLIP_V = (1 << 1) /* 2 */, + ROT_90 = (1 << 2) /* 4 */, + ROT_180 = (FLIP_H | FLIP_V) /* 3 */, + ROT_270 = ((FLIP_H | FLIP_V) | ROT_90) /* 7 */, } diff --git a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl index ac448535e8..7da45daa6d 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl @@ -37,4 +37,12 @@ enum ChromaSiting { * Cb and Cr are vertically sited interstitially. * This is used by 4:2:0 for MPEG-2 frame pictures. */ COSITED_HORIZONTAL = 3, + + /* Cb and Cr are horizontally sited interstitially with a luma sample. + * Cb and Cr are vertically sited coincident. */ + COSITED_VERTICAL = 4, + + /* Cb and Cr are both horizontally & vertically sited coincident + * with a luma sample. */ + COSITED_BOTH = 5, } -- GitLab From 57baaafe40447c60260bf454414ed8af6d939a13 Mon Sep 17 00:00:00 2001 From: Keith Mok Date: Tue, 13 Jun 2023 22:33:10 +0000 Subject: [PATCH 036/376] Fix repo upload fail if no symbolic link to python3 generate_annotation_enums.py was added to repo hook but it specific pthon instrad of python3, on system without symbolic link to python3 from python, repo upload would failed with a file not found error. Test: Manual test Bug: 287123042 Change-Id: I61167c5e97bcabb0b0c1b86971f19ce483ff198f --- automotive/vehicle/tools/generate_annotation_enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index 06e9745fa6..cfae607f0c 100755 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright (C) 2022 The Android Open Source Project # -- GitLab From 12423f5ff6add518612c2a81f002b18f1f84543d Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 14 Jun 2023 20:04:51 -0700 Subject: [PATCH 037/376] [Composer VTS] Subclass the test cases by the interface version This helps us write tests by version number, and avoids checking version interface in every test that we add in newer versions, avoids common mistakes of missing a version check. And makes it clear what features were added in new versions Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 274999658 Change-Id: I2a8d5aa6c9d426de02ab0abf2ca662e330b6a5ea --- .../VtsHalGraphicsComposer3_TargetTest.cpp | 301 +++++++++--------- 1 file changed, 146 insertions(+), 155 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 18d36e4c14..bbcd36ff7b 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -45,7 +45,6 @@ #define LOG_TAG "VtsHalGraphicsComposer3_TargetTest" namespace aidl::android::hardware::graphics::composer3::vts { -namespace { using namespace std::chrono_literals; @@ -891,39 +890,6 @@ TEST_P(GraphicsComposerAidlTest, GetDisplayName) { EXPECT_TRUE(status.isOk()); } -TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "Device does not support the new API for overlay support"; - return; - } - - const auto& [status, properties] = mComposerClient->getOverlaySupport(); - if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && - status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { - GTEST_SUCCEED() << "getOverlaySupport is not supported"; - return; - } - - ASSERT_TRUE(status.isOk()); - for (const auto& i : properties.combinations) { - for (const auto standard : i.standards) { - const auto val = static_cast(standard) & - static_cast(common::Dataspace::STANDARD_MASK); - ASSERT_TRUE(val == static_cast(standard)); - } - for (const auto transfer : i.transfers) { - const auto val = static_cast(transfer) & - static_cast(common::Dataspace::TRANSFER_MASK); - ASSERT_TRUE(val == static_cast(transfer)); - } - for (const auto range : i.ranges) { - const auto val = static_cast(range) & - static_cast(common::Dataspace::RANGE_MASK); - ASSERT_TRUE(val == static_cast(range)); - } - } -} - TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) { const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId()); @@ -1169,6 +1135,79 @@ TEST_P(GraphicsComposerAidlTest, GetDataspaceSaturationMatrix_BadParameter) { EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER)); } +/* + * Test that no two display configs are exactly the same. + */ +TEST_P(GraphicsComposerAidlTest, GetDisplayConfigNoRepetitions) { + for (const auto& display : mDisplays) { + const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); + for (std::vector::size_type i = 0; i < configs.size(); i++) { + for (std::vector::size_type j = i + 1; j < configs.size(); j++) { + const auto& [widthStatus1, width1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::WIDTH); + const auto& [heightStatus1, height1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::HEIGHT); + const auto& [vsyncPeriodStatus1, vsyncPeriod1] = + mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[i], + DisplayAttribute::VSYNC_PERIOD); + const auto& [groupStatus1, group1] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[i], DisplayAttribute::CONFIG_GROUP); + + const auto& [widthStatus2, width2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::WIDTH); + const auto& [heightStatus2, height2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::HEIGHT); + const auto& [vsyncPeriodStatus2, vsyncPeriod2] = + mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[j], + DisplayAttribute::VSYNC_PERIOD); + const auto& [groupStatus2, group2] = mComposerClient->getDisplayAttribute( + display.getDisplayId(), configs[j], DisplayAttribute::CONFIG_GROUP); + + ASSERT_FALSE(width1 == width2 && height1 == height2 && + vsyncPeriod1 == vsyncPeriod2 && group1 == group2); + } + } + } +} + +class GraphicsComposerAidlV2Test : public GraphicsComposerAidlTest { + protected: + void SetUp() override { + GraphicsComposerAidlTest::SetUp(); + if (getInterfaceVersion() <= 1) { + GTEST_SKIP() << "Device interface version is expected to be >= 2"; + } + } +}; + +TEST_P(GraphicsComposerAidlV2Test, GetOverlaySupport) { + const auto& [status, properties] = mComposerClient->getOverlaySupport(); + if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC && + status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) { + GTEST_SUCCEED() << "getOverlaySupport is not supported"; + return; + } + + ASSERT_TRUE(status.isOk()); + for (const auto& i : properties.combinations) { + for (const auto standard : i.standards) { + const auto val = static_cast(standard) & + static_cast(common::Dataspace::STANDARD_MASK); + ASSERT_TRUE(val == static_cast(standard)); + } + for (const auto transfer : i.transfers) { + const auto val = static_cast(transfer) & + static_cast(common::Dataspace::TRANSFER_MASK); + ASSERT_TRUE(val == static_cast(transfer)); + } + for (const auto range : i.ranges) { + const auto val = static_cast(range) & + static_cast(common::Dataspace::RANGE_MASK); + ASSERT_TRUE(val == static_cast(range)); + } + } +} + // Tests for Command. class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { protected: @@ -1767,53 +1806,6 @@ TEST_P(GraphicsComposerAidlCommandTest, SetLayerBuffer) { execute(); } -TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferSlotsToClear) { - // Older HAL versions use a backwards compatible way of clearing buffer slots - const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion(); - ASSERT_TRUE(versionStatus.isOk()); - if (version <= 1) { - GTEST_SUCCEED() << "HAL at version 1 or lower does not have " - "LayerCommand::bufferSlotsToClear."; - return; - } - - const auto& [layerStatus, layer] = - mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); - EXPECT_TRUE(layerStatus.isOk()); - auto& writer = getWriter(getPrimaryDisplayId()); - - // setup 3 buffers in the buffer cache, with the last buffer being active - // then emulate the Android platform code that clears all 3 buffer slots - - const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888); - ASSERT_NE(nullptr, buffer1); - const auto handle1 = buffer1->handle; - writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1); - execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); - - const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); - ASSERT_NE(nullptr, buffer2); - const auto handle2 = buffer2->handle; - writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1); - execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); - - const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888); - ASSERT_NE(nullptr, buffer3); - const auto handle3 = buffer3->handle; - writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1); - execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); - - // Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the - // current active buffer's slot will be cleared, but still remain the active buffer and no - // errors will occur. - writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, {0, 1, 2}); - execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); -} - TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferMultipleTimes) { const auto& [layerStatus, layer] = mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); @@ -2405,12 +2397,66 @@ TEST_P(GraphicsComposerAidlCommandTest, SetIdleTimerEnabled_Timeout_2) { EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk()); } -TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Unsupported) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " - "not supported on older version of the service"; - return; +class GraphicsComposerAidlCommandV2Test : public GraphicsComposerAidlCommandTest { + protected: + void SetUp() override { + GraphicsComposerAidlTest::SetUp(); + if (getInterfaceVersion() <= 1) { + GTEST_SKIP() << "Device interface version is expected to be >= 2"; + } } +}; +/** + * Test Capability::SKIP_VALIDATE + * + * Capability::SKIP_VALIDATE has been deprecated and should not be enabled. + */ +TEST_P(GraphicsComposerAidlCommandV2Test, SkipValidateDeprecatedTest) { + ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE)) + << "Found Capability::SKIP_VALIDATE capability."; +} + +TEST_P(GraphicsComposerAidlCommandV2Test, SetLayerBufferSlotsToClear) { + // Older HAL versions use a backwards compatible way of clearing buffer slots + // HAL at version 1 or lower does not have LayerCommand::bufferSlotsToClear + const auto& [layerStatus, layer] = + mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount); + EXPECT_TRUE(layerStatus.isOk()); + auto& writer = getWriter(getPrimaryDisplayId()); + + // setup 3 buffers in the buffer cache, with the last buffer being active + // then emulate the Android platform code that clears all 3 buffer slots + + const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer1); + const auto handle1 = buffer1->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer2); + const auto handle2 = buffer2->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer3); + const auto handle3 = buffer3->handle; + writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + // Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the + // current active buffer's slot will be cleared, but still remain the active buffer and no + // errors will occur. + writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, {0, 1, 2}); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + +TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebug_Unsupported) { if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { auto status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled( getPrimaryDisplayId(), /*enabled*/ true); @@ -2426,12 +2472,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Unsup } } -TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Enabled) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " - "not supported on older version of the service"; - return; - } +TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebug_Enabled) { if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; return; @@ -2459,13 +2500,8 @@ TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Enabl .isOk()); } -TEST_P(GraphicsComposerAidlCommandTest, +TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebugEnabled_noCallbackWhenIdle) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " - "not supported on older version of the service"; - return; - } if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; return; @@ -2521,13 +2557,8 @@ TEST_P(GraphicsComposerAidlCommandTest, .isOk()); } -TEST_P(GraphicsComposerAidlCommandTest, +TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebugEnabled_SetActiveConfigWithConstraints) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is " - "not supported on older version of the service"; - return; - } if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) { GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported"; return; @@ -2595,67 +2626,27 @@ TEST_P(GraphicsComposerAidlCommandTest, } } -/* - * Test that no two display configs are exactly the same. - */ -TEST_P(GraphicsComposerAidlTest, GetDisplayConfigNoRepetitions) { - for (const auto& display : mDisplays) { - const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId()); - for (std::vector::size_type i = 0; i < configs.size(); i++) { - for (std::vector::size_type j = i + 1; j < configs.size(); j++) { - const auto& [widthStatus1, width1] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[i], DisplayAttribute::WIDTH); - const auto& [heightStatus1, height1] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[i], DisplayAttribute::HEIGHT); - const auto& [vsyncPeriodStatus1, vsyncPeriod1] = - mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[i], - DisplayAttribute::VSYNC_PERIOD); - const auto& [groupStatus1, group1] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[i], DisplayAttribute::CONFIG_GROUP); - - const auto& [widthStatus2, width2] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[j], DisplayAttribute::WIDTH); - const auto& [heightStatus2, height2] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[j], DisplayAttribute::HEIGHT); - const auto& [vsyncPeriodStatus2, vsyncPeriod2] = - mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[j], - DisplayAttribute::VSYNC_PERIOD); - const auto& [groupStatus2, group2] = mComposerClient->getDisplayAttribute( - display.getDisplayId(), configs[j], DisplayAttribute::CONFIG_GROUP); - - ASSERT_FALSE(width1 == width2 && height1 == height2 && - vsyncPeriod1 == vsyncPeriod2 && group1 == group2); - } - } - } -} - -/** - * Test Capability::SKIP_VALIDATE - * - * Capability::SKIP_VALIDATE has been deprecated and should not be enabled. - */ -TEST_P(GraphicsComposerAidlCommandTest, SkipValidateDeprecatedTest) { - if (getInterfaceVersion() <= 1) { - GTEST_SUCCEED() << "HAL at version 1 or lower can contain Capability::SKIP_VALIDATE."; - return; - } - ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE)) - << "Found Capability::SKIP_VALIDATE capability."; -} - GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), ::android::PrintInstanceNameToString); - GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlTest, testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), ::android::PrintInstanceNameToString); -} // namespace +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlV2Test); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlV2Test, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandV2Test); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlCommandV2Test, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); + } // namespace aidl::android::hardware::graphics::composer3::vts int main(int argc, char** argv) { -- GitLab From f523e40029dddb02d2c6ef00a2cbcca1896d54df Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Thu, 15 Jun 2023 23:56:58 +0000 Subject: [PATCH 038/376] Enable rust backend for input common types Bug: 278783893 Test: None Change-Id: Ia1ce9a501dc52f4840583311ca4cc94b018b0aad --- input/common/aidl/Android.bp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp index 95a14b286b..f23f270e0b 100644 --- a/input/common/aidl/Android.bp +++ b/input/common/aidl/Android.bp @@ -20,6 +20,9 @@ aidl_interface { java: { enabled: false, }, + rust: { + enabled: true, + }, }, versions_with_info: [ { -- GitLab From 285598dde00128cfc5fa5a9f7b7847d31daf3620 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Sat, 17 Jun 2023 03:59:51 +0000 Subject: [PATCH 039/376] Fixed metadata label in AIDL radio HAL Metadata Bug: 287517076 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I612ca079bda6f47446ec75ca7b4fece7317bd56d --- .../hardware/broadcastradio/Metadata.aidl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl index 3298cac969..7769b8c373 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl @@ -70,9 +70,9 @@ union Metadata { /** * Station name. * - * This is a generic field to cover any radio technology. + *

This is a generic field to cover any radio technology. * - * If the PROGRAM_NAME has the same content as DAB_*_NAME or RDS_PS, + *

Note: If the program name has the same content as dab*Name or ({@link Metadata#rdsPs}, * it may not be present, to preserve space - framework must repopulate * it on the client side. */ @@ -86,10 +86,10 @@ union Metadata { /** * DAB ensemble name abbreviated (string). * - * The string must be up to 8 characters long. + *

Note: The string must be up to 8 characters long. * - * If the short variant is present, the long (DAB_ENSEMBLE_NAME) one must be - * present as well. + *

Note: If the short variant is present, the long ({@link Metadata#dabEnsembleName}) + * one must be present as well. */ String dabEnsembleNameShort; @@ -99,7 +99,9 @@ union Metadata { String dabServiceName; /** - * DAB service name abbreviated (see DAB_ENSEMBLE_NAME_SHORT) (string) + * DAB service name abbreviated (string) + * + *

Note: The string must be up to 8 characters long. */ String dabServiceNameShort; @@ -109,7 +111,9 @@ union Metadata { String dabComponentName; /** - * DAB component name abbreviated (see DAB_ENSEMBLE_NAME_SHORT) (string) + * DAB component name abbreviated (string) + * + *

Note: The string must be up to 8 characters long. */ String dabComponentNameShort; } -- GitLab From d68149e363aef63e7f28aa6b1612f389387edeff Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 31 May 2023 16:25:51 -0700 Subject: [PATCH 040/376] Support VEHICLE_IN_USE and SHUTDOWN_REQUEST. Support VEHICLE_IN_USE and SHUTDOWN_REQUEST properties in reference VHAL. They are used for remote access feature. Test: atest FakeVehicleHardwareTest Bug: 285205122 Change-Id: Ideb964d1ee625b127bc8e708b46f9639dd59c011 --- .../config/DefaultProperties.json | 11 +++++++ .../hardware/include/FakeVehicleHardware.h | 2 ++ .../hardware/src/FakeVehicleHardware.cpp | 25 ++++++++++++++++ .../hardware/test/FakeVehicleHardwareTest.cpp | 30 +++++++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 5503de22ec..0dfb123b4b 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3628,6 +3628,17 @@ ] } }, + { + "property": "VehicleProperty::SHUTDOWN_REQUEST" + }, + { + "property": "VehicleProperty::VEHICLE_IN_USE", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, { "property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index c3ebd3b3bc..502d957ef4 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -194,6 +194,8 @@ class FakeVehicleHardware : public IVehicleHardware { bool* isSpecialValue) const; VhalResult setApPowerStateReport( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + VhalResult setApPowerStateReqShutdown( + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); VehiclePropValuePool::RecyclableType createApPowerStateReq( aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state); VehiclePropValuePool::RecyclableType createAdasStateReq(int32_t propertyId, int32_t areaId, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 3f5e4c4273..94e4ef713e 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -337,6 +337,25 @@ VehiclePropValuePool::RecyclableType FakeVehicleHardware::createAdasStateReq(int return req; } +VhalResult FakeVehicleHardware::setApPowerStateReqShutdown(const VehiclePropValue& value) { + if (value.value.int32Values.size() != 1) { + return StatusError(StatusCode::INVALID_ARG) + << "Failed to set SHUTDOWN_REQUEST, expect 1 int value: " + << "VehicleApPowerStateShutdownParam"; + } + int powerStateShutdownParam = value.value.int32Values[0]; + auto prop = createApPowerStateReq(VehicleApPowerStateReq::SHUTDOWN_PREPARE); + prop->value.int32Values[1] = powerStateShutdownParam; + if (auto writeResult = mServerSidePropStore->writeValue( + std::move(prop), /*updateStatus=*/true, VehiclePropertyStore::EventMode::ALWAYS); + !writeResult.ok()) { + return StatusError(getErrorCode(writeResult)) + << "failed to write AP_POWER_STATE_REQ into property store, error: " + << getErrorMsg(writeResult); + } + return {}; +} + VhalResult FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) { auto updatedValue = mValuePool->obtain(value); updatedValue->timestamp = elapsedRealtimeNano(); @@ -762,6 +781,12 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case toInt(VehicleProperty::AP_POWER_STATE_REPORT): *isSpecialValue = true; return setApPowerStateReport(value); + case toInt(VehicleProperty::SHUTDOWN_REQUEST): + // If we receive SHUTDOWN_REQUEST, we should send this to an external component which + // should shutdown Android system via sending an AP_POWER_STATE_REQ event. Here we have + // no external components to notify, so we just send the event. + *isSpecialValue = true; + return setApPowerStateReqShutdown(value); case toInt(VehicleProperty::VEHICLE_MAP_SERVICE): // Placeholder for future implementation of VMS property in the default hal. For // now, just returns OK; otherwise, hal clients crash with property not supported. diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 8d385ddcfe..ae1c0f681a 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -21,6 +21,8 @@ #include #include +#include + #include #include #include @@ -69,6 +71,7 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; +using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateShutdownParam; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; @@ -1519,6 +1522,33 @@ std::vector setSpecialValueTestCases() { }, }, }, + SetSpecialValueTestCase{ + .name = "set_shutdown_request", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::SHUTDOWN_REQUEST), + .value.int32Values = + { + toInt(VehicleApPowerStateShutdownParam:: + SHUTDOWN_ONLY), + }, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .value.int32Values = + { + toInt(VehicleApPowerStateReq:: + SHUTDOWN_PREPARE), + toInt(VehicleApPowerStateShutdownParam:: + SHUTDOWN_ONLY), + }, + }, + }, + }, }; } -- GitLab From acd066c61425d6b7f512445c6e2883baa28f381e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 17 May 2023 17:48:30 +0000 Subject: [PATCH 041/376] Clarify the Weaver documentation - Explicitly mention that Weaver is for *persistent* storage - Explicitly mention secure deletion requirement Change-Id: I3eaf7408570ff20c69a21398e39e16be97d2a917 --- weaver/aidl/android/hardware/weaver/IWeaver.aidl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weaver/aidl/android/hardware/weaver/IWeaver.aidl b/weaver/aidl/android/hardware/weaver/IWeaver.aidl index f51034a387..ae816ef3f4 100644 --- a/weaver/aidl/android/hardware/weaver/IWeaver.aidl +++ b/weaver/aidl/android/hardware/weaver/IWeaver.aidl @@ -20,8 +20,8 @@ import android.hardware.weaver.WeaverConfig; import android.hardware.weaver.WeaverReadResponse; /** - * Weaver provides secure storage of secret values that may only be read if the - * corresponding key has been presented. + * Weaver provides secure persistent storage of secret values that may only be + * read if the corresponding key has been presented. * * The storage must be secure as the device's user authentication and encryption * relies on the security of these values. The cardinality of the domains of the @@ -76,7 +76,8 @@ interface IWeaver { WeaverReadResponse read(in int slotId, in byte[] key); /** - * Overwrites the identified slot with the provided key and value. + * Overwrites the identified slot with the provided key and value, rendering + * the previous contents of the slot permanently unrecoverable. * * The new values are written regardless of the current state of the slot in * order to remain idempotent. -- GitLab From def46527927875efad5a3fbfb5e6a695a9106d51 Mon Sep 17 00:00:00 2001 From: mike liao Date: Mon, 26 Jun 2023 14:12:48 +0800 Subject: [PATCH 042/376] Add fix vts fail when configureMonitorEvent [Description] VTS StartFilterInDemux failed when configureMonitorEvent is called [Root Cause] Scrambling status event is not notified when configureMonitorEvent is called so test case failed. [Solution] Scrambling status event is not notified because of no input data. Add input setting and check event notified or not after data is input. Test: Manual bug: 288193021 Change-Id: If5875d064fd67b72f8299205a5e35b1a2bd61934 --- tv/tuner/1.1/vts/functional/FilterTests.cpp | 17 +++++++++++------ tv/tuner/1.1/vts/functional/FilterTests.h | 1 + .../functional/VtsHalTvTunerV1_1TargetTest.cpp | 5 +++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tv/tuner/1.1/vts/functional/FilterTests.cpp b/tv/tuner/1.1/vts/functional/FilterTests.cpp index 8bdf8f68b8..a24cd63f42 100644 --- a/tv/tuner/1.1/vts/functional/FilterTests.cpp +++ b/tv/tuner/1.1/vts/functional/FilterTests.cpp @@ -311,12 +311,6 @@ AssertionResult FilterTests::configureMonitorEvent(uint64_t filterId, uint32_t m android::hardware::tv::tuner::V1_1::IFilter::castFrom(mFilters[filterId]); if (filter_v1_1 != NULL) { status = filter_v1_1->configureMonitorEvent(monitorEventTypes); - if (monitorEventTypes & DemuxFilterMonitorEventType::SCRAMBLING_STATUS) { - mFilterCallbacks[filterId]->testFilterScramblingEvent(); - } - if (monitorEventTypes & DemuxFilterMonitorEventType::IP_CID_CHANGE) { - mFilterCallbacks[filterId]->testFilterIpCidEvent(); - } } else { ALOGW("[vts] Can't cast IFilter into v1_1."); return failure(); @@ -324,6 +318,17 @@ AssertionResult FilterTests::configureMonitorEvent(uint64_t filterId, uint32_t m return AssertionResult(status == Result::SUCCESS); } +AssertionResult FilterTests::testMonitorEvent(uint64_t filterId, uint32_t monitorEventTypes) { + EXPECT_TRUE(mFilterCallbacks[filterId]) << "Test with getNewlyOpenedFilterId first."; + if (monitorEventTypes & DemuxFilterMonitorEventType::SCRAMBLING_STATUS) { + mFilterCallbacks[filterId]->testFilterScramblingEvent(); + } + if (monitorEventTypes & DemuxFilterMonitorEventType::IP_CID_CHANGE) { + mFilterCallbacks[filterId]->testFilterIpCidEvent(); + } + return AssertionResult(true); +} + AssertionResult FilterTests::startIdTest(uint64_t filterId) { EXPECT_TRUE(mFilterCallbacks[filterId]) << "Test with getNewlyOpenedFilterId first."; mFilterCallbacks[filterId]->testStartIdAfterReconfigure(); diff --git a/tv/tuner/1.1/vts/functional/FilterTests.h b/tv/tuner/1.1/vts/functional/FilterTests.h index 1a1273ecb4..e652154b36 100644 --- a/tv/tuner/1.1/vts/functional/FilterTests.h +++ b/tv/tuner/1.1/vts/functional/FilterTests.h @@ -159,6 +159,7 @@ class FilterTests { AssertionResult configAvFilterStreamType(AvStreamType type, uint64_t filterId); AssertionResult configIpFilterCid(uint32_t ipCid, uint64_t filterId); AssertionResult configureMonitorEvent(uint64_t filterId, uint32_t monitorEventTypes); + AssertionResult testMonitorEvent(uint64_t filterId, uint32_t monitorEventTypes); AssertionResult getFilterMQDescriptor(uint64_t filterId, bool getMqDesc); AssertionResult startFilter(uint64_t filterId); AssertionResult stopFilter(uint64_t filterId); diff --git a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp index 41acaa1704..fccd2ede9b 100644 --- a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp +++ b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp @@ -48,6 +48,11 @@ void TunerFilterHidlTest::configSingleFilterInDemuxTest(FilterConfig1_1 filterCo } ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.config1_0.getMqDesc)); ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + if (filterConf.monitorEventTypes > 0) { + ASSERT_TRUE(mFilterTests.testMonitorEvent(filterId, filterConf.monitorEventTypes)); + } + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mFilterTests.closeFilter(filterId)); ASSERT_TRUE(mDemuxTests.closeDemux()); -- GitLab From 3869fa63f256ee6daf351eefab6e84e69495f852 Mon Sep 17 00:00:00 2001 From: Sean Dooher Date: Mon, 12 Jun 2023 20:14:00 +0000 Subject: [PATCH 043/376] thermal: Add support for Rust AIDL backend Updates the VTS test to allow a NULL_POINTER exception when a null pointer is passed as an argument. This matches the behavior of the Rust libbinder_rs while maintaining backwards compatibility by still allowing ILLEGAL_ARGUMENT exceptions in this case. This support is necessary for a new emulated Thermal HAL for Cuttlefish written in Rust. Tested: VtsHalThermalTest in Cuttlefish Bug: 286106286 Change-Id: Iccbebb416f31555da328f752d661660b77125ed3 --- thermal/aidl/Android.bp | 3 +++ thermal/aidl/vts/VtsHalThermalTargetTest.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/thermal/aidl/Android.bp b/thermal/aidl/Android.bp index efc763c388..9382b941b0 100644 --- a/thermal/aidl/Android.bp +++ b/thermal/aidl/Android.bp @@ -35,6 +35,9 @@ aidl_interface { java: { platform_apis: true, }, + rust: { + enabled: true, + }, }, versions_with_info: [ { diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp index 835fbfa85a..4b0eb655b5 100644 --- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp +++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp @@ -128,7 +128,8 @@ TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackTest) { ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); // Expect to fail with null callback status = mThermal->registerThermalChangedCallback(nullptr); - ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT + || status.getExceptionCode() == EX_NULL_POINTER); std::shared_ptr localThermalCallback = ndk::SharedRefBase::make(); // Expect to succeed with different callback @@ -139,7 +140,8 @@ TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackTest) { ASSERT_TRUE(status.isOk()) << status.getMessage(); // Expect to fail with null callback status = mThermal->unregisterThermalChangedCallback(nullptr); - ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT + || status.getExceptionCode() == EX_NULL_POINTER); } // Test Thermal->registerThermalChangedCallbackWithType. @@ -150,7 +152,8 @@ TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackWithTypeTest) { ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); // Expect to fail with null callback status = mThermal->registerThermalChangedCallbackWithType(nullptr, TemperatureType::SKIN); - ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT + || status.getExceptionCode() == EX_NULL_POINTER); std::shared_ptr localThermalCallback = ndk::SharedRefBase::make(); // Expect to succeed with different callback @@ -162,7 +165,8 @@ TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackWithTypeTest) { ASSERT_TRUE(status.isOk()) << status.getMessage(); // Expect to fail with null callback status = mThermal->unregisterThermalChangedCallback(nullptr); - ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); + ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT + || status.getExceptionCode() == EX_NULL_POINTER); } // Test Thermal->getCurrentTemperatures(). -- GitLab From db326d178686dd981dbb81804534b51502392ae2 Mon Sep 17 00:00:00 2001 From: Jin Chen Date: Wed, 28 Jun 2023 10:39:35 -0700 Subject: [PATCH 044/376] [uwb](hal) Add radar support * Adding radar session type, capabilities, oids, and app configs based on the Android UWB radar UCI spec v1.0. Test: Compile Bug: 237097302 Change-Id: Ia0b901859b38127db8532118f2427338fdf502a8 --- .../UwbVendorCapabilityTlvTypes.aidl | 39 ++++--- .../UwbVendorCapabilityTlvValues.aidl | 26 +++-- .../fira_android/UwbVendorGidAndroidOids.aidl | 9 +- .../uwb/fira_android/UwbVendorGids.aidl | 2 +- .../UwbVendorRadarAppConfigTlvTypes.aidl | 49 ++++++++ .../UwbVendorRadarAppConfigTlvValues.aidl | 38 ++++++ .../fira_android/UwbVendorReasonCodes.aidl | 6 +- .../UwbVendorSessionAppConfigTlvTypes.aidl | 24 ++-- .../UwbVendorSessionAppConfigTlvValues.aidl | 2 +- .../UwbVendorSessionInitSessionType.aidl | 3 +- .../fira_android/UwbVendorStatusCodes.aidl | 8 +- .../hardware/uwb/fira_android/README.md | 3 - .../UwbVendorCapabilityTlvTypes.aidl | 10 ++ .../UwbVendorCapabilityTlvValues.aidl | 6 + .../fira_android/UwbVendorGidAndroidOids.aidl | 11 ++ .../UwbVendorRadarAppConfigTlvTypes.aidl | 110 ++++++++++++++++++ .../UwbVendorRadarAppConfigTlvValues.aidl | 29 +++++ .../UwbVendorSessionInitSessionType.aidl | 1 + 18 files changed, 317 insertions(+), 59 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 25d704ecde..ff9c24752f 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -34,23 +34,24 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorCapabilityTlvTypes { - SUPPORTED_POWER_STATS_QUERY = 192, - CCC_SUPPORTED_CHAPS_PER_SLOT = 160, - CCC_SUPPORTED_SYNC_CODES = 161, - CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 162, - CCC_SUPPORTED_CHANNELS = 163, - CCC_SUPPORTED_VERSIONS = 164, - CCC_SUPPORTED_UWB_CONFIGS = 165, - CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166, - CCC_SUPPORTED_RAN_MULTIPLIER = 167, - CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 168, - CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 169, - SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227, - SUPPORTED_MIN_RANGING_INTERVAL_MS = 228, - SUPPORTED_RANGE_DATA_NTF_CONFIG = 229, - SUPPORTED_RSSI_REPORTING = 230, - SUPPORTED_DIAGNOSTICS = 231, - SUPPORTED_MIN_SLOT_DURATION_RSTU = 232, - SUPPORTED_MAX_RANGING_SESSION_NUMBER = 233, - SUPPORTED_CHANNELS_AOA = 234, + SUPPORTED_POWER_STATS_QUERY = 0xC0, + CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0, + CCC_SUPPORTED_SYNC_CODES = 0xA1, + CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2, + CCC_SUPPORTED_CHANNELS = 0xA3, + CCC_SUPPORTED_VERSIONS = 0xA4, + CCC_SUPPORTED_UWB_CONFIGS = 0xA5, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6, + CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7, + CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8, + CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + RADAR_SUPPORT = 0xB0, + SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3, + SUPPORTED_MIN_RANGING_INTERVAL_MS = 0xE4, + SUPPORTED_RANGE_DATA_NTF_CONFIG = 0xE5, + SUPPORTED_RSSI_REPORTING = 0xE6, + SUPPORTED_DIAGNOSTICS = 0xE7, + SUPPORTED_MIN_SLOT_DURATION_RSTU = 0xE8, + SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xE9, + SUPPORTED_CHANNELS_AOA = 0xEA, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 0e33f70221..702e5614ae 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -40,17 +40,19 @@ enum UwbVendorCapabilityTlvValues { PULSE_SHAPE_PRECURSOR_FREE = 1, PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2, CHAPS_PER_SLOT_3 = 1, - CHAPS_PER_SLOT_4 = 2, - CHAPS_PER_SLOT_6 = 4, - CHAPS_PER_SLOT_8 = 8, - CHAPS_PER_SLOT_9 = 16, - CHAPS_PER_SLOT_12 = 32, - CHAPS_PER_SLOT_24 = 64, - HOPPING_SEQUENCE_DEFAULT = 16, - HOPPING_SEQUENCE_AES = 8, - HOPPING_CONFIG_MODE_NONE = 128, - HOPPING_CONFIG_MODE_CONTINUOUS = 64, - HOPPING_CONFIG_MODE_ADAPTIVE = 32, + CHAPS_PER_SLOT_4 = (1 << 1) /* 2 */, + CHAPS_PER_SLOT_6 = (1 << 2) /* 4 */, + CHAPS_PER_SLOT_8 = (1 << 3) /* 8 */, + CHAPS_PER_SLOT_9 = (1 << 4) /* 16 */, + CHAPS_PER_SLOT_12 = (1 << 5) /* 32 */, + CHAPS_PER_SLOT_24 = (1 << 6) /* 64 */, + HOPPING_SEQUENCE_DEFAULT = (1 << 4) /* 16 */, + HOPPING_SEQUENCE_AES = (1 << 3) /* 8 */, + HOPPING_CONFIG_MODE_NONE = (1 << 7) /* 128 */, + HOPPING_CONFIG_MODE_CONTINUOUS = (1 << 6) /* 64 */, + HOPPING_CONFIG_MODE_ADAPTIVE = (1 << 5) /* 32 */, CCC_CHANNEL_5 = 1, - CCC_CHANNEL_9 = 2, + CCC_CHANNEL_9 = (1 << 1) /* 2 */, + RADAR_NOT_SUPPORTED = 0, + RADAR_SWEEP_SAMPLES_SUPPORTED = 1, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index fbcfbff667..34bc4ec6a8 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -34,7 +34,10 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorGidAndroidOids { - ANDROID_GET_POWER_STATS = 0, - ANDROID_SET_COUNTRY_CODE = 1, - ANDROID_RANGE_DIAGNOSTICS = 2, + ANDROID_GET_POWER_STATS = 0x0, + ANDROID_SET_COUNTRY_CODE = 0x1, + ANDROID_RANGE_DIAGNOSTICS = 0x2, + RADAR_SET_APP_CONFIG = 0x11, + RADAR_GET_APP_CONFIG = 0x12, + RADAR_DATA_NTF = 0x13, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl index 5515c67961..f02ed70a65 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl @@ -34,5 +34,5 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorGids { - ANDROID = 12, + ANDROID = 0xC, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl new file mode 100644 index 0000000000..760166c3a4 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorRadarAppConfigTlvTypes { + RADAR_TIMING_PARAMS = 0x0, + SAMPLES_PER_SWEEP = 0x1, + RADAR_CHANNEL_NUMBER = 0x2, + SWEEP_OFFSET = 0x3, + RADAR_RFRAME_CONFIG = 0x4, + RADAR_PREAMBLE_DURATION = 0x5, + RADAR_PREAMBLE_CODE_INDEX = 0x6, + RADAR_SESSION_PRIORITY = 0x7, + BITS_PER_SAMPLE = 0x8, + RADAR_PRF_MODE = 0x9, + NUMBER_OF_BURSTS = 0xA, + RADAR_DATA_TYPE = 0xB, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl new file mode 100644 index 0000000000..1eb2ce93a7 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorRadarAppConfigTlvValues { + RADAR_DATA_TYPE_RADAR_SWEEP_SAMPLES = 0x0, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl index a438cbe16a..db1e0db460 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl @@ -34,7 +34,7 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorReasonCodes { - REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 128, - REASON_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 129, - REASON_REGULATION_UWB_OFF = 130, + REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 0x80, + REASON_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x81, + REASON_REGULATION_UWB_OFF = 0x82, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index c3ac4019a2..d02cf4da1a 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -34,16 +34,16 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionAppConfigTlvTypes { - CCC_HOP_MODE_KEY = 160, - CCC_UWB_TIME0 = 161, - CCC_RANGING_PROTOCOL_VER = 163, - CCC_UWB_CONFIG_ID = 164, - CCC_PULSESHAPE_COMBO = 165, - CCC_URSK_TTL = 166, - CCC_LAST_INDEX_USED = 168, - NB_OF_RANGE_MEASUREMENTS = 227, - NB_OF_AZIMUTH_MEASUREMENTS = 228, - NB_OF_ELEVATION_MEASUREMENTS = 229, - ENABLE_DIAGNOSTICS = 232, - DIAGRAMS_FRAME_REPORTS_FIELDS = 233, + CCC_HOP_MODE_KEY = 0xA0, + CCC_UWB_TIME0 = 0xA1, + CCC_RANGING_PROTOCOL_VER = 0xA3, + CCC_UWB_CONFIG_ID = 0xA4, + CCC_PULSESHAPE_COMBO = 0xA5, + CCC_URSK_TTL = 0xA6, + CCC_LAST_INDEX_USED = 0xA8, + NB_OF_RANGE_MEASUREMENTS = 0xE3, + NB_OF_AZIMUTH_MEASUREMENTS = 0xE4, + NB_OF_ELEVATION_MEASUREMENTS = 0xE5, + ENABLE_DIAGNOSTICS = 0xE8, + DIAGRAMS_FRAME_REPORTS_FIELDS = 0xE9, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl index a7f487bcd2..5216e1f135 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl @@ -34,5 +34,5 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionAppConfigTlvValues { - AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 240, + AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xF0, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl index 30a0a1b98f..bf968bda7f 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl @@ -34,5 +34,6 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionInitSessionType { - CCC = 160, + CCC = 0xA0, + RADAR = 0xA1, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl index 28cf7fe1f3..52f13505ab 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl @@ -34,8 +34,8 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorStatusCodes { - STATUS_ERROR_CCC_SE_BUSY = 80, - STATUS_ERROR_CCC_LIFECYCLE = 81, - STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 82, - STATUS_REGULATION_UWB_OFF = 83, + STATUS_ERROR_CCC_SE_BUSY = 0x50, + STATUS_ERROR_CCC_LIFECYCLE = 0x51, + STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x52, + STATUS_REGULATION_UWB_OFF = 0x53, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/README.md b/uwb/aidl/android/hardware/uwb/fira_android/README.md index e658d934aa..7912bbc311 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/README.md +++ b/uwb/aidl/android/hardware/uwb/fira_android/README.md @@ -10,6 +10,3 @@ These include: All other interactions sent/received over the HAL interface is expected to comply with the UCI specification that can be found [here]( https://groups.firaconsortium.org/wg/Technical/document/folder/127). - -TODO([b/196004116](b/196004116)): Link to the published specification. - diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 22b7bfeedf..ceef1befee 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -149,6 +149,16 @@ enum UwbVendorCapabilityTlvTypes { */ CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + /********************************************* + * RADAR specific + ********************************************/ + /** + * 1 byte bitmask to indicate the supported Radar data types. + * Each "1" in this bitmap corresponds to a specific radar data type where: + * 0x01 = "Radar Sweep Samples", + */ + RADAR_SUPPORT = 0xB0, + /********************************************* * FIRA specific ********************************************/ diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 7c86b79327..6ef52fe5ec 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -51,4 +51,10 @@ enum UwbVendorCapabilityTlvValues { CCC_CHANNEL_5 = 1, CCC_CHANNEL_9 = 1 << 1, + + /********************************************* + * RADAR specific + ********************************************/ + RADAR_NOT_SUPPORTED = 0, + RADAR_SWEEP_SAMPLES_SUPPORTED = 1, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index 4768f550b8..203b940ccc 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -37,4 +37,15 @@ enum UwbVendorGidAndroidOids { // Supported only if the UwbVendorCapabilityTlvTypes.SUPPORTED_DIAGNOSTICS set // to 1. ANDROID_RANGE_DIAGNOSTICS = 0x2, + + /********************************************* + * Range 0x10 - 0x1F reserved for RADAR specific + * Supported only if the UwbVendorCapabilityTlvTypes.RADAR_SUPPORT is not 0x00. + ********************************************/ + // Used to set application configurations for radar session. + RADAR_SET_APP_CONFIG = 0x11, + // Used to get application configurations for radar session. + RADAR_GET_APP_CONFIG = 0x12, + // Used to report radar data for certain radar data types. + RADAR_DATA_NTF = 0x13, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl new file mode 100644 index 0000000000..a5ea688790 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific radar app params set/expected in UCI command: + * GID: 1100b (Android specific Group) + * OID: 010001b (RADAR_SET_APP_CONFIG_CMD) + * OID: 010010b (RADAR_GET_APP_CONFIG_CMD) + */ +@VintfStability +@Backing(type="int") +enum UwbVendorRadarAppConfigTlvTypes { + /** + * 7 byte data + * Radar frame timing parameters: + * Octet [3:0] - BURST_PERIOD + * Duration between the start of two consecutive Radar bursts in ms. + * Octet [5:4] - SWEEP_PERIOD + * Duration between the start times of two consecutive Radar sweeps in + * RSTU. + * Octet [6] - SWEEPS_PER_BURST + * Number of Radar sweeps within the Radar burst. + */ + RADAR_TIMING_PARAMS = 0x0, + /** + * 1 byte data + * The number of samples captured for each radar sweep. (default = 64) + */ + SAMPLES_PER_SWEEP = 0x1, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 9) + */ + RADAR_CHANNEL_NUMBER = 0x2, + /** + * 2 byte data + * Defines the start offset with respect to 0cm distance to limit the sweep + * range. Signed value and unit in samples. + * (default = 0) + */ + SWEEP_OFFSET = 0x3, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 0x0) + */ + RADAR_RFRAME_CONFIG = 0x4, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config, but extended to 0xA. + * (default = 0x2 : 128 symbols) + */ + RADAR_PREAMBLE_DURATION = 0x5, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config, but extended to 127. + * (default = 25) + */ + RADAR_PREAMBLE_CODE_INDEX = 0x6, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 50) + */ + RADAR_SESSION_PRIORITY = 0x7, + /** + * 1 byte data + * Bits per sample in the radar sweep. + * 0x00 = 32 bits per sample (default) + * 0x01 = 48 bits per sample + * 0x02 = 64 bits per sample + */ + BITS_PER_SAMPLE = 0x8, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 0x1) + */ + RADAR_PRF_MODE = 0x9, + /** + * 2 byte data + * Maximum number of Radar bursts to be executed in the session. The + * session is stopped and moved to SESSION_STATE_IDLE Session State when + * configured radar bursts are elapsed. + * 0x00 = Unlimited (default) + */ + NUMBER_OF_BURSTS = 0xA, + /** + * 2 byte data + * Type of radar data to be reported. + * 0x00: Radar Sweep Samples. Reported in RADAR_DATA_NTF. (default) + */ + RADAR_DATA_TYPE = 0xB, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl new file mode 100644 index 0000000000..81c0a4d936 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific radar app config values set/expected in UCI command: + * GID: 1100b (Android specific Group) + * OID: 010001b (RADAR_SET_APP_CONFIG_CMD) + * OID: 010010b (RADAR_GET_APP_CONFIG_CMD) + */ +@VintfStability +@Backing(type="int") +enum UwbVendorRadarAppConfigTlvValues { + RADAR_DATA_TYPE_RADAR_SWEEP_SAMPLES = 0x0, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl index 1e2c817d84..d3df67216b 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl @@ -29,4 +29,5 @@ package android.hardware.uwb.fira_android; enum UwbVendorSessionInitSessionType { /** Added in vendor version 0. */ CCC = 0xA0, + RADAR = 0xA1, } -- GitLab From 51b5c77534e05059079f12db41fec3d0a82e7734 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 21 Jun 2023 12:31:30 -0700 Subject: [PATCH 045/376] Move flaky HIDL VHAL impl test to post submit. The tests is flaky by nature because it depends on timer. Although the flakiness is low, it is too flaky to run as presubmit. Test: atest -s emulator-5554 DefaultVhalImplTest Bug: 288197123 Change-Id: I735e3e6197769e47372f025d7eb82d54159a8ff8 --- automotive/vehicle/2.0/default/TEST_MAPPING | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/2.0/default/TEST_MAPPING b/automotive/vehicle/2.0/default/TEST_MAPPING index bb58700f62..63ea3d595b 100644 --- a/automotive/vehicle/2.0/default/TEST_MAPPING +++ b/automotive/vehicle/2.0/default/TEST_MAPPING @@ -2,7 +2,9 @@ "presubmit": [ { "name": "android.hardware.automotive.vehicle@2.0-manager-unit-tests" - }, + } + ], + "postsubmit": [ { "name": "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests" } -- GitLab From 405a4c2247681590ebb53e6a2a8060560db0c080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= Date: Thu, 8 Jun 2023 11:51:54 +0100 Subject: [PATCH 046/376] TEST_MAPPING: enable vts hal sensors tests in kernel-presubmit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable the following tests: * VtsAidlHalSensorsTargetTest * VtsHalSensorsV2_1TargetTest Bug: 284307085 Bug: 258819618 Test: atest :kernel-presubmit Change-Id: Ie07fee7d40e7d6c388a4a92ae60981d87280e656 Signed-off-by: André Draszik --- sensors/2.1/vts/functional/TEST_MAPPING | 12 ++++++++++++ sensors/aidl/TEST_MAPPING | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sensors/2.1/vts/functional/TEST_MAPPING create mode 100644 sensors/aidl/TEST_MAPPING diff --git a/sensors/2.1/vts/functional/TEST_MAPPING b/sensors/2.1/vts/functional/TEST_MAPPING new file mode 100644 index 0000000000..0129f3996b --- /dev/null +++ b/sensors/2.1/vts/functional/TEST_MAPPING @@ -0,0 +1,12 @@ +{ + "presubmit": [ + { + "name": "VtsHalSensorsV2_1TargetTest" + } + ], + "kernel-presubmit": [ + { + "name": "VtsHalSensorsV2_1TargetTest" + } + ] +} diff --git a/sensors/aidl/TEST_MAPPING b/sensors/aidl/TEST_MAPPING new file mode 100644 index 0000000000..6de4549f9c --- /dev/null +++ b/sensors/aidl/TEST_MAPPING @@ -0,0 +1,12 @@ +{ + "presubmit": [ + { + "name": "VtsAidlHalSensorsTargetTest" + } + ], + "kernel-presubmit": [ + { + "name": "VtsAidlHalSensorsTargetTest" + } + ] +} -- GitLab From ddac81ced09a632436d030c05e63c5d7c8e0c3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= Date: Thu, 8 Jun 2023 17:57:35 +0100 Subject: [PATCH 047/376] VtsAidlHalSensorsTargetTest: change test file push location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upload files to /data/local/tests/unrestricted instead to improve data collection in the event of a crash. Bug: 284307085 Bug: 258819618 Bug: 199904562 Test: atest :kernel-presubmit Change-Id: Id4f73972910525dc4de6c19755d19a38092ae03b Signed-off-by: André Draszik --- sensors/aidl/vts/AndroidTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sensors/aidl/vts/AndroidTest.xml b/sensors/aidl/vts/AndroidTest.xml index 99caf28422..2d3382e5a5 100644 --- a/sensors/aidl/vts/AndroidTest.xml +++ b/sensors/aidl/vts/AndroidTest.xml @@ -22,13 +22,13 @@ -- GitLab From 65e4f77e74c21c806fc95ca26426e941836de933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= Date: Thu, 8 Jun 2023 17:57:35 +0100 Subject: [PATCH 048/376] VtsHalSensorsV2_1TargetTest: change test file push location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upload files to /data/local/tests/unrestricted instead to improve data collection in the event of a crash. Bug: 284307085 Bug: 258819618 Bug: 199904562 Test: atest :kernel-presubmit Change-Id: I14b8bdeec300e94c7796e8dfe644b644b4d96ba3 Signed-off-by: André Draszik --- sensors/2.1/vts/functional/AndroidTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sensors/2.1/vts/functional/AndroidTest.xml b/sensors/2.1/vts/functional/AndroidTest.xml index 2ef8dc63f0..2d21c7f31a 100644 --- a/sensors/2.1/vts/functional/AndroidTest.xml +++ b/sensors/2.1/vts/functional/AndroidTest.xml @@ -22,13 +22,13 @@ -- GitLab From 8787afa9e6e774112439ae50d09150a881cdd5a9 Mon Sep 17 00:00:00 2001 From: Lei Ju Date: Wed, 28 Jun 2023 09:36:19 -0700 Subject: [PATCH 049/376] Introduce a new callback function to get client's UUID Bug: 247124878 Test: compilation and manual test Change-Id: I96b386fc232c4f65615858cf9b65317ae5bdc499 --- .../compatibility_matrix.9.xml | 2 +- contexthub/aidl/Android.bp | 2 +- .../contexthub/IContextHubCallback.aidl | 1 + .../contexthub/IContextHubCallback.aidl | 8 ++++++++ contexthub/aidl/default/Android.bp | 4 ++-- .../aidl/default/contexthub-default.xml | 2 +- contexthub/aidl/vts/Android.bp | 2 +- .../vts/VtsAidlHalContextHubTargetTest.cpp | 19 +++++++++++++++++++ 8 files changed, 34 insertions(+), 6 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 0c6ae7b1ab..29d62591f1 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -185,7 +185,7 @@ android.hardware.contexthub - 2 + 3 IContextHub default diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp index a0315d0b30..cf10529ba1 100644 --- a/contexthub/aidl/Android.bp +++ b/contexthub/aidl/Android.bp @@ -49,6 +49,6 @@ aidl_interface { }, ], - frozen: true, + frozen: false, } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl index 6163cfc662..d0099ffedb 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl @@ -39,5 +39,6 @@ interface IContextHubCallback { void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); void handleTransactionResult(in int transactionId, in boolean success); void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); + byte[16] getUuid(); const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; } diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl index bfcb51e589..41fb266d9b 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl @@ -90,6 +90,14 @@ interface IContextHubCallback { */ void handleNanSessionRequest(in NanSessionRequest request); + /** + * This callback is passed to the HAL implementation to allow the HAL to request a UUID that + * uniquely identifies an IContextHubCallback. + * + * @return a byte array representating the UUID + */ + byte[16] getUuid(); + /** * Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the * Contexthub service must respond. diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp index 6ee7407de8..74bac699eb 100644 --- a/contexthub/aidl/default/Android.bp +++ b/contexthub/aidl/default/Android.bp @@ -29,7 +29,7 @@ cc_library_static { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.contexthub-V2-ndk", + "android.hardware.contexthub-V3-ndk", ], export_include_dirs: ["include"], srcs: [ @@ -50,7 +50,7 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.contexthub-V2-ndk", + "android.hardware.contexthub-V3-ndk", ], static_libs: [ "libcontexthubexampleimpl", diff --git a/contexthub/aidl/default/contexthub-default.xml b/contexthub/aidl/default/contexthub-default.xml index 930f672197..2f8ddc8e1b 100644 --- a/contexthub/aidl/default/contexthub-default.xml +++ b/contexthub/aidl/default/contexthub-default.xml @@ -1,7 +1,7 @@ android.hardware.contexthub - 2 + 3 IContextHub default diff --git a/contexthub/aidl/vts/Android.bp b/contexthub/aidl/vts/Android.bp index 1534b40876..b166bafe26 100644 --- a/contexthub/aidl/vts/Android.bp +++ b/contexthub/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.contexthub-V2-cpp", + "android.hardware.contexthub-V3-cpp", "VtsHalContexthubUtils", ], test_suites: [ diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index c1cc07cf51..e780857f24 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -48,6 +48,10 @@ using ::android::hardware::contexthub::Setting; using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; +// 6612b522-b717-41c8-b48d-c0b1cc64e142 +const std::array kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, + 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42}; + class ContextHubAidl : public testing::TestWithParam> { public: virtual void SetUp() override { @@ -126,6 +130,11 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH Status handleNanSessionRequest(const NanSessionRequest& /* request */) override { return Status::ok(); } + + Status getUuid(std::array* out_uuid) override { + *out_uuid = kUuid; + return Status::ok(); + } }; TEST_P(ContextHubAidl, TestRegisterCallback) { @@ -157,6 +166,11 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } + Status getUuid(std::array* out_uuid) override { + *out_uuid = kUuid; + return Status::ok(); + } + std::promise> promise; }; @@ -223,6 +237,11 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } + Status getUuid(std::array* out_uuid) override { + *out_uuid = kUuid; + return Status::ok(); + } + uint32_t expectedTransactionId = 0; std::promise promise; }; -- GitLab From 76aaef448fcd9458b07b1d78ea4b79165af0cde0 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 29 Jun 2023 18:33:04 -0700 Subject: [PATCH 050/376] Fix a type conversion bug. Convert int64_t to long on x86 platform loses info. Test: atest FakeVehicleHardwareTest on cf_gwear_x86. Bug: 288376096 Change-Id: I8826e2c0ba6c3e26af858a1d8f1388b75d537082 --- .../fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h | 2 +- .../fake_impl/GeneratorHub/src/LinearFakeValueGenerator.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h index d2b701d9a5..2378676387 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/include/LinearFakeValueGenerator.h @@ -57,7 +57,7 @@ class LinearFakeValueGenerator : public FakeValueGenerator { float dispersion; // Defines minimum and maximum value based on initial value. float increment; // Value that we will be added to currentValue with each timer tick. int64_t interval; - long lastEventTimestamp; + int64_t lastEventTimestamp; }; GeneratorCfg mGenCfg; diff --git a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/LinearFakeValueGenerator.cpp b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/LinearFakeValueGenerator.cpp index 91331443bb..fe08dcf335 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/LinearFakeValueGenerator.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/GeneratorHub/src/LinearFakeValueGenerator.cpp @@ -86,7 +86,7 @@ std::optional LinearFakeValueGenerator::nextEvent() { if (mGenCfg.lastEventTimestamp == 0) { mGenCfg.lastEventTimestamp = elapsedRealtimeNano(); } else { - long nextEventTime = mGenCfg.lastEventTimestamp + mGenCfg.interval; + int64_t nextEventTime = mGenCfg.lastEventTimestamp + mGenCfg.interval; // Prevent overflow. assert(nextEventTime > mGenCfg.lastEventTimestamp); mGenCfg.lastEventTimestamp = nextEventTime; -- GitLab From 76d7fbf6a1eac23361510301c0bb8e2f857c66de Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 5 Jul 2023 17:15:12 -0700 Subject: [PATCH 051/376] Fix flaky recurrent timer test. Do not rely on sleep in tests, but wait for the events to happen before timeout. Set the timeout to be large enough (5s) so that the tests are more stable. Test: atest RecurrentTimerTest Bug: 289759453 Change-Id: Iff271ca440426871ed3a798bab50b9532f9256f0 --- .../utils/common/test/RecurrentTimerTest.cpp | 62 ++++++++++++------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp index 141efc135b..62046f38dc 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -28,6 +29,8 @@ namespace hardware { namespace automotive { namespace vehicle { +using ::android::base::ScopedLockAssertion; + class RecurrentTimerTest : public testing::Test { public: std::shared_ptr getCallback(size_t token) { @@ -35,6 +38,15 @@ class RecurrentTimerTest : public testing::Test { std::scoped_lock lockGuard(mLock); mCallbacks.push_back(token); + mCond.notify_all(); + }); + } + + bool waitForCalledCallbacks(size_t count, size_t timeoutInMs) { + std::unique_lock uniqueLock(mLock); + return mCond.wait_for(uniqueLock, std::chrono::milliseconds(timeoutInMs), [this, count] { + ScopedLockAssertion lockAssertion(mLock); + return mCallbacks.size() >= count; }); } @@ -54,6 +66,7 @@ class RecurrentTimerTest : public testing::Test { } private: + std::condition_variable mCond; std::mutex mLock; std::vector mCallbacks GUARDED_BY(mLock); }; @@ -66,12 +79,11 @@ TEST_F(RecurrentTimerTest, testRegisterCallback) { auto action = getCallback(0); timer.registerTimerCallback(interval, action); - std::this_thread::sleep_for(std::chrono::seconds(1)); + // Should only takes 1s, use 5s as timeout to be safe. + ASSERT_TRUE(waitForCalledCallbacks(/* count= */ 10u, /* timeoutInMs= */ 5000)) + << "Not enough callbacks called before timeout"; timer.unregisterTimerCallback(action); - - // Theoretically trigger 10 times, but check for at least 9 times to be stable. - ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); } TEST_F(RecurrentTimerTest, testRegisterUnregisterRegister) { @@ -92,10 +104,11 @@ TEST_F(RecurrentTimerTest, testRegisterUnregisterRegister) { timer.registerTimerCallback(interval, action); - std::this_thread::sleep_for(std::chrono::seconds(1)); + // Should only takes 1s, use 5s as timeout to be safe. + ASSERT_TRUE(waitForCalledCallbacks(/* count= */ 10u, /* timeoutInMs= */ 5000)) + << "Not enough callbacks called before timeout"; - // Theoretically trigger 10 times, but check for at least 9 times to be stable. - ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); + timer.unregisterTimerCallback(action); } TEST_F(RecurrentTimerTest, testDestroyTimerWithCallback) { @@ -114,7 +127,9 @@ TEST_F(RecurrentTimerTest, testDestroyTimerWithCallback) { std::this_thread::sleep_for(std::chrono::milliseconds(200)); - ASSERT_TRUE(getCalledCallbacks().empty()); + // Should be 0, but in rare cases there might be 1 events in the queue while the timer is + // being destroyed. + ASSERT_LE(getCalledCallbacks().size(), 1u); } TEST_F(RecurrentTimerTest, testRegisterMultipleCallbacks) { @@ -132,7 +147,11 @@ TEST_F(RecurrentTimerTest, testRegisterMultipleCallbacks) { auto action3 = getCallback(3); timer.registerTimerCallback(interval3, action3); - std::this_thread::sleep_for(std::chrono::seconds(1)); + // In 1s, we should generate 10 + 20 + 33 = 63 events. + // Here we are waiting for more events to make sure we receive enough events for each actions. + // Use 5s as timeout to be safe. + ASSERT_TRUE(waitForCalledCallbacks(/* count= */ 70u, /* timeoutInMs= */ 5000)) + << "Not enough callbacks called before timeout"; timer.unregisterTimerCallback(action1); timer.unregisterTimerCallback(action2); @@ -152,20 +171,18 @@ TEST_F(RecurrentTimerTest, testRegisterMultipleCallbacks) { action3Count++; } } - // Theoretically trigger 10 times, but check for at least 9 times to be stable. - ASSERT_GE(action1Count, static_cast(9)); - // Theoretically trigger 20 times, but check for at least 15 times to be stable. - ASSERT_GE(action2Count, static_cast(15)); - // Theoretically trigger 33 times, but check for at least 25 times to be stable. - ASSERT_GE(action3Count, static_cast(25)); + + ASSERT_GE(action1Count, static_cast(10)); + ASSERT_GE(action2Count, static_cast(20)); + ASSERT_GE(action3Count, static_cast(33)); } TEST_F(RecurrentTimerTest, testRegisterSameCallbackMultipleTimes) { RecurrentTimer timer; - // 0.02s - int64_t interval1 = 20000000; - // 0.01s - int64_t interval2 = 10000000; + // 0.2s + int64_t interval1 = 200'000'000; + // 0.1s + int64_t interval2 = 100'000'000; auto action = getCallback(0); for (int i = 0; i < 10; i++) { @@ -175,10 +192,9 @@ TEST_F(RecurrentTimerTest, testRegisterSameCallbackMultipleTimes) { clearCalledCallbacks(); - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - - // Theoretically trigger 10 times, but check for at least 9 times to be stable. - ASSERT_GE(getCalledCallbacks().size(), static_cast(9)); + // Should only takes 1s, use 5s as timeout to be safe. + ASSERT_TRUE(waitForCalledCallbacks(/* count= */ 10u, /* timeoutInMs= */ 5000)) + << "Not enough callbacks called before timeout"; timer.unregisterTimerCallback(action); -- GitLab From dcd2ae7c29a3d118595afb10114ce85363eacf36 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Thu, 6 Jul 2023 15:43:00 +0900 Subject: [PATCH 052/376] Allow face HAL to be updated via apex in U Bug: 290142180 Test: m check-vintf-all (with -next- pixel targets) Change-Id: Ia3b15f669219a0941498b90a76b42d5f2f5ac80b --- compatibility_matrices/compatibility_matrix.8.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 6dc7f5a4c9..bb908f3599 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -114,7 +114,7 @@ default - + android.hardware.biometrics.face 3 -- GitLab From 7b1448edcfd3f88365932e2d94659952444aae2b Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 23 Jun 2023 17:43:17 -0700 Subject: [PATCH 053/376] Pass property set error to subscribed clients. Pass the async property set error generated by VehicleHardware layer to subscribed clients Test: atest DefaultVehicleHalTest Bug: 286384730 Change-Id: Iadd92e1c0c741ad6450a0508fe9e6301bdfe66c5 --- .../hardware/src/FakeVehicleHardware.cpp | 1 + .../aidl/impl/vhal/include/ConnectedClient.h | 8 ++- .../impl/vhal/include/DefaultVehicleHal.h | 6 +- .../impl/vhal/include/SubscriptionManager.h | 6 ++ .../aidl/impl/vhal/src/ConnectedClient.cpp | 31 +++++++++- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 37 +++++++++--- .../impl/vhal/src/SubscriptionManager.cpp | 27 +++++++++ .../impl/vhal/test/DefaultVehicleHalTest.cpp | 58 +++++++++++++++++++ .../impl/vhal/test/MockVehicleCallback.cpp | 20 ++++++- .../aidl/impl/vhal/test/MockVehicleCallback.h | 5 ++ .../impl/vhal/test/MockVehicleHardware.cpp | 11 +++- .../aidl/impl/vhal/test/MockVehicleHardware.h | 2 + 12 files changed, 198 insertions(+), 14 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 94e4ef713e..4934771363 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -1833,6 +1833,7 @@ void FakeVehicleHardware::registerOnPropertyChangeEvent( void FakeVehicleHardware::registerOnPropertySetErrorEvent( std::unique_ptr callback) { + // In FakeVehicleHardware, we will never use mOnPropertySetErrorCallback. if (mOnPropertySetErrorCallback != nullptr) { ALOGE("registerOnPropertySetErrorEvent must only be called once"); return; diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index 2e7298ff0b..b3f4a0f722 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -107,12 +107,18 @@ class SubscriptionClient final : public ConnectedClient { // Gets the callback to be called when the request for this client has finished. std::shared_ptr getResultCallback(); - // Marshals the updated values into largeParcelable and sents it through {@code onPropertyEvent} + // Marshals the updated values into largeParcelable and sends it through {@code onPropertyEvent} // callback. static void sendUpdatedValues( CallbackType callback, std::vector&& updatedValues); + // Marshals the set property error events into largeParcelable and sends it through + // {@code onPropertySetError} callback. + static void sendPropertySetErrors( + CallbackType callback, + std::vector&& + vehiclePropErrors); protected: // Gets the callback to be called when the request for this client has timeout. diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 2c2cf1a5bd..74ad7eaf3e 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -249,10 +249,14 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi const CallbackType& callback, std::shared_ptr pendingRequestPool); static void onPropertyChangeEvent( - std::weak_ptr subscriptionManager, + const std::weak_ptr& subscriptionManager, const std::vector& updatedValues); + static void onPropertySetErrorEvent( + const std::weak_ptr& subscriptionManager, + const std::vector& errorEvents); + static void checkHealth(IVehicleHardware* hardware, std::weak_ptr subscriptionManager); diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index 14799d9f84..301d56c270 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -99,6 +99,12 @@ class SubscriptionManager final { const std::vector& updatedValues); + // For a list of set property error events, returns a map that maps clients subscribing to the + // properties to a list of errors for each client. + std::unordered_map> + getSubscribedClientsForErrorEvents(const std::vector& errorEvents); + // Checks whether the sample rate is valid. static bool checkSampleRateHz(float sampleRateHz); diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index 81d231c87f..fb23a25047 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -38,6 +38,8 @@ using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::android::base::Result; @@ -300,7 +302,34 @@ void SubscriptionClient::sendUpdatedValues(std::shared_ptr cal if (ScopedAStatus callbackStatus = callback->onPropertyEvent(vehiclePropValues, sharedMemoryFileCount); !callbackStatus.isOk()) { - ALOGE("subscribe: failed to call UpdateValues callback, client ID: %p, error: %s, " + ALOGE("subscribe: failed to call onPropertyEvent callback, client ID: %p, error: %s, " + "exception: %d, service specific error: %d", + callback->asBinder().get(), callbackStatus.getMessage(), + callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); + } +} + +void SubscriptionClient::sendPropertySetErrors(std::shared_ptr callback, + std::vector&& vehiclePropErrors) { + if (vehiclePropErrors.empty()) { + return; + } + + VehiclePropErrors vehiclePropErrorsLargeParcelable; + ScopedAStatus status = vectorToStableLargeParcelable(std::move(vehiclePropErrors), + &vehiclePropErrorsLargeParcelable); + if (!status.isOk()) { + int statusCode = status.getServiceSpecificError(); + ALOGE("subscribe: failed to marshal result into large parcelable, error: " + "%s, code: %d", + status.getMessage(), statusCode); + return; + } + + if (ScopedAStatus callbackStatus = + callback->onPropertySetError(vehiclePropErrorsLargeParcelable); + !callbackStatus.isOk()) { + ALOGE("subscribe: failed to call onPropertySetError callback, client ID: %p, error: %s, " "exception: %d, service specific error: %d", callback->asBinder().get(), callbackStatus.getMessage(), callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError()); diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 98cfc398af..0d5c070c54 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -144,6 +144,11 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr vehicleHa [subscriptionManagerCopy](std::vector updatedValues) { onPropertyChangeEvent(subscriptionManagerCopy, updatedValues); })); + mVehicleHardware->registerOnPropertySetErrorEvent( + std::make_unique( + [subscriptionManagerCopy](std::vector errorEvents) { + onPropertySetErrorEvent(subscriptionManagerCopy, errorEvents); + })); // Register heartbeat event. mRecurrentAction = std::make_shared>( @@ -177,7 +182,7 @@ DefaultVehicleHal::~DefaultVehicleHal() { } void DefaultVehicleHal::onPropertyChangeEvent( - std::weak_ptr subscriptionManager, + const std::weak_ptr& subscriptionManager, const std::vector& updatedValues) { auto manager = subscriptionManager.lock(); if (manager == nullptr) { @@ -194,6 +199,20 @@ void DefaultVehicleHal::onPropertyChangeEvent( } } +void DefaultVehicleHal::onPropertySetErrorEvent( + const std::weak_ptr& subscriptionManager, + const std::vector& errorEvents) { + auto manager = subscriptionManager.lock(); + if (manager == nullptr) { + ALOGW("the SubscriptionManager is destroyed, DefaultVehicleHal is ending"); + return; + } + auto vehiclePropErrorsByClient = manager->getSubscribedClientsForErrorEvents(errorEvents); + for (auto& [callback, vehiclePropErrors] : vehiclePropErrorsByClient) { + SubscriptionClient::sendPropertySetErrors(callback, std::move(vehiclePropErrors)); + } +} + template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, @@ -692,15 +711,19 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, // Create a new SubscriptionClient if there isn't an existing one. mSubscriptionClients->maybeAddClient(callback); - // Since we have already check the sample rates, the following functions must succeed. if (!onChangeSubscriptions.empty()) { - return toScopedAStatus(mSubscriptionManager->subscribe(callback, onChangeSubscriptions, - /*isContinuousProperty=*/false)); + auto result = mSubscriptionManager->subscribe(callback, onChangeSubscriptions, + /*isContinuousProperty=*/false); + if (!result.ok()) { + return toScopedAStatus(result); + } } if (!continuousSubscriptions.empty()) { - return toScopedAStatus(mSubscriptionManager->subscribe(callback, - continuousSubscriptions, - /*isContinuousProperty=*/true)); + auto result = mSubscriptionManager->subscribe(callback, continuousSubscriptions, + /*isContinuousProperty=*/true); + if (!result.ok()) { + return toScopedAStatus(result); + } } } return ScopedAStatus::ok(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index bba730f6f4..1f2690e340 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -36,6 +36,7 @@ constexpr float ONE_SECOND_IN_NANO = 1'000'000'000.; using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::android::base::Error; using ::android::base::Result; @@ -269,6 +270,32 @@ SubscriptionManager::getSubscribedClients(const std::vector& u return clients; } +std::unordered_map, std::vector> +SubscriptionManager::getSubscribedClientsForErrorEvents( + const std::vector& errorEvents) { + std::scoped_lock lockGuard(mLock); + std::unordered_map, std::vector> clients; + + for (const auto& errorEvent : errorEvents) { + PropIdAreaId propIdAreaId{ + .propId = errorEvent.propId, + .areaId = errorEvent.areaId, + }; + if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { + continue; + } + + for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) { + clients[client].push_back({ + .propId = errorEvent.propId, + .areaId = errorEvent.areaId, + .errorCode = errorEvent.errorCode, + }); + } + } + return clients; +} + bool SubscriptionManager::isEmpty() { std::scoped_lock lockGuard(mLock); return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty(); diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 05e569ab8a..96b71f0af0 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -62,6 +62,7 @@ using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropError; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; @@ -1653,6 +1654,63 @@ TEST_F(DefaultVehicleHalTest, testDumpCallerShouldNotDump) { ASSERT_EQ(msg.find("Vehicle HAL State: "), std::string::npos); } +TEST_F(DefaultVehicleHalTest, testOnPropertySetErrorEvent) { + std::vector options = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + .areaIds = {0}, + }, + { + .propId = GLOBAL_CONTINUOUS_PROP, + .areaIds = {0}, + .sampleRate = 1, + }, + }; + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + std::vector errorEvents = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + .areaId = 0, + .errorCode = StatusCode::INTERNAL_ERROR, + }, + { + .propId = GLOBAL_ON_CHANGE_PROP, + .areaId = 0, + .errorCode = StatusCode::ACCESS_DENIED, + }, + { + .propId = GLOBAL_CONTINUOUS_PROP, + .areaId = 0, + .errorCode = StatusCode::INVALID_ARG, + }, + }; + std::vector expectedResults = { + { + .propId = GLOBAL_ON_CHANGE_PROP, + .areaId = 0, + .errorCode = StatusCode::INTERNAL_ERROR, + }, + { + .propId = GLOBAL_ON_CHANGE_PROP, + .areaId = 0, + .errorCode = StatusCode::ACCESS_DENIED, + }, + { + .propId = GLOBAL_CONTINUOUS_PROP, + .areaId = 0, + .errorCode = StatusCode::INVALID_ARG, + }, + }; + getHardware()->sendOnPropertySetErrorEvent(errorEvents); + + ASSERT_EQ(getCallback()->countOnPropertySetErrorResults(), 1u); + auto maybeVehiclePropErrors = getCallback()->nextOnPropertySetErrorResults(); + ASSERT_TRUE(maybeVehiclePropErrors.has_value()); + const auto& vehiclePropErrors = maybeVehiclePropErrors.value(); + ASSERT_THAT(vehiclePropErrors.payloads, UnorderedElementsAreArray(expectedResults)); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp index f51ce5cb39..54fede1f3d 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp @@ -81,8 +81,14 @@ ScopedAStatus MockVehicleCallback::onPropertyEvent(const VehiclePropValues& resu return result; } -ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors&) { - return ScopedAStatus::ok(); +ScopedAStatus MockVehicleCallback::onPropertySetError(const VehiclePropErrors& results) { + ScopedAStatus result; + { + std::scoped_lock lockGuard(mLock); + result = storeResults(results, &mOnPropertySetErrorResults); + } + mCond.notify_all(); + return result; } std::optional MockVehicleCallback::nextGetValueResults() { @@ -105,6 +111,16 @@ size_t MockVehicleCallback::countOnPropertyEventResults() { return mOnPropertyEventResults.size(); } +std::optional MockVehicleCallback::nextOnPropertySetErrorResults() { + std::scoped_lock lockGuard(mLock); + return pop(mOnPropertySetErrorResults); +} + +size_t MockVehicleCallback::countOnPropertySetErrorResults() { + std::scoped_lock lockGuard(mLock); + return mOnPropertySetErrorResults.size(); +} + bool MockVehicleCallback::waitForSetValueResults(size_t size, size_t timeoutInNano) { std::unique_lock lk(mLock); return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] { diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h index f17b273b18..1545eae08f 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h @@ -63,6 +63,9 @@ class MockVehicleCallback final nextSetValueResults(); std::optional nextOnPropertyEventResults(); + size_t countOnPropertySetErrorResults(); + std::optional + nextOnPropertySetErrorResults(); size_t countOnPropertyEventResults(); bool waitForSetValueResults(size_t size, size_t timeoutInNano); bool waitForGetValueResults(size_t size, size_t timeoutInNano); @@ -77,6 +80,8 @@ class MockVehicleCallback final std::list mOnPropertyEventResults GUARDED_BY(mLock); int32_t mSharedMemoryFileCount GUARDED_BY(mLock); + std::list + mOnPropertySetErrorResults GUARDED_BY(mLock); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index 4df4e1aea5..ba0d33dfde 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -131,8 +131,9 @@ void MockVehicleHardware::registerOnPropertyChangeEvent( } void MockVehicleHardware::registerOnPropertySetErrorEvent( - std::unique_ptr) { - // TODO(b/200737967): mock this. + std::unique_ptr callback) { + std::scoped_lock lockGuard(mLock); + mPropertySetErrorCallback = std::move(callback); } void MockVehicleHardware::setPropertyConfigs(const std::vector& configs) { @@ -254,6 +255,12 @@ template StatusCode MockVehicleHardware::handleRequestsLocked>* storedRequests, std::list>* storedResponses) const; +void MockVehicleHardware::sendOnPropertySetErrorEvent( + const std::vector& errorEvents) { + std::scoped_lock lockGuard(mLock); + (*mPropertySetErrorCallback)(errorEvents); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 743841c216..46b30b9405 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -85,6 +85,7 @@ class MockVehicleHardware final : public IVehicleHardware { aidl::android::hardware::automotive::vehicle::StatusCode status); void setSleepTime(int64_t timeInNano); void setDumpResult(DumpResult result); + void sendOnPropertySetErrorEvent(const std::vector& errorEvents); private: mutable std::mutex mLock; @@ -104,6 +105,7 @@ class MockVehicleHardware final : public IVehicleHardware { mStatusByFunctions GUARDED_BY(mLock); int64_t mSleepTime GUARDED_BY(mLock) = 0; std::unique_ptr mPropertyChangeCallback GUARDED_BY(mLock); + std::unique_ptr mPropertySetErrorCallback GUARDED_BY(mLock); std::function, const std::vector&)> -- GitLab From 4ea2dbc27b6f6df772cc6620b014497ca446f2f7 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 23 Jun 2023 18:05:14 -0700 Subject: [PATCH 054/376] Cleanup dead code. We no longer implement subscription by periodically requesting get from VHAL layer, so most of the logic in subscriptionClient is no longer useful. Test: atest DefaultVehicleHalTest, manually run on emulator verify subscription works. Bug: 288627179 Change-Id: Ice3824514b3205ca3446baf0086be81eda0c47d6 --- .../aidl/impl/vhal/include/ConnectedClient.h | 24 +------ .../impl/vhal/include/DefaultVehicleHal.h | 37 +--------- .../impl/vhal/include/SubscriptionManager.h | 3 + .../aidl/impl/vhal/src/ConnectedClient.cpp | 67 ------------------- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 51 ++------------ .../impl/vhal/src/SubscriptionManager.cpp | 5 ++ .../impl/vhal/test/DefaultVehicleHalTest.cpp | 2 +- 7 files changed, 19 insertions(+), 170 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h index b3f4a0f722..addc9014fc 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h +++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h @@ -99,13 +99,10 @@ class GetSetValuesClient final : public ConnectedClient { std::shared_ptr)>> mResultCallback; }; -// A class to represent a client that calls {@code IVehicle.subscribe}. -class SubscriptionClient final : public ConnectedClient { +class SubscriptionClient { public: - SubscriptionClient(std::shared_ptr requestPool, CallbackType callback); - - // Gets the callback to be called when the request for this client has finished. - std::shared_ptr getResultCallback(); + using CallbackType = + std::shared_ptr; // Marshals the updated values into largeParcelable and sends it through {@code onPropertyEvent} // callback. @@ -119,21 +116,6 @@ class SubscriptionClient final : public ConnectedClient { CallbackType callback, std::vector&& vehiclePropErrors); - - protected: - // Gets the callback to be called when the request for this client has timeout. - std::shared_ptr getTimeoutCallback() override; - - private: - // The following members are only initialized during construction. - std::shared_ptr mTimeoutCallback; - std::shared_ptr mResultCallback; - std::shared_ptr mPropertyChangeCallback; - - static void onGetValueResults( - const void* clientId, CallbackType callback, - std::shared_ptr requestPool, - std::vector results); }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h index 74ad7eaf3e..419e16bab8 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h +++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h @@ -90,39 +90,6 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi GetSetValuesClient; - // A thread safe class to maintain an increasing request ID for each subscribe client. This - // class is safe to pass to async callbacks. - class SubscribeIdByClient { - public: - int64_t getId(const CallbackType& callback); - - private: - std::mutex mLock; - std::unordered_map mIds GUARDED_BY(mLock); - }; - - // A thread safe class to store all subscribe clients. This class is safe to pass to async - // callbacks. - class SubscriptionClients { - public: - SubscriptionClients(std::shared_ptr pool) : mPendingRequestPool(pool) {} - - std::shared_ptr maybeAddClient(const CallbackType& callback); - - std::shared_ptr getClient(const CallbackType& callback); - - void removeClient(const AIBinder* clientId); - - size_t countClients(); - - private: - std::mutex mLock; - std::unordered_map> mClients - GUARDED_BY(mLock); - // PendingRequestPool is thread-safe. - std::shared_ptr mPendingRequestPool; - }; - // A wrapper for binder lifecycle operations to enable stubbing for test. class BinderLifecycleInterface { public: @@ -185,8 +152,6 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi GUARDED_BY(mLock); std::unordered_map> mSetValuesClients GUARDED_BY(mLock); - // SubscriptionClients is thread-safe. - std::shared_ptr mSubscriptionClients; // mBinderLifecycleHandler is only going to be changed in test. std::unique_ptr mBinderLifecycleHandler; @@ -242,6 +207,8 @@ class DefaultVehicleHal final : public aidl::android::hardware::automotive::vehi // mBinderEvents. void onBinderDiedUnlinkedHandler(); + size_t countSubscribeClients(); + // Gets or creates a {@code T} object for the client to or from {@code clients}. template static std::shared_ptr getOrCreateClient( diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index 301d56c270..512d9068c3 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -105,6 +105,9 @@ class SubscriptionManager final { std::vector> getSubscribedClientsForErrorEvents(const std::vector& errorEvents); + // Returns the number of subscribed clients. + size_t countClients(); + // Checks whether the sample rate is valid. static bool checkSampleRateHz(float sampleRateHz); diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp index fb23a25047..35b93d2128 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp @@ -250,36 +250,6 @@ void GetSetValuesClient::sendResultsSeparately( template class GetSetValuesClient; template class GetSetValuesClient; -SubscriptionClient::SubscriptionClient(std::shared_ptr requestPool, - std::shared_ptr callback) - : ConnectedClient(requestPool, callback) { - mTimeoutCallback = std::make_shared( - [](std::unordered_set timeoutIds) { - for (int64_t id : timeoutIds) { - ALOGW("subscribe: requests with IDs: %" PRId64 - " has timed-out, not client informed, " - "possibly one of recurrent requests for this subscription failed", - id); - } - }); - auto requestPoolCopy = mRequestPool; - const void* clientId = reinterpret_cast(this); - mResultCallback = std::make_shared( - [clientId, callback, requestPoolCopy](std::vector results) { - onGetValueResults(clientId, callback, requestPoolCopy, results); - }); -} - -std::shared_ptr)>> -SubscriptionClient::getResultCallback() { - return mResultCallback; -} - -std::shared_ptr -SubscriptionClient::getTimeoutCallback() { - return mTimeoutCallback; -} - void SubscriptionClient::sendUpdatedValues(std::shared_ptr callback, std::vector&& updatedValues) { if (updatedValues.empty()) { @@ -336,43 +306,6 @@ void SubscriptionClient::sendPropertySetErrors(std::shared_ptr } } -void SubscriptionClient::onGetValueResults(const void* clientId, - std::shared_ptr callback, - std::shared_ptr requestPool, - std::vector results) { - std::unordered_set requestIds; - for (const auto& result : results) { - requestIds.insert(result.requestId); - } - - auto finishedRequests = requestPool->tryFinishRequests(clientId, requestIds); - std::vector propValues; - for (auto& result : results) { - int64_t requestId = result.requestId; - if (finishedRequests.find(requestId) == finishedRequests.end()) { - ALOGE("subscribe[%" PRId64 - "]: no pending request for the result from hardware, " - "possibly already time-out", - requestId); - continue; - } - if (result.status != StatusCode::OK) { - ALOGE("subscribe[%" PRId64 - "]: hardware returns non-ok status for getValues, status: " - "%d", - requestId, toInt(result.status)); - continue; - } - if (!result.prop.has_value()) { - ALOGE("subscribe[%" PRId64 "]: no prop value in getValues result", requestId); - continue; - } - propValues.push_back(std::move(result.prop.value())); - } - - sendUpdatedValues(callback, std::move(propValues)); -} - } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 0d5c070c54..f3eba2eb5e 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -92,39 +92,6 @@ float getDefaultSampleRateHz(float sampleRateHz, float minSampleRateHz, float ma } // namespace -std::shared_ptr DefaultVehicleHal::SubscriptionClients::maybeAddClient( - const CallbackType& callback) { - std::scoped_lock lockGuard(mLock); - return getOrCreateClient(&mClients, callback, mPendingRequestPool); -} - -std::shared_ptr DefaultVehicleHal::SubscriptionClients::getClient( - const CallbackType& callback) { - std::scoped_lock lockGuard(mLock); - const AIBinder* clientId = callback->asBinder().get(); - if (mClients.find(clientId) == mClients.end()) { - return nullptr; - } - return mClients[clientId]; -} - -int64_t DefaultVehicleHal::SubscribeIdByClient::getId(const CallbackType& callback) { - std::scoped_lock lockGuard(mLock); - // This would be initialized to 0 if callback does not exist in the map. - int64_t subscribeId = (mIds[callback->asBinder().get()])++; - return subscribeId; -} - -void DefaultVehicleHal::SubscriptionClients::removeClient(const AIBinder* clientId) { - std::scoped_lock lockGuard(mLock); - mClients.erase(clientId); -} - -size_t DefaultVehicleHal::SubscriptionClients::countClients() { - std::scoped_lock lockGuard(mLock); - return mClients.size(); -} - DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr vehicleHardware) : mVehicleHardware(std::move(vehicleHardware)), mPendingRequestPool(std::make_shared(TIMEOUT_IN_NANO)) { @@ -132,9 +99,6 @@ DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr vehicleHa return; } - mSubscriptionClients = std::make_shared(mPendingRequestPool); - - auto subscribeIdByClient = std::make_shared(); IVehicleHardware* vehicleHardwarePtr = mVehicleHardware.get(); mSubscriptionManager = std::make_shared(vehicleHardwarePtr); @@ -262,7 +226,6 @@ void DefaultVehicleHal::onBinderDiedWithContext(const AIBinder* clientId) { ALOGD("binder died, client ID: %p", clientId); mSetValuesClients.erase(clientId); mGetValuesClients.erase(clientId); - mSubscriptionClients->removeClient(clientId); mSubscriptionManager->unsubscribe(clientId); } @@ -301,10 +264,6 @@ template std::shared_ptr DefaultVehicleHal::getOrCreateClient( std::unordered_map>* clients, const CallbackType& callback, std::shared_ptr pendingRequestPool); -template std::shared_ptr -DefaultVehicleHal::getOrCreateClient( - std::unordered_map>* clients, - const CallbackType& callback, std::shared_ptr pendingRequestPool); void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) { mPendingRequestPool = std::make_unique(timeoutInNano); @@ -708,9 +667,6 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, "client died"); } - // Create a new SubscriptionClient if there isn't an existing one. - mSubscriptionClients->maybeAddClient(callback); - if (!onChangeSubscriptions.empty()) { auto result = mSubscriptionManager->subscribe(callback, onChangeSubscriptions, /*isContinuousProperty=*/false); @@ -842,12 +798,15 @@ binder_status_t DefaultVehicleHal::dump(int fd, const char** args, uint32_t numA dprintf(fd, "Containing %zu property configs\n", mConfigsByPropId.size()); dprintf(fd, "Currently have %zu getValues clients\n", mGetValuesClients.size()); dprintf(fd, "Currently have %zu setValues clients\n", mSetValuesClients.size()); - dprintf(fd, "Currently have %zu subscription clients\n", - mSubscriptionClients->countClients()); + dprintf(fd, "Currently have %zu subscribe clients\n", countSubscribeClients()); } return STATUS_OK; } +size_t DefaultVehicleHal::countSubscribeClients() { + return mSubscriptionManager->countClients(); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index 1f2690e340..17683ae4e7 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -301,6 +301,11 @@ bool SubscriptionManager::isEmpty() { return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty(); } +size_t SubscriptionManager::countClients() { + std::scoped_lock lockGuard(mLock); + return mSubscribedPropsByClient.size(); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index 96b71f0af0..fb14373810 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -350,7 +350,7 @@ class DefaultVehicleHalTest : public testing::Test { size_t countClients() { std::scoped_lock lockGuard(mVhal->mLock); return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() + - mVhal->mSubscriptionClients->countClients(); + mVhal->countSubscribeClients(); } std::shared_ptr getPool() { return mVhal->mPendingRequestPool; } -- GitLab From 52c0a3dd9dc3505b05de195f94e5778835ca4de1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 30 Jun 2023 15:46:06 -0700 Subject: [PATCH 055/376] Minor fix to comment style. Use a separate block for HVAC properties comments since we will use the first line as description for the property and hvac fan speed description will not be correct. Test: None Bug: 288331747 Change-Id: Ie6518dec394a3d9c90bd2cb5b38939a2cdd7cccf --- .../android/hardware/automotive/vehicle/VehicleProperty.aidl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 d9c6de7ef9..5f6b827ef0 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -696,8 +696,9 @@ enum VehicleProperty { * and passenger side, an alternative mapping would be: * - ROW_1_LEFT * - ROW_1_RIGHT - * - * + */ + + /** * Fan speed setting * * The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined. -- GitLab From e2f796595c4eaa9c663f128c5073155d49b7aecb Mon Sep 17 00:00:00 2001 From: Bao Do Date: Mon, 10 Jul 2023 03:52:06 +0000 Subject: [PATCH 056/376] Add a config with test skipping for SDK < 33 Test: atest VtsHalBluetoothAudioTargetTest Bug: 288598199 Change-Id: I563c8d50b186f2da2cf077dc3631808f8c2a9eee Merged-In: I563c8d50b186f2da2cf077dc3631808f8c2a9eee --- bluetooth/audio/OWNERS | 4 ++- bluetooth/audio/aidl/vts/Android.bp | 1 + .../vts/VtsHalBluetoothAudioTargetTest.xml | 36 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.xml diff --git a/bluetooth/audio/OWNERS b/bluetooth/audio/OWNERS index a8e9bda9a7..f3657ca9c4 100644 --- a/bluetooth/audio/OWNERS +++ b/bluetooth/audio/OWNERS @@ -1,4 +1,6 @@ +# Bug component: 27441 + include platform/packages/modules/Bluetooth:/OWNERS -cheneyni@google.com aliceypkuo@google.com +quocbaodo@google.com diff --git a/bluetooth/audio/aidl/vts/Android.bp b/bluetooth/audio/aidl/vts/Android.bp index e03fb5873d..0a2a89ad4e 100644 --- a/bluetooth/audio/aidl/vts/Android.bp +++ b/bluetooth/audio/aidl/vts/Android.bp @@ -25,6 +25,7 @@ cc_test { "libcutils", "libfmq", ], + test_config: "VtsHalBluetoothAudioTargetTest.xml", test_suites: [ "general-tests", "vts", diff --git a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.xml b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.xml new file mode 100644 index 0000000000..7b02685419 --- /dev/null +++ b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.xml @@ -0,0 +1,36 @@ + + + + -- GitLab From 86974637e8e2a447a527ac828bf27958c008b339 Mon Sep 17 00:00:00 2001 From: Jin Chen Date: Mon, 10 Jul 2023 16:57:19 -0700 Subject: [PATCH 057/376] [uwb](hal) Add radar data packet format * Update based on Android UWB radar UCI spec v1.1 (go/uwb-radar-uci). Test: Compile Bug: 237097302 Change-Id: I8e8de979ea2f69396b049c2107cba16e71793cb0 --- .../UwbVendorDataPacketFormat.aidl | 38 +++++++++++++++++++ .../fira_android/UwbVendorGidAndroidOids.aidl | 1 - .../UwbVendorDataPacketFormat.aidl | 27 +++++++++++++ .../fira_android/UwbVendorGidAndroidOids.aidl | 2 - 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl new file mode 100644 index 0000000000..efafa32065 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.uwb.fira_android; +@Backing(type="byte") @VintfStability +enum UwbVendorDataPacketFormat { + RADAR_DATA_MESSAGE = 0xF, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index 34bc4ec6a8..1506406be7 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -39,5 +39,4 @@ enum UwbVendorGidAndroidOids { ANDROID_RANGE_DIAGNOSTICS = 0x2, RADAR_SET_APP_CONFIG = 0x11, RADAR_GET_APP_CONFIG = 0x12, - RADAR_DATA_NTF = 0x13, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl new file mode 100644 index 0000000000..7a1b033b66 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorDataPacketFormat.aidl @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.uwb.fira_android; + +/** + * Android specific vendor DPF (Data Packet Format) should be defined here. + */ +@VintfStability +@Backing(type="byte") +enum UwbVendorDataPacketFormat { + // Used to send radar data messages from UWBS to the host. + RADAR_DATA_MESSAGE = 0xF, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index 203b940ccc..95c10a8998 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -46,6 +46,4 @@ enum UwbVendorGidAndroidOids { RADAR_SET_APP_CONFIG = 0x11, // Used to get application configurations for radar session. RADAR_GET_APP_CONFIG = 0x12, - // Used to report radar data for certain radar data types. - RADAR_DATA_NTF = 0x13, } -- GitLab From 595c1da89fef7a9232b33e4ac388150aae2c3547 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 6 Jul 2023 17:38:49 -0700 Subject: [PATCH 058/376] Add more access annotations. For some READ_WRITE property, READ is also allowed. Add the annotations to reflect that. Test: None Bug: 288331747 Change-Id: I46d86606087e747e217269db028ddf03c9bdc0b6 --- .../automotive/vehicle/VehicleProperty.aidl | 112 ++++++++++++++++++ .../tools/generate_annotation_enums.py | 3 +- 2 files changed, 114 insertions(+), 1 deletion(-) 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 5f6b827ef0..28bacb0d52 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -345,6 +345,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -383,6 +384,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -476,6 +478,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ ENGINE_IDLE_AUTO_STOP_ENABLED = 0x0320 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -560,6 +563,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ EV_BRAKE_REGENERATION_LEVEL = 0x040C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, @@ -648,6 +652,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum EvStoppingMode */ EV_STOPPING_MODE = @@ -714,6 +719,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -725,6 +731,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleHvacFanDirection */ HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000 @@ -764,6 +771,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @unit VehicleUnit:CELSIUS */ HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000 @@ -776,6 +784,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN @@ -787,6 +796,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @config_flags Supported areaIds */ HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000 @@ -804,6 +814,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -826,6 +837,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -842,6 +854,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -880,6 +893,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -901,6 +915,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -922,6 +937,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -944,6 +960,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 @@ -966,6 +983,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 @@ -990,6 +1008,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleUnit */ HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000 @@ -1044,6 +1063,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -1078,6 +1098,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -1102,6 +1123,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -1113,6 +1135,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN @@ -1176,6 +1199,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleUnit */ DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000 @@ -1199,6 +1223,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleUnit */ FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000 @@ -1223,6 +1248,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleUnit */ TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000 @@ -1247,6 +1273,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleUnit */ EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000 @@ -1263,6 +1290,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -1285,6 +1313,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 @@ -1634,6 +1663,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 @@ -1658,6 +1688,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32 @@ -1671,6 +1702,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN @@ -1686,6 +1718,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ DOOR_CHILD_LOCK_ENABLED = 0x0B03 + VehiclePropertyGroup.SYSTEM + VehicleArea.DOOR + VehiclePropertyType.BOOLEAN, @@ -1711,6 +1744,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 @@ -1736,6 +1770,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 @@ -1761,6 +1796,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 @@ -1785,6 +1821,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32 @@ -1798,6 +1835,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -1811,6 +1849,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -1827,6 +1866,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_AUTO_FOLD_ENABLED = @@ -1844,6 +1884,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ MIRROR_AUTO_TILT_ENABLED = @@ -1892,6 +1933,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN @@ -1916,6 +1958,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -1943,6 +1986,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -1967,6 +2011,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -1993,6 +2038,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2019,6 +2065,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2045,6 +2092,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2073,6 +2121,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2099,6 +2148,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2121,6 +2171,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2145,6 +2196,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2172,6 +2224,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2197,6 +2250,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2223,6 +2277,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2249,6 +2304,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2273,6 +2329,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2300,6 +2357,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2324,6 +2382,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2351,6 +2410,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2370,6 +2430,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 @@ -2396,6 +2457,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_HEIGHT_POS_V2 = 0x0BA4 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2424,6 +2486,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2446,6 +2509,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2473,6 +2537,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2495,6 +2560,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2522,6 +2588,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32 @@ -2566,6 +2633,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ SEAT_FOOTWELL_LIGHTS_SWITCH = @@ -2582,6 +2650,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_EASY_ACCESS_ENABLED = 0x0B9D + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, @@ -2601,6 +2670,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_AIRBAG_ENABLED = 0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, @@ -2625,6 +2695,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_CUSHION_SIDE_SUPPORT_POS = 0x0B9F + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2652,6 +2723,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_CUSHION_SIDE_SUPPORT_MOVE = 0x0BA0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2674,6 +2746,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_VERTICAL_POS = 0x0BA1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2699,6 +2772,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_LUMBAR_VERTICAL_MOVE = 0x0BA2 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2724,6 +2798,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ SEAT_WALK_IN_POS = 0x0BA3 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -2771,6 +2846,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 @@ -2812,6 +2888,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000 + 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32 @@ -2825,6 +2902,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN @@ -2890,6 +2968,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum WindshieldWipersSwitch */ WINDSHIELD_WIPERS_SWITCH = @@ -2916,6 +2995,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_DEPTH_POS = 0x0BE0 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, @@ -2941,6 +3021,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_DEPTH_MOVE = 0x0BE1 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, @@ -2963,6 +3044,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_HEIGHT_POS = 0x0BE2 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, @@ -2988,6 +3070,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_HEIGHT_MOVE = 0x0BE3 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, @@ -3002,6 +3085,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_THEFT_LOCK_ENABLED = 0x0BE4 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -3015,6 +3099,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_LOCKED = 0x0BE5 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -3029,6 +3114,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ STEERING_WHEEL_EASY_ACCESS_ENABLED = 0x0BE6 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -3055,6 +3141,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ GLOVE_BOX_DOOR_POS = 0x0BF0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, @@ -3073,6 +3160,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ GLOVE_BOX_LOCKED = 0x0BF1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, @@ -3292,6 +3380,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000 @@ -3306,6 +3395,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000 @@ -3336,6 +3426,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000 @@ -3350,6 +3441,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000 @@ -3378,6 +3470,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000 @@ -3406,6 +3499,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000 @@ -3451,6 +3545,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ STEERING_WHEEL_LIGHTS_SWITCH = @@ -4120,6 +4215,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000 @@ -4151,6 +4247,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum VehicleLightSwitch */ REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000 @@ -4167,6 +4264,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @unit VehicleUnit:AMPERE */ EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000 @@ -4188,6 +4286,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000 + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT @@ -4215,6 +4314,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000 + 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN @@ -4378,6 +4478,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ VEHICLE_IN_USE = 0x0F4A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4404,6 +4505,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ AUTOMATIC_EMERGENCY_BRAKING_ENABLED = 0x1000 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4446,6 +4548,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ FORWARD_COLLISION_WARNING_ENABLED = 0x1002 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4485,6 +4588,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ BLIND_SPOT_WARNING_ENABLED = 0x1004 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4525,6 +4629,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ LANE_DEPARTURE_WARNING_ENABLED = 0x1006 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4569,6 +4674,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ LANE_KEEP_ASSIST_ENABLED = 0x1008 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4617,6 +4723,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ LANE_CENTERING_ASSIST_ENABLED = 0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4691,6 +4798,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ EMERGENCY_LANE_KEEP_ASSIST_ENABLED = 0x100D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4734,6 +4842,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ CRUISE_CONTROL_ENABLED = 0x100F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, @@ -4759,6 +4868,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @data_enum CruiseControlType * @data_enum ErrorState */ @@ -4856,6 +4966,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @unit VehicleUnit:MILLI_SECS */ ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP = @@ -4907,6 +5018,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ */ HANDS_ON_DETECTION_ENABLED = 0x1016 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index cfae607f0c..7276fe669b 100755 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -189,11 +189,12 @@ class Converter: continue if RE_COMMENT_BEGIN.match(line): in_comment = True + annotation = None if RE_COMMENT_END.match(line): in_comment = False if in_comment: match = self.annotation_re.match(line) - if match: + if match and not annotation: annotation = match.group(1) else: match = RE_VALUE.match(line) -- GitLab From bc614aeae03a9d324f0d82dad76e7ab36c0056c1 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 11 Jul 2023 14:15:07 -0700 Subject: [PATCH 059/376] Minor update on access annotation. Test: None Bug: 288331747 Change-Id: I3a2246c1c5fd02d06fa2c8f08dc69ac0506bfbcb --- .../android/hardware/automotive/vehicle/VehicleProperty.aidl | 4 ++++ 1 file changed, 4 insertions(+) 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 28bacb0d52..0f6cac89b5 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -421,6 +421,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.CONTINUOUS * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ * @unit VehicleUnit:METER */ RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000 @@ -4476,6 +4477,9 @@ enum VehicleProperty { * powers on the vehicle. VEHICLE_IN_USE is set to true. After a driving session, user powers * off the vehicle, VEHICLE_IN_USE is set to false. * + *

This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.READ_WRITE * @access VehiclePropertyAccess.READ -- GitLab From 8ddd65dbc0ad4070b1ecf6b6a7d3070278e1b5d7 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 28 Jun 2023 17:02:29 -0700 Subject: [PATCH 060/376] Add script to parse VehicleProperty.aidl to CSV. Allow parsing the VHAL property definitions/annotations in VehicleProperty.aidl into a CSV file so that we can generate documentation. Test: python generate_annotation_enums.py --output_csv /tmp/prop.csv Bug: 288331747 Change-Id: Icc5d023c8efdc01ead220313d6a7c66d22c63a0a --- .../tools/generate_annotation_enums.py | 166 ++++++++++++++---- 1 file changed, 132 insertions(+), 34 deletions(-) diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index 7276fe669b..c432e9d6b6 100755 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -49,6 +49,8 @@ RE_COMMENT_BEGIN = re.compile('\s*\/\*\*?') RE_COMMENT_END = re.compile('\s*\*\/') RE_CHANGE_MODE = re.compile('\s*\* @change_mode (\S+)\s*') RE_ACCESS = re.compile('\s*\* @access (\S+)\s*') +RE_DATA_ENUM = re.compile('\s*\* @data_enum (\S+)\s*') +RE_UNIT = re.compile('\s*\* @unit (\S+)\s+') RE_VALUE = re.compile('\s*(\w+)\s*=(.*)') LICENSE = """/* @@ -166,55 +168,121 @@ ACCESS_JAVA_FOOTER = """ """ -class Converter: +class PropertyConfig: + """Represents one VHAL property definition in VehicleProperty.aidl.""" - def __init__(self, name, annotation_re): - self.name = name - self.annotation_re = annotation_re + def __init__(self): + self.name = None + self.description = None + self.change_mode = None + self.access_modes = [] + self.enum_types = [] + self.unit_type = None - def convert(self, input, output, header, footer, cpp): + def __repr__(self): + return self.__str__() + + def __str__(self): + return ('PropertyConfig{{' + + 'name: {}, description: {}, change_mode: {}, access_modes: {}, enum_types: {}' + + ', unit_type: {}}}').format(self.name, self.description, self.change_mode, + self.access_modes, self.enum_types, self.unit_type) + + +class FileParser: + + def __init__(self): + self.configs = None + + def parseFile(self, input_file): + """Parses the input VehicleProperty.aidl file into a list of property configs.""" processing = False in_comment = False - content = LICENSE + header - annotation = None - id = 0 - with open(input, 'r') as f: + configs = [] + config = None + with open(input_file, 'r') as f: for line in f.readlines(): if RE_ENUM_START.match(line): processing = True - annotation = None elif RE_ENUM_END.match(line): processing = False if not processing: continue if RE_COMMENT_BEGIN.match(line): in_comment = True - annotation = None + config = PropertyConfig() + description = '' if RE_COMMENT_END.match(line): in_comment = False if in_comment: - match = self.annotation_re.match(line) - if match and not annotation: - annotation = match.group(1) + if not config.description: + sline = line.strip() + # Skip the first line of comment + if sline.startswith('*'): + # Remove the '*'. + sline = sline[1:].strip() + # We reach an empty line of comment, the description part is ending. + if sline == '': + config.description = description + else: + if description != '': + description += ' ' + description += sline + match = RE_CHANGE_MODE.match(line) + if match: + config.change_mode = match.group(1).replace('VehiclePropertyChangeMode.', '') + match = RE_ACCESS.match(line) + if match: + config.access_modes.append(match.group(1).replace('VehiclePropertyAccess.', '')) + match = RE_UNIT.match(line) + if match: + config.unit_type = match.group(1) + match = RE_DATA_ENUM.match(line) + if match: + config.enum_types.append(match.group(1)) else: match = RE_VALUE.match(line) if match: prop_name = match.group(1) if prop_name == 'INVALID': continue - if not annotation: + if not config.change_mode: raise Exception( - 'No @' + self.name + ' annotation for property: ' + prop_name) - if id != 0: - content += '\n' - if cpp: - annotation = annotation.replace('.', '::') - content += (TAB + TAB + '{VehicleProperty::' + prop_name + ', ' + - annotation + '},') - else: - content += (TAB + TAB + 'Map.entry(VehicleProperty.' + prop_name + ', ' + - annotation + '),') - id += 1 + 'No change_mode annotation for property: ' + prop_name) + if not config.access_modes: + raise Exception( + 'No access_mode annotation for property: ' + prop_name) + config.name = prop_name + configs.append(config) + + self.configs = configs + + def convert(self, output, header, footer, cpp, field): + """Converts the property config file to C++/Java output file.""" + counter = 0 + content = LICENSE + header + for config in self.configs: + if field == 'change_mode': + if cpp: + annotation = "VehiclePropertyChangeMode::" + config.change_mode + else: + annotation = "VehiclePropertyChangeMode." + config.change_mode + elif field == 'access_mode': + if cpp: + annotation = "VehiclePropertyAccess::" + config.access_modes[0] + else: + annotation = "VehiclePropertyAccess." + config.access_modes[0] + else: + raise Exception('Unknown field: ' + field) + if counter != 0: + content += '\n' + if cpp: + content += (TAB + TAB + '{VehicleProperty::' + config.name + ', ' + + annotation + '},') + else: + content += (TAB + TAB + 'Map.entry(VehicleProperty.' + config.name + ', ' + + annotation + '),') + counter += 1 # Remove the additional ',' at the end for the Java file. if not cpp: @@ -225,6 +293,30 @@ class Converter: with open(output, 'w') as f: f.write(content) + def outputAsCsv(self, output): + content = 'name,description,change mode,access mode,enum type,unit type\n' + for config in self.configs: + enum_types = None + if not config.enum_types: + enum_types = '/' + else: + enum_types = '/'.join(config.enum_types) + unit_type = config.unit_type + if not unit_type: + unit_type = '/' + access_modes = '' + content += '"{}","{}","{}","{}","{}","{}"\n'.format( + config.name, + # Need to escape quote as double quote. + config.description.replace('"', '""'), + config.change_mode, + '/'.join(config.access_modes), + enum_types, + unit_type) + + with open(output, 'w+') as f: + f.write(content) + def createTempFile(): f = tempfile.NamedTemporaryFile(delete=False); @@ -239,6 +331,8 @@ def main(): parser.add_argument('--preupload_files', nargs='+', required=False, help='modified files') parser.add_argument('--check_only', required=False, action='store_true', help='only check whether the generated files need update') + parser.add_argument('--output_csv', required=False, + help='Path to the parsing result in CSV style, useful for doc generation') args = parser.parse_args(); android_top = None output_folder = None @@ -258,6 +352,12 @@ def main(): 'at the android root') aidl_file = os.path.join(android_top, PROP_AIDL_FILE_PATH) + f = FileParser(); + f.parseFile(aidl_file) + + if args.output_csv: + f.outputAsCsv(args.output_csv) + return change_mode_cpp_file = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH); access_cpp_file = os.path.join(android_top, ACCESS_CPP_FILE_PATH); @@ -281,14 +381,12 @@ def main(): temp_files.append(access_java_output) try: - c = Converter('change_mode', RE_CHANGE_MODE); - c.convert(aidl_file, change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, - True) - c.convert(aidl_file, change_mode_java_output, CHANGE_MODE_JAVA_HEADER, - CHANGE_MODE_JAVA_FOOTER, False) - c = Converter('access', RE_ACCESS) - c.convert(aidl_file, access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True) - c.convert(aidl_file, access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False) + f.convert(change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, + True, 'change_mode') + f.convert(change_mode_java_output, CHANGE_MODE_JAVA_HEADER, + CHANGE_MODE_JAVA_FOOTER, False, 'change_mode') + f.convert(access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True, 'access_mode') + f.convert(access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False, 'access_mode') if not args.check_only: return -- GitLab From e94dd21fdceb22b7dd52f976ccb778f4449d4691 Mon Sep 17 00:00:00 2001 From: Aishwarya Mallamapti Date: Fri, 7 Jul 2023 21:28:51 +0000 Subject: [PATCH 061/376] Block data call If network is a non-terrestrial network, block data requests with NET_CAPABILITY_INTERNET. Bug: 287114765 Test: Flashed build on raven-userdebug and performed basic functionality tests, atest DataNetworkControllerTest#testNonTerrestrialNetworkChanged Change-Id: Ie21183b093d006f2d9b0bb00845d06965a52f812 --- .../android/hardware/radio/data/DataCallFailCause.aidl | 1 + radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl index 009b428273..362be3a3f6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl @@ -379,4 +379,5 @@ enum DataCallFailCause { SLICE_REJECTED = 0x8CC, MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, ALL_MATCHING_RULES_FAILED = 0x8CE, + SATELLITE_ENABLED = 0x8CF, } diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl index e015e8eec9..ef68c8c754 100644 --- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl @@ -1306,4 +1306,8 @@ enum DataCallFailCause { * If connection failed for all matching URSP rules. */ ALL_MATCHING_RULES_FAILED = 0x8CE, + /** + * Data call is not allowed as device is connected to satellite. + */ + SATELLITE_ENABLED = 0x8CF, } -- GitLab From 4420c1dbbf28cc80ac47cdbafb9cc81034f8fc8f Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 21 Jun 2023 22:49:04 +0000 Subject: [PATCH 062/376] Fix wrong timeout and mock method in radio VTS Fixed wrong time unit convension for timeout values used in broadcast radio HAL VTS. Also replaced tuner callback mock method which caused segmentation fault when unimplemented callback methods are called. In addition, antenna connection state was checked at the end of the each test instead of at the beginning. Bug: 277531858 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Ied70fcfd2742ae5d253aec984e2161afa6f65162 --- .../VtsHalBroadcastradioAidlTargetTest.cpp | 219 +++++++++++++----- 1 file changed, 156 insertions(+), 63 deletions(-) diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 356673f715..8bee1b2d1f 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -32,11 +32,11 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -61,11 +61,6 @@ using ::testing::SaveArg; namespace bcutils = ::aidl::android::hardware::broadcastradio::utils; -inline constexpr std::chrono::seconds kTuneTimeoutSec = - std::chrono::seconds(IBroadcastRadio::TUNER_TIMEOUT_MS * 1000); -inline constexpr std::chrono::seconds kProgramListScanTimeoutSec = - std::chrono::seconds(IBroadcastRadio::LIST_COMPLETE_TIMEOUT_MS * 1000); - const ConfigFlag kConfigFlagValues[] = { ConfigFlag::FORCE_MONO, ConfigFlag::FORCE_ANALOG, @@ -108,20 +103,68 @@ bool supportsFM(const AmFmRegionConfig& config) { } // namespace -class TunerCallbackMock : public BnTunerCallback { +class CallbackFlag final { + public: + CallbackFlag(int timeoutMs) { mTimeoutMs = timeoutMs; } + /** + * Notify that the callback is called. + */ + void notify() { + std::unique_lock lock(mMutex); + mCalled = true; + lock.unlock(); + mCv.notify_all(); + }; + + /** + * Wait for the timeout passed into the constructor. + */ + bool wait() { + std::unique_lock lock(mMutex); + return mCv.wait_for(lock, std::chrono::milliseconds(mTimeoutMs), + [this] { return mCalled; }); + }; + + /** + * Reset the callback to not called. + */ + void reset() { + std::unique_lock lock(mMutex); + mCalled = false; + } + + private: + std::mutex mMutex; + bool mCalled GUARDED_BY(mMutex) = false; + std::condition_variable mCv; + int mTimeoutMs; +}; + +class TunerCallbackImpl final : public BnTunerCallback { public: - TunerCallbackMock(); + TunerCallbackImpl(); ScopedAStatus onTuneFailed(Result result, const ProgramSelector& selector) override; - MOCK_TIMEOUT_METHOD1(onCurrentProgramInfoChangedMock, ScopedAStatus(const ProgramInfo&)); ScopedAStatus onCurrentProgramInfoChanged(const ProgramInfo& info) override; ScopedAStatus onProgramListUpdated(const ProgramListChunk& chunk) override; - MOCK_METHOD1(onAntennaStateChange, ScopedAStatus(bool connected)); - MOCK_METHOD1(onParametersUpdated, ScopedAStatus(const vector& parameters)); - MOCK_METHOD2(onConfigFlagUpdated, ScopedAStatus(ConfigFlag in_flag, bool in_value)); - MOCK_TIMEOUT_METHOD0(onProgramListReady, void()); + ScopedAStatus onParametersUpdated(const vector& parameters) override; + ScopedAStatus onAntennaStateChange(bool connected) override; + ScopedAStatus onConfigFlagUpdated(ConfigFlag in_flag, bool in_value) override; + + bool waitOnCurrentProgramInfoChangedCallback(); + bool waitProgramReady(); + void reset(); + bool getAntennaConnectionState(); + ProgramInfo getCurrentProgramInfo(); + bcutils::ProgramInfoSet getProgramList(); + + private: std::mutex mLock; + bool mAntennaConnectionState GUARDED_BY(mLock); + ProgramInfo mCurrentProgramInfo GUARDED_BY(mLock); bcutils::ProgramInfoSet mProgramList GUARDED_BY(mLock); + CallbackFlag mOnCurrentProgramInfoChangedFlag = CallbackFlag(IBroadcastRadio::TUNER_TIMEOUT_MS); + CallbackFlag mOnProgramListReadyFlag = CallbackFlag(IBroadcastRadio::LIST_COMPLETE_TIMEOUT_MS); }; struct AnnouncementListenerMock : public BnAnnouncementListener { @@ -139,7 +182,7 @@ class BroadcastRadioHalTest : public testing::TestWithParam { std::shared_ptr mModule; Properties mProperties; - std::shared_ptr mCallback = SharedRefBase::make(); + std::shared_ptr mCallback; }; MATCHER_P(InfoHasId, id, string(negation ? "does not contain" : "contains") + " " + id.toString()) { @@ -147,20 +190,18 @@ MATCHER_P(InfoHasId, id, string(negation ? "does not contain" : "contains") + " return ids.end() != find(ids.begin(), ids.end(), id.value); } -TunerCallbackMock::TunerCallbackMock() { - EXPECT_TIMEOUT_CALL(*this, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); - - // we expect the antenna is connected through the whole test - EXPECT_CALL(*this, onAntennaStateChange(false)).Times(0); +TunerCallbackImpl::TunerCallbackImpl() { + mAntennaConnectionState = true; } -ScopedAStatus TunerCallbackMock::onTuneFailed(Result result, const ProgramSelector& selector) { +ScopedAStatus TunerCallbackImpl::onTuneFailed(Result result, const ProgramSelector& selector) { LOG(DEBUG) << "Tune failed for selector" << selector.toString(); EXPECT_TRUE(result == Result::CANCELED); return ndk::ScopedAStatus::ok(); } -ScopedAStatus TunerCallbackMock::onCurrentProgramInfoChanged(const ProgramInfo& info) { +ScopedAStatus TunerCallbackImpl::onCurrentProgramInfoChanged(const ProgramInfo& info) { + LOG(DEBUG) << "onCurrentProgramInfoChanged called"; for (const auto& id : info.selector) { EXPECT_NE(id.type, IdentifierType::INVALID); } @@ -196,21 +237,75 @@ ScopedAStatus TunerCallbackMock::onCurrentProgramInfoChanged(const ProgramInfo& } } - return onCurrentProgramInfoChangedMock(info); -} + { + std::lock_guard lk(mLock); + mCurrentProgramInfo = info; + } -ScopedAStatus TunerCallbackMock::onProgramListUpdated(const ProgramListChunk& chunk) { - std::lock_guard lk(mLock); + mOnCurrentProgramInfoChangedFlag.notify(); + return ndk::ScopedAStatus::ok(); +} - updateProgramList(chunk, &mProgramList); +ScopedAStatus TunerCallbackImpl::onProgramListUpdated(const ProgramListChunk& chunk) { + LOG(DEBUG) << "onProgramListUpdated called"; + { + std::lock_guard lk(mLock); + updateProgramList(chunk, &mProgramList); + } if (chunk.complete) { - onProgramListReady(); + mOnProgramListReadyFlag.notify(); } return ndk::ScopedAStatus::ok(); } +ScopedAStatus TunerCallbackImpl::onParametersUpdated( + [[maybe_unused]] const vector& parameters) { + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus TunerCallbackImpl::onAntennaStateChange(bool connected) { + if (!connected) { + std::lock_guard lk(mLock); + mAntennaConnectionState = false; + } + return ndk::ScopedAStatus::ok(); +} + +ScopedAStatus TunerCallbackImpl::onConfigFlagUpdated([[maybe_unused]] ConfigFlag in_flag, + [[maybe_unused]] bool in_value) { + return ndk::ScopedAStatus::ok(); +} + +bool TunerCallbackImpl::waitOnCurrentProgramInfoChangedCallback() { + return mOnCurrentProgramInfoChangedFlag.wait(); +} + +bool TunerCallbackImpl::waitProgramReady() { + return mOnProgramListReadyFlag.wait(); +} + +void TunerCallbackImpl::reset() { + mOnCurrentProgramInfoChangedFlag.reset(); + mOnProgramListReadyFlag.reset(); +} + +bool TunerCallbackImpl::getAntennaConnectionState() { + std::lock_guard lk(mLock); + return mAntennaConnectionState; +} + +ProgramInfo TunerCallbackImpl::getCurrentProgramInfo() { + std::lock_guard lk(mLock); + return mCurrentProgramInfo; +} + +bcutils::ProgramInfoSet TunerCallbackImpl::getProgramList() { + std::lock_guard lk(mLock); + return mProgramList; +} + void BroadcastRadioHalTest::SetUp() { EXPECT_EQ(mModule.get(), nullptr) << "Module is already open"; @@ -228,6 +323,8 @@ void BroadcastRadioHalTest::SetUp() { EXPECT_FALSE(mProperties.product.empty()); EXPECT_GT(mProperties.supportedIdentifierTypes.size(), 0u); + mCallback = SharedRefBase::make(); + // set callback EXPECT_TRUE(mModule->setTunerCallback(mCallback).isOk()); } @@ -236,6 +333,11 @@ void BroadcastRadioHalTest::TearDown() { if (mModule) { ASSERT_TRUE(mModule->unsetTunerCallback().isOk()); } + if (mCallback) { + // we expect the antenna is connected through the whole test + EXPECT_TRUE(mCallback->getAntennaConnectionState()); + mCallback = nullptr; + } } bool BroadcastRadioHalTest::getAmFmRegionConfig(bool full, AmFmRegionConfig* config) { @@ -256,7 +358,7 @@ std::optional BroadcastRadioHalTest::getProgramList() { std::optional BroadcastRadioHalTest::getProgramList( const ProgramFilter& filter) { - EXPECT_TIMEOUT_CALL(*mCallback, onProgramListReady).Times(AnyNumber()); + mCallback->reset(); auto startResult = mModule->startProgramListUpdates(filter); @@ -268,13 +370,13 @@ std::optional BroadcastRadioHalTest::getProgramList( if (!startResult.isOk()) { return std::nullopt; } - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onProgramListReady, kProgramListScanTimeoutSec); + EXPECT_TRUE(mCallback->waitProgramReady()); auto stopResult = mModule->stopProgramListUpdates(); EXPECT_TRUE(stopResult.isOk()); - return mCallback->mProgramList; + return mCallback->getProgramList(); } /** @@ -456,7 +558,7 @@ TEST_P(BroadcastRadioHalTest, TuneFailsWithoutTunerCallback) { * - if it is supported, the test is ignored; */ TEST_P(BroadcastRadioHalTest, TuneFailsWithNotSupported) { - LOG(DEBUG) << "TuneFailsWithInvalid Test"; + LOG(DEBUG) << "TuneFailsWithNotSupported Test"; vector supportTestId = { makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 0), // invalid @@ -477,9 +579,9 @@ TEST_P(BroadcastRadioHalTest, TuneFailsWithNotSupported) { for (const auto& id : supportTestId) { ProgramSelector sel{id, {}}; - auto result = mModule->tune(sel); - if (!bcutils::isSupported(mProperties, sel)) { + auto result = mModule->tune(sel); + EXPECT_EQ(result.getServiceSpecificError(), notSupportedError); } } @@ -508,9 +610,9 @@ TEST_P(BroadcastRadioHalTest, TuneFailsWithInvalid) { for (const auto& id : invalidId) { ProgramSelector sel{id, {}}; - auto result = mModule->tune(sel); - if (bcutils::isSupported(mProperties, sel)) { + auto result = mModule->tune(sel); + EXPECT_EQ(result.getServiceSpecificError(), invalidArgumentsError); } } @@ -549,13 +651,7 @@ TEST_P(BroadcastRadioHalTest, FmTune) { int64_t freq = 90900; // 90.9 FM ProgramSelector sel = makeSelectorAmfm(freq); // try tuning - ProgramInfo infoCb = {}; - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, - InfoHasId(makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq))) - .Times(AnyNumber()) - .WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(ndk::ScopedAStatus::ok())))) - .WillRepeatedly(testing::InvokeWithoutArgs([] { return ndk::ScopedAStatus::ok(); })); - + mCallback->reset(); auto result = mModule->tune(sel); // expect a failure if it's not supported @@ -566,7 +662,8 @@ TEST_P(BroadcastRadioHalTest, FmTune) { // expect a callback if it succeeds EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); + ProgramInfo infoCb = mCallback->getCurrentProgramInfo(); LOG(DEBUG) << "Current program info: " << infoCb.toString(); @@ -638,12 +735,6 @@ TEST_P(BroadcastRadioHalTest, DabTune) { } // try tuning - ProgramInfo infoCb = {}; - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, - InfoHasId(makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, freq))) - .Times(AnyNumber()) - .WillOnce( - DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(ndk::ScopedAStatus::ok())))); auto result = mModule->tune(sel); @@ -655,7 +746,9 @@ TEST_P(BroadcastRadioHalTest, DabTune) { // expect a callback if it succeeds EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); + ProgramInfo infoCb = mCallback->getCurrentProgramInfo(); + LOG(DEBUG) << "Current program info: " << infoCb.toString(); // it should tune exactly to what was requested @@ -669,13 +762,13 @@ TEST_P(BroadcastRadioHalTest, DabTune) { * * Verifies that: * - the method succeeds; - * - the program info is changed within kTuneTimeoutSec; + * - the program info is changed within kTuneTimeoutMs; * - works both directions and with or without skipping sub-channel. */ TEST_P(BroadcastRadioHalTest, Seek) { LOG(DEBUG) << "Seek Test"; - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + mCallback->reset(); auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true); @@ -685,14 +778,14 @@ TEST_P(BroadcastRadioHalTest, Seek) { } EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + mCallback->reset(); result = mModule->seek(/* in_directionUp= */ false, /* in_skipSubChannel= */ false); EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); } /** @@ -720,13 +813,13 @@ TEST_P(BroadcastRadioHalTest, SeekFailsWithoutTunerCallback) { * * Verifies that: * - the method succeeds or returns NOT_SUPPORTED; - * - the program info is changed within kTuneTimeoutSec if the method succeeded; + * - the program info is changed within kTuneTimeoutMs if the method succeeded; * - works both directions. */ TEST_P(BroadcastRadioHalTest, Step) { LOG(DEBUG) << "Step Test"; - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + mCallback->reset(); auto result = mModule->step(/* in_directionUp= */ true); @@ -735,14 +828,14 @@ TEST_P(BroadcastRadioHalTest, Step) { return; } EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); - EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChangedMock, _).Times(AnyNumber()); + mCallback->reset(); result = mModule->step(/* in_directionUp= */ false); EXPECT_TRUE(result.isOk()); - EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChangedMock, kTuneTimeoutSec); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); } /** @@ -955,7 +1048,7 @@ TEST_P(BroadcastRadioHalTest, SetConfigFlags) { * * Verifies that: * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; - * - the complete list is fetched within kProgramListScanTimeoutSec; + * - the complete list is fetched within kProgramListScanTimeoutMs; * - stopProgramListUpdates does not crash. */ TEST_P(BroadcastRadioHalTest, GetProgramListFromEmptyFilter) { @@ -969,7 +1062,7 @@ TEST_P(BroadcastRadioHalTest, GetProgramListFromEmptyFilter) { * * Verifies that: * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; - * - the complete list is fetched within kProgramListScanTimeoutSec; + * - the complete list is fetched within kProgramListScanTimeoutMs; * - stopProgramListUpdates does not crash; * - result for startProgramListUpdates using a filter with AMFM_FREQUENCY_KHZ value of the first * AMFM program matches the expected result. @@ -1017,7 +1110,7 @@ TEST_P(BroadcastRadioHalTest, GetProgramListFromAmFmFilter) { * * Verifies that: * - startProgramListUpdates either succeeds or returns NOT_SUPPORTED; - * - the complete list is fetched within kProgramListScanTimeoutSec; + * - the complete list is fetched within kProgramListScanTimeoutMs; * - stopProgramListUpdates does not crash; * - result for startProgramListUpdates using a filter with DAB_ENSEMBLE value of the first DAB * program matches the expected result. -- GitLab From e5c4f5546ae88683fe11924621a338111476a150 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 23 Jun 2023 19:49:05 +0000 Subject: [PATCH 063/376] Adjust documentation for UNKNOWN dataspaces. Summarize the recommendations in {STANDARD, TRANSFER, RANGE}_UNSPECIFIED, but also indicate the UNKNOWN isn't really appropriate to signal. Bug: 288461753 Change-Id: I237e45b7d83ed620ee79b9e39aed73fe71a047b0 Test: docs --- .../hardware/graphics/common/Dataspace.aidl | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl index 3ff0a6534b..4b6613e914 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl @@ -23,11 +23,26 @@ enum Dataspace { /** * Default-assumption data space, when not explicitly specified. * - * It is safest to assume the buffer is an image with sRGB primaries and - * encoding ranges, but the consumer and/or the producer of the data may - * simply be using defaults. No automatic gamma transform should be - * expected, except for a possible display gamma transform when drawn to a - * screen. + * IAllocator implementations must not assume a particular dataspace interpretation when + * allocating a buffer. That is, the dataspace stored on a buffer's metadata must + * explicitly be UNKNOWN at the time of allocation. All other vendor implementations (for + * example, IComposer) are suggested to assume that the buffer is an image that conforms + * to the recommendations outlined by STANDARD_UNSPECIFIED, TRANSFER_UNSPECIFIED, and + * RANGE_UNSPECIFIED in order to avoid obviously-broken behavior. + * + * This means: + * - RGB buffers may be assumed to follow sRGB (IEC 61966-2.1) + * - YCbCr buffers smaller than 720p may be assumed to follow BT. 601-7 + * - YCbCr buffers at least 720p may be assumed to follow BT. 709-6 + * - Y buffers are full range with an undefined transfer and primaries + * - All other buffer formats may be treated in an implementation-defined manner + * + * It is the framework's - and application's - responsibility to communicate + * an accurate dataspace for any buffers throughout the system to guarantee + * well-defined behavior. For the framework, this means translating UNKNOWN + * dataspaces to a chosen default, and setting gralloc metadata on the buffer + * accordingly. For the application, this means signaling a defined dataspace + * to any framework apis. */ UNKNOWN = 0x0, -- GitLab From e50ed5d4e6d983fbf490527c847144e103a61109 Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 29 Jun 2023 19:54:40 -0700 Subject: [PATCH 064/376] Upgrade Composer interface version Test: device boots, atest libsurfacerflinger_unittest, atest VtsHalGraphicsComposer3_TargetTest BUG: 284866749 BUG: 287517352 Change-Id: I803a4291c0839857f7e23696da7dac4c15a21e09 --- compatibility_matrices/compatibility_matrix.9.xml | 2 +- graphics/Android.bp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 14b921004e..559e7c2a4b 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -248,7 +248,7 @@ android.hardware.graphics.composer3 - 2 + 3 IComposer default diff --git a/graphics/Android.bp b/graphics/Android.bp index 2fbcb41c47..8a69f0950e 100644 --- a/graphics/Android.bp +++ b/graphics/Android.bp @@ -53,13 +53,13 @@ cc_defaults { cc_defaults { name: "android.hardware.graphics.composer3-ndk_static", static_libs: [ - "android.hardware.graphics.composer3-V2-ndk", + "android.hardware.graphics.composer3-V3-ndk", ], } cc_defaults { name: "android.hardware.graphics.composer3-ndk_shared", shared_libs: [ - "android.hardware.graphics.composer3-V2-ndk", + "android.hardware.graphics.composer3-V3-ndk", ], } -- GitLab From d40b5667d71af5fb250c676d7570eea89d22909f Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 23 May 2023 21:44:49 +0000 Subject: [PATCH 065/376] [Composer-HAL-AIDL] Interface changes with getDisplayConfigurations Updates to the AIDL interfaces with getDisplayConfigurations This will be replacing the getDisplayConfig api that will be deprecated in the upcoming CL's. implementations will follow in the upcoming CL's Test: device boots, atest libsurfacerflinger_unittest, atest VtsHalGraphicsComposer3_TargetTest BUG: 284866749 BUG: 287517352 Change-Id: I2b64dcaace26a297f308e8f5c2568c35c9cd38cb --- graphics/composer/aidl/Android.bp | 2 +- .../composer3/DisplayConfiguration.aidl | 47 ++++++++++++++ .../graphics/composer3/IComposerClient.aidl | 4 ++ .../composer3/DisplayConfiguration.aidl | 63 +++++++++++++++++++ .../graphics/composer3/IComposerClient.aidl | 25 +++++--- 5 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 40448ec43e..88abb7387c 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -31,7 +31,7 @@ aidl_interface { enabled: true, support_system_process: true, }, - frozen: true, + frozen: false, vndk_use_version: "1", srcs: [ "android/hardware/graphics/composer3/*.aidl", diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl new file mode 100644 index 0000000000..908842a467 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -0,0 +1,47 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable DisplayConfiguration { + int configId; + int width; + int height; + @nullable android.hardware.graphics.composer3.DisplayConfiguration.Dpi dpi; + int configGroup; + int vsyncPeriod; + parcelable Dpi { + float x; + float y; + } +} diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl index cb85a88995..2f08b6fbf9 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl @@ -44,6 +44,9 @@ interface IComposerClient { float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); + /** + * @deprecated use getDisplayConfigurations instead. For legacy support getDisplayConfigs should return at least one valid config. All the configs returned from the getDisplayConfigs should also be returned from getDisplayConfigurations. + */ int[] getDisplayConfigs(long display); android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display); android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display); @@ -79,6 +82,7 @@ interface IComposerClient { android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities(); android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy); void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); + android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; const int EX_BAD_LAYER = 3; diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl new file mode 100644 index 0000000000..b0095d2dcd --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -0,0 +1,63 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable DisplayConfiguration { + /** + * The config id, to be used with IComposerClient.setActiveConfig. + */ + int configId; + + /** + * Dimensions in pixels + */ + int width; + int height; + + /** + * Dots per thousand inches. + * If the DPI for a configuration is unavailable or is + * considered unreliable, the device may set null instead. + */ + parcelable Dpi { + float x; + float y; + } + @nullable Dpi dpi; + + /** + * The configuration group ID this config is associated to. + * Switching between configurations within the same group may be + * done seamlessly in some conditions via + * setActiveConfigWithConstraints. Configurations which share the + * same config group are similar in all attributes except for the + * vsync period. + */ + int configGroup; + + /** + * Vsync period in nanoseconds. This period represents the internal + * frequency of the display. IComposerCallback.onVsync is expected + * to be called on each vsync event. For non-VRR configurations, a + * frame can be presented on each vsync event. + * + * A present fence, retrieved from CommandResultPayload.presentFence + * must be signaled on a vsync boundary. + */ + int vsyncPeriod; +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 4e77f86cf4..5d04a28b00 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -28,6 +28,7 @@ import android.hardware.graphics.composer3.ContentType; import android.hardware.graphics.composer3.DisplayAttribute; import android.hardware.graphics.composer3.DisplayCapability; import android.hardware.graphics.composer3.DisplayCommand; +import android.hardware.graphics.composer3.DisplayConfiguration; import android.hardware.graphics.composer3.DisplayConnectionType; import android.hardware.graphics.composer3.DisplayContentSample; import android.hardware.graphics.composer3.DisplayContentSamplingAttributes; @@ -263,15 +264,12 @@ interface IComposerClient { DisplayCapability[] getDisplayCapabilities(long display); /** - * Returns handles for all of the valid display configurations on this - * display. - * This should never return INVALID_CONFIGURATION as a valid value. + * @deprecated use getDisplayConfigurations instead. + * For legacy support getDisplayConfigs should return at least one valid config. + * All the configs returned from the getDisplayConfigs should also be returned + * from getDisplayConfigurations. * - * @param display is the display to query. - * - * @return is an array of configuration handles. - * - * @exception EX_BAD_DISPLAY when an invalid display handle was passed in. + * @see getDisplayConfigurations */ int[] getDisplayConfigs(long display); @@ -864,4 +862,15 @@ interface IComposerClient { * false when refresh rate callback is disabled. */ void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); + + /** + * Returns all of the valid display configurations. + * getDisplayConfigurations is the superset of getDisplayConfigs and + * getDisplayConfigs should return at least one config. + * + * @param display is the display for which the configurations are requested. + * + * @see getDisplayConfigs + */ + DisplayConfiguration[] getDisplayConfigurations(long display); } -- GitLab From 77fe4802dd5436d81c94e37c96026ef545c98cab Mon Sep 17 00:00:00 2001 From: Hakjun Choi Date: Tue, 20 Jun 2023 13:18:42 +0000 Subject: [PATCH 066/376] Add setSatellitePlmn() related HAL apis Provide api to let modem know which are the satellite plmn BUG: 287538011 Test: atest VtsHalRadioTargetTest Test: MO/MT call, SMS, MMS in live network with a phone Change-Id: I7be865098f67a1c7c0273d7b9b6508968618a0f3 --- .../hardware/radio/network/IRadioNetwork.aidl | 1 + .../radio/network/IRadioNetworkResponse.aidl | 1 + .../hardware/radio/network/IRadioNetwork.aidl | 14 ++++++++ .../radio/network/IRadioNetworkResponse.aidl | 17 ++++++++++ .../include/libradiocompat/RadioNetwork.h | 3 ++ .../libradiocompat/network/RadioNetwork.cpp | 8 +++++ radio/aidl/vts/radio_network_response.cpp | 6 ++++ radio/aidl/vts/radio_network_test.cpp | 34 +++++++++++++++++++ radio/aidl/vts/radio_network_utils.h | 2 ++ 9 files changed, 86 insertions(+) diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl index cbc1e30fbd..d1a831b0a5 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl @@ -82,4 +82,5 @@ interface IRadioNetwork { oneway void isNullCipherAndIntegrityEnabled(in int serial); oneway void isN1ModeEnabled(in int serial); oneway void setN1ModeEnabled(in int serial, boolean enable); + oneway void setSatellitePlmn(in int serial, in List plmnList); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl index c86bebcf1d..bf43d7c1f6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -81,4 +81,5 @@ interface IRadioNetworkResponse { oneway void isNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); oneway void isN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled); oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info); + oneway void setSatellitePlmnResponse(in android.hardware.radio.RadioResponseInfo info); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index e4c385670d..2f40bd6a86 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -556,4 +556,18 @@ oneway interface IRadioNetwork { * Response function is IRadioNetworkResponse.setN1ModeEnabledResponse() */ void setN1ModeEnabled(in int serial, boolean enable); + + /** + * Set the non-terrestrial PLMN with lower priority than terrestrial networks. + * MCC/MNC broadcast by the non-terrestrial networks may not be included in OPLMNwACT file on + * SIM profile. Acquisition of satellite based system is lower priority to terrestrial + * networks. UE shall make all attempts to acquire terrestrial service prior to camping on + * satellite LTE service. + * + * @param serial Serial number of request. + * @param plmnList The list of roaming PLMN used for connecting to satellite networks. + * + * Response function is IRadioNetworkResponse.setSatellitePlmnResponse() + */ + void setSatellitePlmn(in int serial, in List plmnList); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index db37a0e649..9798944147 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -668,4 +668,21 @@ oneway interface IRadioNetworkResponse { * RadioError:INVALID_STATE */ void setN1ModeEnabledResponse(in RadioResponseInfo info); + + /** + * Response of setSatellitePlmn. + * This is an optional API. + * + * @param info Response info struct containing response type, serial no. and error. + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:INVALID_MODEM_STATE + * RadioError:MODEM_ERR + * RadioError:NO_RESOURCES + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + */ + void setSatellitePlmnResponse(in RadioResponseInfo info); } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index d57c83de19..ff3f10de6f 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -108,6 +108,9 @@ class RadioNetwork : public RadioCompatBase, ::ndk::ScopedAStatus setNullCipherAndIntegrityEnabled(int32_t serial, bool enabled) override; ::ndk::ScopedAStatus isNullCipherAndIntegrityEnabled(int32_t serial) override; + ::ndk::ScopedAStatus setSatellitePlmn(int32_t serial, + const std::vector& plmnList) override; + protected: std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index a379eec10b..1aa7c29a79 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -372,4 +372,12 @@ ScopedAStatus RadioNetwork::setN1ModeEnabled(int32_t serial, bool /*enable*/) { respond()->setN1ModeEnabledResponse(notSupported(serial)); return ok(); } + +ScopedAStatus RadioNetwork::setSatellitePlmn(int32_t serial, + const std::vector& /*plmnList*/) { + LOG_CALL << serial; + LOG(ERROR) << " setSatellitePlmn is unsupported by HIDL HALs"; + respond()->setSatellitePlmnResponse(notSupported(serial)); + return ok(); +} } // namespace android::hardware::radio::compat diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index 25d45a5577..eab9fac167 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -320,3 +320,9 @@ ndk::ScopedAStatus RadioNetworkResponse::setN1ModeEnabledResponse(const RadioRes parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } + +ndk::ScopedAStatus RadioNetworkResponse::setSatellitePlmnResponse(const RadioResponseInfo& info) { + rspInfo = info; + parent_network.notify(info.serial); + return ndk::ScopedAStatus::ok(); +} diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 2beb249674..9af2494199 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -2076,3 +2076,37 @@ TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); } + +/** + * Test IRadioNetwork.setSatellitePlmn() for the response returned. + */ +TEST_P(RadioNetworkTest, setSatellitePlmn) { + int32_t aidl_version; + std::vector plmnList = {"00101", "00102", "00103"}; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + if (aidl_version < 3) { + ALOGI("Skipped the test since setSatellitePlmn is not supported on version < 3."); + GTEST_SKIP(); + } + + serial = GetRandomSerialNumber(); + + ndk::ScopedAStatus res = radio_network->setSatellitePlmn(serial, plmnList); + ASSERT_OK(res); + + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); + EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); + + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, + { + RadioError::NONE, + RadioError::INVALID_ARGUMENTS, + RadioError::INVALID_MODEM_STATE, + RadioError::MODEM_ERR, + RadioError::NO_RESOURCES, + RadioError::RADIO_NOT_AVAILABLE, + RadioError::REQUEST_NOT_SUPPORTED, + })); +} diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index 8f8f6b070f..c2466acb5b 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -169,6 +169,8 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { const RadioResponseInfo& info, bool isEnabled) override; virtual ndk::ScopedAStatus setN1ModeEnabledResponse(const RadioResponseInfo& info) override; + + virtual ndk::ScopedAStatus setSatellitePlmnResponse(const RadioResponseInfo& info) override; }; /* Callback class for radio network indication */ -- GitLab From 02fe4772187e6d22d4e16b35327dba5f3234a1be Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 30 Jun 2023 18:04:41 -0700 Subject: [PATCH 067/376] [Composer VTS] Adds VTS for getDisplayConfigurations Test getDisplayConfigurations on the version 3 of the composer. Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 287518719 BUG: 284866749 Change-Id: Ibb654dbeb4b164d86f92f51f8083ed1ab06fcfa4 --- .../composer/aidl/vts/VtsComposerClient.cpp | 124 ++++++++++++------ .../composer/aidl/vts/VtsComposerClient.h | 9 +- .../VtsHalGraphicsComposer3_TargetTest.cpp | 109 +++++++++++++++ 3 files changed, 202 insertions(+), 40 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp index 25b0ca0a17..bf42d8898c 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp @@ -58,7 +58,7 @@ bool VtsComposerClient::tearDown() { return verifyComposerCallbackParams() && destroyAllLayers(); } -std::pair VtsComposerClient::getInterfaceVersion() { +std::pair VtsComposerClient::getInterfaceVersion() const { int32_t version = 1; auto status = mComposerClient->getInterfaceVersion(&version); return {std::move(status), version}; @@ -295,7 +295,24 @@ std::pair VtsComposerClient::getDisplayCon std::pair> VtsComposerClient::getDisplayConfigs( int64_t display) { std::vector outConfigs; - return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs}; + if (!getDisplayConfigurationSupported()) { + return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs}; + } + + auto [status, configs] = getDisplayConfigurations(display); + if (!status.isOk()) { + return {std::move(status), outConfigs}; + } + for (const auto& config : configs) { + outConfigs.emplace_back(config.configId); + } + return {std::move(status), outConfigs}; +} + +std::pair> +VtsComposerClient::getDisplayConfigurations(int64_t display) { + std::vector outConfigs; + return {mComposerClient->getDisplayConfigurations(display, &outConfigs), outConfigs}; } std::pair VtsComposerClient::getDisplayVsyncPeriod(int64_t display) { @@ -439,31 +456,41 @@ std::pair> VtsComposerClient::getDisplays vtsDisplays.reserve(displays.size()); for (int64_t display : displays) { auto vtsDisplay = VtsDisplay{display}; - auto configs = getDisplayConfigs(display); - if (!configs.first.isOk()) { - ALOGE("Unable to get the displays for test, failed to get the configs " - "for display %" PRId64, - display); - return {std::move(configs.first), vtsDisplays}; - } - for (int config : configs.second) { - auto status = addDisplayConfig(&vtsDisplay, config); + if (getDisplayConfigurationSupported()) { + auto [status, configs] = getDisplayConfigurations(display); + if (!status.isOk()) { + ALOGE("Unable to get the displays for test, failed to get the DisplayConfigs " + "for display %" PRId64, + display); + return {std::move(status), vtsDisplays}; + } + addDisplayConfigs(&vtsDisplay, configs); + } else { + auto [status, configs] = getDisplayConfigs(display); if (!status.isOk()) { - ALOGE("Unable to get the displays for test, failed to add config " + ALOGE("Unable to get the displays for test, failed to get the configs " "for display %" PRId64, display); return {std::move(status), vtsDisplays}; } + for (int config : configs) { + status = addDisplayConfigLegacy(&vtsDisplay, config); + if (!status.isOk()) { + ALOGE("Unable to get the displays for test, failed to add config " + "for display %" PRId64, + display); + return {std::move(status), vtsDisplays}; + } + } } - - auto config = getActiveConfig(display); - if (!config.first.isOk()) { + auto activeConfig = getActiveConfig(display); + if (!activeConfig.first.isOk()) { ALOGE("Unable to get the displays for test, failed to get active config " - "for display %" PRId64, display); - return {std::move(config.first), vtsDisplays}; + "for display %" PRId64, + display); + return {std::move(activeConfig.first), vtsDisplays}; } - - auto status = updateDisplayProperties(&vtsDisplay, config.second); + auto status = updateDisplayProperties(&vtsDisplay, activeConfig.second); if (!status.isOk()) { ALOGE("Unable to get the displays for test, " "failed to update the properties " @@ -480,39 +507,53 @@ std::pair> VtsComposerClient::getDisplays } } -ScopedAStatus VtsComposerClient::addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config) { - const auto width = - getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH); - const auto height = - getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT); +void VtsComposerClient::addDisplayConfigs(VtsDisplay* vtsDisplay, + const std::vector& configs) { + for (const auto& config : configs) { + vtsDisplay->addDisplayConfig(config.configId, {config.vsyncPeriod, config.configGroup}); + } +} + +ScopedAStatus VtsComposerClient::addDisplayConfigLegacy(VtsDisplay* vtsDisplay, int32_t config) { const auto vsyncPeriod = getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::VSYNC_PERIOD); const auto configGroup = getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::CONFIG_GROUP); - if (width.first.isOk() && height.first.isOk() && vsyncPeriod.first.isOk() && - configGroup.first.isOk()) { + if (vsyncPeriod.first.isOk() && configGroup.first.isOk()) { vtsDisplay->addDisplayConfig(config, {vsyncPeriod.second, configGroup.second}); return ScopedAStatus::ok(); } - LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk() - << ", height: " << height.first.isOk() << ", vsync: " << vsyncPeriod.first.isOk() + LOG(ERROR) << "Failed to update display property vsync: " << vsyncPeriod.first.isOk() << ", config: " << configGroup.first.isOk(); return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG); } ScopedAStatus VtsComposerClient::updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config) { - const auto width = - getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH); - const auto height = - getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT); - if (width.first.isOk() && height.first.isOk()) { - vtsDisplay->setDimensions(width.second, height.second); - return ScopedAStatus::ok(); - } + if (getDisplayConfigurationSupported()) { + auto [status, configs] = getDisplayConfigurations(vtsDisplay->getDisplayId()); + if (status.isOk()) { + for (const auto& displayConfig : configs) { + if (displayConfig.configId == config) { + vtsDisplay->setDimensions(displayConfig.width, displayConfig.height); + return ScopedAStatus::ok(); + } + } + } + LOG(ERROR) << "Failed to update display property with DisplayConfig"; + } else { + const auto width = + getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH); + const auto height = + getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT); + if (width.first.isOk() && height.first.isOk()) { + vtsDisplay->setDimensions(width.second, height.second); + return ScopedAStatus::ok(); + } - LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk() - << ", height: " << height.first.isOk(); + LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk() + << ", height: " << height.first.isOk(); + } return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG); } @@ -576,6 +617,13 @@ bool VtsComposerClient::verifyComposerCallbackParams() { return isValid; } +bool VtsComposerClient::getDisplayConfigurationSupported() const { + auto [status, interfaceVersion] = getInterfaceVersion(); + EXPECT_TRUE(status.isOk()); + // getDisplayConfigurations api is supported starting interface version 3 + return interfaceVersion >= 3; +} + bool VtsComposerClient::destroyAllLayers() { std::unordered_map physicalDisplays; while (!mDisplayResources.empty()) { diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h index ea3318c2ce..1add23cadf 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.h +++ b/graphics/composer/aidl/vts/VtsComposerClient.h @@ -61,7 +61,7 @@ class VtsComposerClient { bool tearDown(); - std::pair getInterfaceVersion(); + std::pair getInterfaceVersion() const; std::pair createVirtualDisplay(int32_t width, int32_t height, PixelFormat pixelFormat, @@ -142,6 +142,9 @@ class VtsComposerClient { std::pair> getDisplayConfigs(int64_t display); + std::pair> getDisplayConfigurations( + int64_t display); + std::pair getDisplayVsyncPeriod(int64_t display); ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled); @@ -190,7 +193,9 @@ class VtsComposerClient { std::vector takeListOfRefreshRateChangedDebugData(); private: - ScopedAStatus addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config); + void addDisplayConfigs(VtsDisplay*, const std::vector&); + ScopedAStatus addDisplayConfigLegacy(VtsDisplay*, int32_t config); + bool getDisplayConfigurationSupported() const; ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config); ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index bbcd36ff7b..d559213129 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1208,6 +1208,110 @@ TEST_P(GraphicsComposerAidlV2Test, GetOverlaySupport) { } } +class GraphicsComposerAidlV3Test : public GraphicsComposerAidlTest { + protected: + void SetUp() override { + GraphicsComposerAidlTest::SetUp(); + if (getInterfaceVersion() <= 2) { + GTEST_SKIP() << "Device interface version is expected to be >= 3"; + } + } +}; + +TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) { + for (const auto& display : mDisplays) { + const auto& [status, displayConfigurations] = + mComposerClient->getDisplayConfigurations(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); + EXPECT_FALSE(displayConfigurations.empty()); + + for (const auto& displayConfig : displayConfigurations) { + EXPECT_NE(-1, displayConfig.width); + EXPECT_NE(-1, displayConfig.height); + EXPECT_NE(-1, displayConfig.vsyncPeriod); + EXPECT_NE(-1, displayConfig.configGroup); + if (displayConfig.dpi) { + EXPECT_NE(-1, displayConfig.dpi->x); + EXPECT_NE(-1, displayConfig.dpi->y); + } + } + } +} + +TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigsIsSubsetOfGetDisplayConfigurations) { + for (const auto& display : mDisplays) { + const auto& [status, displayConfigurations] = + mComposerClient->getDisplayConfigurations(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); + + const auto& [legacyConfigStatus, legacyConfigs] = + mComposerClient->getDisplayConfigs(display.getDisplayId()); + EXPECT_TRUE(legacyConfigStatus.isOk()); + EXPECT_FALSE(legacyConfigs.empty()); + EXPECT_TRUE(legacyConfigs.size() <= displayConfigurations.size()); + + for (const auto legacyConfigId : legacyConfigs) { + const auto& legacyWidth = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::WIDTH); + const auto& legacyHeight = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::HEIGHT); + const auto& legacyVsyncPeriod = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::VSYNC_PERIOD); + const auto& legacyConfigGroup = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::CONFIG_GROUP); + const auto& legacyDpiX = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::DPI_X); + const auto& legacyDpiY = mComposerClient->getDisplayAttribute( + display.getDisplayId(), legacyConfigId, DisplayAttribute::DPI_Y); + + EXPECT_TRUE(legacyWidth.first.isOk() && legacyHeight.first.isOk() && + legacyVsyncPeriod.first.isOk() && legacyConfigGroup.first.isOk()); + + EXPECT_TRUE(std::any_of( + displayConfigurations.begin(), displayConfigurations.end(), + [&](const auto& displayConfiguration) { + const bool requiredAttributesPredicate = + displayConfiguration.configId == legacyConfigId && + displayConfiguration.width == legacyWidth.second && + displayConfiguration.height == legacyHeight.second && + displayConfiguration.vsyncPeriod == legacyVsyncPeriod.second && + displayConfiguration.configGroup == legacyConfigGroup.second; + + if (!requiredAttributesPredicate) { + // Required attributes did not match + return false; + } + + // Check optional attributes + const auto& [legacyDpiXStatus, legacyDpiXValue] = legacyDpiX; + const auto& [legacyDpiYStatus, legacyDpiYValue] = legacyDpiY; + if (displayConfiguration.dpi) { + if (!legacyDpiXStatus.isOk() || !legacyDpiYStatus.isOk()) { + // getDisplayAttribute failed for optional attributes + return false; + } + + // DPI values in DisplayConfigurations are not scaled (* 1000.f) + // the way they are in the legacy DisplayConfigs. + constexpr float kEpsilon = 0.001f; + return std::abs(displayConfiguration.dpi->x - + legacyDpiXValue / 1000.f) < kEpsilon && + std::abs(displayConfiguration.dpi->y - + legacyDpiYValue / 1000.f) < kEpsilon; + } else { + return !legacyDpiXStatus.isOk() && !legacyDpiYStatus.isOk() && + EX_SERVICE_SPECIFIC == legacyDpiXStatus.getExceptionCode() && + EX_SERVICE_SPECIFIC == legacyDpiYStatus.getExceptionCode() && + IComposerClient::EX_UNSUPPORTED == + legacyDpiXStatus.getServiceSpecificError() && + IComposerClient::EX_UNSUPPORTED == + legacyDpiYStatus.getServiceSpecificError(); + } + })); + } + } +} + // Tests for Command. class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { protected: @@ -2641,6 +2745,11 @@ INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlV2Test, testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), ::android::PrintInstanceNameToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlV3Test); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlV3Test, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandV2Test); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandV2Test, -- GitLab From b2419270972129dd41d3da9dc5bd2f7168342340 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Thu, 18 Aug 2022 10:30:24 -0700 Subject: [PATCH 068/376] composer: vts: changing config groups should not check newVsyncAppliedTimeNanos Bug: 240542961 Test: by partner Change-Id: Id39d6c4a2a238b43dcf7b24249cab84a27eaf9dd --- graphics/composer/2.4/vts/functional/AndroidTest.xml | 2 +- .../VtsHalGraphicsComposerV2_4TargetTest.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/graphics/composer/2.4/vts/functional/AndroidTest.xml b/graphics/composer/2.4/vts/functional/AndroidTest.xml index 773db93255..76269952a2 100644 --- a/graphics/composer/2.4/vts/functional/AndroidTest.xml +++ b/graphics/composer/2.4/vts/functional/AndroidTest.xml @@ -31,6 +31,6 @@ diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index 35225d9a03..dac46f948a 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -544,10 +544,12 @@ void GraphicsComposerHidlTest::Test_setActiveConfigWithConstraints(const TestPar setActiveConfigWithConstraints(display, config2, constraints, &timeline)); EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos >= constraints.desiredTimeNanos); - // Refresh rate should change within a reasonable time - constexpr std::chrono::nanoseconds kReasonableTimeForChange = 1s; // 1 second - EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos - constraints.desiredTimeNanos <= - kReasonableTimeForChange.count()); + if (configGroup1 == configGroup2) { + // Refresh rate should change within a reasonable time + constexpr std::chrono::nanoseconds kReasonableTimeForChange = 1s; + EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos - constraints.desiredTimeNanos <= + kReasonableTimeForChange.count()); + } if (timeline.refreshRequired) { if (params.refreshMiss) { -- GitLab From 7ee5f52f282eebf37c3f257924e77ed6d0792e5b Mon Sep 17 00:00:00 2001 From: Aishwarya Mallampati Date: Tue, 18 Jul 2023 02:33:02 +0000 Subject: [PATCH 069/376] Revert "Block data call" This reverts commit e94dd21fdceb22b7dd52f976ccb778f4449d4691. Reason for revert: Replace SATELLITE_ENABLED with SERVICE_OPTION_NOT_SUPPORTED Change-Id: Icda920e607cf4bf0517fbf97547d86144c0051f1 --- .../android/hardware/radio/data/DataCallFailCause.aidl | 1 - radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl | 4 ---- 2 files changed, 5 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl index 362be3a3f6..009b428273 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl @@ -379,5 +379,4 @@ enum DataCallFailCause { SLICE_REJECTED = 0x8CC, MATCH_ALL_RULE_NOT_ALLOWED = 0x8CD, ALL_MATCHING_RULES_FAILED = 0x8CE, - SATELLITE_ENABLED = 0x8CF, } diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl index ef68c8c754..e015e8eec9 100644 --- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl +++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl @@ -1306,8 +1306,4 @@ enum DataCallFailCause { * If connection failed for all matching URSP rules. */ ALL_MATCHING_RULES_FAILED = 0x8CE, - /** - * Data call is not allowed as device is connected to satellite. - */ - SATELLITE_ENABLED = 0x8CF, } -- GitLab From 978de0a8a4968774e81e10e716a46bd9e1369479 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 19 Jul 2023 17:20:19 +0000 Subject: [PATCH 070/376] Fix null pointer crash in AIDL radio HAL VTS Bug: 277531858 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d --- .../aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 8bee1b2d1f..790d60b252 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -997,13 +997,12 @@ TEST_P(BroadcastRadioHalTest, SetConfigFlags) { LOG(DEBUG) << "SetConfigFlags Test"; auto get = [&](ConfigFlag flag) -> bool { - bool* gotValue = nullptr; + bool gotValue; - auto halResult = mModule->isConfigFlagSet(flag, gotValue); + auto halResult = mModule->isConfigFlagSet(flag, &gotValue); - EXPECT_FALSE(gotValue == nullptr); EXPECT_TRUE(halResult.isOk()); - return *gotValue; + return gotValue; }; auto notSupportedError = resultToInt(Result::NOT_SUPPORTED); -- GitLab From 3def8566020a8e14f19a50f38f8fca4e163c42d3 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Thu, 20 Jul 2023 16:56:07 +0800 Subject: [PATCH 071/376] Use android.hardware.graphics.common wrap. Bug: 291745893 Test: builds Change-Id: I4de7ecf4593957d4ef76ff3d66b1b7daa0d3f11a --- camera/device/default/Android.bp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp index b577597d8c..b9f10d6fd6 100644 --- a/camera/device/default/Android.bp +++ b/camera/device/default/Android.bp @@ -25,7 +25,10 @@ package { cc_library_shared { name: "camera.device-external-impl", - defaults: ["hidl_defaults"], + defaults: [ + "android.hardware.graphics.common-ndk_shared", + "hidl_defaults", + ], proprietary: true, srcs: [ "ExternalCameraDevice.cpp", @@ -38,7 +41,6 @@ cc_library_shared { "android.hardware.camera.common-V1-ndk", "android.hardware.camera.device-V1-ndk", "android.hardware.graphics.allocator-V1-ndk", - "android.hardware.graphics.common-V4-ndk", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@4.0", -- GitLab From 3bd4d9b299751f0d4dd9f1810f45d097dc643918 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 19 Jul 2023 00:38:57 +0000 Subject: [PATCH 072/376] Implement config flag in default AIDL radio HAL Implemented getting and setting config flag method in IBroadcastRadio inferface for default AIDL broadcast radio HAL. Bug: 249850737 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Iedbae78fe3afccab5e8cbb850b2d8f3da3ab20d4 --- .../aidl/default/BroadcastRadio.cpp | 20 ++++++++++++------- broadcastradio/aidl/default/BroadcastRadio.h | 3 +++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp index c0c475a532..4d097c1607 100644 --- a/broadcastradio/aidl/default/BroadcastRadio.cpp +++ b/broadcastradio/aidl/default/BroadcastRadio.cpp @@ -421,20 +421,26 @@ ScopedAStatus BroadcastRadio::stopProgramListUpdates() { return ScopedAStatus::ok(); } -ScopedAStatus BroadcastRadio::isConfigFlagSet(ConfigFlag flag, [[maybe_unused]] bool* returnIsSet) { +ScopedAStatus BroadcastRadio::isConfigFlagSet(ConfigFlag flag, bool* returnIsSet) { LOG(DEBUG) << __func__ << ": flag = " << toString(flag); - LOG(INFO) << __func__ << ": getting ConfigFlag is not supported"; - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - resultToInt(Result::NOT_SUPPORTED), "getting ConfigFlag is not supported"); + int flagBit = static_cast(flag); + lock_guard lk(mMutex); + *returnIsSet = ((mConfigFlagValues >> flagBit) & 1) == 1; + return ScopedAStatus::ok(); } ScopedAStatus BroadcastRadio::setConfigFlag(ConfigFlag flag, bool value) { LOG(DEBUG) << __func__ << ": flag = " << toString(flag) << ", value = " << value; - LOG(INFO) << __func__ << ": setting ConfigFlag is not supported"; - return ScopedAStatus::fromServiceSpecificErrorWithMessage( - resultToInt(Result::NOT_SUPPORTED), "setting ConfigFlag is not supported"); + int flagBitMask = 1 << (static_cast(flag)); + lock_guard lk(mMutex); + if (value) { + mConfigFlagValues |= flagBitMask; + } else { + mConfigFlagValues &= ~flagBitMask; + } + return ScopedAStatus::ok(); } ScopedAStatus BroadcastRadio::setParameters( diff --git a/broadcastradio/aidl/default/BroadcastRadio.h b/broadcastradio/aidl/default/BroadcastRadio.h index 1c85ddc51d..092776f62d 100644 --- a/broadcastradio/aidl/default/BroadcastRadio.h +++ b/broadcastradio/aidl/default/BroadcastRadio.h @@ -75,6 +75,9 @@ class BroadcastRadio final : public BnBroadcastRadio { ProgramSelector mCurrentProgram GUARDED_BY(mMutex) = {}; std::shared_ptr mCallback GUARDED_BY(mMutex); + // Bitmap for all ConfigFlag values + int mConfigFlagValues GUARDED_BY(mMutex) = 0; + std::optional getAmFmRangeLocked() const; void cancelLocked(); ProgramInfo tuneInternalLocked(const ProgramSelector& sel); -- GitLab From be1b4d6ccec45f47bbb9459bf9aa31b4c6875c7b Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Thu, 20 Jul 2023 19:11:37 +0000 Subject: [PATCH 073/376] Support per-port display configs in VTS Bug: 277855934 Change-Id: I92e1615d8eb9466b40e02f8e2df8b3432e927af6 --- .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 78 +++++++++++++------ 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index b0472209dc..269abd150d 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -129,33 +129,20 @@ class GraphicsCompositionTestBase : public ::testing::Test { return {false, graphicBuffer}; } - uint64_t getStableDisplayId(int64_t display) { - const auto& [status, identification] = - mComposerClient->getDisplayIdentificationData(display); - EXPECT_TRUE(status.isOk()); + // Gets the per-display XML config + std::unique_ptr getDisplayConfigXml(int64_t display) { - if (const auto info = ::android::parseDisplayIdentificationData( - static_cast(identification.port), identification.data)) { - return info->id.value; + if (auto document = getDisplayConfigXmlByStableId(getStableDisplayId(display)); + document != nullptr) { + return document; } - return ::android::PhysicalDisplayId::fromPort(static_cast(identification.port)) - .value; - } - - // Gets the per-display XML config - std::unique_ptr getDisplayConfigXml(int64_t display) { - std::stringstream pathBuilder; - pathBuilder << "/vendor/etc/displayconfig/display_id_" << getStableDisplayId(display) - << ".xml"; - const std::string path = pathBuilder.str(); - auto document = std::make_unique(); - const tinyxml2::XMLError error = document->LoadFile(path.c_str()); - if (error == tinyxml2::XML_SUCCESS) { + // Fallback to looking up a per-port config if no config exists for the full ID + if (auto document = getDisplayConfigXmlByPort(getPort(display)); document != nullptr) { return document; - } else { - return nullptr; } + + return nullptr; } // Gets the max display brightness for this display. @@ -256,6 +243,53 @@ class GraphicsCompositionTestBase : public ::testing::Test { } } } + + uint8_t getPort(int64_t display) { + const auto& [status, identification] = + mComposerClient->getDisplayIdentificationData(display); + EXPECT_TRUE(status.isOk()); + return static_cast(identification.port); + } + + uint64_t getStableDisplayId(int64_t display) { + const auto& [status, identification] = + mComposerClient->getDisplayIdentificationData(display); + EXPECT_TRUE(status.isOk()); + + if (const auto info = ::android::parseDisplayIdentificationData( + static_cast(identification.port), identification.data)) { + return info->id.value; + } + + return ::android::PhysicalDisplayId::fromPort(static_cast(identification.port)) + .value; + } + + std::unique_ptr loadXml(const std::string& path) { + auto document = std::make_unique(); + const tinyxml2::XMLError error = document->LoadFile(path.c_str()); + if (error != tinyxml2::XML_SUCCESS) { + ALOGD("%s: Failed to load config file: %s", __func__, path.c_str()); + return nullptr; + } + + ALOGD("%s: Successfully loaded config file: %s", __func__, path.c_str()); + return document; + } + + std::unique_ptr getDisplayConfigXmlByPort(uint8_t port) { + std::stringstream pathBuilder; + pathBuilder << "/vendor/etc/displayconfig/display_port_" << static_cast(port) + << ".xml"; + return loadXml(pathBuilder.str()); + } + + std::unique_ptr getDisplayConfigXmlByStableId(uint64_t stableId) { + std::stringstream pathBuilder; + pathBuilder << "/vendor/etc/displayconfig/display_id_" << stableId + << ".xml"; + return loadXml(pathBuilder.str()); + } }; class GraphicsCompositionTest : public GraphicsCompositionTestBase, -- GitLab From bc41c5fb196054cfba05513ab9a26d5b8932e773 Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 18 Jul 2023 20:50:59 -0700 Subject: [PATCH 074/376] [Composer-HAL-AIDL] Adds vrr interface configuration Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 287517352 BUG: 284881912 Change-Id: I71ed35acb18a00009cd23afe47f5c48494d08c0c --- .../graphics/composer3/DisplayCommand.aidl | 1 + .../composer3/DisplayConfiguration.aidl | 1 + .../graphics/composer3/IComposerClient.aidl | 3 +- .../graphics/composer3/VrrConfig.aidl | 48 ++++++++++++++ .../graphics/composer3/DisplayCommand.aidl | 11 ++++ .../composer3/DisplayConfiguration.aidl | 7 ++ .../graphics/composer3/IComposerClient.aidl | 33 +++++++++- .../graphics/composer3/VrrConfig.aidl | 65 +++++++++++++++++++ 8 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl index 662240e96b..cce35e79ab 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -45,4 +45,5 @@ parcelable DisplayCommand { boolean acceptDisplayChanges; boolean presentDisplay; boolean presentOrValidateDisplay; + int frameIntervalNs; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl index 908842a467..040afd7866 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -40,6 +40,7 @@ parcelable DisplayConfiguration { @nullable android.hardware.graphics.composer3.DisplayConfiguration.Dpi dpi; int configGroup; int vsyncPeriod; + @nullable android.hardware.graphics.composer3.VrrConfig vrrConfig; parcelable Dpi { float x; float y; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl index 2f08b6fbf9..a60c93dbd5 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl @@ -82,7 +82,8 @@ interface IComposerClient { android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities(); android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy); void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled); - android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display); + android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs); + oneway void notifyExpectedPresent(long display, in android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs); const int EX_BAD_CONFIG = 1; const int EX_BAD_DISPLAY = 2; const int EX_BAD_LAYER = 3; diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl new file mode 100644 index 0000000000..bb2569f342 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl @@ -0,0 +1,48 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@VintfStability +parcelable VrrConfig { + int minFrameIntervalNs; + @nullable android.hardware.graphics.composer3.VrrConfig.FrameIntervalPowerHint[] frameIntervalPowerHints; + @nullable android.hardware.graphics.composer3.VrrConfig.NotifyExpectedPresentConfig notifyExpectedPresentConfig; + parcelable FrameIntervalPowerHint { + int frameIntervalNs; + int averageRefreshPeriodNs; + } + parcelable NotifyExpectedPresentConfig { + int notifyExpectedPresentHeadsUpNs; + int notifyExpectedPresentTimeoutNs; + } +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl index 4f69aeeab7..02c1389de1 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl @@ -174,4 +174,15 @@ parcelable DisplayCommand { * or perform a VALIDATE_DISPLAY action instead. */ boolean presentOrValidateDisplay; + + /** + * If a value greater than 0 is set, it provides a hint about the next frame(s) + * cadence. This parameter represents the time in nanoseconds of when to expect the + * next frames to arrive. For example. frameIntervalNs=33333333 indicates that the + * cadence of the next frames is 30Hz. + * + * The implementation should take the necessary steps to present the next frames as + * close as possible to the cadence. + */ + int frameIntervalNs; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl index b0095d2dcd..791078da24 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -15,6 +15,7 @@ */ package android.hardware.graphics.composer3; +import android.hardware.graphics.composer3.VrrConfig; @VintfStability parcelable DisplayConfiguration { @@ -60,4 +61,10 @@ parcelable DisplayConfiguration { * must be signaled on a vsync boundary. */ int vsyncPeriod; + + /** + * Represents the specific configurations for VRR (Variable Refresh Rate) display modes. + * Non-VRR modes should set this to null. + */ + @nullable VrrConfig vrrConfig; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 5d04a28b00..c57f94e81f 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -22,6 +22,7 @@ import android.hardware.graphics.common.HdrConversionCapability; import android.hardware.graphics.common.HdrConversionStrategy; import android.hardware.graphics.common.Transform; import android.hardware.graphics.composer3.ClientTargetProperty; +import android.hardware.graphics.composer3.ClockMonotonicTimestamp; import android.hardware.graphics.composer3.ColorMode; import android.hardware.graphics.composer3.CommandResultPayload; import android.hardware.graphics.composer3.ContentType; @@ -869,8 +870,38 @@ interface IComposerClient { * getDisplayConfigs should return at least one config. * * @param display is the display for which the configurations are requested. + * @param maxFrameIntervalNs refers to the largest frameInterval to be set for + * VrrConfig.frameIntervalPowerHints in nanoseconds * * @see getDisplayConfigs */ - DisplayConfiguration[] getDisplayConfigurations(long display); + DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs); + + /** + * Provides an early hint for a frame that is likely to be presented. + * This is used for the implementation to take the necessary steps to ensure that + * the next frame(s) could be presented as close as possible to the expectedPresentTime and + * according to the frameIntervalNs cadence. + * See DisplayCommand.expectedPresentTime and DisplayCommand.frameIntervalNs. + * + * The framework will call this function based on the parameters specified in + * DisplayConfiguration.VrrConfig: + * - notifyExpectedPresentTimeoutNs specifies the idle time from the previous present command + * where the framework must send the early hint for the next frame. + * - notifyExpectedPresentHeadsUpNs specifies minimal time that framework must send + * the early hint before the next frame. + * + * The framework can omit calling this API when the next present command matches + * the cadence of the previous present command frameIntervalNs. + * + * If DisplayConfiguration.notifyExpectedPresentConfig is null, this function will never be + * called. + * + * @param display is the display for which the notifyExpectedPresent is called. + * @param expectedPresentTime is the expectedPresentTime that will be provided in the next + * present command + * @param frameIntervalNs is a hint about the cadence of the next frames in nanoseconds. + */ + oneway void notifyExpectedPresent( + long display, in ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs); } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl new file mode 100644 index 0000000000..3b241ba0c9 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl @@ -0,0 +1,65 @@ +/** + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +@VintfStability +parcelable VrrConfig { + /** + * The minimal time (in nanoseconds) that needs to pass between the previously presented frame + * and when the next frame can be presented. + */ + int minFrameIntervalNs; + + /** + * An optional mapping between frame intervals, and the physical display refresh period on + * average. This provides useful information to the framework when picking a specific frame rate + * (which is a divisor of the vsync rate) about the real display refresh rate, which could be + * used for power optimizations. The implementation should populate this map for frame rates + * that requires the display to run at a higher refresh rate due to self refresh frames. The + * lowest frame rate provided should be according to the parameter `maxFrameIntervalNs` + * specified in IComposerClient.getDisplayConfigurations, as the framework would generally not + * try to run at a lower frame rate. + */ + parcelable FrameIntervalPowerHint { + int frameIntervalNs; + int averageRefreshPeriodNs; + } + @nullable FrameIntervalPowerHint[] frameIntervalPowerHints; + + parcelable NotifyExpectedPresentConfig { + /** + * The minimal time in nanoseconds that IComposerClient.notifyExpectedPresent needs to be + * called ahead of an expectedPresentTime provided on a presentDisplay command. + */ + int notifyExpectedPresentHeadsUpNs; + + /** + * The time in nanoseconds that represents a timeout from the previous presentDisplay, which + * after this point the display needs a call to IComposerClient.notifyExpectedPresent before + * sending the next frame. If set to 0, there is no need to call + * IComposerClient.notifyExpectedPresent for timeout. + */ + int notifyExpectedPresentTimeoutNs; + } + + /** + * Parameters for when to call IComposerClient.notifyExpectedPresent. + * + * When set to null, the framework will not call IComposerClient.notifyExpectedPresent. + */ + @nullable NotifyExpectedPresentConfig notifyExpectedPresentConfig; +} -- GitLab From 2704c5fe1257f8a17a23ed7e666f10c0be92034d Mon Sep 17 00:00:00 2001 From: ramindani Date: Tue, 18 Jul 2023 20:53:24 -0700 Subject: [PATCH 075/376] [Composer VTS] Adds VTS for the vrr configuration Test getDisplayConfigurations with vrr parameters Test notifyExpectedPresent does not return error Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 287517352 BUG: 284881912 Change-Id: I49d6876922e9fde47e531200a29413495458b8a5 --- .../composer/aidl/vts/VtsComposerClient.cpp | 9 +++- .../composer/aidl/vts/VtsComposerClient.h | 6 +++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 48 +++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp index bf42d8898c..11b995e2e2 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp @@ -312,7 +312,14 @@ std::pair> VtsComposerClient::getDisplayConf std::pair> VtsComposerClient::getDisplayConfigurations(int64_t display) { std::vector outConfigs; - return {mComposerClient->getDisplayConfigurations(display, &outConfigs), outConfigs}; + return {mComposerClient->getDisplayConfigurations(display, kMaxFrameIntervalNs, &outConfigs), + outConfigs}; +} + +ScopedAStatus VtsComposerClient::notifyExpectedPresent(int64_t display, + ClockMonotonicTimestamp expectedPresentTime, + int frameIntervalNs) { + return mComposerClient->notifyExpectedPresent(display, expectedPresentTime, frameIntervalNs); } std::pair VtsComposerClient::getDisplayVsyncPeriod(int64_t display) { diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h index 1add23cadf..20dc7336df 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.h +++ b/graphics/composer/aidl/vts/VtsComposerClient.h @@ -145,6 +145,10 @@ class VtsComposerClient { std::pair> getDisplayConfigurations( int64_t display); + ScopedAStatus notifyExpectedPresent(int64_t display, + ClockMonotonicTimestamp expectedPresentTime, + int frameIntervalNs); + std::pair getDisplayVsyncPeriod(int64_t display); ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled); @@ -192,6 +196,8 @@ class VtsComposerClient { std::vector takeListOfRefreshRateChangedDebugData(); + static constexpr int32_t kMaxFrameIntervalNs = 50000000; // 20fps + private: void addDisplayConfigs(VtsDisplay*, const std::vector&); ScopedAStatus addDisplayConfigLegacy(VtsDisplay*, int32_t config); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index d559213129..90944d5b68 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1234,6 +1234,43 @@ TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) { EXPECT_NE(-1, displayConfig.dpi->x); EXPECT_NE(-1, displayConfig.dpi->y); } + if (displayConfig.vrrConfig) { + const auto& vrrConfig = *displayConfig.vrrConfig; + EXPECT_GE(vrrConfig.minFrameIntervalNs, displayConfig.vsyncPeriod); + + const auto verifyFrameIntervalIsDivisorOfVsync = [&](int32_t frameIntervalNs) { + constexpr auto kThreshold = 0.05f; // 5% + const auto ratio = + static_cast(frameIntervalNs) / displayConfig.vsyncPeriod; + return ratio - std::round(ratio) <= kThreshold; + }; + + EXPECT_TRUE(verifyFrameIntervalIsDivisorOfVsync(vrrConfig.minFrameIntervalNs)); + + if (vrrConfig.frameIntervalPowerHints) { + const auto& frameIntervalPowerHints = *vrrConfig.frameIntervalPowerHints; + EXPECT_FALSE(frameIntervalPowerHints.empty()); + + const auto minFrameInterval = *min_element(frameIntervalPowerHints.cbegin(), + frameIntervalPowerHints.cend()); + EXPECT_LE(minFrameInterval->frameIntervalNs, + VtsComposerClient::kMaxFrameIntervalNs); + + EXPECT_TRUE(std::all_of(frameIntervalPowerHints.cbegin(), + frameIntervalPowerHints.cend(), + [&](const auto& frameIntervalPowerHint) { + return verifyFrameIntervalIsDivisorOfVsync( + frameIntervalPowerHint->frameIntervalNs); + })); + } + + if (vrrConfig.notifyExpectedPresentConfig) { + const auto& notifyExpectedPresentConfig = + *vrrConfig.notifyExpectedPresentConfig; + EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs); + EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs); + } + } } } } @@ -1312,6 +1349,17 @@ TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigsIsSubsetOfGetDisplayConfigur } } +// TODO(b/291792736) Add detailed VTS test cases for NotifyExpectedPresent +TEST_P(GraphicsComposerAidlV3Test, NotifyExpectedPresent) { + for (const auto& display : mDisplays) { + EXPECT_TRUE(mComposerClient + ->notifyExpectedPresent(display.getDisplayId(), + ClockMonotonicTimestamp{0}, + std::chrono::nanoseconds{8ms}.count()) + .isOk()); + } +} + // Tests for Command. class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { protected: -- GitLab From 04cadfcdd69018cb3db9a22c3befe87c7cff2581 Mon Sep 17 00:00:00 2001 From: Matthew Sedam Date: Thu, 20 Jul 2023 20:29:53 +0000 Subject: [PATCH 076/376] Fix a segmentation fault in NoStaleEvents tests This CL fixes an issue where a sensor may not generate any events and the processing code calls .front() on an empty std::vector. Bug: 291779133 Test: Presubmits Change-Id: Ibb118f239ce9ea42fc25d1d05ba6bd46a60231f0 --- sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp | 8 +++++++- sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp index 618acbb1d4..456aee7f74 100644 --- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp +++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp @@ -921,9 +921,15 @@ TEST_P(SensorsAidlTest, NoStaleEvents) { continue; } + // Skip sensors with no events + const std::vector events = callback.getEvents(sensor.sensorHandle); + if (events.empty()) { + continue; + } + // Ensure that the first event received is not stale by ensuring that its timestamp is // sufficiently different from the previous event - const Event newEvent = callback.getEvents(sensor.sensorHandle).front(); + const Event newEvent = events.front(); std::chrono::milliseconds delta = duration_cast(std::chrono::nanoseconds( newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle])); diff --git a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h index aa6e8814a2..b3815807b7 100644 --- a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h +++ b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h @@ -806,9 +806,15 @@ TEST_P(SensorsHidlTest, NoStaleEvents) { continue; } + // Skip sensors with no events + const std::vector events = callback.getEvents(sensor.sensorHandle); + if (events.empty()) { + continue; + } + // Ensure that the first event received is not stale by ensuring that its timestamp is // sufficiently different from the previous event - const EventType newEvent = callback.getEvents(sensor.sensorHandle).front(); + const EventType newEvent = events.front(); milliseconds delta = duration_cast( nanoseconds(newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle])); milliseconds sensorMinDelay = duration_cast(microseconds(sensor.minDelay)); -- GitLab From c665f4e34f672792f00c503984ff3916376c7221 Mon Sep 17 00:00:00 2001 From: shrikar Date: Mon, 24 Jul 2023 18:30:28 +0000 Subject: [PATCH 077/376] Changed radius to diameter in INFO_EXTERIOR_DIMENSIONS docs in HAL layer Bug: 284972202 Test: manual build Change-Id: Ib72aa4d93d2fcf8c9961fd143842018efe27c18c --- .../android/hardware/automotive/vehicle/VehicleProperty.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 28bacb0d52..e7f934053e 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -169,7 +169,7 @@ enum VehicleProperty { * int32Values[4] = wheel base * int32Values[5] = track width front * int32Values[6] = track width rear - * int32Values[7] = curb to curb turning radius + * int32Values[7] = curb to curb turning diameter * * @change_mode VehiclePropertyChangeMode.STATIC * @access VehiclePropertyAccess.READ -- GitLab From e849ecd0556761ef84e7cbc3c35ea3d0885cd4f5 Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 25 Jul 2023 16:32:49 -0400 Subject: [PATCH 078/376] Remove unused dependencies from composer3 VTS Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I1eeb3ad326d91ec317e91bc3c515a8f28baae074 --- graphics/composer/aidl/vts/Android.bp | 14 -------------- graphics/composer/aidl/vts/ReadbackVts.h | 2 -- graphics/composer/aidl/vts/RenderEngineVts.cpp | 1 - graphics/composer/aidl/vts/RenderEngineVts.h | 2 -- 4 files changed, 19 deletions(-) diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp index 88b5de41bb..e60e1a7e65 100644 --- a/graphics/composer/aidl/vts/Android.bp +++ b/graphics/composer/aidl/vts/Android.bp @@ -55,13 +55,6 @@ cc_test { "libhidlbase", "libprocessgroup", "libtinyxml2", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", "libvndksupport", ], header_libs: [ @@ -71,13 +64,6 @@ cc_test { "android.hardware.graphics.common@1.2", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", "libarect", "libbase", diff --git a/graphics/composer/aidl/vts/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h index ee9f0d58ad..d5602c1716 100644 --- a/graphics/composer/aidl/vts/ReadbackVts.h +++ b/graphics/composer/aidl/vts/ReadbackVts.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,6 @@ namespace aidl::android::hardware::graphics::composer3::vts { using ::android::renderengine::LayerSettings; using common::Dataspace; using common::PixelFormat; -using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper; static const Color BLACK = {0.0f, 0.0f, 0.0f, 1.0f}; static const Color RED = {1.0f, 0.0f, 0.0f, 1.0f}; diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp index 66779c8cad..19e8a9bee3 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp @@ -19,7 +19,6 @@ namespace aidl::android::hardware::graphics::composer3::vts { -using ::android::hardware::graphics::mapper::V2_1::IMapper; using ::android::renderengine::DisplaySettings; using ::android::renderengine::LayerSettings; using ::android::renderengine::RenderEngineCreationArgs; diff --git a/graphics/composer/aidl/vts/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h index 43d3a42808..69f7ab453a 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.h +++ b/graphics/composer/aidl/vts/RenderEngineVts.h @@ -15,7 +15,6 @@ */ #pragma once -#include #include #include #include @@ -29,7 +28,6 @@ namespace aidl::android::hardware::graphics::composer3::vts { -using ::android::hardware::graphics::mapper::V2_1::IMapper; using ::android::renderengine::DisplaySettings; using ::android::renderengine::ExternalTexture; using ::android::renderengine::RenderEngineCreationArgs; -- GitLab From 7f996c3f1c72e5f0e6b92b5857249e1aa0f7d891 Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 25 Jul 2023 17:34:33 -0400 Subject: [PATCH 079/376] Remove direct mapper from composer2.4 VTS Bug: 292584923 Test: make VtsHalGraphicsComposerV2_4TargetTest Change-Id: I4379df1d673fc709b9a496b5c44cb9420798a05d --- .../composer/2.4/vts/functional/Android.bp | 12 +--------- .../VtsHalGraphicsComposerV2_4TargetTest.cpp | 24 ++++++++----------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp index b4ab259dd6..0e53cbe5de 100644 --- a/graphics/composer/2.4/vts/functional/Android.bp +++ b/graphics/composer/2.4/vts/functional/Android.bp @@ -38,16 +38,10 @@ cc_test { "libbinder_ndk", "libfmq", "libsync", + "libui", "android.hardware.common-V2-ndk", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", @@ -56,10 +50,6 @@ cc_test { "android.hardware.graphics.composer@2.3-vts", "android.hardware.graphics.composer@2.4", "android.hardware.graphics.composer@2.4-vts", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", ], header_libs: [ diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index dac46f948a..956c762409 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -30,9 +29,7 @@ #include #include #include -#include -#include -#include +#include #include namespace android { @@ -53,7 +50,6 @@ using common::V1_2::PixelFormat; using V2_1::Layer; using V2_1::vts::NativeHandleWrapper; using V2_2::Transform; -using V2_2::vts::Gralloc; using ContentType = IComposerClient::ContentType; using DisplayCapability = IComposerClient::DisplayCapability; @@ -103,8 +99,6 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam { } mComposerCallback->setVsyncAllowed(false); - ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique()); - mWriter = std::make_unique(1024); mReader = std::make_unique(); } @@ -157,12 +151,15 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam { void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); } - NativeHandleWrapper allocate(int32_t width, int32_t height) { - return mGralloc->allocate( - width, height, /*layerCount*/ 1, - static_cast(PixelFormat::RGBA_8888), + sp allocate(int32_t width, int32_t height) { + auto result = sp::make( + width, height, static_cast(PixelFormat::RGBA_8888), /*layerCount*/ 1, static_cast(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN | BufferUsage::COMPOSER_OVERLAY)); + if (result->initCheck() != STATUS_OK) { + return nullptr; + } + return result; } struct TestParameters { @@ -256,7 +253,6 @@ class GraphicsComposerHidlTest : public ::testing::TestWithParam { std::unique_ptr mWriter; std::unique_ptr mReader; sp mComposerCallback; - std::unique_ptr mGralloc; }; TEST_P(GraphicsComposerHidlTest, getDisplayCapabilitiesBadDisplay) { @@ -458,7 +454,7 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display, mWriter->setLayerBlendMode(IComposerClient::BlendMode::NONE); mWriter->setLayerSurfaceDamage( std::vector(1, display.getFrameRect())); - mWriter->setLayerBuffer(0, handle.get(), -1); + mWriter->setLayerBuffer(0, handle->handle, -1); mWriter->setLayerDataspace(Dataspace::UNKNOWN); mWriter->validateDisplay(); @@ -476,7 +472,7 @@ void GraphicsComposerHidlTest::sendRefreshFrame(const VtsDisplay& display, ASSERT_NE(nullptr, handle.get()); mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, handle.get(), -1); + mWriter->setLayerBuffer(0, handle->handle, -1); mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); mWriter->validateDisplay(); execute(); -- GitLab From 650fe3ed52c01582bde0c233751a7cca8360b87a Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 25 Jul 2023 21:08:42 -0400 Subject: [PATCH 080/376] Remove mapper from composer2.3 VTS It was unused anyway Bug: 292584923 Test: make VtsHalGraphicsComposerV2_3TargetTest Change-Id: I81fb1be275ef54062a8ae5bddec17a137dda7946 --- graphics/composer/2.3/vts/functional/Android.bp | 11 ----------- .../VtsHalGraphicsComposerV2_3TargetTest.cpp | 8 -------- 2 files changed, 19 deletions(-) diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp index 13f2b113ab..f84775efa2 100644 --- a/graphics/composer/2.3/vts/functional/Android.bp +++ b/graphics/composer/2.3/vts/functional/Android.bp @@ -40,25 +40,14 @@ cc_test { "libhidlbase", "libsync", "android.hardware.common-V2-ndk", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.2-vts", "android.hardware.graphics.composer@2.3", "android.hardware.graphics.composer@2.3-vts", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", ], header_libs: [ diff --git a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp index ecfe66c80d..c072ef08a9 100644 --- a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp +++ b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -29,7 +28,6 @@ #include #include #include -#include namespace android { namespace hardware { @@ -43,7 +41,6 @@ using common::V1_1::RenderIntent; using common::V1_2::ColorMode; using common::V1_2::Dataspace; using common::V1_2::PixelFormat; -using V2_2::vts::Gralloc; class GraphicsComposerHidlTest : public ::testing::TestWithParam { protected: @@ -128,8 +125,6 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { void SetUp() override { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp()); - ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique()); - mWriter = std::make_unique(1024); mReader = std::make_unique(); } @@ -143,9 +138,6 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { std::unique_ptr mWriter; std::unique_ptr mReader; - - private: - std::unique_ptr mGralloc; }; /** -- GitLab From 82c666bd8c0f39d7921b91b36b7a47ae630d9ceb Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 25 Jul 2023 22:03:27 -0400 Subject: [PATCH 081/376] Remove mapper from composer2.2 VTS Test: make VtsHalGraphicsComposerV2_2TargetTest Bug: 292584923 Change-Id: Id281c732535ace4a36750d759b59db7aa6e5cb3a --- graphics/composer/2.2/utils/vts/Android.bp | 6 - .../composer/2.2/utils/vts/ComposerVts.cpp | 60 --------- .../composer/2.2/utils/vts/ReadbackVts.cpp | 67 +++------- .../2.2/utils/vts/RenderEngineVts.cpp | 1 - .../include/composer-vts/2.2/ComposerVts.h | 31 ----- .../include/composer-vts/2.2/ReadbackVts.h | 24 +--- .../composer-vts/2.2/RenderEngineVts.h | 2 - .../composer/2.2/vts/functional/Android.bp | 11 -- ...VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 124 ++++++++---------- .../VtsHalGraphicsComposerV2_2TargetTest.cpp | 37 ++---- 10 files changed, 93 insertions(+), 270 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index d11592f512..7a6bcb28a5 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -42,7 +42,6 @@ cc_library_static { static_libs: [ "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", - "android.hardware.graphics.mapper@2.1-vts", "libarect", "libgtest", "libmath", @@ -50,15 +49,10 @@ cc_library_static { "librenderengine", "libshaders", "libtonemap", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0", - "android.hardware.graphics.mapper@4.0-vts", ], export_static_lib_headers: [ "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", - "android.hardware.graphics.mapper@2.1-vts", ], header_libs: [ "android.hardware.graphics.composer@2.2-command-buffer", diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp index d4f028169f..d0410648ac 100644 --- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp @@ -179,66 +179,6 @@ std::array ComposerClient::getDataspaceSaturationMatrix(Dataspace dat return matrix; } -Gralloc::Gralloc() { - [this] { - ALOGD("Attempting to initialize gralloc4"); - ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared( - /*aidlAllocatorServiceName*/ IAllocator::descriptor + - std::string("/default"), - /*hidlAllocatorServiceName*/ "default", - /*mapperServiceName*/ "default", - /*errOnFailure=*/false)); - if (mGralloc4->getMapper() == nullptr || !mGralloc4->hasAllocator()) { - mGralloc4 = nullptr; - ALOGD("Failed to initialize gralloc4, initializing gralloc3"); - ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared("default", "default", - /*errOnFailure=*/false)); - if (mGralloc3->getMapper() == nullptr || mGralloc3->getAllocator() == nullptr) { - mGralloc3 = nullptr; - ALOGD("Failed to initialize gralloc3, initializing gralloc2_1"); - mGralloc2_1 = std::make_shared(/*errOnFailure*/ false); - if (!mGralloc2_1->getMapper()) { - mGralloc2_1 = nullptr; - ALOGD("Failed to initialize gralloc2_1, initializing gralloc2"); - ASSERT_NO_FATAL_FAILURE(mGralloc2 = std::make_shared()); - } - } - } - }(); -} - -bool Gralloc::validateBufferSize(const native_handle_t* bufferHandle, uint32_t width, - uint32_t height, uint32_t layerCount, PixelFormat format, - uint64_t usage, uint32_t stride) { - if (mGralloc4) { - IMapper4::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = static_cast(format); - info.usage = usage; - return mGralloc4->validateBufferSize(bufferHandle, info, stride); - } else if (mGralloc3) { - IMapper3::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = static_cast(format); - info.usage = usage; - return mGralloc3->validateBufferSize(bufferHandle, info, stride); - } else if (mGralloc2_1) { - IMapper2_1::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = static_cast(format); - info.usage = usage; - return mGralloc2_1->validateBufferSize(bufferHandle, info, stride); - } else { - return true; - } -} - } // namespace vts } // namespace V2_2 } // namespace composer diff --git a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp index a1794afeed..9ba34f17c5 100644 --- a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp +++ b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp @@ -187,12 +187,11 @@ void ReadbackHelper::compareColorBuffers(std::vector& ex } ReadbackBuffer::ReadbackBuffer(Display display, const std::shared_ptr& client, - const std::shared_ptr& gralloc, uint32_t width, - uint32_t height, PixelFormat pixelFormat, Dataspace dataspace) { + uint32_t width, uint32_t height, PixelFormat pixelFormat, + Dataspace dataspace) { mDisplay = display; mComposerClient = client; - mGralloc = gralloc; mPixelFormat = pixelFormat; mDataspace = dataspace; @@ -202,20 +201,12 @@ ReadbackBuffer::ReadbackBuffer(Display display, const std::shared_ptr(BufferUsage::CPU_READ_OFTEN | BufferUsage::GPU_TEXTURE); - - mAccessRegion.top = 0; - mAccessRegion.left = 0; - mAccessRegion.width = width; - mAccessRegion.height = height; } void ReadbackBuffer::setReadbackBuffer() { - mBufferHandle.reset(new Gralloc::NativeHandleWrapper( - mGralloc->allocate(mWidth, mHeight, mLayerCount, mFormat, mUsage, - /*import*/ true, &mStride))); - ASSERT_NE(false, mGralloc->validateBufferSize(mBufferHandle->get(), mWidth, mHeight, - mLayerCount, mFormat, mUsage, mStride)); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(mDisplay, mBufferHandle->get(), -1)); + mBuffer = sp::make(mWidth, mHeight, (int32_t)mFormat, mLayerCount, mUsage); + ASSERT_EQ(STATUS_OK, mBuffer->initCheck()); + ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(mDisplay, mBuffer->handle, -1)); } void ReadbackBuffer::checkReadbackBuffer(std::vector expectedColors) { @@ -223,15 +214,14 @@ void ReadbackBuffer::checkReadbackBuffer(std::vector exp int32_t fenceHandle; ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle)); - void* bufData = mGralloc->lock(mBufferHandle->get(), mUsage, mAccessRegion, fenceHandle); + void* bufData = nullptr; + int32_t stride = mBuffer->stride; + status_t status = mBuffer->lockAsync(mUsage, &bufData, fenceHandle); + ASSERT_EQ(STATUS_OK, status); ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888); - ReadbackHelper::compareColorBuffers(expectedColors, bufData, mStride, mWidth, mHeight, + ReadbackHelper::compareColorBuffers(expectedColors, bufData, stride, mWidth, mHeight, mPixelFormat); - int32_t unlockFence = mGralloc->unlock(mBufferHandle->get()); - if (unlockFence != -1) { - sync_wait(unlockFence, -1); - close(unlockFence); - } + EXPECT_EQ(STATUS_OK, mBuffer->unlock()); } void TestColorLayer::write(const std::shared_ptr& writer) { @@ -251,12 +241,10 @@ LayerSettings TestColorLayer::toRenderEngineLayerSettings() { } TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, - const std::shared_ptr& gralloc, TestRenderEngine& renderEngine, Display display, int32_t width, int32_t height, PixelFormat format, IComposerClient::Composition composition) : TestLayer{client, display}, mRenderEngine(renderEngine) { - mGralloc = gralloc; mComposition = composition; mWidth = width; mHeight = height; @@ -265,11 +253,6 @@ TestBufferLayer::TestBufferLayer(const std::shared_ptr& client, mUsage = static_cast(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN | BufferUsage::COMPOSER_OVERLAY | BufferUsage::GPU_TEXTURE); - mAccessRegion.top = 0; - mAccessRegion.left = 0; - mAccessRegion.width = width; - mAccessRegion.height = height; - setSourceCrop({0, 0, (float)width, (float)height}); } @@ -277,15 +260,13 @@ void TestBufferLayer::write(const std::shared_ptr& writer) { TestLayer::write(writer); writer->setLayerCompositionType(mComposition); writer->setLayerVisibleRegion(std::vector(1, mDisplayFrame)); - if (mBufferHandle != nullptr) writer->setLayerBuffer(0, mBufferHandle->get(), mFillFence); + if (mBuffer) writer->setLayerBuffer(0, mBuffer->handle, -1); } LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings(); layerSettings.source.buffer.buffer = std::make_shared( - new GraphicBuffer(mBufferHandle->get(), GraphicBuffer::CLONE_HANDLE, mWidth, mHeight, - static_cast(mFormat), 1, mUsage, mStride), - mRenderEngine.getInternalRenderEngine(), + mBuffer, mRenderEngine.getInternalRenderEngine(), renderengine::impl::ExternalTexture::Usage::READABLE); layerSettings.source.buffer.usePremultipliedAlpha = @@ -304,24 +285,18 @@ LayerSettings TestBufferLayer::toRenderEngineLayerSettings() { } void TestBufferLayer::fillBuffer(std::vector expectedColors) { - void* bufData = mGralloc->lock(mBufferHandle->get(), mUsage, mAccessRegion, -1); - ASSERT_NO_FATAL_FAILURE( - ReadbackHelper::fillBuffer(mWidth, mHeight, mStride, bufData, mFormat, expectedColors)); - mFillFence = mGralloc->unlock(mBufferHandle->get()); - if (mFillFence != -1) { - sync_wait(mFillFence, -1); - close(mFillFence); - } + void* bufData = nullptr; + status_t status = mBuffer->lock(mUsage, &bufData); + ASSERT_EQ(STATUS_OK, status); + ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, mBuffer->stride, bufData, + mFormat, expectedColors)); + EXPECT_EQ(STATUS_OK, mBuffer->unlock()); } void TestBufferLayer::setBuffer(std::vector colors) { - mBufferHandle.reset(new Gralloc::NativeHandleWrapper( - mGralloc->allocate(mWidth, mHeight, mLayerCount, mFormat, mUsage, - /*import*/ true, &mStride))); - ASSERT_NE(nullptr, mBufferHandle->get()); + mBuffer = sp::make(mWidth, mHeight, (int32_t)mFormat, mLayerCount, mUsage); + ASSERT_EQ(STATUS_OK, mBuffer->initCheck()); ASSERT_NO_FATAL_FAILURE(fillBuffer(colors)); - ASSERT_NE(false, mGralloc->validateBufferSize(mBufferHandle->get(), mWidth, mHeight, - mLayerCount, mFormat, mUsage, mStride)); } void TestBufferLayer::setDataspace(Dataspace dataspace, diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index 1700b2ade9..62974f8409 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -24,7 +24,6 @@ namespace composer { namespace V2_2 { namespace vts { -using mapper::V2_1::IMapper; using renderengine::DisplaySettings; using renderengine::LayerSettings; using renderengine::RenderEngineCreationArgs; 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 02d7bdb9da..3e26d9483f 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 @@ -26,7 +26,6 @@ #include #include #include -#include #include namespace android { @@ -41,14 +40,6 @@ using common::V1_1::ColorMode; using common::V1_1::Dataspace; using common::V1_1::PixelFormat; using common::V1_1::RenderIntent; -using IMapper2_1 = android::hardware::graphics::mapper::V2_1::IMapper; -using IMapper3 = android::hardware::graphics::mapper::V3_0::IMapper; -using IMapper4 = android::hardware::graphics::mapper::V4_0::IMapper; -using Gralloc2 = android::hardware::graphics::mapper::V2_0::vts::Gralloc; -using Gralloc2_1 = android::hardware::graphics::mapper::V2_1::vts::Gralloc; -using Gralloc3 = android::hardware::graphics::mapper::V3_0::vts::Gralloc; -using Gralloc4 = android::hardware::graphics::mapper::V4_0::vts::Gralloc; -using IAllocator = aidl::android::hardware::graphics::allocator::IAllocator; class ComposerClient; @@ -92,28 +83,6 @@ class ComposerClient : public V2_1::vts::ComposerClient { const sp mClient; }; -class Gralloc : public V2_1::vts::Gralloc { - public: - using NativeHandleWrapper = V2_1::vts::NativeHandleWrapper; - - Gralloc(); - const NativeHandleWrapper allocate(uint32_t width, uint32_t height, uint32_t layerCount, - PixelFormat format, uint64_t usage, bool import = true, - uint32_t* outStride = nullptr) { - return V2_1::vts::Gralloc::allocate( - width, height, layerCount, - static_cast(format), usage, - import, outStride); - } - - bool validateBufferSize(const native_handle_t* bufferHandle, uint32_t width, uint32_t height, - uint32_t layerCount, PixelFormat format, uint64_t usage, - uint32_t stride); - - protected: - std::shared_ptr mGralloc2_1 = nullptr; -}; - } // namespace vts } // namespace V2_2 } // namespace composer diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h index 58efde9b5a..87136988b1 100644 --- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h +++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -38,8 +37,6 @@ using android::hardware::hidl_handle; using common::V1_1::BufferUsage; using common::V1_1::Dataspace; using common::V1_1::PixelFormat; -using IMapper2_1 = mapper::V2_1::IMapper; -using Gralloc2_1 = mapper::V2_1::vts::Gralloc; using renderengine::LayerSettings; using V2_1::Display; using V2_1::Layer; @@ -113,9 +110,8 @@ class TestColorLayer : public TestLayer { class TestBufferLayer : public TestLayer { public: TestBufferLayer( - const std::shared_ptr& client, const std::shared_ptr& gralloc, - TestRenderEngine& renderEngine, Display display, int32_t width, int32_t height, - PixelFormat format, + const std::shared_ptr& client, TestRenderEngine& renderEngine, + Display display, int32_t width, int32_t height, PixelFormat format, IComposerClient::Composition composition = IComposerClient::Composition::DEVICE); void write(const std::shared_ptr& writer) override; @@ -135,15 +131,11 @@ class TestBufferLayer : public TestLayer { uint32_t mLayerCount; PixelFormat mFormat; uint64_t mUsage; - AccessRegion mAccessRegion; - uint32_t mStride; protected: IComposerClient::Composition mComposition; - std::shared_ptr mGralloc; TestRenderEngine& mRenderEngine; - int32_t mFillFence; - std::unique_ptr mBufferHandle; + sp mBuffer; }; class ReadbackHelper { @@ -179,9 +171,8 @@ class ReadbackHelper { class ReadbackBuffer { public: - ReadbackBuffer(Display display, const std::shared_ptr& client, - const std::shared_ptr& gralloc, uint32_t width, uint32_t height, - PixelFormat pixelFormat, Dataspace dataspace); + ReadbackBuffer(Display display, const std::shared_ptr& client, uint32_t width, + uint32_t height, PixelFormat pixelFormat, Dataspace dataspace); void setReadbackBuffer(); @@ -193,13 +184,10 @@ class ReadbackBuffer { uint32_t mLayerCount; PixelFormat mFormat; uint64_t mUsage; - AccessRegion mAccessRegion; - uint32_t mStride; - std::unique_ptr mBufferHandle = nullptr; + sp mBuffer; PixelFormat mPixelFormat; Dataspace mDataspace; Display mDisplay; - std::shared_ptr mGralloc; std::shared_ptr mComposerClient; }; diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h index 26027d33a2..c9808c9cfd 100644 --- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h +++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h @@ -34,10 +34,8 @@ namespace composer { namespace V2_2 { namespace vts { -using mapper::V2_1::IMapper; using renderengine::DisplaySettings; using renderengine::RenderEngineCreationArgs; -using vts::Gralloc; class TestRenderEngine { public: diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index 34763766da..be9dea50f8 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -54,24 +54,13 @@ cc_test { "libsync", "libui", "android.hardware.common-V2-ndk", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.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", "android.hardware.graphics.composer@2.2-vts", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", "libgtest", "librenderengine", diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index e2a0f4d22f..7537b62c0a 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -47,7 +47,6 @@ using V2_1::Config; using V2_1::Display; using V2_1::vts::NativeHandleWrapper; using V2_1::vts::TestCommandReader; -using vts::Gralloc; class GraphicsCompositionTestBase : public ::testing::Test { protected: @@ -79,7 +78,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { // set up command writer/reader and gralloc mWriter = std::make_shared(1024); mReader = std::make_unique(); - mGralloc = std::make_shared(); ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON)); @@ -143,7 +141,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { std::vector mTestColorModes; std::shared_ptr mWriter; std::unique_ptr mReader; - std::shared_ptr mGralloc; std::unique_ptr mTestRenderEngine; bool mHasReadbackBuffer; @@ -220,7 +217,7 @@ TEST_P(GraphicsCompositionTest, SingleSolidColorLayer) { std::vector expectedColors(mDisplayWidth * mDisplayHeight); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -272,7 +269,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { mWriter->selectDisplay(mPrimaryDisplay); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); std::vector expectedColors(mDisplayWidth * mDisplayHeight); @@ -285,9 +282,9 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -352,15 +349,16 @@ TEST_P(GraphicsCompositionTest, SetLayerBufferNoEffect) { // This following buffer call should have no effect uint64_t usage = static_cast(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN); - NativeHandleWrapper bufferHandle = - mGralloc->allocate(mDisplayWidth, mDisplayHeight, 1, PixelFormat::RGBA_8888, usage); - mWriter->setLayerBuffer(0, bufferHandle.get(), -1); + sp buffer = sp::make( + mDisplayWidth, mDisplayHeight, (int32_t)PixelFormat::RGBA_8888, 1, usage); + ASSERT_EQ(STATUS_OK, buffer->initCheck()); + mWriter->setLayerBuffer(0, buffer->handle, -1); // expected color for each pixel std::vector expectedColors(mDisplayWidth * mDisplayHeight); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -419,16 +417,16 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_FP16); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_FP16); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -462,25 +460,20 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { } // create client target buffer - uint32_t clientStride; - NativeHandleWrapper clientBufferHandle = - mGralloc->allocate(layer->mWidth, layer->mHeight, layer->mLayerCount, - clientFormat, clientUsage, /*import*/ true, &clientStride); - ASSERT_NE(nullptr, clientBufferHandle.get()); + sp clientBuffer = + sp::make(layer->mWidth, layer->mHeight, (int32_t)clientFormat, + layer->mLayerCount, clientUsage); + ASSERT_EQ(STATUS_OK, clientBuffer->initCheck()); - void* clientBufData = - mGralloc->lock(clientBufferHandle.get(), clientUsage, layer->mAccessRegion, -1); + void* clientBufData = nullptr; + ASSERT_EQ(STATUS_OK, clientBuffer->lock(clientUsage, &clientBufData)); ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(layer->mWidth, layer->mHeight, - clientStride, clientBufData, + clientBuffer->stride, clientBufData, clientFormat, expectedColors)); - int clientFence = mGralloc->unlock(clientBufferHandle.get()); - if (clientFence != -1) { - sync_wait(clientFence, -1); - close(clientFence); - } + clientBuffer->unlock(); - mWriter->setClientTarget(0, clientBufferHandle.get(), clientFence, clientDataspace, + mWriter->setClientTarget(0, clientBuffer->handle, -1, clientDataspace, std::vector(1, damage)); layer->setToClientComposition(mWriter); @@ -531,12 +524,12 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); auto deviceLayer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, + mComposerClient, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, mDisplayHeight / 2, PixelFormat::RGBA_8888); std::vector deviceColors(deviceLayer->mWidth * deviceLayer->mHeight); @@ -573,8 +566,8 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { } auto clientLayer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, clientWidth, - clientHeight, PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE); + mComposerClient, *mTestRenderEngine, mPrimaryDisplay, clientWidth, clientHeight, + PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE); IComposerClient::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}; clientLayer->setDisplayFrame(clientFrame); clientLayer->setZOrder(0); @@ -590,27 +583,22 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { } // create client target buffer ASSERT_EQ(1, mReader->mCompositionChanges[0].second); - uint32_t clientStride; - NativeHandleWrapper clientBufferHandle = - mGralloc->allocate(mDisplayWidth, mDisplayHeight, clientLayer->mLayerCount, - clientFormat, clientUsage, /*import*/ true, &clientStride); - ASSERT_NE(nullptr, clientBufferHandle.get()); + sp clientBuffer = + sp::make(mDisplayWidth, mDisplayHeight, (int32_t)clientFormat, + clientLayer->mLayerCount, clientUsage); + ASSERT_EQ(STATUS_OK, clientBuffer->initCheck()); - void* clientBufData = mGralloc->lock(clientBufferHandle.get(), clientUsage, - {0, 0, mDisplayWidth, mDisplayHeight}, -1); + void* clientBufData = nullptr; + ASSERT_EQ(STATUS_OK, clientBuffer->lock(clientUsage, &clientBufData)); std::vector clientColors(mDisplayWidth * mDisplayHeight); ReadbackHelper::fillColorsArea(clientColors, mDisplayWidth, clientFrame, RED); ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mDisplayWidth, mDisplayHeight, - clientStride, clientBufData, + clientBuffer->stride, clientBufData, clientFormat, clientColors)); - int clientFence = mGralloc->unlock(clientBufferHandle.get()); - if (clientFence != -1) { - sync_wait(clientFence, -1); - close(clientFence); - } + EXPECT_EQ(STATUS_OK, clientBuffer->unlock()); - mWriter->setClientTarget(0, clientBufferHandle.get(), clientFence, clientDataspace, + mWriter->setClientTarget(0, clientBuffer->handle, -1, clientDataspace, std::vector(1, clientFrame)); clientLayer->setToClientComposition(mWriter); mWriter->validateDisplay(); @@ -655,9 +643,9 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { std::vector expectedColors(mDisplayWidth * mDisplayHeight); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -665,7 +653,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -742,7 +730,7 @@ TEST_P(GraphicsCompositionTest, SetLayerPlaneAlpha) { std::vector> layers = {layer}; - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -803,9 +791,9 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, BLUE); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter); @@ -819,7 +807,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { // update expected colors to match crop ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight}, BLUE); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(layers); @@ -886,7 +874,7 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE); ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -955,9 +943,9 @@ class GraphicsBlendModeCompositionTest backgroundLayer->setZOrder(0); backgroundLayer->setColor(mBackgroundColor); - auto layer = std::make_shared( - mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth, - mDisplayHeight, PixelFormat::RGBA_8888); + auto layer = std::make_shared(mComposerClient, *mTestRenderEngine, + mPrimaryDisplay, mDisplayWidth, + mDisplayHeight, PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); layer->setZOrder(10); layer->setDataspace(Dataspace::UNKNOWN, mWriter); @@ -1043,7 +1031,7 @@ TEST_P(GraphicsBlendModeCompositionTest, DISABLED_None) { setUpLayers(IComposerClient::BlendMode::NONE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); @@ -1102,7 +1090,7 @@ TEST_P(GraphicsBlendModeCompositionTest, DISABLED_Coverage) { setUpLayers(IComposerClient::BlendMode::COVERAGE); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); @@ -1153,7 +1141,7 @@ TEST_P(GraphicsBlendModeCompositionTest, Premultiplied) { setUpLayers(IComposerClient::BlendMode::PREMULTIPLIED); setExpectedColors(expectedColors); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); writeLayers(mLayers); @@ -1193,7 +1181,7 @@ class GraphicsTransformCompositionTest : public GraphicsCompositionTest { IComposerClient::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength, mSideLength}; - mLayer = std::make_shared(mComposerClient, mGralloc, *mTestRenderEngine, + mLayer = std::make_shared(mComposerClient, *mTestRenderEngine, mPrimaryDisplay, mSideLength, mSideLength, PixelFormat::RGBA_8888); mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength}); @@ -1236,7 +1224,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_H); @@ -1291,7 +1279,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -1346,7 +1334,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, + ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp index 13ae089d65..8f41598b2d 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp @@ -18,14 +18,13 @@ #include #include -#include #include #include #include #include #include #include -#include +#include namespace android { namespace hardware { @@ -141,8 +140,6 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { void SetUp() override { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp()); - ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique()); - mWriter = std::make_unique(1024); mReader = std::make_unique(); } @@ -152,20 +149,10 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown()); } - NativeHandleWrapper allocate() { - uint64_t usage = - static_cast(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN); - return mGralloc->allocate(/*width*/ 64, /*height*/ 64, /*layerCount*/ 1, - PixelFormat::RGBA_8888, usage); - } - void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); } std::unique_ptr mWriter; std::unique_ptr mReader; - - private: - std::unique_ptr mGralloc; }; /** @@ -437,13 +424,11 @@ TEST_P(GraphicsComposerHidlTest, SetReadbackBuffer) { uint64_t usage = static_cast(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN); - std::unique_ptr gralloc; - std::unique_ptr buffer; - ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique()); - ASSERT_NO_FATAL_FAILURE(buffer.reset(new NativeHandleWrapper( - gralloc->allocate(mDisplayWidth, mDisplayHeight, 1, mReadbackPixelFormat, usage)))); + sp buffer = sp::make(mDisplayWidth, mDisplayHeight, + (int32_t)mReadbackPixelFormat, 1, usage); + ASSERT_EQ(STATUS_OK, buffer->initCheck()); - mComposerClient->setReadbackBuffer(mPrimaryDisplay, buffer->get(), -1); + mComposerClient->setReadbackBuffer(mPrimaryDisplay, buffer->handle, -1); } /** @@ -460,14 +445,12 @@ TEST_P(GraphicsComposerHidlTest, SetReadbackBufferBadDisplay) { uint64_t usage = static_cast(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN); - std::unique_ptr gralloc; - std::unique_ptr buffer; - ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique()); - ASSERT_NO_FATAL_FAILURE(buffer.reset(new NativeHandleWrapper( - gralloc->allocate(mDisplayWidth, mDisplayHeight, 1, mReadbackPixelFormat, usage)))); + sp buffer = sp::make(mDisplayWidth, mDisplayHeight, + (int32_t)mReadbackPixelFormat, 1, usage); + ASSERT_EQ(STATUS_OK, buffer->initCheck()); - Error error = - mComposerClient->getRaw()->setReadbackBuffer(mInvalidDisplayId, buffer->get(), nullptr); + Error error = mComposerClient->getRaw()->setReadbackBuffer(mInvalidDisplayId, buffer->handle, + nullptr); ASSERT_EQ(Error::BAD_DISPLAY, error); } -- GitLab From 764fe0dea7b983c0c8d710a7fdadf2d0b0d25894 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 26 Jul 2023 18:07:05 +0000 Subject: [PATCH 082/376] Implement default radio HAL stopProgramListUpdates Implemented stopProgramListUpdates method in default AIDL broadcast radio HAL. Created a separate thread for program list updates, so that canceling pending tuning operations and canceling pending program list updates are independent. Bug: 243681584 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I9e09f267a2264fa0cbc280d0d6ea71037db519ac --- .../aidl/default/BroadcastRadio.cpp | 27 ++++++++++++------- broadcastradio/aidl/default/BroadcastRadio.h | 5 +++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp index 4d097c1607..8584921fba 100644 --- a/broadcastradio/aidl/default/BroadcastRadio.cpp +++ b/broadcastradio/aidl/default/BroadcastRadio.cpp @@ -115,7 +115,8 @@ BroadcastRadio::BroadcastRadio(const VirtualRadio& virtualRadio) } BroadcastRadio::~BroadcastRadio() { - mThread.reset(); + mTuningThread.reset(); + mProgramListThread.reset(); } ScopedAStatus BroadcastRadio::getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs) { @@ -239,7 +240,7 @@ ScopedAStatus BroadcastRadio::tune(const ProgramSelector& program) { callback->onCurrentProgramInfoChanged(programInfo); }; auto cancelTask = [program, callback]() { callback->onTuneFailed(Result::CANCELED, program); }; - mThread->schedule(task, cancelTask, kTuneDelayTimeMs); + mTuningThread->schedule(task, cancelTask, kTuneDelayTimeMs); return ScopedAStatus::ok(); } @@ -267,7 +268,7 @@ ScopedAStatus BroadcastRadio::seek(bool directionUp, bool skipSubChannel) { callback->onTuneFailed(Result::TIMEOUT, {}); }; - mThread->schedule(task, cancelTask, kSeekDelayTimeMs); + mTuningThread->schedule(task, cancelTask, kSeekDelayTimeMs); return ScopedAStatus::ok(); } @@ -300,7 +301,7 @@ ScopedAStatus BroadcastRadio::seek(bool directionUp, bool skipSubChannel) { } callback->onCurrentProgramInfoChanged(programInfo); }; - mThread->schedule(task, cancelTask, kSeekDelayTimeMs); + mTuningThread->schedule(task, cancelTask, kSeekDelayTimeMs); return ScopedAStatus::ok(); } @@ -355,15 +356,15 @@ ScopedAStatus BroadcastRadio::step(bool directionUp) { callback->onCurrentProgramInfoChanged(programInfo); }; auto cancelTask = [callback]() { callback->onTuneFailed(Result::CANCELED, {}); }; - mThread->schedule(task, cancelTask, kStepDelayTimeMs); + mTuningThread->schedule(task, cancelTask, kStepDelayTimeMs); return ScopedAStatus::ok(); } void BroadcastRadio::cancelLocked() { - LOG(DEBUG) << __func__ << ": cancelling current operations..."; + LOG(DEBUG) << __func__ << ": cancelling current tuning operations..."; - mThread->cancelAll(); + mTuningThread->cancelAll(); if (mCurrentProgram.primaryId.type != IdentifierType::INVALID) { mIsTuneCompleted = true; } @@ -388,6 +389,8 @@ ScopedAStatus BroadcastRadio::startProgramListUpdates(const ProgramFilter& filte lock_guard lk(mMutex); + cancelProgramListUpdateLocked(); + const auto& list = mVirtualRadio.getProgramList(); vector filteredList; std::copy_if(list.begin(), list.end(), std::back_inserter(filteredList), filterCb); @@ -410,14 +413,20 @@ ScopedAStatus BroadcastRadio::startProgramListUpdates(const ProgramFilter& filte callback->onProgramListUpdated(chunk); }; - mThread->schedule(task, kListDelayTimeS); + mProgramListThread->schedule(task, kListDelayTimeS); return ScopedAStatus::ok(); } +void BroadcastRadio::cancelProgramListUpdateLocked() { + LOG(DEBUG) << __func__ << ": cancelling current program list update operations..."; + mProgramListThread->cancelAll(); +} + ScopedAStatus BroadcastRadio::stopProgramListUpdates() { LOG(DEBUG) << __func__ << ": requested program list updates to stop..."; - // TODO(b/243681584) Implement stop program list updates method + lock_guard lk(mMutex); + cancelProgramListUpdateLocked(); return ScopedAStatus::ok(); } diff --git a/broadcastradio/aidl/default/BroadcastRadio.h b/broadcastradio/aidl/default/BroadcastRadio.h index 092776f62d..0f818cef63 100644 --- a/broadcastradio/aidl/default/BroadcastRadio.h +++ b/broadcastradio/aidl/default/BroadcastRadio.h @@ -68,7 +68,9 @@ class BroadcastRadio final : public BnBroadcastRadio { const VirtualRadio& mVirtualRadio; std::mutex mMutex; AmFmRegionConfig mAmFmConfig GUARDED_BY(mMutex); - std::unique_ptr<::android::WorkerThread> mThread GUARDED_BY(mMutex) = + std::unique_ptr<::android::WorkerThread> mTuningThread GUARDED_BY(mMutex) = + std::unique_ptr<::android::WorkerThread>(new ::android::WorkerThread()); + std::unique_ptr<::android::WorkerThread> mProgramListThread GUARDED_BY(mMutex) = std::unique_ptr<::android::WorkerThread>(new ::android::WorkerThread()); bool mIsTuneCompleted GUARDED_BY(mMutex) = true; Properties mProperties GUARDED_BY(mMutex); @@ -81,6 +83,7 @@ class BroadcastRadio final : public BnBroadcastRadio { std::optional getAmFmRangeLocked() const; void cancelLocked(); ProgramInfo tuneInternalLocked(const ProgramSelector& sel); + void cancelProgramListUpdateLocked(); binder_status_t cmdHelp(int fd) const; binder_status_t cmdTune(int fd, const char** args, uint32_t numArgs); -- GitLab From 9118110a1505f41fe71325bd2015d949697868a7 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Wed, 26 Jul 2023 19:42:08 +0000 Subject: [PATCH 083/376] composer3: add rust backend Change-Id: I2d3d91fd714130252d63b697958f128c9bd06dc5 Test: presubmit Bug: 293256928 --- graphics/composer/aidl/Android.bp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index 88abb7387c..c105ad4b6e 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -54,6 +54,9 @@ aidl_interface { enabled: true, }, }, + rust: { + enabled: true, + }, }, versions_with_info: [ { -- GitLab From 6d0abbb439a8eb7199beeae35e599d6594edbbef Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 26 Jul 2023 15:54:47 -0400 Subject: [PATCH 084/376] Remove mapper from composer2.1 VTS Bug: 292584923 Test: make VtsHalGraphicsComposerV2_3TargetTest VtsHalGraphicsComposerV2_4TargetTest VtsHalGraphicsComposerV2_2TargetTest VtsHalGraphicsComposerV2_1TargetTest Change-Id: I3642995e7236a3b9b08ad5419c9d02b67243b24a --- .../composer/2.1/utils/resources/Android.bp | 7 +- .../2.1/utils/resources/ComposerResources.cpp | 67 ++--------- .../2.1/ComposerResources.h | 9 +- graphics/composer/2.1/utils/vts/Android.bp | 9 +- .../composer/2.1/utils/vts/ComposerVts.cpp | 107 ------------------ .../include/composer-vts/2.1/ComposerVts.h | 56 --------- .../composer/2.1/vts/functional/Android.bp | 12 +- .../VtsHalGraphicsComposerV2_1TargetTest.cpp | 49 ++++---- .../include/composer-vts/2.2/ReadbackVts.h | 1 - ...VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 1 - .../VtsHalGraphicsComposerV2_2TargetTest.cpp | 1 - .../VtsHalGraphicsComposerV2_4TargetTest.cpp | 1 - 12 files changed, 42 insertions(+), 278 deletions(-) diff --git a/graphics/composer/2.1/utils/resources/Android.bp b/graphics/composer/2.1/utils/resources/Android.bp index 9eb23fa82e..405200317f 100644 --- a/graphics/composer/2.1/utils/resources/Android.bp +++ b/graphics/composer/2.1/utils/resources/Android.bp @@ -29,20 +29,15 @@ cc_library { vendor_available: true, shared_libs: [ "android.hardware.graphics.composer@2.1", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", "libcutils", "libhardware", // TODO remove hwcomposer2.h dependency "libhidlbase", "liblog", + "libui", "libutils", ], export_shared_lib_headers: [ "android.hardware.graphics.composer@2.1", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", "libhardware", "libhidlbase", "liblog", diff --git a/graphics/composer/2.1/utils/resources/ComposerResources.cpp b/graphics/composer/2.1/utils/resources/ComposerResources.cpp index e52bf7124a..80bfb7a26a 100644 --- a/graphics/composer/2.1/utils/resources/ComposerResources.cpp +++ b/graphics/composer/2.1/utils/resources/ComposerResources.cpp @@ -18,6 +18,8 @@ #include "composer-resources/2.1/ComposerResources.h" +#include + namespace android { namespace hardware { namespace graphics { @@ -25,23 +27,10 @@ namespace composer { namespace V2_1 { namespace hal { -bool ComposerHandleImporter::init() { - mMapper4 = mapper::V4_0::IMapper::getService(); - if (mMapper4) { - return true; - } - ALOGI_IF(!mMapper4, "failed to get mapper 4.0 service, falling back to mapper 3.0"); - - mMapper3 = mapper::V3_0::IMapper::getService(); - if (mMapper3) { - return true; - } - ALOGI_IF(!mMapper3, "failed to get mapper 3.0 service, falling back to mapper 2.0"); - - mMapper2 = mapper::V2_0::IMapper::getService(); - ALOGE_IF(!mMapper2, "failed to get mapper 2.0 service"); +ComposerHandleImporter::ComposerHandleImporter() : mMapper{GraphicBufferMapper::get()} {} - return mMapper2 != nullptr; +bool ComposerHandleImporter::init() { + return true; } Error ComposerHandleImporter::importBuffer(const native_handle_t* rawHandle, @@ -51,51 +40,17 @@ Error ComposerHandleImporter::importBuffer(const native_handle_t* rawHandle, return Error::NONE; } - const native_handle_t* bufferHandle; - if (mMapper2) { - mapper::V2_0::Error error; - mMapper2->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - bufferHandle = static_cast(tmpBufferHandle); - }); - if (error != mapper::V2_0::Error::NONE) { - return Error::NO_RESOURCES; - } - } - if (mMapper3) { - mapper::V3_0::Error error; - mMapper3->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - bufferHandle = static_cast(tmpBufferHandle); - }); - if (error != mapper::V3_0::Error::NONE) { - return Error::NO_RESOURCES; - } - } - if (mMapper4) { - mapper::V4_0::Error error; - mMapper4->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - bufferHandle = static_cast(tmpBufferHandle); - }); - if (error != mapper::V4_0::Error::NONE) { - return Error::NO_RESOURCES; - } + status_t status = mMapper.importBufferNoValidate(rawHandle, outBufferHandle); + if (status == STATUS_OK) { + return Error::NONE; + } else { + return Error::NO_RESOURCES; } - - *outBufferHandle = bufferHandle; - return Error::NONE; } void ComposerHandleImporter::freeBuffer(const native_handle_t* bufferHandle) { if (bufferHandle) { - if (mMapper2) { - mMapper2->freeBuffer(static_cast(const_cast(bufferHandle))); - } else if (mMapper3) { - mMapper3->freeBuffer(static_cast(const_cast(bufferHandle))); - } else if (mMapper4) { - mMapper4->freeBuffer(static_cast(const_cast(bufferHandle))); - } + mMapper.freeBuffer(bufferHandle); } } diff --git a/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h b/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h index de78a59e91..983811859e 100644 --- a/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h +++ b/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h @@ -27,12 +27,10 @@ #include -#include -#include -#include #include namespace android { +class GraphicBufferMapper; namespace hardware { namespace graphics { namespace composer { @@ -42,6 +40,7 @@ namespace hal { // wrapper for IMapper to import buffers and sideband streams class ComposerHandleImporter { public: + ComposerHandleImporter(); bool init(); Error importBuffer(const native_handle_t* rawHandle, const native_handle_t** outBufferHandle); @@ -50,9 +49,7 @@ class ComposerHandleImporter { void freeStream(const native_handle_t* streamHandle); private: - sp mMapper2; - sp mMapper3; - sp mMapper4; + GraphicBufferMapper& mMapper; }; class ComposerHandleCache { diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp index 7b6a0e6367..0e0081d872 100644 --- a/graphics/composer/2.1/utils/vts/Android.bp +++ b/graphics/composer/2.1/utils/vts/Android.bp @@ -34,18 +34,15 @@ cc_library_static { "GraphicsComposerCallback.cpp", "TestCommandReader.cpp", ], + shared_libs: [ + "libui", + ], static_libs: [ "android.hardware.graphics.composer@2.1", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libgtest", ], export_static_lib_headers: [ "android.hardware.graphics.composer@2.1", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", ], header_libs: [ "android.hardware.graphics.composer@2.1-command-buffer", diff --git a/graphics/composer/2.1/utils/vts/ComposerVts.cpp b/graphics/composer/2.1/utils/vts/ComposerVts.cpp index 4603dd1b8c..8b8978465c 100644 --- a/graphics/composer/2.1/utils/vts/ComposerVts.cpp +++ b/graphics/composer/2.1/utils/vts/ComposerVts.cpp @@ -308,113 +308,6 @@ void ComposerClient::execute(TestCommandReader* reader, CommandWriterBase* write writer->reset(); } -NativeHandleWrapper::~NativeHandleWrapper() { - if (mHandle) { - mGralloc.freeBuffer(mHandle); - } -} - -Gralloc::Gralloc() { - [this] { - ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared( - /*aidlAllocatorServiceName*/ IAllocator::descriptor + - std::string("/default"), - /*hidlAllocatorServiceName*/ "default", - /*mapperServiceName*/ "default", - /*errOnFailure=*/false)); - if (!mGralloc4->hasAllocator() || mGralloc4->getMapper() == nullptr) { - mGralloc4 = nullptr; - ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared("default", "default", - /*errOnFailure=*/false)); - if (mGralloc3->getAllocator() == nullptr || mGralloc3->getMapper() == nullptr) { - mGralloc3 = nullptr; - ASSERT_NO_FATAL_FAILURE(mGralloc2 = std::make_shared()); - } - } - }(); -} - -const NativeHandleWrapper Gralloc::allocate(uint32_t width, uint32_t height, uint32_t layerCount, - PixelFormat format, uint64_t usage, bool import, - uint32_t* outStride) { - const native_handle_t* handle; - if (mGralloc4) { - IMapper4::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = static_cast(format); - info.usage = usage; - handle = mGralloc4->allocate(info, import, outStride); - } else if (mGralloc3) { - IMapper3::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = static_cast(format); - info.usage = usage; - handle = mGralloc3->allocate(info, import, outStride); - } else { - IMapper2::BufferDescriptorInfo info{}; - info.width = width; - info.height = height; - info.layerCount = layerCount; - info.format = format; - info.usage = usage; - handle = mGralloc2->allocate(info, import, outStride); - } - return NativeHandleWrapper(*this, handle); -} - -void* Gralloc::lock(const native_handle_t* bufferHandle, uint64_t cpuUsage, - const AccessRegion& accessRegionRect, int acquireFence) { - if (mGralloc4) { - IMapper4::Rect accessRegion; - accessRegion.left = accessRegionRect.left; - accessRegion.top = accessRegionRect.top; - accessRegion.width = accessRegionRect.width; - accessRegion.height = accessRegionRect.height; - return mGralloc4->lock(bufferHandle, cpuUsage, accessRegion, acquireFence); - } else if (mGralloc3) { - IMapper3::Rect accessRegion; - accessRegion.left = accessRegionRect.left; - accessRegion.top = accessRegionRect.top; - accessRegion.width = accessRegionRect.width; - accessRegion.height = accessRegionRect.height; - int32_t bytesPerPixel; - int32_t bytesPerStride; - return mGralloc3->lock(bufferHandle, cpuUsage, accessRegion, acquireFence, &bytesPerPixel, - &bytesPerStride); - } else { - IMapper2::Rect accessRegion; - accessRegion.left = accessRegionRect.left; - accessRegion.top = accessRegionRect.top; - accessRegion.width = accessRegionRect.width; - accessRegion.height = accessRegionRect.height; - return mGralloc2->lock(bufferHandle, cpuUsage, accessRegion, acquireFence); - } -} - -int Gralloc::unlock(const native_handle_t* bufferHandle) { - if (mGralloc4) { - return mGralloc4->unlock(bufferHandle); - } else if (mGralloc3) { - return mGralloc3->unlock(bufferHandle); - } else { - return mGralloc2->unlock(bufferHandle); - } -} - -void Gralloc::freeBuffer(const native_handle_t* bufferHandle) { - if (mGralloc4) { - mGralloc4->freeBuffer(bufferHandle); - } else if (mGralloc3) { - mGralloc3->freeBuffer(bufferHandle); - } else { - mGralloc2->freeBuffer(bufferHandle); - } -} - } // namespace vts } // namespace V2_1 } // namespace composer 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 f8ea661f12..c0aacb5748 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 @@ -25,9 +25,6 @@ #include #include #include -#include -#include -#include #include #include "gtest/gtest.h" @@ -43,13 +40,6 @@ 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 IMapper2 = android::hardware::graphics::mapper::V2_0::IMapper; -using IMapper3 = android::hardware::graphics::mapper::V3_0::IMapper; -using IMapper4 = android::hardware::graphics::mapper::V4_0::IMapper; -using Gralloc2 = android::hardware::graphics::mapper::V2_0::vts::Gralloc; -using Gralloc3 = android::hardware::graphics::mapper::V3_0::vts::Gralloc; -using Gralloc4 = android::hardware::graphics::mapper::V4_0::vts::Gralloc; -using IAllocator = aidl::android::hardware::graphics::allocator::IAllocator; class ComposerClient; @@ -129,52 +119,6 @@ class ComposerClient { const sp mClient; }; -class AccessRegion { - public: - int32_t left; - int32_t top; - int32_t width; - int32_t height; -}; - -class Gralloc; - -// RAII wrapper around native_handle_t* -class NativeHandleWrapper { - public: - NativeHandleWrapper(Gralloc& gralloc, const native_handle_t* handle) - : mGralloc(gralloc), mHandle(handle) {} - - ~NativeHandleWrapper(); - - const native_handle_t* get() { return mHandle; } - - private: - Gralloc& mGralloc; - const native_handle_t* mHandle; -}; - -class Gralloc { - public: - explicit Gralloc(); - - const NativeHandleWrapper allocate(uint32_t width, uint32_t height, uint32_t layerCount, - PixelFormat format, uint64_t usage, bool import = true, - uint32_t* outStride = nullptr); - - void* lock(const native_handle_t* bufferHandle, uint64_t cpuUsage, - const AccessRegion& accessRegionRect, int acquireFence); - - int unlock(const native_handle_t* bufferHandle); - - void freeBuffer(const native_handle_t* bufferHandle); - - protected: - std::shared_ptr mGralloc2 = nullptr; - std::shared_ptr mGralloc3 = nullptr; - std::shared_ptr mGralloc4 = nullptr; -}; - } // namespace vts } // namespace V2_1 } // namespace composer diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp index 0f6d7e8eba..e6af356699 100644 --- a/graphics/composer/2.1/vts/functional/Android.bp +++ b/graphics/composer/2.1/vts/functional/Android.bp @@ -38,22 +38,12 @@ cc_test { "libbinder_ndk", "libfmq", "libsync", + "libui", "android.hardware.common-V2-ndk", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", ], static_libs: [ - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.1-vts", - "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0-vts", "libaidlcommonsupport", ], header_libs: [ diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp index 9444d89f80..b67cfc2114 100644 --- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp +++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp @@ -25,9 +25,7 @@ #include #include #include -#include -#include -#include +#include #include @@ -52,7 +50,6 @@ 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 GrallocError = android::hardware::graphics::mapper::V2_0::Error; class GraphicsComposerHidlTest : public ::testing::TestWithParam { protected: @@ -651,7 +648,6 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { void SetUp() override { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp()); - ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique()); Config activeConfig = mComposerClient->getActiveConfig(mPrimaryDisplay); mDisplayWidth = mComposerClient->getDisplayAttribute(mPrimaryDisplay, activeConfig, IComposerClient::Attribute::WIDTH); @@ -666,13 +662,17 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown()); } - NativeHandleWrapper allocate() { return allocate(mDisplayWidth, mDisplayHeight); } + sp allocate() { return allocate(mDisplayWidth, mDisplayHeight); } - NativeHandleWrapper allocate(uint32_t width, uint32_t height) { - uint64_t usage = + sp allocate(int32_t width, int32_t height) { + auto result = sp::make( + width, height, static_cast(PixelFormat::RGBA_8888), /*layerCount*/ 1, static_cast(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN | - BufferUsage::COMPOSER_OVERLAY); - return mGralloc->allocate(width, height, 1, PixelFormat::RGBA_8888, usage); + BufferUsage::COMPOSER_OVERLAY)); + if (result->initCheck() != STATUS_OK) { + return nullptr; + } + return result; } void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); } @@ -681,9 +681,6 @@ class GraphicsComposerHidlCommandTest : public GraphicsComposerHidlTest { std::unique_ptr mReader; int32_t mDisplayWidth; int32_t mDisplayHeight; - - private: - std::unique_ptr mGralloc; }; /** @@ -729,11 +726,11 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_OUTPUT_BUFFER) { display = mComposerClient->createVirtualDisplay(64, 64, PixelFormat::IMPLEMENTATION_DEFINED, kBufferSlotCount, &format)); - std::unique_ptr handle; - ASSERT_NO_FATAL_FAILURE(handle.reset(new NativeHandleWrapper(allocate()))); + auto handle = allocate(); + ASSERT_TRUE(handle); mWriter->selectDisplay(display); - mWriter->setOutputBuffer(0, handle->get(), -1); + mWriter->setOutputBuffer(0, handle->handle, -1); execute(); } @@ -802,7 +799,7 @@ TEST_P(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) mWriter->setLayerZOrder(10); mWriter->setLayerBlendMode(IComposerClient::BlendMode::NONE); mWriter->setLayerSurfaceDamage(std::vector(1, displayFrame)); - mWriter->setLayerBuffer(0, handle.get(), -1); + mWriter->setLayerBuffer(0, handle->handle, -1); mWriter->setLayerDataspace(Dataspace::UNKNOWN); mWriter->validateDisplay(); @@ -820,7 +817,7 @@ TEST_P(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) mWriter->selectLayer(layer); auto handle2 = allocate(); ASSERT_NE(nullptr, handle2.get()); - mWriter->setLayerBuffer(0, handle2.get(), -1); + mWriter->setLayerBuffer(0, handle2->handle, -1); mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); mWriter->presentDisplay(); execute(); @@ -840,7 +837,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_CURSOR_POSITION) { mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, handle.get(), -1); + mWriter->setLayerBuffer(0, handle->handle, -1); mWriter->setLayerCompositionType(IComposerClient::Composition::CURSOR); mWriter->setLayerDisplayFrame(displayFrame); mWriter->setLayerPlaneAlpha(1); @@ -881,7 +878,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER) { mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, handle.get(), -1); + mWriter->setLayerBuffer(0, handle->handle, -1); execute(); } @@ -905,7 +902,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_multipleTimes) { mWriter->selectLayer(layer); mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); mWriter->setLayerDisplayFrame(displayFrame); - mWriter->setLayerBuffer(0, handle1.get(), -1); + mWriter->setLayerBuffer(0, handle1->handle, -1); mWriter->setLayerDataspace(Dataspace::UNKNOWN); mWriter->validateDisplay(); execute(); @@ -928,7 +925,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_multipleTimes) { mWriter->selectLayer(layer); mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); mWriter->setLayerDisplayFrame(displayFrame); - mWriter->setLayerBuffer(1, handle2.get(), -1); + mWriter->setLayerBuffer(1, handle2->handle, -1); mWriter->setLayerDataspace(Dataspace::UNKNOWN); mWriter->validateDisplay(); execute(); @@ -951,7 +948,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_multipleTimes) { mWriter->selectLayer(layer); mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE); mWriter->setLayerDisplayFrame(displayFrame); - mWriter->setLayerBuffer(2, handle3.get(), -1); + mWriter->setLayerBuffer(2, handle3->handle, -1); mWriter->setLayerDataspace(Dataspace::UNKNOWN); mWriter->validateDisplay(); execute(); @@ -968,10 +965,10 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_BUFFER_multipleTimes) { // Ensure we can clear multiple buffer slots and then restore the active buffer at the end mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); - mWriter->setLayerBuffer(0, clearSlotBuffer.get(), -1); + mWriter->setLayerBuffer(0, clearSlotBuffer->handle, -1); mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); - mWriter->setLayerBuffer(1, clearSlotBuffer.get(), -1); + mWriter->setLayerBuffer(1, clearSlotBuffer->handle, -1); mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); mWriter->setLayerBuffer(2, nullptr, -1); @@ -1113,7 +1110,7 @@ TEST_P(GraphicsComposerHidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { mWriter->selectDisplay(mPrimaryDisplay); mWriter->selectLayer(layer); - mWriter->setLayerSidebandStream(handle.get()); + mWriter->setLayerSidebandStream(handle->handle); execute(); } diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h index 87136988b1..aa6932ad0d 100644 --- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h +++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h @@ -40,7 +40,6 @@ using common::V1_1::PixelFormat; using renderengine::LayerSettings; using V2_1::Display; using V2_1::Layer; -using V2_1::vts::AccessRegion; using V2_1::vts::TestCommandReader; static const IComposerClient::Color BLACK = {0, 0, 0, 0xff}; diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index 7537b62c0a..4fac8d4b2b 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -45,7 +45,6 @@ using common::V1_1::Dataspace; using common::V1_1::PixelFormat; using V2_1::Config; using V2_1::Display; -using V2_1::vts::NativeHandleWrapper; using V2_1::vts::TestCommandReader; class GraphicsCompositionTestBase : public ::testing::Test { diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp index 8f41598b2d..2bd287b29d 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp @@ -39,7 +39,6 @@ using common::V1_1::ColorMode; using common::V1_1::Dataspace; using common::V1_1::PixelFormat; using common::V1_1::RenderIntent; -using V2_1::vts::NativeHandleWrapper; class GraphicsComposerHidlTest : public ::testing::TestWithParam { protected: diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index 956c762409..7ae917b4ed 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -48,7 +48,6 @@ using common::V1_2::ColorMode; using common::V1_2::Dataspace; using common::V1_2::PixelFormat; using V2_1::Layer; -using V2_1::vts::NativeHandleWrapper; using V2_2::Transform; using ContentType = IComposerClient::ContentType; -- GitLab From 631dc15b2e6a5256bd5e9574de138bb4f65b7e76 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 26 Jul 2023 16:06:34 -0400 Subject: [PATCH 085/376] Remove allocator from composer2.1-4 VTS Bug: 292584923 Test: make VtsHalGraphicsComposerV2_3TargetTest VtsHalGraphicsComposerV2_4TargetTest VtsHalGraphicsComposerV2_2TargetTest VtsHalGraphicsComposerV2_1TargetTest Change-Id: I6c5e8c8b96450f800bb60b6ed0ce3b3c10ce1565 --- graphics/composer/2.1/utils/vts/Android.bp | 1 - graphics/composer/2.1/vts/functional/Android.bp | 1 - graphics/composer/2.2/utils/vts/Android.bp | 1 - .../2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h | 1 - graphics/composer/2.2/vts/functional/Android.bp | 1 - .../vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 1 - graphics/composer/2.3/utils/vts/Android.bp | 1 - graphics/composer/2.3/vts/functional/Android.bp | 1 - graphics/composer/2.4/utils/vts/Android.bp | 1 - graphics/composer/2.4/vts/functional/Android.bp | 1 - graphics/composer/aidl/vts/RenderEngineVts.h | 1 - 11 files changed, 11 deletions(-) diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp index 0e0081d872..3bc127f0a9 100644 --- a/graphics/composer/2.1/utils/vts/Android.bp +++ b/graphics/composer/2.1/utils/vts/Android.bp @@ -26,7 +26,6 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.1-vts", defaults: [ - "android.hardware.graphics.allocator-ndk_static", "hidl_defaults", ], srcs: [ diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp index e6af356699..0706341f2d 100644 --- a/graphics/composer/2.1/vts/functional/Android.bp +++ b/graphics/composer/2.1/vts/functional/Android.bp @@ -27,7 +27,6 @@ cc_test { name: "VtsHalGraphicsComposerV2_1TargetTest", defaults: [ "VtsHalTargetTestDefaults", - "android.hardware.graphics.allocator-ndk_static", ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"], diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp index 7a6bcb28a5..a923923b31 100644 --- a/graphics/composer/2.2/utils/vts/Android.bp +++ b/graphics/composer/2.2/utils/vts/Android.bp @@ -26,7 +26,6 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.2-vts", defaults: [ - "android.hardware.graphics.allocator-ndk_static", "android.hardware.graphics.composer3-ndk_static", "hidl_defaults", "librenderengine_deps", diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h index c9808c9cfd..09b89ffa23 100644 --- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h +++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index be9dea50f8..a781712783 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -27,7 +27,6 @@ cc_test { name: "VtsHalGraphicsComposerV2_2TargetTest", defaults: [ "VtsHalTargetTestDefaults", - "android.hardware.graphics.allocator-ndk_static", "android.hardware.graphics.composer3-ndk_static", "librenderengine_deps", ], diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index 4fac8d4b2b..fa1d58897c 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/graphics/composer/2.3/utils/vts/Android.bp b/graphics/composer/2.3/utils/vts/Android.bp index b372804341..99429db887 100644 --- a/graphics/composer/2.3/utils/vts/Android.bp +++ b/graphics/composer/2.3/utils/vts/Android.bp @@ -26,7 +26,6 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.3-vts", defaults: [ - "android.hardware.graphics.allocator-ndk_static", "hidl_defaults", ], srcs: [ diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp index f84775efa2..0d3c27df02 100644 --- a/graphics/composer/2.3/vts/functional/Android.bp +++ b/graphics/composer/2.3/vts/functional/Android.bp @@ -27,7 +27,6 @@ cc_test { name: "VtsHalGraphicsComposerV2_3TargetTest", defaults: [ "VtsHalTargetTestDefaults", - "android.hardware.graphics.allocator-ndk_static", ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"], diff --git a/graphics/composer/2.4/utils/vts/Android.bp b/graphics/composer/2.4/utils/vts/Android.bp index d2b2ffab9a..c39b5eb1d1 100644 --- a/graphics/composer/2.4/utils/vts/Android.bp +++ b/graphics/composer/2.4/utils/vts/Android.bp @@ -26,7 +26,6 @@ package { cc_library_static { name: "android.hardware.graphics.composer@2.4-vts", defaults: [ - "android.hardware.graphics.allocator-ndk_static", "hidl_defaults", ], srcs: [ diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp index 0e53cbe5de..52624b4dec 100644 --- a/graphics/composer/2.4/vts/functional/Android.bp +++ b/graphics/composer/2.4/vts/functional/Android.bp @@ -27,7 +27,6 @@ cc_test { name: "VtsHalGraphicsComposerV2_4TargetTest", defaults: [ "VtsHalTargetTestDefaults", - "android.hardware.graphics.allocator-ndk_static", ], tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"], srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"], diff --git a/graphics/composer/aidl/vts/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h index 69f7ab453a..612f0ea270 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.h +++ b/graphics/composer/aidl/vts/RenderEngineVts.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include -- GitLab From 8c3289db922643e329ce981315c3224b9c633ead Mon Sep 17 00:00:00 2001 From: Ram Mohan Date: Thu, 29 Jun 2023 08:36:31 +0530 Subject: [PATCH 086/376] bluetooth: Fix dependency on android.hardware.audio.common Make android.hardware.bluetooth.audio-V3 and VtsHalBluetoothAudioTargetTest to depend on android.hardware.audio.common-V2. This is needed so that the audio HAL service can depend on android.hardware.bluetooth.audio-V3. Bug: 228804498 Test: m Change-Id: Ic001e651de4cc6ef6920f1d6d80ab272c45aefe2 --- bluetooth/audio/aidl/Android.bp | 4 ++-- bluetooth/audio/aidl/vts/Android.bp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bluetooth/audio/aidl/Android.bp b/bluetooth/audio/aidl/Android.bp index 32f8cca7d2..16b22fef36 100644 --- a/bluetooth/audio/aidl/Android.bp +++ b/bluetooth/audio/aidl/Android.bp @@ -29,7 +29,7 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V1", + "android.hardware.audio.common-V2", ], backend: { cpp: { @@ -69,7 +69,7 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V1", + "android.hardware.audio.common-V2", ], }, diff --git a/bluetooth/audio/aidl/vts/Android.bp b/bluetooth/audio/aidl/vts/Android.bp index 5a604a1960..fe297e02b1 100644 --- a/bluetooth/audio/aidl/vts/Android.bp +++ b/bluetooth/audio/aidl/vts/Android.bp @@ -16,7 +16,7 @@ cc_test { tidy_timeout_srcs: ["VtsHalBluetoothAudioTargetTest.cpp"], srcs: ["VtsHalBluetoothAudioTargetTest.cpp"], static_libs: [ - "android.hardware.audio.common-V1-ndk", + "android.hardware.audio.common-V2-ndk", "android.hardware.bluetooth.audio-V3-ndk", "android.hardware.common-V2-ndk", "android.hardware.common.fmq-V1-ndk", -- GitLab From d411bd3bda15f64b32e1f0e8906e9d39a6d8458c Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 19 Jul 2023 15:22:41 -0700 Subject: [PATCH 087/376] [Composer-HAL-AIDL] Deprecates getDisplayAttribute Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 284866749 BUG: 287518295 Change-Id: Ib4f32d9b60cbbbf127963e0fa4b273951e9d46e6 --- .../hardware/graphics/composer3/IComposerClient.aidl | 3 +++ .../hardware/graphics/composer3/IComposerClient.aidl | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl index 2f08b6fbf9..6d2b485fa0 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl @@ -42,6 +42,9 @@ interface IComposerClient { int getActiveConfig(long display); android.hardware.graphics.composer3.ColorMode[] getColorModes(long display); float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); + /** + * @deprecated use getDisplayConfigurations instead. Returns a display attribute value for a particular display configuration. For legacy support getDisplayAttribute should return valid values for any requested DisplayAttribute, and for all of the configs obtained either through getDisplayConfigs or getDisplayConfigurations. + */ int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute); android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display); /** diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 5d04a28b00..cb4b9fbc3b 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -235,9 +235,18 @@ interface IComposerClient { float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace); /** + * @deprecated use getDisplayConfigurations instead. + * * Returns a display attribute value for a particular display * configuration. * + * For legacy support getDisplayAttribute should return valid values for any requested + * DisplayAttribute, and for all of the configs obtained either through getDisplayConfigs + * or getDisplayConfigurations. + * + * @see getDisplayConfigurations + * @see getDisplayConfigs + * * @param display is the display to query. * @param config is the display configuration for which to return * attribute values. -- GitLab From 65382f6a50f6e78aacd57d3f17e2e63adf2bd2a5 Mon Sep 17 00:00:00 2001 From: Tang Lee Date: Tue, 1 Aug 2023 18:23:07 +0800 Subject: [PATCH 088/376] Fix external camera HAL crashes External USB camera hal service crashes when disconnecting the camera. ExternalCameraDeviceSession's desctructor is called and deletes mLock, but mBufferRequestThread is still running and waiting on the same mLock, which causes the "pthread_mutex_lock called on a destroyed mutex" error. Fix the issue by stopping the thread in destructor. Also refactors the functions and remove unused conditions. Bug: 289741662 Test: Test with USB camera Change-Id: I06b1ff6e192a4bca16822785d65d68a6aae53414 --- .../default/ExternalCameraDeviceSession.cpp | 24 +++++++++---------- .../default/ExternalCameraDeviceSession.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp index c9629744c2..95a36f0615 100644 --- a/camera/device/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/default/ExternalCameraDeviceSession.cpp @@ -224,10 +224,6 @@ void ExternalCameraDeviceSession::initOutputThread() { } void ExternalCameraDeviceSession::closeOutputThread() { - closeOutputThreadImpl(); -} - -void ExternalCameraDeviceSession::closeOutputThreadImpl() { if (mOutputThread != nullptr) { mOutputThread->flush(); mOutputThread->requestExitAndWait(); @@ -235,6 +231,13 @@ void ExternalCameraDeviceSession::closeOutputThreadImpl() { } } +void ExternalCameraDeviceSession::closeBufferRequestThread() { + if (mBufferRequestThread != nullptr) { + mBufferRequestThread->requestExitAndWait(); + mBufferRequestThread.reset(); + } +} + Status ExternalCameraDeviceSession::initStatus() const { Mutex::Autolock _l(mLock); Status status = Status::OK; @@ -248,7 +251,7 @@ Status ExternalCameraDeviceSession::initStatus() const { ExternalCameraDeviceSession::~ExternalCameraDeviceSession() { if (!isClosed()) { ALOGE("ExternalCameraDeviceSession deleted before close!"); - close(/*callerIsDtor*/ true); + closeImpl(); } } @@ -1411,19 +1414,16 @@ Status ExternalCameraDeviceSession::importBufferLocked(int32_t streamId, uint64_ } ScopedAStatus ExternalCameraDeviceSession::close() { - close(false); + closeImpl(); return fromStatus(Status::OK); } -void ExternalCameraDeviceSession::close(bool callerIsDtor) { +void ExternalCameraDeviceSession::closeImpl() { Mutex::Autolock _il(mInterfaceLock); bool closed = isClosed(); if (!closed) { - if (callerIsDtor) { - closeOutputThreadImpl(); - } else { - closeOutputThread(); - } + closeOutputThread(); + closeBufferRequestThread(); Mutex::Autolock _l(mLock); // free all buffers diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h index e7eb799da2..836266f3de 100644 --- a/camera/device/default/ExternalCameraDeviceSession.h +++ b/camera/device/default/ExternalCameraDeviceSession.h @@ -240,9 +240,9 @@ class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputT // To init/close different version of output thread void initOutputThread(); void closeOutputThread(); - void closeOutputThreadImpl(); + void closeBufferRequestThread(); - void close(bool callerIsDtor); + void closeImpl(); Status initStatus() const; status_t initDefaultRequests(); -- GitLab From 07a826c28cc90ca027d267dd14329690128e549c Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Tue, 1 Aug 2023 19:59:39 +0000 Subject: [PATCH 089/376] composer3: minor fix to dpi documentation Change-Id: Ie31cb78f682761d1022592a22867307ab78b5a75 Test: prebuild --- .../hardware/graphics/composer3/DisplayConfiguration.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl index b0095d2dcd..f4a7c45088 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl @@ -30,7 +30,7 @@ parcelable DisplayConfiguration { int height; /** - * Dots per thousand inches. + * Dots per inch. * If the DPI for a configuration is unavailable or is * considered unreliable, the device may set null instead. */ -- GitLab From 2ee3317613d43900d9d2d7e124968c2387e34624 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 4 Aug 2023 21:59:23 +0000 Subject: [PATCH 090/376] Add API level for IMapper 4's bad metadata test Some devices shipped with broken validation for HDR metadata. Relax the test for vendor freeze purposes. Bug: 276843519 Test: VtsHalGraphicsMapperV4_0TargetTest Change-Id: I564f4bd12145f7831faa1e5a0f2d2abe074e4769 --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 03d9041fd2..bae362f04e 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -2223,11 +2223,14 @@ TEST_P(GraphicsMapperHidlTest, SetBadMetadata) { // Keep optional metadata types below and populate the encoded metadata vec // with some arbitrary different metadata because the common gralloc4::decode*() // functions do not distinguish between an empty vec and bad value. - ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::SRGB_LINEAR, &vec)); - ASSERT_EQ(Error::UNSUPPORTED, - mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2086, vec)); - ASSERT_EQ(Error::UNSUPPORTED, - mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec)); + if (base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__) >= __ANDROID_API_T__) { + // Some old grallocs shipped with broken validation. + ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::SRGB_LINEAR, &vec)); + ASSERT_EQ(Error::UNSUPPORTED, + mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2086, vec)); + ASSERT_EQ(Error::UNSUPPORTED, + mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec)); + } } /** -- GitLab From cef396ca26136d812405e78009e7a1374ca89e5c Mon Sep 17 00:00:00 2001 From: Shreshta Manu Date: Mon, 7 Aug 2023 16:52:42 +0000 Subject: [PATCH 091/376] [uwb-interfaces] Add support for prioritized channel list Test: compiles Bug: 293959095 Change-Id: I18da378128b96b73ae457045354d22a4add988d0 --- .../uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl | 1 + .../uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index ff9c24752f..21951b6e20 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -45,6 +45,7 @@ enum UwbVendorCapabilityTlvTypes { CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7, CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8, CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + CCC_PRIORITIZED_CHANNEL_LIST = 0xAA, RADAR_SUPPORT = 0xB0, SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3, SUPPORTED_MIN_RANGING_INTERVAL_MS = 0xE4, diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index ceef1befee..2141b5a1c9 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -149,6 +149,11 @@ enum UwbVendorCapabilityTlvTypes { */ CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + /** + * Byte array of channels supported by the device, ordered by priority from highest to lowest. + */ + CCC_PRIORITIZED_CHANNEL_LIST = 0xAA, + /********************************************* * RADAR specific ********************************************/ -- GitLab From a7c86be17f4b350437bb4c35bdf7016de4c7b6fd Mon Sep 17 00:00:00 2001 From: Hakjun Choi Date: Tue, 8 Aug 2023 02:50:28 +0000 Subject: [PATCH 092/376] Revert "Add setSatellitePlmn() related HAL apis" Revert submission 23748984-SATELLITE_ROAMING_PLMN Reason for revert: satellite roaming plmn will be moved from radio network HAL to satellite modem interface, to reduce change revert first Reverted changes: /q/submissionid:23748984-SATELLITE_ROAMING_PLMN Change-Id: I292644110472dfa97a94db623d246682afdc90c8 --- .../hardware/radio/network/IRadioNetwork.aidl | 1 - .../radio/network/IRadioNetworkResponse.aidl | 1 - .../hardware/radio/network/IRadioNetwork.aidl | 14 -------- .../radio/network/IRadioNetworkResponse.aidl | 17 ---------- .../include/libradiocompat/RadioNetwork.h | 3 -- .../libradiocompat/network/RadioNetwork.cpp | 8 ----- radio/aidl/vts/radio_network_response.cpp | 6 ---- radio/aidl/vts/radio_network_test.cpp | 34 ------------------- radio/aidl/vts/radio_network_utils.h | 2 -- 9 files changed, 86 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl index d1a831b0a5..cbc1e30fbd 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl @@ -82,5 +82,4 @@ interface IRadioNetwork { oneway void isNullCipherAndIntegrityEnabled(in int serial); oneway void isN1ModeEnabled(in int serial); oneway void setN1ModeEnabled(in int serial, boolean enable); - oneway void setSatellitePlmn(in int serial, in List plmnList); } diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl index bf43d7c1f6..c86bebcf1d 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -81,5 +81,4 @@ interface IRadioNetworkResponse { oneway void isNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled); oneway void isN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled); oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void setSatellitePlmnResponse(in android.hardware.radio.RadioResponseInfo info); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index 2f40bd6a86..e4c385670d 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -556,18 +556,4 @@ oneway interface IRadioNetwork { * Response function is IRadioNetworkResponse.setN1ModeEnabledResponse() */ void setN1ModeEnabled(in int serial, boolean enable); - - /** - * Set the non-terrestrial PLMN with lower priority than terrestrial networks. - * MCC/MNC broadcast by the non-terrestrial networks may not be included in OPLMNwACT file on - * SIM profile. Acquisition of satellite based system is lower priority to terrestrial - * networks. UE shall make all attempts to acquire terrestrial service prior to camping on - * satellite LTE service. - * - * @param serial Serial number of request. - * @param plmnList The list of roaming PLMN used for connecting to satellite networks. - * - * Response function is IRadioNetworkResponse.setSatellitePlmnResponse() - */ - void setSatellitePlmn(in int serial, in List plmnList); } diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index 9798944147..db37a0e649 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -668,21 +668,4 @@ oneway interface IRadioNetworkResponse { * RadioError:INVALID_STATE */ void setN1ModeEnabledResponse(in RadioResponseInfo info); - - /** - * Response of setSatellitePlmn. - * This is an optional API. - * - * @param info Response info struct containing response type, serial no. and error. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:MODEM_ERR - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - */ - void setSatellitePlmnResponse(in RadioResponseInfo info); } diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h index ff3f10de6f..d57c83de19 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h @@ -108,9 +108,6 @@ class RadioNetwork : public RadioCompatBase, ::ndk::ScopedAStatus setNullCipherAndIntegrityEnabled(int32_t serial, bool enabled) override; ::ndk::ScopedAStatus isNullCipherAndIntegrityEnabled(int32_t serial) override; - ::ndk::ScopedAStatus setSatellitePlmn(int32_t serial, - const std::vector& plmnList) override; - protected: std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond(); diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp index 1aa7c29a79..a379eec10b 100644 --- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp +++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp @@ -372,12 +372,4 @@ ScopedAStatus RadioNetwork::setN1ModeEnabled(int32_t serial, bool /*enable*/) { respond()->setN1ModeEnabledResponse(notSupported(serial)); return ok(); } - -ScopedAStatus RadioNetwork::setSatellitePlmn(int32_t serial, - const std::vector& /*plmnList*/) { - LOG_CALL << serial; - LOG(ERROR) << " setSatellitePlmn is unsupported by HIDL HALs"; - respond()->setSatellitePlmnResponse(notSupported(serial)); - return ok(); -} } // namespace android::hardware::radio::compat diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp index eab9fac167..25d45a5577 100644 --- a/radio/aidl/vts/radio_network_response.cpp +++ b/radio/aidl/vts/radio_network_response.cpp @@ -320,9 +320,3 @@ ndk::ScopedAStatus RadioNetworkResponse::setN1ModeEnabledResponse(const RadioRes parent_network.notify(info.serial); return ndk::ScopedAStatus::ok(); } - -ndk::ScopedAStatus RadioNetworkResponse::setSatellitePlmnResponse(const RadioResponseInfo& info) { - rspInfo = info; - parent_network.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 9af2494199..2beb249674 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -2076,37 +2076,3 @@ TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); } - -/** - * Test IRadioNetwork.setSatellitePlmn() for the response returned. - */ -TEST_P(RadioNetworkTest, setSatellitePlmn) { - int32_t aidl_version; - std::vector plmnList = {"00101", "00102", "00103"}; - ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); - ASSERT_OK(aidl_status); - if (aidl_version < 3) { - ALOGI("Skipped the test since setSatellitePlmn is not supported on version < 3."); - GTEST_SKIP(); - } - - serial = GetRandomSerialNumber(); - - ndk::ScopedAStatus res = radio_network->setSatellitePlmn(serial, plmnList); - ASSERT_OK(res); - - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); - EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, - { - RadioError::NONE, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, - RadioError::MODEM_ERR, - RadioError::NO_RESOURCES, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, - })); -} diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h index c2466acb5b..8f8f6b070f 100644 --- a/radio/aidl/vts/radio_network_utils.h +++ b/radio/aidl/vts/radio_network_utils.h @@ -169,8 +169,6 @@ class RadioNetworkResponse : public BnRadioNetworkResponse { const RadioResponseInfo& info, bool isEnabled) override; virtual ndk::ScopedAStatus setN1ModeEnabledResponse(const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus setSatellitePlmnResponse(const RadioResponseInfo& info) override; }; /* Callback class for radio network indication */ -- GitLab From 42027e0ee77e91da7967e3ce9da39c1b80e29e72 Mon Sep 17 00:00:00 2001 From: Matt Buckley Date: Mon, 7 Aug 2023 23:50:04 +0000 Subject: [PATCH 093/376] Refactor Power VTS in terms of AIDL version Rewrite Power VTS check support using AIDL versions instead of API versions, and change hint session tests to use a common test fixture. Bug: 294917526 Test: atest VtsHalPowerTargetTest Change-Id: I3cef31fa8dc6341a47d173a13d07521bafe4a1e5 --- power/aidl/vts/VtsHalPowerTargetTest.cpp | 133 ++++++++--------------- 1 file changed, 48 insertions(+), 85 deletions(-) diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp index c2216f8cf6..0976d18cef 100644 --- a/power/aidl/vts/VtsHalPowerTargetTest.cpp +++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp @@ -29,7 +29,6 @@ namespace aidl::android::hardware::power { namespace { -using ::android::base::GetUintProperty; using android::hardware::power::Boost; using android::hardware::power::IPower; using android::hardware::power::IPowerHintSession; @@ -92,36 +91,33 @@ const std::vector kDurations = { DurationWrapper(1000000000L, 4L), }; -// DEVICEs launching with Android 11 MUST meet the requirements for the -// target-level=5 compatibility_matrix file. -const uint64_t kCompatibilityMatrix5ApiLevel = 30; - -// DEVICEs launching with Android 13 MUST meet the requirements for the -// target-level=7 compatibility_matrix file. -const uint64_t kCompatibilityMatrix7ApiLevel = 33; - -// DEVICEs launching with Android 14 MUST meet the requirements for the -// target-level=8 compatibility_matrix file. -const uint64_t kCompatibilityMatrix8ApiLevel = 34; - -inline bool isUnknownOrUnsupported(const ndk::ScopedAStatus& status) { - return status.getStatus() == STATUS_UNKNOWN_TRANSACTION || - status.getExceptionCode() == EX_UNSUPPORTED_OPERATION; -} - class PowerAidl : public testing::TestWithParam { public: virtual void SetUp() override { AIBinder* binder = AServiceManager_waitForService(GetParam().c_str()); ASSERT_NE(binder, nullptr); power = IPower::fromBinder(ndk::SpAIBinder(binder)); - - mApiLevel = GetUintProperty("ro.vendor.api_level", 0); - ASSERT_NE(mApiLevel, 0); + auto status = power->getInterfaceVersion(&mServiceVersion); + ASSERT_TRUE(status.isOk()); } std::shared_ptr power; - uint64_t mApiLevel; + int32_t mServiceVersion; +}; + +class HintSessionAidl : public PowerAidl { + public: + virtual void SetUp() override { + PowerAidl::SetUp(); + if (mServiceVersion < 2) { + GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; + } + + auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession); + ASSERT_TRUE(status.isOk()); + ASSERT_NE(nullptr, mSession); + } + std::shared_ptr mSession; }; TEST_P(PowerAidl, setMode) { @@ -175,113 +171,80 @@ TEST_P(PowerAidl, isBoostSupported) { } TEST_P(PowerAidl, getHintSessionPreferredRate) { - int64_t rate = -1; - auto status = power->getHintSessionPreferredRate(&rate); - if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) { - EXPECT_TRUE(isUnknownOrUnsupported(status)); - GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; + if (mServiceVersion < 2) { + GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond."; } - ASSERT_TRUE(status.isOk()); + + int64_t rate = -1; + ASSERT_TRUE(power->getHintSessionPreferredRate(&rate).isOk()); // At least 1ms rate limit from HAL ASSERT_GE(rate, 1000000); } -TEST_P(PowerAidl, createAndCloseHintSession) { - std::shared_ptr session; - auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); - if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) { - EXPECT_TRUE(isUnknownOrUnsupported(status)); - GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; - } - ASSERT_TRUE(status.isOk()); - ASSERT_NE(nullptr, session); - ASSERT_TRUE(session->pause().isOk()); - ASSERT_TRUE(session->resume().isOk()); +TEST_P(HintSessionAidl, createAndCloseHintSession) { + ASSERT_TRUE(mSession->pause().isOk()); + ASSERT_TRUE(mSession->resume().isOk()); // Test normal destroy operation - ASSERT_TRUE(session->close().isOk()); - session.reset(); + ASSERT_TRUE(mSession->close().isOk()); + mSession.reset(); } -TEST_P(PowerAidl, createHintSessionFailed) { +TEST_P(HintSessionAidl, createHintSessionFailed) { std::shared_ptr session; auto status = power->createHintSession(getpid(), getuid(), kEmptyTids, 16666666L, &session); // Regardless of whether V2 and beyond is supported, the status is always not STATUS_OK. ASSERT_FALSE(status.isOk()); - - // If device not launching with Android 13 and beyond, check whether it's supported, - // if not, skip the test. - if (mApiLevel < kCompatibilityMatrix7ApiLevel && isUnknownOrUnsupported(status)) { - GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; - } ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); } -TEST_P(PowerAidl, updateAndReportDurations) { - std::shared_ptr session; - auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); - if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) { - EXPECT_TRUE(isUnknownOrUnsupported(status)); - GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; - } - ASSERT_TRUE(status.isOk()); - ASSERT_NE(nullptr, session); - - ASSERT_TRUE(session->updateTargetWorkDuration(16666667LL).isOk()); - ASSERT_TRUE(session->reportActualWorkDuration(kDurations).isOk()); +TEST_P(HintSessionAidl, updateAndReportDurations) { + ASSERT_TRUE(mSession->updateTargetWorkDuration(16666667LL).isOk()); + ASSERT_TRUE(mSession->reportActualWorkDuration(kDurations).isOk()); } -TEST_P(PowerAidl, sendSessionHint) { - std::shared_ptr session; - auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); - if (!status.isOk()) { - EXPECT_TRUE(isUnknownOrUnsupported(status)); - return; +TEST_P(HintSessionAidl, sendSessionHint) { + if (mServiceVersion < 4) { + GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } + for (const auto& sessionHint : kSessionHints) { - ASSERT_TRUE(session->sendHint(sessionHint).isOk()); + ASSERT_TRUE(mSession->sendHint(sessionHint).isOk()); } for (const auto& sessionHint : kInvalidSessionHints) { - ASSERT_TRUE(session->sendHint(sessionHint).isOk()); + ASSERT_TRUE(mSession->sendHint(sessionHint).isOk()); } } -TEST_P(PowerAidl, setThreads) { - std::shared_ptr session; - auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session); - if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) { - EXPECT_TRUE(isUnknownOrUnsupported(status)); - GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond."; +TEST_P(HintSessionAidl, setThreads) { + if (mServiceVersion < 4) { + GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond."; } - ASSERT_TRUE(status.isOk()); - status = session->setThreads(kEmptyTids); - if (mApiLevel < kCompatibilityMatrix8ApiLevel && isUnknownOrUnsupported(status)) { - GTEST_SKIP() << "DEVICE not launching with Android 14 and beyond."; - } + auto status = mSession->setThreads(kEmptyTids); ASSERT_FALSE(status.isOk()); ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode()); - status = session->setThreads(kSelfTids); - ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(mSession->setThreads(kSelfTids).isOk()); } // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11 // or later TEST_P(PowerAidl, hasFixedPerformance) { - if (mApiLevel < kCompatibilityMatrix5ApiLevel) { - GTEST_SKIP() << "FIXED_PERFORMANCE mode is only required for all devices launching Android " - "11 or later."; - } bool supported; ASSERT_TRUE(power->isModeSupported(Mode::FIXED_PERFORMANCE, &supported).isOk()); ASSERT_TRUE(supported); } GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerAidl); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HintSessionAidl); + INSTANTIATE_TEST_SUITE_P(Power, PowerAidl, testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), ::android::PrintInstanceNameToString); +INSTANTIATE_TEST_SUITE_P(Power, HintSessionAidl, + testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)), + ::android::PrintInstanceNameToString); } // namespace } // namespace aidl::android::hardware::power -- GitLab From 1fde90c1537be38d6a468d3d31cabc3cf00d6d1e Mon Sep 17 00:00:00 2001 From: Matt Buckley Date: Wed, 28 Jun 2023 19:55:26 +0000 Subject: [PATCH 094/376] Add plumbing for ADPF Power Efficiency hint These patches introduce a new power efficiency mode for hint sessions to the public API, and internally expose a new setMode API for hint sessions that resembles the setMode API for iPower, to control different session operating modes. This set of patches: - Updates the PowerHAL AIDL to version 5, and updates relevant bp files - Exposes new setPreferPowerEfficiency(bool enabled) method from the SDK and NDK - Exposes new setMode(int mode, bool enabled) method from PowerHAL AIDL and HintManagerService - Adds support for new setMode call in PowerHAL Bug: b/288117936 Test: manual Change-Id: Id006341b5ab0ae6fadd975d740d2fcf89f0636e4 --- .../compatibility_matrix.9.xml | 2 +- power/aidl/Android.bp | 40 ++++++++++++++++++- .../current/android/hardware/power/Boost.aidl | 12 +++--- .../hardware/power/IPowerHintSession.aidl | 1 + .../current/android/hardware/power/Mode.aidl | 34 ++++++++-------- .../android/hardware/power/SessionMode.aidl | 38 ++++++++++++++++++ .../hardware/power/IPowerHintSession.aidl | 10 +++++ .../android/hardware/power/SessionMode.aidl | 28 +++++++++++++ power/aidl/default/Android.bp | 2 +- power/aidl/default/PowerHintSession.cpp | 4 ++ power/aidl/default/PowerHintSession.h | 2 + power/aidl/default/power-default.xml | 2 +- power/aidl/vts/Android.bp | 4 +- power/aidl/vts/VtsHalPowerTargetTest.cpp | 24 +++++++++++ 14 files changed, 173 insertions(+), 30 deletions(-) create mode 100644 power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl create mode 100644 power/aidl/android/hardware/power/SessionMode.aidl diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 14b921004e..ff716dfac4 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -390,7 +390,7 @@ android.hardware.power - 4 + 5 IPower default diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp index 082572d34c..76439265af 100644 --- a/power/aidl/Android.bp +++ b/power/aidl/Android.bp @@ -55,6 +55,44 @@ aidl_interface { }, ], - frozen: true, + frozen: false, } + +cc_defaults { + name: "android.hardware.power-ndk_shared", + shared_libs: [ + "android.hardware.power-V5-ndk", + ], +} + +cc_defaults { + name: "android.hardware.power-ndk_export_shared", + shared_libs: [ + "android.hardware.power-V5-ndk", + ], + export_shared_lib_headers: [ + "android.hardware.power-V5-ndk", + ], +} + +cc_defaults { + name: "android.hardware.power-ndk_static", + static_libs: [ + "android.hardware.power-V5-ndk", + ], +} + +java_defaults { + name: "android.hardware.power-java_shared", + libs: [ + "android.hardware.power-V5-java", + ], +} + +java_defaults { + name: "android.hardware.power-java_static", + static_libs: [ + "android.hardware.power-V5-java", + ], +} diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl index c792d4e0c2..8ee15eff7f 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl @@ -34,10 +34,10 @@ package android.hardware.power; @Backing(type="int") @VintfStability enum Boost { - INTERACTION = 0, - DISPLAY_UPDATE_IMMINENT = 1, - ML_ACC = 2, - AUDIO_LAUNCH = 3, - CAMERA_LAUNCH = 4, - CAMERA_SHOT = 5, + INTERACTION, + DISPLAY_UPDATE_IMMINENT, + ML_ACC, + AUDIO_LAUNCH, + CAMERA_LAUNCH, + CAMERA_SHOT, } diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl index e6809da92c..6bc663e125 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl @@ -41,4 +41,5 @@ interface IPowerHintSession { oneway void close(); oneway void sendHint(android.hardware.power.SessionHint hint); void setThreads(in int[] threadIds); + oneway void setMode(android.hardware.power.SessionMode type, boolean enabled); } diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl index f38426b785..efbb300f8d 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl @@ -34,21 +34,21 @@ package android.hardware.power; @Backing(type="int") @VintfStability enum Mode { - DOUBLE_TAP_TO_WAKE = 0, - LOW_POWER = 1, - SUSTAINED_PERFORMANCE = 2, - FIXED_PERFORMANCE = 3, - VR = 4, - LAUNCH = 5, - EXPENSIVE_RENDERING = 6, - INTERACTIVE = 7, - DEVICE_IDLE = 8, - DISPLAY_INACTIVE = 9, - AUDIO_STREAMING_LOW_LATENCY = 10, - CAMERA_STREAMING_SECURE = 11, - CAMERA_STREAMING_LOW = 12, - CAMERA_STREAMING_MID = 13, - CAMERA_STREAMING_HIGH = 14, - GAME = 15, - GAME_LOADING = 16, + DOUBLE_TAP_TO_WAKE, + LOW_POWER, + SUSTAINED_PERFORMANCE, + FIXED_PERFORMANCE, + VR, + LAUNCH, + EXPENSIVE_RENDERING, + INTERACTIVE, + DEVICE_IDLE, + DISPLAY_INACTIVE, + AUDIO_STREAMING_LOW_LATENCY, + CAMERA_STREAMING_SECURE, + CAMERA_STREAMING_LOW, + CAMERA_STREAMING_MID, + CAMERA_STREAMING_HIGH, + GAME, + GAME_LOADING, } diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl new file mode 100644 index 0000000000..d0ae0bab70 --- /dev/null +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.power; +@Backing(type="int") @VintfStability +enum SessionMode { + POWER_EFFICIENCY, +} diff --git a/power/aidl/android/hardware/power/IPowerHintSession.aidl b/power/aidl/android/hardware/power/IPowerHintSession.aidl index 7db0ea1d54..62263c8aa9 100644 --- a/power/aidl/android/hardware/power/IPowerHintSession.aidl +++ b/power/aidl/android/hardware/power/IPowerHintSession.aidl @@ -17,6 +17,7 @@ package android.hardware.power; import android.hardware.power.SessionHint; +import android.hardware.power.SessionMode; import android.hardware.power.WorkDuration; @VintfStability @@ -81,4 +82,13 @@ interface IPowerHintSession { * must be thrown. */ void setThreads(in int[] threadIds); + + /** + * Called to enable or disable special modes for the hint session, which may + * adjust the power or performance of the session. + * + * @param type The mode being set + * @param enabled True to enable the mode, false to disable it + */ + oneway void setMode(SessionMode type, boolean enabled); } diff --git a/power/aidl/android/hardware/power/SessionMode.aidl b/power/aidl/android/hardware/power/SessionMode.aidl new file mode 100644 index 0000000000..f1ee64e7da --- /dev/null +++ b/power/aidl/android/hardware/power/SessionMode.aidl @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.power; + +@VintfStability +@Backing(type="int") +enum SessionMode { + /** + * This mode indicates that the work of this hint session is not + * critical to perceived performance, despite its CPU intensity, + * and can be safely scheduled to prefer power efficiency. + */ + POWER_EFFICIENCY, +} diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp index da91ee6690..c0bfbe8d6f 100644 --- a/power/aidl/default/Android.bp +++ b/power/aidl/default/Android.bp @@ -23,6 +23,7 @@ package { cc_binary { name: "android.hardware.power-service.example", + defaults: ["android.hardware.power-ndk_shared"], relative_install_path: "hw", init_rc: [":android.hardware.power.rc"], vintf_fragments: [":android.hardware.power.xml"], @@ -30,7 +31,6 @@ cc_binary { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.power-V4-ndk", ], srcs: [ "main.cpp", diff --git a/power/aidl/default/PowerHintSession.cpp b/power/aidl/default/PowerHintSession.cpp index f395800e8c..452e435c29 100644 --- a/power/aidl/default/PowerHintSession.cpp +++ b/power/aidl/default/PowerHintSession.cpp @@ -59,4 +59,8 @@ ScopedAStatus PowerHintSession::setThreads(const std::vector& threadIds return ScopedAStatus::ok(); } +ScopedAStatus PowerHintSession::setMode(SessionMode /* mode */, bool /* enabled */) { + return ScopedAStatus::ok(); +} + } // namespace aidl::android::hardware::power::impl::example diff --git a/power/aidl/default/PowerHintSession.h b/power/aidl/default/PowerHintSession.h index 1d74716461..b488bf108e 100644 --- a/power/aidl/default/PowerHintSession.h +++ b/power/aidl/default/PowerHintSession.h @@ -18,6 +18,7 @@ #include #include +#include #include namespace aidl::android::hardware::power::impl::example { @@ -33,6 +34,7 @@ class PowerHintSession : public BnPowerHintSession { ndk::ScopedAStatus close() override; ndk::ScopedAStatus sendHint(SessionHint hint) override; ndk::ScopedAStatus setThreads(const std::vector& threadIds) override; + ndk::ScopedAStatus setMode(SessionMode mode, bool enabled) override; }; } // namespace aidl::android::hardware::power::impl::example diff --git a/power/aidl/default/power-default.xml b/power/aidl/default/power-default.xml index f5dd6b957c..418fb83d62 100644 --- a/power/aidl/default/power-default.xml +++ b/power/aidl/default/power-default.xml @@ -1,7 +1,7 @@ android.hardware.power - 4 + 5 IPower/default diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp index 56c98bd2d8..eb98b8b5bf 100644 --- a/power/aidl/vts/Android.bp +++ b/power/aidl/vts/Android.bp @@ -26,14 +26,12 @@ cc_test { defaults: [ "VtsHalTargetTestDefaults", "use_libaidlvintf_gtest_helper_static", + "android.hardware.power-ndk_static", ], srcs: ["VtsHalPowerTargetTest.cpp"], shared_libs: [ "libbinder_ndk", ], - static_libs: [ - "android.hardware.power-V4-ndk", - ], test_suites: [ "general-tests", "vts", diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp index 0976d18cef..96995a0acc 100644 --- a/power/aidl/vts/VtsHalPowerTargetTest.cpp +++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp @@ -34,6 +34,7 @@ using android::hardware::power::IPower; using android::hardware::power::IPowerHintSession; using android::hardware::power::Mode; using android::hardware::power::SessionHint; +using android::hardware::power::SessionMode; using android::hardware::power::WorkDuration; const std::vector kBoosts{ndk::enum_range().begin(), ndk::enum_range().end()}; @@ -43,6 +44,9 @@ const std::vector kModes{ndk::enum_range().begin(), ndk::enum_range< const std::vector kSessionHints{ndk::enum_range().begin(), ndk::enum_range().end()}; +const std::vector kSessionModes{ndk::enum_range().begin(), + ndk::enum_range().end()}; + const std::vector kInvalidBoosts = { static_cast(static_cast(kBoosts.front()) - 1), static_cast(static_cast(kBoosts.back()) + 1), @@ -58,6 +62,11 @@ const std::vector kInvalidSessionHints = { static_cast(static_cast(kSessionHints.back()) + 1), }; +const std::vector kInvalidSessionModes = { + static_cast(static_cast(kSessionModes.front()) - 1), + static_cast(static_cast(kSessionModes.back()) + 1), +}; + class DurationWrapper : public WorkDuration { public: DurationWrapper(int64_t dur, int64_t time) { @@ -228,6 +237,21 @@ TEST_P(HintSessionAidl, setThreads) { ASSERT_TRUE(mSession->setThreads(kSelfTids).isOk()); } +TEST_P(HintSessionAidl, setSessionMode) { + if (mServiceVersion < 5) { + GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond."; + } + + for (const auto& sessionMode : kSessionModes) { + ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk()); + ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk()); + } + for (const auto& sessionMode : kInvalidSessionModes) { + ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk()); + ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk()); + } +} + // FIXED_PERFORMANCE mode is required for all devices which ship on Android 11 // or later TEST_P(PowerAidl, hasFixedPerformance) { -- GitLab From 8c5976f06a9c9b0cb92735c3eeba7f7485f4e7ca Mon Sep 17 00:00:00 2001 From: Arthur Ishiguro Date: Wed, 9 Aug 2023 17:18:56 +0000 Subject: [PATCH 095/376] Add CPU_WRITE_RARELY flag Without this flag, the test may fail with SEGV_ACCERR. Bug: 293475360 Test: Run test Change-Id: I2d7cfba94145239afde196567400c966a2769419 --- sensors/common/vts/utils/GrallocWrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sensors/common/vts/utils/GrallocWrapper.cpp b/sensors/common/vts/utils/GrallocWrapper.cpp index e6e088826b..a15e7fee8c 100644 --- a/sensors/common/vts/utils/GrallocWrapper.cpp +++ b/sensors/common/vts/utils/GrallocWrapper.cpp @@ -124,7 +124,8 @@ class GrallocHalWrapper : public IGrallocHalWrapper { private: static constexpr uint64_t kBufferUsage = - static_cast(BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::CPU_READ_OFTEN); + static_cast(BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::CPU_READ_OFTEN | + BufferUsage::CPU_WRITE_RARELY); AllocatorWrapperT mAllocator; sp mMapper; -- GitLab From b36d24d12aebd013a8d7e737a3211e0e28f8d3e3 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Thu, 10 Aug 2023 16:34:50 -0700 Subject: [PATCH 096/376] Update VHAL property version to v3. Bug: 295405997 Test: Manual Build Change-Id: I2faf065006e6889309caf69a9b277f42fdc00702 --- automotive/vehicle/Android.bp | 2 +- automotive/vehicle/aidl/aidl_test/Android.bp | 2 +- automotive/vehicle/aidl_property/Android.bp | 3 +-- automotive/vehicle/vhal_static_cpp_lib.mk | 2 +- compatibility_matrices/compatibility_matrix.9.xml | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp index c0d71d7dac..f0abbcf357 100644 --- a/automotive/vehicle/Android.bp +++ b/automotive/vehicle/Android.bp @@ -22,6 +22,6 @@ cc_defaults { name: "VehicleHalInterfaceDefaults", static_libs: [ "android.hardware.automotive.vehicle-V2-ndk", - "android.hardware.automotive.vehicle.property-V2-ndk", + "android.hardware.automotive.vehicle.property-V3-ndk", ], } diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp index 44d7445d25..79ac309c13 100644 --- a/automotive/vehicle/aidl/aidl_test/Android.bp +++ b/automotive/vehicle/aidl/aidl_test/Android.bp @@ -52,7 +52,7 @@ android_test { ], static_libs: [ "android.hardware.automotive.vehicle-V2-java", - "android.hardware.automotive.vehicle.property-V2-java", + "android.hardware.automotive.vehicle.property-V3-java", "androidx.test.runner", "truth-prebuilt", ], diff --git a/automotive/vehicle/aidl_property/Android.bp b/automotive/vehicle/aidl_property/Android.bp index 19fa4a38db..db96382549 100644 --- a/automotive/vehicle/aidl_property/Android.bp +++ b/automotive/vehicle/aidl_property/Android.bp @@ -28,7 +28,7 @@ aidl_interface { // This HAL was originally part of android.hardware.automotive.vehicle "android/hardware/automotive/vehicle/*.aidl", ], - frozen: true, + frozen: false, stability: "vintf", backend: { cpp: { @@ -52,7 +52,6 @@ aidl_interface { version: "2", imports: [], }, - ], } diff --git a/automotive/vehicle/vhal_static_cpp_lib.mk b/automotive/vehicle/vhal_static_cpp_lib.mk index 995589c47e..bffa0769a3 100644 --- a/automotive/vehicle/vhal_static_cpp_lib.mk +++ b/automotive/vehicle/vhal_static_cpp_lib.mk @@ -17,4 +17,4 @@ LOCAL_STATIC_LIBRARIES += \ android.hardware.automotive.vehicle-V2-ndk \ - android.hardware.automotive.vehicle.property-V2-ndk + android.hardware.automotive.vehicle.property-V3-ndk diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 0928f1489f..1272b3600f 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -94,7 +94,7 @@ android.hardware.automotive.vehicle - 1-2 + 1-3 IVehicle default -- GitLab From 46d65626e2ff9b679cd61c3fc1277025b9f5916d Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Thu, 10 Aug 2023 18:29:08 -0700 Subject: [PATCH 097/376] Add UNKNOWN to VehicleAreaSeat aidl. Bug: 293521207 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: Idf42a5735eb8e187759c3d84cc4891a473d97d35 --- .../android/hardware/automotive/vehicle/VehicleAreaSeat.aidl | 1 + .../android/hardware/automotive/vehicle/VehicleAreaSeat.aidl | 1 + 2 files changed, 2 insertions(+) diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl index 44c9d54567..a24f515697 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -34,6 +34,7 @@ package android.hardware.automotive.vehicle; @Backing(type="int") @VintfStability enum VehicleAreaSeat { + UNKNOWN = 0x0000, ROW_1_LEFT = 0x0001, ROW_1_CENTER = 0x0002, ROW_1_RIGHT = 0x0004, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl index 89d50ea183..e70fb22717 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl @@ -22,6 +22,7 @@ package android.hardware.automotive.vehicle; @VintfStability @Backing(type="int") enum VehicleAreaSeat { + UNKNOWN = 0x0000, ROW_1_LEFT = 0x0001, ROW_1_CENTER = 0x0002, ROW_1_RIGHT = 0x0004, -- GitLab From 32a41abac3d28363398f873e6d6720908cce6508 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Tue, 15 Aug 2023 02:07:52 +0000 Subject: [PATCH 098/376] Remove color management configuration in VTS Color management is now turned on by default, so there's no reason to explicitly enable it in renderengine. Bug: 295966830 Test: builds Change-Id: I42c8afb30950081cd57072680da06895dcc02f2c --- .../VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 14 +++++++------- .../vts/VtsHalGraphicsComposer3_ReadbackTest.cpp | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index fa1d58897c..74d2f03ba3 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -82,13 +82,13 @@ class GraphicsCompositionTestBase : public ::testing::Test { ASSERT_NO_FATAL_FAILURE( mTestRenderEngine = std::unique_ptr(new TestRenderEngine( renderengine::RenderEngineCreationArgs::Builder() - .setPixelFormat(static_cast(ui::PixelFormat::RGBA_8888)) - .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers) - .setUseColorManagerment(true) - .setEnableProtectedContext(false) - .setPrecacheToneMapperShaderOnly(false) - .setContextPriority(renderengine::RenderEngine::ContextPriority::HIGH) - .build()))); + .setPixelFormat(static_cast(ui::PixelFormat::RGBA_8888)) + .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers) + .setEnableProtectedContext(false) + .setPrecacheToneMapperShaderOnly(false) + .setContextPriority( + renderengine::RenderEngine::ContextPriority::HIGH) + .build()))); renderengine::DisplaySettings clientCompositionDisplay; clientCompositionDisplay.physicalDisplay = Rect(mDisplayWidth, mDisplayHeight); diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 269abd150d..a83b833eeb 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -70,7 +70,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { ::android::renderengine::RenderEngineCreationArgs::Builder() .setPixelFormat(static_cast(common::PixelFormat::RGBA_8888)) .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers) - .setUseColorManagerment(true) .setEnableProtectedContext(false) .setPrecacheToneMapperShaderOnly(false) .setContextPriority(::android::renderengine::RenderEngine:: -- GitLab From 75a546270a0b99782570cea31774d9b59ef061ba Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 18 Aug 2023 15:01:52 +0000 Subject: [PATCH 099/376] Remove useFramebufferCache parameter in drawLayers() GLESRenderEngine used it, but GLESRenderEngine is no more. Bug: 199918329 Test: builds Change-Id: I9c735e5820bd187f910905e7e77f9445f0ff30db --- graphics/composer/2.2/utils/vts/RenderEngineVts.cpp | 2 +- graphics/composer/aidl/vts/RenderEngineVts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp index 62974f8409..6960d069f1 100644 --- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp +++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp @@ -71,7 +71,7 @@ void TestRenderEngine::drawLayers() { auto texture = std::make_shared( mGraphicBuffer, *mRenderEngine, renderengine::impl::ExternalTexture::Usage::WRITEABLE); auto result = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayers, texture, true, + ->drawLayers(mDisplaySettings, compositionLayers, texture, std::move(bufferFence)) .get(); if (result.ok()) { diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp index 19e8a9bee3..d1f89d06f7 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp @@ -66,7 +66,7 @@ void TestRenderEngine::drawLayers() { mGraphicBuffer, *mRenderEngine, ::android::renderengine::impl::ExternalTexture::Usage::WRITEABLE); auto result = mRenderEngine - ->drawLayers(mDisplaySettings, compositionLayers, texture, true, + ->drawLayers(mDisplaySettings, compositionLayers, texture, std::move(bufferFence)) .get(); if (result.ok()) { -- GitLab From 3d3baed1bc85f8ddddb2764a5a09cd4d578419f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Sat, 19 Aug 2023 02:07:47 +0000 Subject: [PATCH 100/376] Add missing gRPC include. Othewise the header is not self contained and breaks when upgrading gRPC. Bug: 279548314 Test: presubmit Change-Id: Ife50863bd16eda6bc639261b1f91fdfcf48f6294 --- automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h index 90588aa375..e740da7e5c 100644 --- a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h @@ -24,6 +24,8 @@ #include "VehicleServer.grpc.pb.h" #include "VehicleServer.pb.h" +#include + #include #include #include -- GitLab From 6791803d4ad568c8ba66d20199e84746f412df23 Mon Sep 17 00:00:00 2001 From: terryguan Date: Tue, 22 Aug 2023 17:46:12 -0700 Subject: [PATCH 101/376] Add buffer result for generating vendor configs Add buffers to verify the success of generating and restoring vendor configs. Bug: 281835821 Test: atest android.car.apitest.CarPropertyManagerTest Change-Id: Ic3cb8bf3e606847ff55d719900ad0b764b56aaf4 --- .../aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 4934771363..0f8da0099c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -1015,9 +1015,11 @@ DumpResult FakeVehicleHardware::dump(const std::vector& options) { } else if (EqualsIgnoreCase(option, "--genTestVendorConfigs")) { mAddExtraTestVendorConfigs = true; result.refreshPropertyConfigs = true; + result.buffer = "successfully generated vendor configs"; } else if (EqualsIgnoreCase(option, "--restoreVendorConfigs")) { mAddExtraTestVendorConfigs = false; result.refreshPropertyConfigs = true; + result.buffer = "successfully restored vendor configs"; } else { result.buffer = StringPrintf("Invalid option: %s\n", option.c_str()); } -- GitLab From 7ec22261092b0db1ade58bc0e3f1892182fc1288 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Wed, 23 Aug 2023 10:38:21 +0800 Subject: [PATCH 102/376] remove overlapping instance android.hardware.threadnetwork from matrix Bug: 296965759 Test: m Change-Id: Icf127545e2f1150ddacf2390eb841ca3db49ec40 --- compatibility_matrices/compatibility_matrix.9.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index b05916ec2d..934aaae01a 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -567,14 +567,6 @@ default - - android.hardware.threadnetwork - 1 - - IThreadChip - chip0 - - android.hardware.tv.hdmi.cec 1 -- GitLab From cc3f5884cd7a7c198caa2780e58d828b4ec8ca9c Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 18 May 2023 21:31:23 +0000 Subject: [PATCH 103/376] Added logic for ACC properties to return NOT_AVAILABLE in standard CC. ACC properties and certain CRUISE_CONTROL_COMMAND enums will return StatusCode NOT_AVAILABLE_DISABLED when CRUISE_CONTROL_TYPE is STANDARD. Bug: 268680457 Test: atest FakeVehicleHardwareTest Change-Id: Id79c93a0dab6224dd3e6fae3aa747781a848aa94 --- .../config/DefaultProperties.json | 2 +- .../hardware/include/FakeVehicleHardware.h | 1 + .../hardware/src/FakeVehicleHardware.cpp | 87 +++++++++++++++++-- .../hardware/test/FakeVehicleHardwareTest.cpp | 45 +++++++++- 4 files changed, 126 insertions(+), 9 deletions(-) diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 0dfb123b4b..b9f784b717 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3387,7 +3387,7 @@ "property": "VehicleProperty::CRUISE_CONTROL_TYPE", "defaultValue": { "int32Values": [ - "CruiseControlType::STANDARD" + "CruiseControlType::ADAPTIVE" ] }, "areas": [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 502d957ef4..f130fa4615 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -189,6 +189,7 @@ class FakeVehicleHardware : public IVehicleHardware { VhalResult maybeSetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue); + VhalResult isCruiseControlTypeStandard() const; ValueResultType maybeGetSpecialValue( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value, bool* isSpecialValue) const; diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 4934771363..efd7f8e6a3 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -52,6 +52,8 @@ namespace fake { namespace { +using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; +using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; @@ -611,6 +613,18 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getUserHalProp( } } +VhalResult FakeVehicleHardware::isCruiseControlTypeStandard() const { + auto isCruiseControlTypeAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_TYPE)); + if (!isCruiseControlTypeAvailableResult.ok()) { + return isCruiseControlTypeAvailableResult.error(); + } + auto cruiseControlTypeValue = + mServerSidePropStore->readValue(toInt(VehicleProperty::CRUISE_CONTROL_TYPE)); + return cruiseControlTypeValue.value()->value.int32Values[0] == + toInt(CruiseControlType::STANDARD); +} + FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( const VehiclePropValue& value, bool* isSpecialValue) const { *isSpecialValue = false; @@ -638,6 +652,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available"; } + VhalResult isAdasPropertyAvailableResult; switch (propId) { case OBD2_FREEZE_FRAME: *isSpecialValue = true; @@ -660,16 +675,33 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); case toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED): - [[fallthrough]]; + isAdasPropertyAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); + if (!isAdasPropertyAvailableResult.ok()) { + *isSpecialValue = true; + return isAdasPropertyAvailableResult.error(); + } + return nullptr; case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): [[fallthrough]]; case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): { - auto isAdasPropertyAvailableResult = + isAdasPropertyAvailableResult = isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); if (!isAdasPropertyAvailableResult.ok()) { *isSpecialValue = true; return isAdasPropertyAvailableResult.error(); } + auto isCruiseControlTypeStandardResult = isCruiseControlTypeStandard(); + if (!isCruiseControlTypeStandardResult.ok()) { + *isSpecialValue = true; + return isCruiseControlTypeStandardResult.error(); + } + if (isCruiseControlTypeStandardResult.value()) { + *isSpecialValue = true; + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) + << "tried to get target time gap or lead vehicle measured distance value " + << "while on a standard CC setting"; + } return nullptr; } default: @@ -730,7 +762,13 @@ void FakeVehicleHardware::sendAdasPropertiesState(int32_t propertyId, int32_t st } auto& dependentPropConfig = dependentPropConfigResult.value(); for (auto& areaConfig : dependentPropConfig->areaConfigs) { - auto propValue = createAdasStateReq(dependentPropId, areaConfig.areaId, state); + int32_t hardcoded_state = state; + // TODO: restore old/initial values here instead of hardcoded value (b/295542701) + if (state == 1 && dependentPropId == toInt(VehicleProperty::CRUISE_CONTROL_TYPE)) { + hardcoded_state = toInt(CruiseControlType::ADAPTIVE); + } + auto propValue = + createAdasStateReq(dependentPropId, areaConfig.areaId, hardcoded_state); // This will trigger a property change event for the current ADAS property value. mServerSidePropStore->writeValue(std::move(propValue), /*updateStatus=*/true, VehiclePropertyStore::EventMode::ALWAYS); @@ -777,6 +815,8 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu } } + VhalResult isAdasPropertyAvailableResult; + VhalResult isCruiseControlTypeStandardResult; switch (propId) { case toInt(VehicleProperty::AP_POWER_STATE_REPORT): *isSpecialValue = true; @@ -802,7 +842,7 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu *isSpecialValue = true; return setHvacTemperatureValueSuggestion(value); case toInt(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND): { - auto isAdasPropertyAvailableResult = + isAdasPropertyAvailableResult = isAdasPropertyAvailable(toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE)); if (!isAdasPropertyAvailableResult.ok()) { *isSpecialValue = true; @@ -810,14 +850,47 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu return isAdasPropertyAvailableResult; } case toInt(VehicleProperty::CRUISE_CONTROL_COMMAND): - [[fallthrough]]; + isAdasPropertyAvailableResult = + isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); + if (!isAdasPropertyAvailableResult.ok()) { + *isSpecialValue = true; + return isAdasPropertyAvailableResult; + } + isCruiseControlTypeStandardResult = isCruiseControlTypeStandard(); + if (!isCruiseControlTypeStandardResult.ok()) { + *isSpecialValue = true; + return isCruiseControlTypeStandardResult.error(); + } + if (isCruiseControlTypeStandardResult.value() && + (value.value.int32Values[0] == + toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP) || + value.value.int32Values[0] == + toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP))) { + *isSpecialValue = true; + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) + << "tried to use a change target time gap command while on a standard CC " + << "setting"; + } + return {}; case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): { - auto isAdasPropertyAvailableResult = + isAdasPropertyAvailableResult = isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE)); if (!isAdasPropertyAvailableResult.ok()) { *isSpecialValue = true; + return isAdasPropertyAvailableResult; } - return isAdasPropertyAvailableResult; + isCruiseControlTypeStandardResult = isCruiseControlTypeStandard(); + if (!isCruiseControlTypeStandardResult.ok()) { + *isSpecialValue = true; + return isCruiseControlTypeStandardResult.error(); + } + if (isCruiseControlTypeStandardResult.value()) { + *isSpecialValue = true; + return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) + << "tried to set target time gap or lead vehicle measured distance value " + << "while on a standard CC setting"; + } + return {}; } #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index ae1c0f681a..a77d565d6e 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -62,6 +62,8 @@ namespace vehicle { namespace fake { namespace { +using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; +using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; @@ -1454,7 +1456,7 @@ std::vector setSpecialValueTestCases() { }, VehiclePropValue{ .prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE), - .value.int32Values = {1}, + .value.int32Values = {2}, }, VehiclePropValue{ .prop = toInt(VehicleProperty::CRUISE_CONTROL_STATE), @@ -1834,6 +1836,47 @@ TEST_F(FakeVehicleHardwareTest, testSetAdasPropNotAvailable) { } } +TEST_F(FakeVehicleHardwareTest, testGetAccPropertiesOnStandardCc) { + std::vector ccTypeDependentProperties = { + toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP), + toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE), + }; + + StatusCode status = + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + .value.int32Values = {toInt(CruiseControlType::STANDARD)}}); + EXPECT_EQ(status, StatusCode::OK); + + for (int32_t dependentProp : ccTypeDependentProperties) { + auto getValueResult = getValue(VehiclePropValue{.prop = dependentProp}); + EXPECT_FALSE(getValueResult.ok()); + EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED); + } +} + +TEST_F(FakeVehicleHardwareTest, testSetAccPropertiesOnStandardCc) { + std::vector testVehiclePropValues = { + VehiclePropValue{ + .prop = toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP), + .value.int32Values = {3}}, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND), + .value.int32Values = {toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP)}}, + VehiclePropValue{ + .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND), + .value.int32Values = {toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP)}}}; + + StatusCode status = + setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE), + .value.int32Values = {toInt(CruiseControlType::STANDARD)}}); + EXPECT_EQ(status, StatusCode::OK); + + for (auto value : testVehiclePropValues) { + status = setValue(value); + EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED); + } +} + TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) { std::unordered_map> adasEnabledPropToAdasPropWithErrorState = { // AEB -- GitLab From 9fec41344bd5b0467610e773e1222e009c31a006 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Wed, 14 Jun 2023 05:25:55 +0000 Subject: [PATCH 104/376] Add Thread network HAL Bug: b/203492431 Test: Build and run the VTS test and run otbr-agent on Android emulator. (cherry picked from https://android-review.googlesource.com/q/commit:24e527475f91bf52fe75e1342635ac08446c106c) Merged-In: If58b5a8c75e40376ae6c6e93554afe750496308b Change-Id: If58b5a8c75e40376ae6c6e93554afe750496308b --- .../compatibility_matrix.8.xml | 8 + threadnetwork/aidl/Android.bp | 22 +++ threadnetwork/aidl/OWNERS | 3 + .../hardware/threadnetwork/IThreadChip.aidl | 45 +++++ .../threadnetwork/IThreadChipCallback.aidl | 38 ++++ .../hardware/threadnetwork/IThreadChip.aidl | 90 +++++++++ .../threadnetwork/IThreadChipCallback.aidl | 31 +++ threadnetwork/aidl/default/Android.bp | 56 ++++++ ...roid.hardware.threadnetwork-service.sim.rc | 3 + threadnetwork/aidl/default/main.cpp | 30 +++ threadnetwork/aidl/default/service.cpp | 87 +++++++++ threadnetwork/aidl/default/service.hpp | 40 ++++ threadnetwork/aidl/default/thread_chip.cpp | 177 ++++++++++++++++++ threadnetwork/aidl/default/thread_chip.hpp | 62 ++++++ .../aidl/default/threadnetwork-default.xml | 6 + threadnetwork/aidl/default/utils.cpp | 36 ++++ threadnetwork/aidl/default/utils.hpp | 20 ++ threadnetwork/aidl/vts/Android.bp | 38 ++++ .../vts/VtsHalThreadNetworkTargetTest.cpp | 147 +++++++++++++++ 19 files changed, 939 insertions(+) create mode 100644 threadnetwork/aidl/Android.bp create mode 100644 threadnetwork/aidl/OWNERS create mode 100644 threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl create mode 100644 threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChipCallback.aidl create mode 100644 threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl create mode 100644 threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl create mode 100644 threadnetwork/aidl/default/Android.bp create mode 100644 threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc create mode 100644 threadnetwork/aidl/default/main.cpp create mode 100644 threadnetwork/aidl/default/service.cpp create mode 100644 threadnetwork/aidl/default/service.hpp create mode 100644 threadnetwork/aidl/default/thread_chip.cpp create mode 100644 threadnetwork/aidl/default/thread_chip.hpp create mode 100644 threadnetwork/aidl/default/threadnetwork-default.xml create mode 100644 threadnetwork/aidl/default/utils.cpp create mode 100644 threadnetwork/aidl/default/utils.hpp create mode 100644 threadnetwork/aidl/vts/Android.bp create mode 100644 threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index c04a4999ae..9956cc1bc3 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -717,4 +717,12 @@ .* + + android.hardware.threadnetwork + 1 + + IThreadChip + chip[0-9]+ + + diff --git a/threadnetwork/aidl/Android.bp b/threadnetwork/aidl/Android.bp new file mode 100644 index 0000000000..480ac0f377 --- /dev/null +++ b/threadnetwork/aidl/Android.bp @@ -0,0 +1,22 @@ +aidl_interface { + name: "android.hardware.threadnetwork", + vendor_available: true, + srcs: [ + "android/hardware/threadnetwork/*.aidl", + ], + + stability: "vintf", + + backend: { + java: { + platform_apis: true, + }, + ndk: { + apex_available: [ + "//apex_available:platform", + "com.android.threadnetwork", + ], + min_sdk_version: "33", + }, + }, +} diff --git a/threadnetwork/aidl/OWNERS b/threadnetwork/aidl/OWNERS new file mode 100644 index 0000000000..e3111c8cac --- /dev/null +++ b/threadnetwork/aidl/OWNERS @@ -0,0 +1,3 @@ +# Bug component: 1288834 +zhanglongxia@google.com +xyk@google.com diff --git a/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl new file mode 100644 index 0000000000..e4d4cbe788 --- /dev/null +++ b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.threadnetwork; +@VintfStability +interface IThreadChip { + void open(in android.hardware.threadnetwork.IThreadChipCallback callback); + void close(); + void reset(); + void sendSpinelFrame(in byte[] frame); + const int ERROR_FAILED = 1; + const int ERROR_INVALID_ARGS = 2; + const int ERROR_NO_BUFS = 3; + const int ERROR_BUSY = 4; +} diff --git a/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChipCallback.aidl b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChipCallback.aidl new file mode 100644 index 0000000000..e86b3ec8b0 --- /dev/null +++ b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChipCallback.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.threadnetwork; +@VintfStability +interface IThreadChipCallback { + oneway void onReceiveSpinelFrame(in byte[] frame); +} diff --git a/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl new file mode 100644 index 0000000000..eebaa46983 --- /dev/null +++ b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.threadnetwork; + +import android.hardware.threadnetwork.IThreadChipCallback; + +/** + * Controls a Thread radio chip on the device. + */ + +@VintfStability +interface IThreadChip { + /** + * The operation failed for the internal error. + */ + const int ERROR_FAILED = 1; + + /** + * The invalid arguments. + */ + const int ERROR_INVALID_ARGS = 2; + + /** + * Insufficient buffers available to send frames. + */ + const int ERROR_NO_BUFS = 3; + + /** + * Service is busy and could not service the operation. + */ + const int ERROR_BUSY = 4; + + /** + * This method initializes the Thread HAL instance. If open completes + * successfully, then the Thread HAL instance is ready to accept spinel + * messages through sendSpinelFrame() API. + * + * @param callback A IThreadChipCallback callback instance. + * + * @throws ServiceSpecificException with one of the following values: + * - ERROR_FAILED The interface cannot be opened due to an internal error. + * - ERROR_INVALID_ARGS The callback handle is invalid (for example, it is null). + * - ERROR_BUSY This interface is in use. + */ + void open(in IThreadChipCallback callback); + + /** + * Close the Thread HAL instance. Must free all resources. + */ + void close(); + + /** + * This method resets the Thread HAL internal state. The callback registered by + * `open()` won’t be reset and the resource allocated by `open()` won’t be free. + * + */ + void reset(); + + /** + * This method sends a spinel frame to the Thread HAL. + * + * This method should block until the frame is sent out successfully or + * the method throws errors immediately. + * + * Spinel Protocol: + * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h + * + * @param frame The spinel frame to be sent. + * + * @throws ServiceSpecificException with one of the following values: + * - ERROR_FAILED The Thread HAL failed to send the frame for an internal reason. + * - ERROR_NO_BUFS Insufficient buffer space to send the frame. + * - ERROR_BUSY The Thread HAL is busy. + */ + void sendSpinelFrame(in byte[] frame); +} diff --git a/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl new file mode 100644 index 0000000000..046edc3ead --- /dev/null +++ b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.threadnetwork; + +@VintfStability +interface IThreadChipCallback { + /** + * This method is called when a spinel frame is received. Thread network + * will process the received spinel frame. + * + * Spinel Protocol: + * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h + * + * @param frame The received spinel frame. + */ + oneway void onReceiveSpinelFrame(in byte[] frame); +} diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp new file mode 100644 index 0000000000..201306d053 --- /dev/null +++ b/threadnetwork/aidl/default/Android.bp @@ -0,0 +1,56 @@ +// +// Copyright (c) 2022 Google LLC. +// All rights reserved. +// +// This document is the property of Google LLC, Inc. It is +// considered proprietary and confidential information. +// +// This document may not be reproduced or transmitted in any form, +// in whole or in part, without the express written permission of +// Google LLC. + +cc_defaults { + name: "threadnetwork_service_default", + vintf_fragments: ["threadnetwork-default.xml"], + vendor: true, + relative_install_path: "hw", + + shared_libs: [ + "android.hardware.threadnetwork-V1-ndk", + "libbase", + "libbinder_ndk", + "libcutils", + "liblog", + "libutils", + ], + + cppflags: [ + "-Wno-non-virtual-dtor", + ], + + static_libs: [ + "openthread-common", + "openthread-hdlc", + "openthread-platform", + "openthread-posix", + "openthread-url", + ], + + srcs: [ + "main.cpp", + "service.cpp", + "thread_chip.cpp", + "utils.cpp", + ], +} + +cc_binary { + name: "android.hardware.threadnetwork-service.sim", + defaults: ["threadnetwork_service_default"], + init_rc: ["android.hardware.threadnetwork-service.sim.rc"], +} + +cc_binary { + name: "android.hardware.threadnetwork-service", + defaults: ["threadnetwork_service_default"], +} diff --git a/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc b/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc new file mode 100644 index 0000000000..2fb409cd93 --- /dev/null +++ b/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc @@ -0,0 +1,3 @@ +service vendor.threadnetwork_hal /vendor/bin/hw/android.hardware.threadnetwork-service.sim spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=1 + class hal + user thread_network diff --git a/threadnetwork/aidl/default/main.cpp b/threadnetwork/aidl/default/main.cpp new file mode 100644 index 0000000000..9f2a789cfa --- /dev/null +++ b/threadnetwork/aidl/default/main.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "service.hpp" +#include "utils.hpp" + +int main(int argc, char* argv[]) { + CHECK_GT(argc, 1); + aidl::android::hardware::threadnetwork::Service service(&argv[1], argc - 1); + + ALOGI("Thread Network HAL is running"); + + service.startLoop(); + return EXIT_FAILURE; // should not reach +} diff --git a/threadnetwork/aidl/default/service.cpp b/threadnetwork/aidl/default/service.cpp new file mode 100644 index 0000000000..44bb99a4d5 --- /dev/null +++ b/threadnetwork/aidl/default/service.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "service.hpp" + +#include +#include +#include + +#include "thread_chip.hpp" +#include "utils.hpp" + +namespace aidl { +namespace android { +namespace hardware { +namespace threadnetwork { + +Service::Service(char* urls[], int numUrls) : mBinderFd(-1) { + CHECK_NE(urls, nullptr); + CHECK_GT(numUrls, 0); + + for (int i = 0; i < numUrls; i++) { + auto threadChip = ndk::SharedRefBase::make(i, urls[i]); + CHECK_NE(threadChip, nullptr); + mThreadChips.push_back(std::move(threadChip)); + } + + binder_status_t status = ABinderProcess_setupPolling(&mBinderFd); + CHECK_EQ(status, ::STATUS_OK); + CHECK_GE(mBinderFd, 0); +} + +void Service::Update(otSysMainloopContext& context) { + FD_SET(mBinderFd, &context.mReadFdSet); + context.mMaxFd = std::max(context.mMaxFd, mBinderFd); +} + +void Service::Process(const otSysMainloopContext& context) { + if (FD_ISSET(mBinderFd, &context.mReadFdSet)) { + ABinderProcess_handlePolledCommands(); + } +} + +void Service::startLoop(void) { + const struct timeval kPollTimeout = {1, 0}; + otSysMainloopContext context; + int rval; + + ot::Posix::Mainloop::Manager::Get().Add(*this); + + while (true) { + context.mMaxFd = -1; + context.mTimeout = kPollTimeout; + + FD_ZERO(&context.mReadFdSet); + FD_ZERO(&context.mWriteFdSet); + FD_ZERO(&context.mErrorFdSet); + + ot::Posix::Mainloop::Manager::Get().Update(context); + + rval = select(context.mMaxFd + 1, &context.mReadFdSet, &context.mWriteFdSet, + &context.mErrorFdSet, &context.mTimeout); + + if (rval >= 0) { + ot::Posix::Mainloop::Manager::Get().Process(context); + } else if (errno != EINTR) { + ALOGE("select() failed: %s", strerror(errno)); + break; + } + } +} +} // namespace threadnetwork +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/threadnetwork/aidl/default/service.hpp b/threadnetwork/aidl/default/service.hpp new file mode 100644 index 0000000000..413704996c --- /dev/null +++ b/threadnetwork/aidl/default/service.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mainloop.hpp" +#include "thread_chip.hpp" + +namespace aidl { +namespace android { +namespace hardware { +namespace threadnetwork { + +class Service : public ot::Posix::Mainloop::Source { + public: + Service(char* urls[], int numUrls); + + void Update(otSysMainloopContext& context) override; + void Process(const otSysMainloopContext& context) override; + void startLoop(void); + + private: + int mBinderFd; + std::vector> mThreadChips; +}; +} // namespace threadnetwork +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp new file mode 100644 index 0000000000..b5cc7ebb58 --- /dev/null +++ b/threadnetwork/aidl/default/thread_chip.cpp @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "thread_chip.hpp" + +#include +#include +#include + +#include "utils.hpp" + +namespace aidl { +namespace android { +namespace hardware { +namespace threadnetwork { + +ThreadChip::ThreadChip(uint8_t id, char* url) + : mUrl(), + mInterface(handleReceivedFrame, this, mRxFrameBuffer), + mRxFrameBuffer(), + mCallback(nullptr) { + const std::string name(std::string() + IThreadChip::descriptor + "/chip" + std::to_string(id)); + binder_status_t status; + + ALOGI("ServiceName: %s, Url: %s", name.c_str(), url); + CHECK_EQ(mUrl.Init(url), 0); + status = AServiceManager_addService(asBinder().get(), name.c_str()); + CHECK_EQ(status, STATUS_OK); +} + +void ThreadChip::clientDeathCallback(void* context) { + reinterpret_cast(context)->clientDeathCallback(); +} + +void ThreadChip::clientDeathCallback(void) { + ALOGW("Thread Network HAL client is dead."); + close(); +} + +void ThreadChip::handleReceivedFrame(void* context) { + static_cast(context)->handleReceivedFrame(); +} + +void ThreadChip::handleReceivedFrame(void) { + if (mCallback != nullptr) { + mCallback->onReceiveSpinelFrame(std::vector( + mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength())); + } + + mRxFrameBuffer.DiscardFrame(); +} + +ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& in_callback) { + ndk::ScopedAStatus status; + AIBinder* binder; + + VerifyOrExit(mCallback == nullptr, + status = errorStatus(ERROR_BUSY, "Interface is already opened")); + VerifyOrExit(in_callback != nullptr, + status = errorStatus(ERROR_INVALID_ARGS, "The callback is NULL")); + binder = in_callback->asBinder().get(); + VerifyOrExit(binder != nullptr, + status = errorStatus(ERROR_FAILED, "Failed to get the callback binder")); + mBinderDeathRecipient = AIBinder_DeathRecipient_new(clientDeathCallback); + VerifyOrExit(AIBinder_linkToDeath(binder, mBinderDeathRecipient, this) == STATUS_OK, + status = errorStatus(ERROR_FAILED, "Failed to link the binder to death")); + VerifyOrExit(mInterface.Init(mUrl) == OT_ERROR_NONE, + status = errorStatus(ERROR_FAILED, "Failed to initialize the interface")); + + mCallback = in_callback; + ot::Posix::Mainloop::Manager::Get().Add(*this); + status = ndk::ScopedAStatus::ok(); + +exit: + if (!status.isOk()) + { + if (mBinderDeathRecipient != nullptr) + { + AIBinder_DeathRecipient_delete(mBinderDeathRecipient); + mBinderDeathRecipient = nullptr; + } + ALOGW("Open failed, error: %s", status.getDescription().c_str()); + } + else + { + ALOGI("open()"); + } + + return status; +} + +ndk::ScopedAStatus ThreadChip::close() { + VerifyOrExit(mCallback != nullptr); + mCallback = nullptr; + mInterface.Deinit(); + + ot::Posix::Mainloop::Manager::Get().Remove(*this); + + AIBinder_DeathRecipient_delete(mBinderDeathRecipient); + mBinderDeathRecipient = nullptr; + +exit: + ALOGI("close()"); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_frame) { + ndk::ScopedAStatus status; + otError error; + + VerifyOrExit(mCallback != nullptr, + status = errorStatus(ERROR_FAILED, "The interface is not open")); + + error = mInterface.SendFrame(reinterpret_cast(in_frame.data()), + in_frame.size()); + if (error == OT_ERROR_NONE) { + status = ndk::ScopedAStatus::ok(); + } else if (error == OT_ERROR_NO_BUFS) { + status = errorStatus(ERROR_NO_BUFS, "Insufficient buffer space to send"); + } else if (error == OT_ERROR_BUSY) { + status = errorStatus(ERROR_BUSY, "The interface is busy"); + } else { + status = errorStatus(ERROR_FAILED, "Failed to send the spinel frame"); + } + +exit: + if (!status.isOk()) + { + ALOGW("Send spinel frame failed, error: %s", status.getDescription().c_str()); + } + + return status; +} + +ndk::ScopedAStatus ThreadChip::reset() { + mInterface.OnRcpReset(); + ALOGI("reset()"); + return ndk::ScopedAStatus::ok(); +} + +void ThreadChip::Update(otSysMainloopContext& context) { + if (mCallback != nullptr) { + mInterface.UpdateFdSet(context.mReadFdSet, context.mWriteFdSet, context.mMaxFd, + context.mTimeout); + } +} + +void ThreadChip::Process(const otSysMainloopContext& context) { + struct RadioProcessContext radioContext; + + if (mCallback != nullptr) { + radioContext.mReadFdSet = &context.mReadFdSet; + radioContext.mWriteFdSet = &context.mWriteFdSet; + mInterface.Process(radioContext); + } +} + +ndk::ScopedAStatus ThreadChip::errorStatus(int32_t error, const char* message) { + return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(error, message)); +} +} // namespace threadnetwork +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp new file mode 100644 index 0000000000..d444374f9e --- /dev/null +++ b/threadnetwork/aidl/default/thread_chip.hpp @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "hdlc_interface.hpp" +#include "lib/spinel/spinel_interface.hpp" +#include "mainloop.hpp" + +#include +#include + +namespace aidl { +namespace android { +namespace hardware { +namespace threadnetwork { + +class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { + public: + ThreadChip(uint8_t id, char* url); + + ndk::ScopedAStatus open(const std::shared_ptr& in_callback) override; + ndk::ScopedAStatus close() override; + ndk::ScopedAStatus sendSpinelFrame(const std::vector& in_frame) override; + ndk::ScopedAStatus reset() override; + void Update(otSysMainloopContext& context) override; + void Process(const otSysMainloopContext& context) override; + + private: + static void clientDeathCallback(void* context); + void clientDeathCallback(void); + static void handleReceivedFrame(void* context); + void handleReceivedFrame(void); + ndk::ScopedAStatus errorStatus(int32_t error, const char* message); + + ot::Url::Url mUrl; + ot::Posix::HdlcInterface mInterface; + ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer; + std::shared_ptr mCallback; + AIBinder_DeathRecipient* mBinderDeathRecipient; +}; + +} // namespace threadnetwork +} // namespace hardware +} // namespace android +} // namespace aidl diff --git a/threadnetwork/aidl/default/threadnetwork-default.xml b/threadnetwork/aidl/default/threadnetwork-default.xml new file mode 100644 index 0000000000..d7dee1e95b --- /dev/null +++ b/threadnetwork/aidl/default/threadnetwork-default.xml @@ -0,0 +1,6 @@ + + + android.hardware.threadnetwork + IThreadChip/chip0 + + diff --git a/threadnetwork/aidl/default/utils.cpp b/threadnetwork/aidl/default/utils.cpp new file mode 100644 index 0000000000..a8f3464a8c --- /dev/null +++ b/threadnetwork/aidl/default/utils.cpp @@ -0,0 +1,36 @@ + +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "utils.hpp" + +#include + +void otLogCritPlat(const char* format, ...) { + va_list args; + + va_start(args, format); + __android_log_vprint(ANDROID_LOG_FATAL, LOG_TAG, format, args); + va_end(args); +} + +void otLogWarnPlat(const char* format, ...) { + va_list args; + + va_start(args, format); + __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args); + va_end(args); +} diff --git a/threadnetwork/aidl/default/utils.hpp b/threadnetwork/aidl/default/utils.hpp new file mode 100644 index 0000000000..279c0ba446 --- /dev/null +++ b/threadnetwork/aidl/default/utils.hpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#define LOG_TAG "threadnetwork_hal" +#include diff --git a/threadnetwork/aidl/vts/Android.bp b/threadnetwork/aidl/vts/Android.bp new file mode 100644 index 0000000000..864e885a37 --- /dev/null +++ b/threadnetwork/aidl/vts/Android.bp @@ -0,0 +1,38 @@ +// +// Copyright (C) 2022 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +cc_test { + name: "VtsHalThreadNetworkTargetTest", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + srcs: [ + "VtsHalThreadNetworkTargetTest.cpp", + ], + + shared_libs: [ + "libbinder", + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.threadnetwork-V1-ndk", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp new file mode 100644 index 0000000000..04c6deaf2a --- /dev/null +++ b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "ThreadNetworkHalTargetTest" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using aidl::android::hardware::threadnetwork::BnThreadChipCallback; +using aidl::android::hardware::threadnetwork::IThreadChip; +using android::ProcessState; +using ndk::ScopedAStatus; +using ndk::SpAIBinder; + +namespace { +constexpr static int kCallbackTimeoutMs = 5000; +} // namespace + +class ThreadChipCallback : public BnThreadChipCallback { + public: + ThreadChipCallback(const std::function&)>& on_spinel_message_cb) + : on_spinel_message_cb_(on_spinel_message_cb) {} + + ScopedAStatus onReceiveSpinelFrame(const std::vector& in_aFrame) { + on_spinel_message_cb_(in_aFrame); + return ScopedAStatus::ok(); + } + + private: + std::function&)> on_spinel_message_cb_; +}; + +class ThreadNetworkAidl : public testing::TestWithParam { + public: + virtual void SetUp() override { + std::string serviceName = GetParam(); + + ALOGI("serviceName: %s", serviceName.c_str()); + + thread_chip = IThreadChip::fromBinder( + SpAIBinder(AServiceManager_waitForService(serviceName.c_str()))); + ASSERT_NE(thread_chip, nullptr); + } + + virtual void TearDown() override { thread_chip->close(); } + + std::shared_ptr thread_chip; +}; + +TEST_P(ThreadNetworkAidl, Open) { + std::shared_ptr callback = + ndk::SharedRefBase::make([](auto /* data */) {}); + + EXPECT_TRUE(thread_chip->open(callback).isOk()); +} + +TEST_P(ThreadNetworkAidl, Close) { + std::shared_ptr callback = + ndk::SharedRefBase::make([](auto /* data */) {}); + + EXPECT_TRUE(thread_chip->open(callback).isOk()); + EXPECT_TRUE(thread_chip->close().isOk()); +} + +TEST_P(ThreadNetworkAidl, Reset) { + std::shared_ptr callback = + ndk::SharedRefBase::make([](auto /* data */) {}); + + EXPECT_TRUE(thread_chip->open(callback).isOk()); + EXPECT_TRUE(thread_chip->reset().isOk()); +} + +TEST_P(ThreadNetworkAidl, SendSpinelFrame) { + const uint8_t kCmdOffset = 2; + const uint8_t kMajorVersionOffset = 3; + const uint8_t kMinorVersionOffset = 4; + const std::vector kGetSpinelProtocolVersion({0x81, 0x02, 0x01}); + const std::vector kGetSpinelProtocolVersionResponse({0x81, 0x06, 0x01, 0x04, 0x03}); + uint8_t min_major_version = kGetSpinelProtocolVersionResponse[kMajorVersionOffset]; + uint8_t min_minor_version = kGetSpinelProtocolVersionResponse[kMinorVersionOffset]; + uint8_t major_version; + uint8_t minor_version; + std::promise open_cb_promise; + std::future open_cb_future{open_cb_promise.get_future()}; + std::shared_ptr callback; + std::vector received_frame; + std::chrono::milliseconds timeout{kCallbackTimeoutMs}; + + callback = ndk::SharedRefBase::make( + [&](const std::vector& in_aFrame) { + if (in_aFrame.size() == kGetSpinelProtocolVersionResponse.size() && + in_aFrame[kCmdOffset] == kGetSpinelProtocolVersionResponse[kCmdOffset]) { + major_version = in_aFrame[kMajorVersionOffset]; + minor_version = in_aFrame[kMinorVersionOffset]; + open_cb_promise.set_value(); + } + }); + + ASSERT_NE(callback, nullptr); + + EXPECT_TRUE(thread_chip->open(callback).isOk()); + + EXPECT_TRUE(thread_chip->sendSpinelFrame(kGetSpinelProtocolVersion).isOk()); + EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready); + + EXPECT_GE(major_version, min_major_version); + if (major_version == min_major_version) { + EXPECT_GE(minor_version, min_minor_version); + } +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThreadNetworkAidl); +INSTANTIATE_TEST_SUITE_P( + Thread, ThreadNetworkAidl, + testing::ValuesIn(android::getAidlHalInstanceNames(IThreadChip::descriptor)), + android::PrintInstanceNameToString); + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + ProcessState::self()->setThreadPoolMaxThreadCount(1); + ProcessState::self()->startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From aa36cb13b99b3e9b30c78304dc2766e1d6202f90 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Thu, 15 Jun 2023 10:15:59 +0800 Subject: [PATCH 105/376] add fuzz test and fix the Thread network HAL compile errors Bug: 288825495 Test: Build and run fuzz test in cuttlefish (cherry picked from https://android-review.googlesource.com/q/commit:5c027015c3437ecf54e9a8dc4eb8a7b4b3ec542b) Merged-In: If14bd95657d6a71737a348ccbc6d1b05bbcc1f4c Change-Id: If14bd95657d6a71737a348ccbc6d1b05bbcc1f4c --- .../compatibility_matrix.8.xml | 8 ---- .../compatibility_matrix.9.xml | 8 ++++ threadnetwork/aidl/default/Android.bp | 38 ++++++++++++++++-- .../aidl/default/{utils.hpp => fuzzer.cpp} | 20 ++++++++-- threadnetwork/aidl/default/main.cpp | 27 ++++++++++++- threadnetwork/aidl/default/service.cpp | 15 +------ threadnetwork/aidl/default/service.hpp | 4 +- threadnetwork/aidl/default/thread_chip.cpp | 39 ++++++------------- threadnetwork/aidl/default/thread_chip.hpp | 2 +- threadnetwork/aidl/default/utils.cpp | 9 ++++- 10 files changed, 105 insertions(+), 65 deletions(-) rename threadnetwork/aidl/default/{utils.hpp => fuzzer.cpp} (50%) diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 9956cc1bc3..c04a4999ae 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -717,12 +717,4 @@ .* - - android.hardware.threadnetwork - 1 - - IThreadChip - chip[0-9]+ - - diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 188746d79b..2f18a380d3 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -727,4 +727,12 @@ .* + + android.hardware.threadnetwork + 1 + + IThreadChip + chip[0-9]+ + + diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp index 201306d053..736e808b49 100644 --- a/threadnetwork/aidl/default/Android.bp +++ b/threadnetwork/aidl/default/Android.bp @@ -24,10 +24,6 @@ cc_defaults { "libutils", ], - cppflags: [ - "-Wno-non-virtual-dtor", - ], - static_libs: [ "openthread-common", "openthread-hdlc", @@ -48,9 +44,43 @@ cc_binary { name: "android.hardware.threadnetwork-service.sim", defaults: ["threadnetwork_service_default"], init_rc: ["android.hardware.threadnetwork-service.sim.rc"], + required: ["ot-rcp"], } cc_binary { name: "android.hardware.threadnetwork-service", defaults: ["threadnetwork_service_default"], } + +cc_fuzz { + name: "android.hardware.threadnetwork-service.fuzzer", + + defaults:["service_fuzzer_defaults"], + shared_libs: [ + "libbinder_ndk", + ], + + static_libs: [ + "android.hardware.threadnetwork-V1-ndk", + "libbase", + "liblog", + "openthread-common", + "openthread-hdlc", + "openthread-platform", + "openthread-posix", + "openthread-url", + ], + + srcs: [ + "thread_chip.cpp", + "utils.cpp", + "fuzzer.cpp", + ], + + required: ["ot-rcp"], + fuzz_config: { + cc: [ + "zhanglongxia@google.com", + ], + }, +} diff --git a/threadnetwork/aidl/default/utils.hpp b/threadnetwork/aidl/default/fuzzer.cpp similarity index 50% rename from threadnetwork/aidl/default/utils.hpp rename to threadnetwork/aidl/default/fuzzer.cpp index 279c0ba446..512708daf4 100644 --- a/threadnetwork/aidl/default/utils.hpp +++ b/threadnetwork/aidl/default/fuzzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,19 @@ * limitations under the License. */ -#pragma once +#include +#include +#include "thread_chip.hpp" + +using aidl::android::hardware::threadnetwork::ThreadChip; +using android::fuzzService; + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + char url[] = "spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=2"; + auto service = ndk::SharedRefBase::make(url); + + fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size)); + + return 0; +} -#define LOG_TAG "threadnetwork_hal" -#include diff --git a/threadnetwork/aidl/default/main.cpp b/threadnetwork/aidl/default/main.cpp index 9f2a789cfa..841904174d 100644 --- a/threadnetwork/aidl/default/main.cpp +++ b/threadnetwork/aidl/default/main.cpp @@ -14,14 +14,37 @@ * limitations under the License. */ +#include #include +#include +#include +#include #include "service.hpp" -#include "utils.hpp" +#include "thread_chip.hpp" + +using aidl::android::hardware::threadnetwork::IThreadChip; +using aidl::android::hardware::threadnetwork::ThreadChip; int main(int argc, char* argv[]) { CHECK_GT(argc, 1); - aidl::android::hardware::threadnetwork::Service service(&argv[1], argc - 1); + std::vector> threadChips; + aidl::android::hardware::threadnetwork::Service service; + + for (int id = 0; id < argc - 1; id++) { + binder_status_t status; + const std::string serviceName(std::string() + IThreadChip::descriptor + "/chip" + + std::to_string(id)); + auto threadChip = ndk::SharedRefBase::make(argv[id + 1]); + + CHECK_NE(threadChip, nullptr); + + status = AServiceManager_addService(threadChip->asBinder().get(), serviceName.c_str()); + CHECK_EQ(status, STATUS_OK); + + ALOGI("ServiceName: %s, Url: %s", serviceName.c_str(), argv[id + 1]); + threadChips.push_back(std::move(threadChip)); + } ALOGI("Thread Network HAL is running"); diff --git a/threadnetwork/aidl/default/service.cpp b/threadnetwork/aidl/default/service.cpp index 44bb99a4d5..7f583f4f44 100644 --- a/threadnetwork/aidl/default/service.cpp +++ b/threadnetwork/aidl/default/service.cpp @@ -18,25 +18,14 @@ #include #include #include - -#include "thread_chip.hpp" -#include "utils.hpp" +#include namespace aidl { namespace android { namespace hardware { namespace threadnetwork { -Service::Service(char* urls[], int numUrls) : mBinderFd(-1) { - CHECK_NE(urls, nullptr); - CHECK_GT(numUrls, 0); - - for (int i = 0; i < numUrls; i++) { - auto threadChip = ndk::SharedRefBase::make(i, urls[i]); - CHECK_NE(threadChip, nullptr); - mThreadChips.push_back(std::move(threadChip)); - } - +Service::Service(void) : mBinderFd(-1) { binder_status_t status = ABinderProcess_setupPolling(&mBinderFd); CHECK_EQ(status, ::STATUS_OK); CHECK_GE(mBinderFd, 0); diff --git a/threadnetwork/aidl/default/service.hpp b/threadnetwork/aidl/default/service.hpp index 413704996c..6a94791909 100644 --- a/threadnetwork/aidl/default/service.hpp +++ b/threadnetwork/aidl/default/service.hpp @@ -15,7 +15,6 @@ */ #include "mainloop.hpp" -#include "thread_chip.hpp" namespace aidl { namespace android { @@ -24,7 +23,7 @@ namespace threadnetwork { class Service : public ot::Posix::Mainloop::Source { public: - Service(char* urls[], int numUrls); + Service(void); void Update(otSysMainloopContext& context) override; void Process(const otSysMainloopContext& context) override; @@ -32,7 +31,6 @@ class Service : public ot::Posix::Mainloop::Source { private: int mBinderFd; - std::vector> mThreadChips; }; } // namespace threadnetwork } // namespace hardware diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp index b5cc7ebb58..e542c7c335 100644 --- a/threadnetwork/aidl/default/thread_chip.cpp +++ b/threadnetwork/aidl/default/thread_chip.cpp @@ -19,26 +19,19 @@ #include #include #include - -#include "utils.hpp" +#include namespace aidl { namespace android { namespace hardware { namespace threadnetwork { -ThreadChip::ThreadChip(uint8_t id, char* url) +ThreadChip::ThreadChip(char* url) : mUrl(), mInterface(handleReceivedFrame, this, mRxFrameBuffer), mRxFrameBuffer(), mCallback(nullptr) { - const std::string name(std::string() + IThreadChip::descriptor + "/chip" + std::to_string(id)); - binder_status_t status; - - ALOGI("ServiceName: %s, Url: %s", name.c_str(), url); CHECK_EQ(mUrl.Init(url), 0); - status = AServiceManager_addService(asBinder().get(), name.c_str()); - CHECK_EQ(status, STATUS_OK); } void ThreadChip::clientDeathCallback(void* context) { @@ -85,17 +78,13 @@ ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& status = ndk::ScopedAStatus::ok(); exit: - if (!status.isOk()) - { - if (mBinderDeathRecipient != nullptr) - { - AIBinder_DeathRecipient_delete(mBinderDeathRecipient); - mBinderDeathRecipient = nullptr; + if (!status.isOk()) { + if (mBinderDeathRecipient != nullptr) { + AIBinder_DeathRecipient_delete(mBinderDeathRecipient); + mBinderDeathRecipient = nullptr; } ALOGW("Open failed, error: %s", status.getDescription().c_str()); - } - else - { + } else { ALOGI("open()"); } @@ -137,8 +126,7 @@ ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_fr } exit: - if (!status.isOk()) - { + if (!status.isOk()) { ALOGW("Send spinel frame failed, error: %s", status.getDescription().c_str()); } @@ -146,25 +134,20 @@ exit: } ndk::ScopedAStatus ThreadChip::reset() { - mInterface.OnRcpReset(); + mInterface.HardwareReset(); ALOGI("reset()"); return ndk::ScopedAStatus::ok(); } void ThreadChip::Update(otSysMainloopContext& context) { if (mCallback != nullptr) { - mInterface.UpdateFdSet(context.mReadFdSet, context.mWriteFdSet, context.mMaxFd, - context.mTimeout); + mInterface.UpdateFdSet(&context); } } void ThreadChip::Process(const otSysMainloopContext& context) { - struct RadioProcessContext radioContext; - if (mCallback != nullptr) { - radioContext.mReadFdSet = &context.mReadFdSet; - radioContext.mWriteFdSet = &context.mWriteFdSet; - mInterface.Process(radioContext); + mInterface.Process(&context); } } diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp index d444374f9e..d93dfef22e 100644 --- a/threadnetwork/aidl/default/thread_chip.hpp +++ b/threadnetwork/aidl/default/thread_chip.hpp @@ -33,7 +33,7 @@ namespace threadnetwork { class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { public: - ThreadChip(uint8_t id, char* url); + ThreadChip(char* url); ndk::ScopedAStatus open(const std::shared_ptr& in_callback) override; ndk::ScopedAStatus close() override; diff --git a/threadnetwork/aidl/default/utils.cpp b/threadnetwork/aidl/default/utils.cpp index a8f3464a8c..b4da7d76f5 100644 --- a/threadnetwork/aidl/default/utils.cpp +++ b/threadnetwork/aidl/default/utils.cpp @@ -15,9 +15,10 @@ * limitations under the License. */ -#include "utils.hpp" - +#include #include +#include +#include void otLogCritPlat(const char* format, ...) { va_list args; @@ -34,3 +35,7 @@ void otLogWarnPlat(const char* format, ...) { __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args); va_end(args); } + +OT_TOOL_WEAK void otPlatAlarmMilliFired(otInstance* aInstance) { + OT_UNUSED_VARIABLE(aInstance); +} -- GitLab From 83c4ef44e5027ffbd0d6a22fb4f66e36538cfd80 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Mon, 3 Jul 2023 10:52:45 +0800 Subject: [PATCH 106/376] add Spinel SPI interface support This commit enables the Thread Network HAL to support the Spinel SPI interface. Bug: 277286756 Test: Build and run otbr-agent on the emulator. (cherry picked from https://android-review.googlesource.com/q/commit:7ae6d6f4ffe49c358978b9ea9c670ee2aefe4a27) Merged-In: I6726eead5686f0afb33e5e2035ebc9021eca5afa Change-Id: I6726eead5686f0afb33e5e2035ebc9021eca5afa --- threadnetwork/aidl/default/Android.bp | 2 + threadnetwork/aidl/default/thread_chip.cpp | 45 +++++++++++++++------- threadnetwork/aidl/default/thread_chip.hpp | 5 +-- threadnetwork/aidl/default/utils.cpp | 39 +++++++++++++++++++ 4 files changed, 75 insertions(+), 16 deletions(-) diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp index 736e808b49..8b938d2cb3 100644 --- a/threadnetwork/aidl/default/Android.bp +++ b/threadnetwork/aidl/default/Android.bp @@ -29,6 +29,7 @@ cc_defaults { "openthread-hdlc", "openthread-platform", "openthread-posix", + "openthread-spi", "openthread-url", ], @@ -68,6 +69,7 @@ cc_fuzz { "openthread-hdlc", "openthread-platform", "openthread-posix", + "openthread-spi", "openthread-url", ], diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp index e542c7c335..94d1e93cbe 100644 --- a/threadnetwork/aidl/default/thread_chip.cpp +++ b/threadnetwork/aidl/default/thread_chip.cpp @@ -21,17 +21,36 @@ #include #include +#include "hdlc_interface.hpp" +#include "spi_interface.hpp" + namespace aidl { namespace android { namespace hardware { namespace threadnetwork { -ThreadChip::ThreadChip(char* url) - : mUrl(), - mInterface(handleReceivedFrame, this, mRxFrameBuffer), - mRxFrameBuffer(), - mCallback(nullptr) { +ThreadChip::ThreadChip(char* url) : mUrl(), mRxFrameBuffer(), mCallback(nullptr) { + static const char kHdlcProtocol[] = "spinel+hdlc"; + static const char kSpiProtocol[] = "spinel+spi"; + const char* protocol; + CHECK_EQ(mUrl.Init(url), 0); + + protocol = mUrl.GetProtocol(); + CHECK_NE(protocol, nullptr); + + if (memcmp(protocol, kSpiProtocol, strlen(kSpiProtocol)) == 0) { + mSpinelInterface = std::make_shared(handleReceivedFrameJump, this, + mRxFrameBuffer); + } else if (memcmp(protocol, kHdlcProtocol, strlen(kHdlcProtocol)) == 0) { + mSpinelInterface = std::make_shared(handleReceivedFrameJump, this, + mRxFrameBuffer); + } else { + ALOGE("The protocol \"%s\" is not supported!", protocol); + exit(1); + } + + CHECK_NE(mSpinelInterface, nullptr); } void ThreadChip::clientDeathCallback(void* context) { @@ -43,7 +62,7 @@ void ThreadChip::clientDeathCallback(void) { close(); } -void ThreadChip::handleReceivedFrame(void* context) { +void ThreadChip::handleReceivedFrameJump(void* context) { static_cast(context)->handleReceivedFrame(); } @@ -70,7 +89,7 @@ ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& mBinderDeathRecipient = AIBinder_DeathRecipient_new(clientDeathCallback); VerifyOrExit(AIBinder_linkToDeath(binder, mBinderDeathRecipient, this) == STATUS_OK, status = errorStatus(ERROR_FAILED, "Failed to link the binder to death")); - VerifyOrExit(mInterface.Init(mUrl) == OT_ERROR_NONE, + VerifyOrExit(mSpinelInterface->Init(mUrl) == OT_ERROR_NONE, status = errorStatus(ERROR_FAILED, "Failed to initialize the interface")); mCallback = in_callback; @@ -94,7 +113,7 @@ exit: ndk::ScopedAStatus ThreadChip::close() { VerifyOrExit(mCallback != nullptr); mCallback = nullptr; - mInterface.Deinit(); + mSpinelInterface->Deinit(); ot::Posix::Mainloop::Manager::Get().Remove(*this); @@ -113,8 +132,8 @@ ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_fr VerifyOrExit(mCallback != nullptr, status = errorStatus(ERROR_FAILED, "The interface is not open")); - error = mInterface.SendFrame(reinterpret_cast(in_frame.data()), - in_frame.size()); + error = mSpinelInterface->SendFrame(reinterpret_cast(in_frame.data()), + in_frame.size()); if (error == OT_ERROR_NONE) { status = ndk::ScopedAStatus::ok(); } else if (error == OT_ERROR_NO_BUFS) { @@ -134,20 +153,20 @@ exit: } ndk::ScopedAStatus ThreadChip::reset() { - mInterface.HardwareReset(); + mSpinelInterface->HardwareReset(); ALOGI("reset()"); return ndk::ScopedAStatus::ok(); } void ThreadChip::Update(otSysMainloopContext& context) { if (mCallback != nullptr) { - mInterface.UpdateFdSet(&context); + mSpinelInterface->UpdateFdSet(&context); } } void ThreadChip::Process(const otSysMainloopContext& context) { if (mCallback != nullptr) { - mInterface.Process(&context); + mSpinelInterface->Process(&context); } } diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp index d93dfef22e..294190a658 100644 --- a/threadnetwork/aidl/default/thread_chip.hpp +++ b/threadnetwork/aidl/default/thread_chip.hpp @@ -19,7 +19,6 @@ #include #include -#include "hdlc_interface.hpp" #include "lib/spinel/spinel_interface.hpp" #include "mainloop.hpp" @@ -45,12 +44,12 @@ class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { private: static void clientDeathCallback(void* context); void clientDeathCallback(void); - static void handleReceivedFrame(void* context); + static void handleReceivedFrameJump(void* context); void handleReceivedFrame(void); ndk::ScopedAStatus errorStatus(int32_t error, const char* message); ot::Url::Url mUrl; - ot::Posix::HdlcInterface mInterface; + std::shared_ptr mSpinelInterface; ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer; std::shared_ptr mCallback; AIBinder_DeathRecipient* mBinderDeathRecipient; diff --git a/threadnetwork/aidl/default/utils.cpp b/threadnetwork/aidl/default/utils.cpp index b4da7d76f5..1cb42ec624 100644 --- a/threadnetwork/aidl/default/utils.cpp +++ b/threadnetwork/aidl/default/utils.cpp @@ -36,6 +36,45 @@ void otLogWarnPlat(const char* format, ...) { va_end(args); } +void otLogNotePlat(const char* format, ...) { + va_list args; + + va_start(args, format); + __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args); + va_end(args); +} + +void otLogInfoPlat(const char* format, ...) { + va_list args; + + va_start(args, format); + __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args); + va_end(args); +} + +void otLogDebgPlat(const char* format, ...) { + va_list args; + + va_start(args, format); + __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args); + va_end(args); +} + +void otDumpDebgPlat(const char* aText, const void* aData, uint16_t aDataLength) { + constexpr uint16_t kBufSize = 512; + char buf[kBufSize]; + + if ((aText != nullptr) && (aData != nullptr)) { + const uint8_t* data = reinterpret_cast(aData); + + for (uint16_t i = 0; (i < aDataLength) && (i < (kBufSize - 1) / 3); i++) { + snprintf(buf + (i * 3), (kBufSize - 1) - (i * 3), "%02x ", data[i]); + } + + __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, "%s: %s", aText, buf); + } +} + OT_TOOL_WEAK void otPlatAlarmMilliFired(otInstance* aInstance) { OT_UNUSED_VARIABLE(aInstance); } -- GitLab From 3bbcbcdc8a9194a84c612cb5b7f56d2fbce72877 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Thu, 6 Jul 2023 13:37:56 +0800 Subject: [PATCH 107/376] fix the Thread Network fuzz testing error The current fuzz testing comunicates with the Thread radio chip simulation program `ot-rcp`. The 'ot-rcp' is not installed by all devices, which causes the fuzz testing program is unable to find the program '/vendor/bin/ot-rcp'. This commit enables the HAL to talk to the '/dev/null' to avoid '/vendor/bin/ot-rcp' not being found. Bug: 289627270 Test: Run the fuzz test on cuttlefish (cherry picked from https://android-review.googlesource.com/q/commit:7f7e8647fa94b9d126cb88f366740f2b50b1f864) Merged-In: If410d7d75abe05c7c2d2c82fa0450e925b9a48bb Change-Id: If410d7d75abe05c7c2d2c82fa0450e925b9a48bb --- threadnetwork/aidl/default/Android.bp | 1 - threadnetwork/aidl/default/fuzzer.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp index 8b938d2cb3..bcd570498e 100644 --- a/threadnetwork/aidl/default/Android.bp +++ b/threadnetwork/aidl/default/Android.bp @@ -79,7 +79,6 @@ cc_fuzz { "fuzzer.cpp", ], - required: ["ot-rcp"], fuzz_config: { cc: [ "zhanglongxia@google.com", diff --git a/threadnetwork/aidl/default/fuzzer.cpp b/threadnetwork/aidl/default/fuzzer.cpp index 512708daf4..fb6e5489bc 100644 --- a/threadnetwork/aidl/default/fuzzer.cpp +++ b/threadnetwork/aidl/default/fuzzer.cpp @@ -22,7 +22,7 @@ using aidl::android::hardware::threadnetwork::ThreadChip; using android::fuzzService; extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - char url[] = "spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=2"; + char url[] = "spinel+hdlc+null:///dev/null"; auto service = ndk::SharedRefBase::make(url); fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size)); -- GitLab From bed5323f89272fab62c5dfba4b0a7d73847c1841 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Thu, 6 Jul 2023 18:09:22 +0800 Subject: [PATCH 108/376] change the Thread Network HAL api from 'reset' to 'hardwareReset' This CL changes the API from 'reset' to 'hardwareReset' to make the the definition of the API clearer. This CL also optimizes the Thread Network HAL default implementation. Bug: 289867661 Test: Run Thread stack on cuttlefish. (cherry picked from https://android-review.googlesource.com/q/commit:a6165dcccf0096f8363b4b64b0f5332267eea330) Merged-In: Id742453d9d7a0d369ac8f16905efdacfcfba1dbc Change-Id: Id742453d9d7a0d369ac8f16905efdacfcfba1dbc --- .../hardware/threadnetwork/IThreadChip.aidl | 7 +- .../hardware/threadnetwork/IThreadChip.aidl | 21 ++- threadnetwork/aidl/default/thread_chip.cpp | 147 +++++++++++------- threadnetwork/aidl/default/thread_chip.hpp | 14 +- .../vts/VtsHalThreadNetworkTargetTest.cpp | 2 +- 5 files changed, 112 insertions(+), 79 deletions(-) diff --git a/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl index e4d4cbe788..607ceb398d 100644 --- a/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl +++ b/threadnetwork/aidl/aidl_api/android.hardware.threadnetwork/current/android/hardware/threadnetwork/IThreadChip.aidl @@ -36,10 +36,9 @@ package android.hardware.threadnetwork; interface IThreadChip { void open(in android.hardware.threadnetwork.IThreadChipCallback callback); void close(); - void reset(); + void hardwareReset(); void sendSpinelFrame(in byte[] frame); const int ERROR_FAILED = 1; - const int ERROR_INVALID_ARGS = 2; - const int ERROR_NO_BUFS = 3; - const int ERROR_BUSY = 4; + const int ERROR_NO_BUFS = 2; + const int ERROR_BUSY = 3; } diff --git a/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl index eebaa46983..e695623286 100644 --- a/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl +++ b/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl @@ -29,20 +29,15 @@ interface IThreadChip { */ const int ERROR_FAILED = 1; - /** - * The invalid arguments. - */ - const int ERROR_INVALID_ARGS = 2; - /** * Insufficient buffers available to send frames. */ - const int ERROR_NO_BUFS = 3; + const int ERROR_NO_BUFS = 2; /** * Service is busy and could not service the operation. */ - const int ERROR_BUSY = 4; + const int ERROR_BUSY = 3; /** * This method initializes the Thread HAL instance. If open completes @@ -51,9 +46,10 @@ interface IThreadChip { * * @param callback A IThreadChipCallback callback instance. * + * @throws EX_ILLEGAL_ARGUMENT if the callback handle is invalid (for example, it is null). + * * @throws ServiceSpecificException with one of the following values: * - ERROR_FAILED The interface cannot be opened due to an internal error. - * - ERROR_INVALID_ARGS The callback handle is invalid (for example, it is null). * - ERROR_BUSY This interface is in use. */ void open(in IThreadChipCallback callback); @@ -64,11 +60,14 @@ interface IThreadChip { void close(); /** - * This method resets the Thread HAL internal state. The callback registered by - * `open()` won’t be reset and the resource allocated by `open()` won’t be free. + * This method hardware resets the Thread radio chip via the physical reset pin. + * The callback registered by `open()` won’t be reset and the resource allocated + * by `open()` won’t be free. + * + * @throws EX_UNSUPPORTED_OPERATION if the Thread radio chip doesn't support the hardware reset. * */ - void reset(); + void hardwareReset(); /** * This method sends a spinel frame to the Thread HAL. diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp index 94d1e93cbe..3d38cb841b 100644 --- a/threadnetwork/aidl/default/thread_chip.cpp +++ b/threadnetwork/aidl/default/thread_chip.cpp @@ -17,6 +17,8 @@ #include "thread_chip.hpp" #include +#include +#include #include #include #include @@ -46,20 +48,36 @@ ThreadChip::ThreadChip(char* url) : mUrl(), mRxFrameBuffer(), mCallback(nullptr) mSpinelInterface = std::make_shared(handleReceivedFrameJump, this, mRxFrameBuffer); } else { - ALOGE("The protocol \"%s\" is not supported!", protocol); - exit(1); + ALOGE("The protocol \"%s\" is not supported", protocol); + exit(EXIT_FAILURE); } CHECK_NE(mSpinelInterface, nullptr); + + mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient( + AIBinder_DeathRecipient_new(ThreadChip::onBinderDiedJump)); + AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), ThreadChip::onBinderUnlinkedJump); +} + +ThreadChip::~ThreadChip() { + AIBinder_DeathRecipient_delete(mDeathRecipient.get()); +} + +void ThreadChip::onBinderDiedJump(void* context) { + reinterpret_cast(context)->onBinderDied(); +} + +void ThreadChip::onBinderDied(void) { + ALOGW("Thread Network HAL client is dead"); } -void ThreadChip::clientDeathCallback(void* context) { - reinterpret_cast(context)->clientDeathCallback(); +void ThreadChip::onBinderUnlinkedJump(void* context) { + reinterpret_cast(context)->onBinderUnlinked(); } -void ThreadChip::clientDeathCallback(void) { - ALOGW("Thread Network HAL client is dead."); - close(); +void ThreadChip::onBinderUnlinked(void) { + ALOGW("ThreadChip binder is unlinked"); + deinitChip(); } void ThreadChip::handleReceivedFrameJump(void* context) { @@ -76,75 +94,83 @@ void ThreadChip::handleReceivedFrame(void) { } ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& in_callback) { - ndk::ScopedAStatus status; - AIBinder* binder; - - VerifyOrExit(mCallback == nullptr, - status = errorStatus(ERROR_BUSY, "Interface is already opened")); - VerifyOrExit(in_callback != nullptr, - status = errorStatus(ERROR_INVALID_ARGS, "The callback is NULL")); - binder = in_callback->asBinder().get(); - VerifyOrExit(binder != nullptr, - status = errorStatus(ERROR_FAILED, "Failed to get the callback binder")); - mBinderDeathRecipient = AIBinder_DeathRecipient_new(clientDeathCallback); - VerifyOrExit(AIBinder_linkToDeath(binder, mBinderDeathRecipient, this) == STATUS_OK, - status = errorStatus(ERROR_FAILED, "Failed to link the binder to death")); - VerifyOrExit(mSpinelInterface->Init(mUrl) == OT_ERROR_NONE, - status = errorStatus(ERROR_FAILED, "Failed to initialize the interface")); - - mCallback = in_callback; - ot::Posix::Mainloop::Manager::Get().Add(*this); - status = ndk::ScopedAStatus::ok(); - -exit: - if (!status.isOk()) { - if (mBinderDeathRecipient != nullptr) { - AIBinder_DeathRecipient_delete(mBinderDeathRecipient); - mBinderDeathRecipient = nullptr; - } - ALOGW("Open failed, error: %s", status.getDescription().c_str()); + ndk::ScopedAStatus status = initChip(in_callback); + + if (status.isOk()) { + AIBinder_linkToDeath(in_callback->asBinder().get(), mDeathRecipient.get(), this); + ALOGI("Open IThreadChip successfully"); } else { - ALOGI("open()"); + ALOGW("Failed to open IThreadChip: %s", status.getDescription().c_str()); } return status; } +ndk::ScopedAStatus ThreadChip::initChip(const std::shared_ptr& in_callback) { + if (in_callback == nullptr) { + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } else if (mCallback == nullptr) { + if (mSpinelInterface->Init(mUrl) != OT_ERROR_NONE) { + return errorStatus(ERROR_FAILED, "Failed to initialize the interface"); + } + + mCallback = in_callback; + ot::Posix::Mainloop::Manager::Get().Add(*this); + return ndk::ScopedAStatus::ok(); + } else { + return errorStatus(ERROR_BUSY, "Interface has been opened"); + } +} + ndk::ScopedAStatus ThreadChip::close() { - VerifyOrExit(mCallback != nullptr); - mCallback = nullptr; - mSpinelInterface->Deinit(); + ndk::ScopedAStatus status; + std::shared_ptr callback = mCallback; - ot::Posix::Mainloop::Manager::Get().Remove(*this); + status = deinitChip(); + if (status.isOk()) { + if (callback != nullptr) { + AIBinder_unlinkToDeath(callback->asBinder().get(), mDeathRecipient.get(), this); + } - AIBinder_DeathRecipient_delete(mBinderDeathRecipient); - mBinderDeathRecipient = nullptr; + ALOGI("Close IThreadChip successfully"); + } else { + ALOGW("Failed to close IThreadChip: %s", status.getDescription().c_str()); + } -exit: - ALOGI("close()"); - return ndk::ScopedAStatus::ok(); + return status; +} + +ndk::ScopedAStatus ThreadChip::deinitChip() { + if (mCallback != nullptr) { + mSpinelInterface->Deinit(); + ot::Posix::Mainloop::Manager::Get().Remove(*this); + mCallback = nullptr; + return ndk::ScopedAStatus::ok(); + } + + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); } ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_frame) { ndk::ScopedAStatus status; otError error; - VerifyOrExit(mCallback != nullptr, - status = errorStatus(ERROR_FAILED, "The interface is not open")); - - error = mSpinelInterface->SendFrame(reinterpret_cast(in_frame.data()), - in_frame.size()); - if (error == OT_ERROR_NONE) { - status = ndk::ScopedAStatus::ok(); - } else if (error == OT_ERROR_NO_BUFS) { - status = errorStatus(ERROR_NO_BUFS, "Insufficient buffer space to send"); - } else if (error == OT_ERROR_BUSY) { - status = errorStatus(ERROR_BUSY, "The interface is busy"); + if (mCallback == nullptr) { + status = errorStatus(ERROR_FAILED, "The interface is not open"); } else { - status = errorStatus(ERROR_FAILED, "Failed to send the spinel frame"); + error = mSpinelInterface->SendFrame(reinterpret_cast(in_frame.data()), + in_frame.size()); + if (error == OT_ERROR_NONE) { + status = ndk::ScopedAStatus::ok(); + } else if (error == OT_ERROR_NO_BUFS) { + status = errorStatus(ERROR_NO_BUFS, "Insufficient buffer space to send"); + } else if (error == OT_ERROR_BUSY) { + status = errorStatus(ERROR_BUSY, "The interface is busy"); + } else { + status = errorStatus(ERROR_FAILED, "Failed to send the spinel frame"); + } } -exit: if (!status.isOk()) { ALOGW("Send spinel frame failed, error: %s", status.getDescription().c_str()); } @@ -152,8 +178,11 @@ exit: return status; } -ndk::ScopedAStatus ThreadChip::reset() { - mSpinelInterface->HardwareReset(); +ndk::ScopedAStatus ThreadChip::hardwareReset() { + if (mSpinelInterface->HardwareReset() == OT_ERROR_NOT_IMPLEMENTED) { + return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); + } + ALOGI("reset()"); return ndk::ScopedAStatus::ok(); } diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp index 294190a658..1ab6d544d1 100644 --- a/threadnetwork/aidl/default/thread_chip.hpp +++ b/threadnetwork/aidl/default/thread_chip.hpp @@ -22,6 +22,7 @@ #include "lib/spinel/spinel_interface.hpp" #include "mainloop.hpp" +#include #include #include @@ -33,26 +34,31 @@ namespace threadnetwork { class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { public: ThreadChip(char* url); + ~ThreadChip(); ndk::ScopedAStatus open(const std::shared_ptr& in_callback) override; ndk::ScopedAStatus close() override; ndk::ScopedAStatus sendSpinelFrame(const std::vector& in_frame) override; - ndk::ScopedAStatus reset() override; + ndk::ScopedAStatus hardwareReset() override; void Update(otSysMainloopContext& context) override; void Process(const otSysMainloopContext& context) override; private: - static void clientDeathCallback(void* context); - void clientDeathCallback(void); + static void onBinderDiedJump(void* context); + void onBinderDied(void); + static void onBinderUnlinkedJump(void* context); + void onBinderUnlinked(void); static void handleReceivedFrameJump(void* context); void handleReceivedFrame(void); ndk::ScopedAStatus errorStatus(int32_t error, const char* message); + ndk::ScopedAStatus initChip(const std::shared_ptr& in_callback); + ndk::ScopedAStatus deinitChip(); ot::Url::Url mUrl; std::shared_ptr mSpinelInterface; ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer; std::shared_ptr mCallback; - AIBinder_DeathRecipient* mBinderDeathRecipient; + ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; }; } // namespace threadnetwork diff --git a/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp index 04c6deaf2a..5925b54b6a 100644 --- a/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp +++ b/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp @@ -91,7 +91,7 @@ TEST_P(ThreadNetworkAidl, Reset) { ndk::SharedRefBase::make([](auto /* data */) {}); EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->reset().isOk()); + EXPECT_TRUE(thread_chip->hardwareReset().isOk()); } TEST_P(ThreadNetworkAidl, SendSpinelFrame) { -- GitLab From ff240c6b837aabab2d20dbfc1460ca56bf912af0 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Fri, 9 Jun 2023 16:09:12 +0800 Subject: [PATCH 109/376] remove the Thread Network HAL from the stage folder The Thread Network HAL is going to be added to the AOSP. The implementation of the Thread Network HAL under the staging folder is no longer needed. This commit removes the unstable Thread Network HAL. Bug: 283905423 Test: Build (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b044d98115f19fa6d1e430fd6065a372153f8680) Merged-In: I7e4bf260c03dd0500725fec068747e3b3d05820c Change-Id: I8c7ea027b45511597c4014785718b4bda4198520 --- staging/threadnetwork/OWNERS | 5 - staging/threadnetwork/README.md | 12 -- staging/threadnetwork/aidl/Android.bp | 26 --- .../hardware/threadnetwork/IThreadChip.aidl | 88 -------- .../threadnetwork/IThreadChipCallback.aidl | 30 --- staging/threadnetwork/aidl/default/Android.bp | 63 ------ ...roid.hardware.threadnetwork-service.sim.rc | 3 - staging/threadnetwork/aidl/default/main.cpp | 30 --- .../threadnetwork/aidl/default/service.cpp | 90 -------- .../threadnetwork/aidl/default/service.hpp | 42 ---- .../aidl/default/thread_chip.cpp | 197 ------------------ .../aidl/default/thread_chip.hpp | 68 ------ staging/threadnetwork/aidl/default/utils.cpp | 34 --- staging/threadnetwork/aidl/vts/Android.bp | 47 ----- .../vts/VtsHalThreadNetworkTargetTest.cpp | 149 ------------- 15 files changed, 884 deletions(-) delete mode 100644 staging/threadnetwork/OWNERS delete mode 100644 staging/threadnetwork/README.md delete mode 100644 staging/threadnetwork/aidl/Android.bp delete mode 100644 staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl delete mode 100644 staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl delete mode 100644 staging/threadnetwork/aidl/default/Android.bp delete mode 100644 staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc delete mode 100644 staging/threadnetwork/aidl/default/main.cpp delete mode 100644 staging/threadnetwork/aidl/default/service.cpp delete mode 100644 staging/threadnetwork/aidl/default/service.hpp delete mode 100644 staging/threadnetwork/aidl/default/thread_chip.cpp delete mode 100644 staging/threadnetwork/aidl/default/thread_chip.hpp delete mode 100644 staging/threadnetwork/aidl/default/utils.cpp delete mode 100644 staging/threadnetwork/aidl/vts/Android.bp delete mode 100644 staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp diff --git a/staging/threadnetwork/OWNERS b/staging/threadnetwork/OWNERS deleted file mode 100644 index 037215d70f..0000000000 --- a/staging/threadnetwork/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Bug component: 1203089 - -wgtdkp@google.com -xyk@google.com -zhanglongxia@google.com diff --git a/staging/threadnetwork/README.md b/staging/threadnetwork/README.md deleted file mode 100644 index 12104e5f4d..0000000000 --- a/staging/threadnetwork/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Staging threadnetwork HAL interface - -The directory includes the unstable/unreleased version of `hardware/interfaces/threadnetwork` -code which should **NOT** be used in production. But vendors may start verifying their hardware -with the HAL interface. - -This directory will be cleaned up when the stable Thread HAL interface is added in -`hardware/interfaces/threadnetwork` by version `V` or later. - -More information about _Thread_: -- https://www.threadgroup.org -- https://openthread.io diff --git a/staging/threadnetwork/aidl/Android.bp b/staging/threadnetwork/aidl/Android.bp deleted file mode 100644 index b59d6da3f5..0000000000 --- a/staging/threadnetwork/aidl/Android.bp +++ /dev/null @@ -1,26 +0,0 @@ -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -aidl_interface { - name: "android.hardware.threadnetwork", - host_supported: true, - vendor_available: true, - - srcs: [ - "android/hardware/threadnetwork/*.aidl", - ], - - unstable: true, - - backend: { - ndk: { - enabled: true, - }, - }, -} diff --git a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl b/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl deleted file mode 100644 index 3c57149324..0000000000 --- a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChip.aidl +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.threadnetwork; - -import android.hardware.threadnetwork.IThreadChipCallback; - -/** - * Controls a Thread radio chip on the device. - */ - -interface IThreadChip { - /** - * The operation failed for the internal error. - */ - const int ERROR_FAILED = 1; - - /** - * Insufficient buffers available to send frames. - */ - const int ERROR_NO_BUFS = 2; - - /** - * Service is busy and could not service the operation. - */ - const int ERROR_BUSY = 3; - - /** - * This method initializes the Thread HAL instance. If open completes - * successfully, then the Thread HAL instance is ready to accept spinel - * messages through sendSpinelFrame() API. - * - * @param callback A IThreadChipCallback callback instance. If multiple - * callbacks are passed in, the open() will return ERROR_BUSY. - * - * @throws EX_ILLEGAL_ARGUMENT if the callback handle is invalid (for example, it is null). - * @throws ServiceSpecificException with one of the following values: - * - ERROR_FAILED The interface cannot be opened due to an internal error. - * - ERROR_BUSY This interface is in use. - */ - void open(in IThreadChipCallback callback); - - /** - * Close the Thread HAL instance. Must free all resources. - * - * @throws EX_ILLEGAL_STATE if the Thread HAL instance is not opened. - * - */ - void close(); - - /** - * This method resets the Thread HAL internal state. The callback registered by - * `open()` won’t be reset and the resource allocated by `open()` won’t be free. - * - */ - void reset(); - - /** - * This method sends a spinel frame to the Thread HAL. - * - * This method should block until the frame is sent out successfully or - * the method throws errors immediately. - * - * Spinel Protocol: - * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h - * - * @param frame The spinel frame to be sent. - * - * @throws ServiceSpecificException with one of the following values: - * - ERROR_FAILED The Thread HAL failed to send the frame for an internal reason. - * - ERROR_NO_BUFS Insufficient buffer space to send the frame. - * - ERROR_BUSY The Thread HAL is busy. - */ - void sendSpinelFrame(in byte[] frame); -} diff --git a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl b/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl deleted file mode 100644 index a0fe88cf8d..0000000000 --- a/staging/threadnetwork/aidl/android/hardware/threadnetwork/IThreadChipCallback.aidl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.threadnetwork; - -interface IThreadChipCallback { - /** - * This method is called when a spinel frame is received. Thread network - * will process the received spinel frame. - * - * Spinel Protocol: - * https://github.com/openthread/openthread/blob/main/src/lib/spinel/spinel.h - * - * @param frame The received spinel frame. - */ - oneway void onReceiveSpinelFrame(in byte[] frame); -} diff --git a/staging/threadnetwork/aidl/default/Android.bp b/staging/threadnetwork/aidl/default/Android.bp deleted file mode 100644 index 8fc22ad538..0000000000 --- a/staging/threadnetwork/aidl/default/Android.bp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -cc_defaults { - name: "threadnetwork_service_default", - vendor: true, - relative_install_path: "hw", - - shared_libs: [ - "android.hardware.threadnetwork-ndk", - "libbase", - "libbinder_ndk", - "libcutils", - "liblog", - "libutils", - ], - - static_libs: [ - "openthread-common", - "openthread-hdlc", - "openthread-platform", - "openthread-posix", - "openthread-url", - ], - - srcs: [ - "main.cpp", - "service.cpp", - "thread_chip.cpp", - "utils.cpp", - ], -} - -cc_binary { - name: "android.hardware.threadnetwork-service.sim", - defaults: ["threadnetwork_service_default"], - init_rc: ["android.hardware.threadnetwork-service.sim.rc"], -} - -cc_binary { - name: "android.hardware.threadnetwork-service", - defaults: ["threadnetwork_service_default"], -} diff --git a/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc b/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc deleted file mode 100644 index 2fb409cd93..0000000000 --- a/staging/threadnetwork/aidl/default/android.hardware.threadnetwork-service.sim.rc +++ /dev/null @@ -1,3 +0,0 @@ -service vendor.threadnetwork_hal /vendor/bin/hw/android.hardware.threadnetwork-service.sim spinel+hdlc+forkpty:///vendor/bin/ot-rcp?forkpty-arg=1 - class hal - user thread_network diff --git a/staging/threadnetwork/aidl/default/main.cpp b/staging/threadnetwork/aidl/default/main.cpp deleted file mode 100644 index b6c8bbb7ba..0000000000 --- a/staging/threadnetwork/aidl/default/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "service.hpp" - -int main(int argc, char* argv[]) { - CHECK_GT(argc, 1); - aidl::android::hardware::threadnetwork::Service service(&argv[1], argc - 1); - - ALOGI("Thread Network HAL is running"); - - service.startLoop(); - return EXIT_FAILURE; // should not reach -} diff --git a/staging/threadnetwork/aidl/default/service.cpp b/staging/threadnetwork/aidl/default/service.cpp deleted file mode 100644 index 8047214f24..0000000000 --- a/staging/threadnetwork/aidl/default/service.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "service.hpp" - -#include -#include -#include -#include - -#include "thread_chip.hpp" - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -Service::Service(char* urls[], int numUrls) : mBinderFd(-1) { - int fd; - - CHECK_NE(urls, nullptr); - CHECK_GT(numUrls, 0); - - for (int i = 0; i < numUrls; i++) { - auto threadChip = ndk::SharedRefBase::make(i, urls[i]); - CHECK_NE(threadChip, nullptr); - mThreadChips.push_back(std::move(threadChip)); - } - - binder_status_t status = ABinderProcess_setupPolling(&fd); - CHECK_EQ(status, ::STATUS_OK); - CHECK_GE(fd, 0); - mBinderFd.reset(fd); -} - -void Service::Update(otSysMainloopContext& context) { - FD_SET(mBinderFd.get(), &context.mReadFdSet); - context.mMaxFd = std::max(context.mMaxFd, mBinderFd.get()); -} - -void Service::Process(const otSysMainloopContext& context) { - if (FD_ISSET(mBinderFd.get(), &context.mReadFdSet)) { - ABinderProcess_handlePolledCommands(); - } -} - -void Service::startLoop(void) { - const struct timeval kPollTimeout = {1, 0}; - otSysMainloopContext context; - int rval; - - ot::Posix::Mainloop::Manager::Get().Add(*this); - - while (true) { - context.mMaxFd = -1; - context.mTimeout = kPollTimeout; - - FD_ZERO(&context.mReadFdSet); - FD_ZERO(&context.mWriteFdSet); - FD_ZERO(&context.mErrorFdSet); - - ot::Posix::Mainloop::Manager::Get().Update(context); - - rval = select(context.mMaxFd + 1, &context.mReadFdSet, &context.mWriteFdSet, - &context.mErrorFdSet, &context.mTimeout); - - if (rval >= 0) { - ot::Posix::Mainloop::Manager::Get().Process(context); - } else if (errno != EINTR) { - ALOGE("select() failed: %s", strerror(errno)); - break; - } - } -} -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/service.hpp b/staging/threadnetwork/aidl/default/service.hpp deleted file mode 100644 index 6e6e86845a..0000000000 --- a/staging/threadnetwork/aidl/default/service.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "mainloop.hpp" -#include "thread_chip.hpp" - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -class Service : public ot::Posix::Mainloop::Source { - public: - Service(char* urls[], int numUrls); - - void Update(otSysMainloopContext& context) override; - void Process(const otSysMainloopContext& context) override; - void startLoop(void); - - private: - ::android::base::unique_fd mBinderFd; - std::vector> mThreadChips; -}; -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/thread_chip.cpp b/staging/threadnetwork/aidl/default/thread_chip.cpp deleted file mode 100644 index 38abad4ab5..0000000000 --- a/staging/threadnetwork/aidl/default/thread_chip.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "thread_chip.hpp" - -#include -#include -#include -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -static ndk::ScopedAStatus errorStatus(int32_t error, const char* message) { - return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(error, message)); -} - -ThreadChip::ThreadChip(uint8_t id, char* url) - : mUrl(), - mInterface(handleReceivedFrame, this, mRxFrameBuffer), - mRxFrameBuffer(), - mCallback(nullptr) { - const std::string name(std::string() + IThreadChip::descriptor + "/chip" + std::to_string(id)); - binder_status_t status; - - ALOGI("ServiceName: %s, Url: %s", name.c_str(), url); - CHECK_EQ(mUrl.Init(url), 0); - status = AServiceManager_addService(asBinder().get(), name.c_str()); - CHECK_EQ(status, STATUS_OK); - - mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient( - AIBinder_DeathRecipient_new(ThreadChip::onBinderDied)); - AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), ThreadChip::onBinderUnlinked); -} - -ThreadChip::~ThreadChip() { - AIBinder_DeathRecipient_delete(mDeathRecipient.get()); -} - -void ThreadChip::onBinderDied(void* context) { - reinterpret_cast(context)->onBinderDied(); -} - -void ThreadChip::onBinderDied(void) { - ALOGW("Thread Network HAL client is dead."); -} - -void ThreadChip::onBinderUnlinked(void* context) { - reinterpret_cast(context)->onBinderUnlinked(); -} - -void ThreadChip::onBinderUnlinked(void) { - ALOGW("ThreadChip binder is unlinked."); - deinitChip(); -} - -void ThreadChip::handleReceivedFrame(void* context) { - reinterpret_cast(context)->handleReceivedFrame(); -} - -void ThreadChip::handleReceivedFrame(void) { - if (mCallback != nullptr) { - mCallback->onReceiveSpinelFrame(std::vector( - mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength())); - } - - mRxFrameBuffer.DiscardFrame(); -} - -ndk::ScopedAStatus ThreadChip::open(const std::shared_ptr& in_callback) { - ndk::ScopedAStatus status = initChip(in_callback); - - if (status.isOk()) { - AIBinder_linkToDeath(in_callback->asBinder().get(), mDeathRecipient.get(), this); - ALOGI("Open IThreadChip successfully."); - } else { - ALOGW("Open IThreadChip failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::initChip(const std::shared_ptr& in_callback) { - if (in_callback == nullptr) { - return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); - } else if (mCallback == nullptr) { - if (mInterface.Init(mUrl) != OT_ERROR_NONE) { - return errorStatus(ERROR_FAILED, "Failed to initialize the interface"); - } - - mCallback = in_callback; - ot::Posix::Mainloop::Manager::Get().Add(*this); - return ndk::ScopedAStatus::ok(); - } else { - return errorStatus(ERROR_BUSY, "Interface is already opened"); - } -} - -ndk::ScopedAStatus ThreadChip::close() { - ndk::ScopedAStatus status; - std::shared_ptr callback = mCallback; - - status = deinitChip(); - if (status.isOk()) { - if (callback != nullptr) { - AIBinder_unlinkToDeath(callback->asBinder().get(), mDeathRecipient.get(), this); - } - - ALOGI("Close IThreadChip successfully"); - } else { - ALOGW("Close IThreadChip failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::deinitChip() { - if (mCallback != nullptr) { - mInterface.Deinit(); - ot::Posix::Mainloop::Manager::Get().Remove(*this); - mCallback = nullptr; - return ndk::ScopedAStatus::ok(); - } - - return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); -} - -ndk::ScopedAStatus ThreadChip::sendSpinelFrame(const std::vector& in_frame) { - ndk::ScopedAStatus status; - otError error; - - if (mCallback == nullptr) { - status = errorStatus(ERROR_FAILED, "The interface is not open"); - } else { - error = mInterface.SendFrame(reinterpret_cast(in_frame.data()), - in_frame.size()); - if (error == OT_ERROR_NONE) { - status = ndk::ScopedAStatus::ok(); - } else if (error == OT_ERROR_NO_BUFS) { - status = errorStatus(ERROR_NO_BUFS, "Insufficient buffer space to send"); - } else if (error == OT_ERROR_BUSY) { - status = errorStatus(ERROR_BUSY, "The interface is busy"); - } else { - status = errorStatus(ERROR_FAILED, "Failed to send the spinel frame"); - } - } - - if (!status.isOk()) { - ALOGW("Send spinel frame failed, error: %s", status.getDescription().c_str()); - } - - return status; -} - -ndk::ScopedAStatus ThreadChip::reset() { - mInterface.OnRcpReset(); - ALOGI("reset()"); - return ndk::ScopedAStatus::ok(); -} - -void ThreadChip::Update(otSysMainloopContext& context) { - if (mCallback != nullptr) { - mInterface.UpdateFdSet(context.mReadFdSet, context.mWriteFdSet, context.mMaxFd, - context.mTimeout); - } -} - -void ThreadChip::Process(const otSysMainloopContext& context) { - struct RadioProcessContext radioContext; - - if (mCallback != nullptr) { - radioContext.mReadFdSet = &context.mReadFdSet; - radioContext.mWriteFdSet = &context.mWriteFdSet; - mInterface.Process(radioContext); - } -} -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/thread_chip.hpp b/staging/threadnetwork/aidl/default/thread_chip.hpp deleted file mode 100644 index da5cba7585..0000000000 --- a/staging/threadnetwork/aidl/default/thread_chip.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include "hdlc_interface.hpp" -#include "lib/spinel/spinel_interface.hpp" -#include "mainloop.hpp" - -#include -#include -#include - -namespace aidl { -namespace android { -namespace hardware { -namespace threadnetwork { - -class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source { - public: - ThreadChip(uint8_t id, char* url); - ~ThreadChip(); - - ndk::ScopedAStatus open(const std::shared_ptr& in_callback) override; - ndk::ScopedAStatus close() override; - ndk::ScopedAStatus sendSpinelFrame(const std::vector& in_frame) override; - ndk::ScopedAStatus reset() override; - void Update(otSysMainloopContext& context) override; - void Process(const otSysMainloopContext& context) override; - - private: - static void onBinderDied(void* context); - void onBinderDied(void); - static void onBinderUnlinked(void* context); - void onBinderUnlinked(void); - static void handleReceivedFrame(void* context); - void handleReceivedFrame(void); - - ndk::ScopedAStatus initChip(const std::shared_ptr& in_callback); - ndk::ScopedAStatus deinitChip(); - - ot::Url::Url mUrl; - ot::Posix::HdlcInterface mInterface; - ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer; - std::shared_ptr mCallback; - ::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; -}; - -} // namespace threadnetwork -} // namespace hardware -} // namespace android -} // namespace aidl diff --git a/staging/threadnetwork/aidl/default/utils.cpp b/staging/threadnetwork/aidl/default/utils.cpp deleted file mode 100644 index d3b4062ee3..0000000000 --- a/staging/threadnetwork/aidl/default/utils.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -void otLogCritPlat(const char* format, ...) { - va_list args; - - va_start(args, format); - __android_log_vprint(ANDROID_LOG_FATAL, LOG_TAG, format, args); - va_end(args); -} - -void otLogWarnPlat(const char* format, ...) { - va_list args; - - va_start(args, format); - __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args); - va_end(args); -} diff --git a/staging/threadnetwork/aidl/vts/Android.bp b/staging/threadnetwork/aidl/vts/Android.bp deleted file mode 100644 index e2609ed1b5..0000000000 --- a/staging/threadnetwork/aidl/vts/Android.bp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package { - // See: http://go/android-license-faq - // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "hardware_interfaces_license" - // to get the below license kinds: - // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["hardware_interfaces_license"], -} - -cc_test { - name: "VtsHalThreadNetworkTargetTest", - defaults: [ - "VtsHalTargetTestDefaults", - "use_libaidlvintf_gtest_helper_static", - ], - srcs: [ - "VtsHalThreadNetworkTargetTest.cpp", - ], - - shared_libs: [ - "libbinder", - "libbinder_ndk", - ], - static_libs: [ - "android.hardware.threadnetwork-ndk", - ], - test_suites: [ - "general-tests", - "vts", - ], -} diff --git a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp b/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp deleted file mode 100644 index 3e43f9c8b7..0000000000 --- a/staging/threadnetwork/aidl/vts/VtsHalThreadNetworkTargetTest.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "ThreadNetworkHalTargetTest" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using aidl::android::hardware::threadnetwork::BnThreadChipCallback; -using aidl::android::hardware::threadnetwork::IThreadChip; -using android::ProcessState; -using ndk::ScopedAStatus; -using ndk::SpAIBinder; - -namespace { -constexpr static int kCallbackTimeoutMs = 5000; -} // namespace - -class ThreadChipCallback : public BnThreadChipCallback { - public: - ThreadChipCallback(const std::function&)>& on_spinel_message_cb) - : on_spinel_message_cb_(on_spinel_message_cb) {} - - ScopedAStatus onReceiveSpinelFrame(const std::vector& in_aFrame) { - on_spinel_message_cb_(in_aFrame); - return ScopedAStatus::ok(); - } - - private: - std::function&)> on_spinel_message_cb_; -}; - -class ThreadNetworkAidl : public testing::TestWithParam { - public: - virtual void SetUp() override { - std::string serviceName = GetParam(); - - ALOGI("serviceName: %s", serviceName.c_str()); - - thread_chip = IThreadChip::fromBinder( - SpAIBinder(AServiceManager_waitForService(serviceName.c_str()))); - ASSERT_NE(thread_chip, nullptr); - } - - virtual void TearDown() override { thread_chip->close(); } - - std::shared_ptr thread_chip; -}; - -TEST_P(ThreadNetworkAidl, Open) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_EQ(thread_chip->open(callback).getServiceSpecificError(), IThreadChip::ERROR_BUSY); -} - -TEST_P(ThreadNetworkAidl, Close) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->close().isOk()); - EXPECT_EQ(thread_chip->close().getExceptionCode(), EX_ILLEGAL_STATE); -} - -TEST_P(ThreadNetworkAidl, Reset) { - std::shared_ptr callback = - ndk::SharedRefBase::make([](auto /* data */) {}); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - EXPECT_TRUE(thread_chip->reset().isOk()); -} - -TEST_P(ThreadNetworkAidl, SendSpinelFrame) { - const uint8_t kCmdOffset = 2; - const uint8_t kMajorVersionOffset = 3; - const uint8_t kMinorVersionOffset = 4; - const std::vector kGetSpinelProtocolVersion({0x81, 0x02, 0x01}); - const std::vector kGetSpinelProtocolVersionResponse({0x81, 0x06, 0x01, 0x04, 0x03}); - uint8_t min_major_version = kGetSpinelProtocolVersionResponse[kMajorVersionOffset]; - uint8_t min_minor_version = kGetSpinelProtocolVersionResponse[kMinorVersionOffset]; - uint8_t major_version; - uint8_t minor_version; - std::promise open_cb_promise; - std::future open_cb_future{open_cb_promise.get_future()}; - std::shared_ptr callback; - std::vector received_frame; - std::chrono::milliseconds timeout{kCallbackTimeoutMs}; - - callback = ndk::SharedRefBase::make( - [&](const std::vector& in_aFrame) { - if (in_aFrame.size() == kGetSpinelProtocolVersionResponse.size() && - in_aFrame[kCmdOffset] == kGetSpinelProtocolVersionResponse[kCmdOffset]) { - major_version = in_aFrame[kMajorVersionOffset]; - minor_version = in_aFrame[kMinorVersionOffset]; - open_cb_promise.set_value(); - } - }); - - ASSERT_NE(callback, nullptr); - - EXPECT_TRUE(thread_chip->open(callback).isOk()); - - EXPECT_TRUE(thread_chip->sendSpinelFrame(kGetSpinelProtocolVersion).isOk()); - EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready); - - EXPECT_GE(major_version, min_major_version); - if (major_version == min_major_version) { - EXPECT_GE(minor_version, min_minor_version); - } -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ThreadNetworkAidl); -INSTANTIATE_TEST_SUITE_P( - Thread, ThreadNetworkAidl, - testing::ValuesIn(android::getAidlHalInstanceNames(IThreadChip::descriptor)), - android::PrintInstanceNameToString); - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - ProcessState::self()->setThreadPoolMaxThreadCount(1); - ProcessState::self()->startThreadPool(); - return RUN_ALL_TESTS(); -} -- GitLab From a59b235aeac1d03f430c5a419af82ec2971927bc Mon Sep 17 00:00:00 2001 From: Kangping Dong Date: Wed, 23 Aug 2023 16:26:32 +0800 Subject: [PATCH 110/376] [Thread] add "owner: google" for Thread HAL This is for bypassing frozen HAL check on release branches. Background: We need to write code in the tethering module that depends on the HAL interface and that code will be auto-merged to udc-mainline-prod branch. Merged-In is added to stop this CL from auto-merged to the main branch Test: build Bug: 296211911 Merged-In: I7e4bf260c03dd0500725fec068747e3b3d05820c Change-Id: Id81adc9ff55649bf6d06cb2519d3e5805da15e5e --- threadnetwork/aidl/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/threadnetwork/aidl/Android.bp b/threadnetwork/aidl/Android.bp index 480ac0f377..91c43c54b7 100644 --- a/threadnetwork/aidl/Android.bp +++ b/threadnetwork/aidl/Android.bp @@ -1,5 +1,6 @@ aidl_interface { name: "android.hardware.threadnetwork", + owner: "google", vendor_available: true, srcs: [ "android/hardware/threadnetwork/*.aidl", -- GitLab From 0d92059a6e300dc9f854512a913aac348450439e Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 25 Aug 2023 11:10:37 -0700 Subject: [PATCH 111/376] audio: Properly handle closed effects in HIDL implementation Ensure that the default HIDL implementation (legacy wrapper) does not attempt to call into the legacy implementation after it has been released. Added new option for VTS tests to verify this behavior. This does not require any new functionality from existing implementations. The test ensures that after a call to 'IEffect.close', calls of all other interface methods do not crash and return an error. This is a natural expectation, thus HIDL implementations not passing these new checks need to be fixed. Bug: 294273146 Test: atest VtsHalAudioEffectV5_0TargetTest Test: atest VtsHalAudioEffectV6_0TargetTest Test: atest VtsHalAudioEffectV7_0TargetTest Change-Id: If83e0a5f8f51f3f87c62fcfbfba469a421ad1cf8 --- audio/effect/all-versions/default/Effect.cpp | 63 ++-- audio/effect/all-versions/default/Effect.h | 6 +- .../VtsHalAudioEffectTargetTest.cpp | 268 ++++++++++++------ 3 files changed, 237 insertions(+), 100 deletions(-) diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp index 5aecd324eb..4a9e144627 100644 --- a/audio/effect/all-versions/default/Effect.cpp +++ b/audio/effect/all-versions/default/Effect.cpp @@ -315,7 +315,7 @@ Effect::Effect(bool isInput, effect_handle_t handle) Effect::~Effect() { ATRACE_CALL(); - (void)close(); + auto [_, handle] = closeImpl(); if (mProcessThread.get()) { ATRACE_NAME("mProcessThread->join"); status_t status = mProcessThread->join(); @@ -328,11 +328,10 @@ Effect::~Effect() { mInBuffer.clear(); mOutBuffer.clear(); #if MAJOR_VERSION <= 5 - int status = EffectRelease(mHandle); - ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status)); + int status = EffectRelease(handle); + ALOGW_IF(status, "Error releasing effect %p: %s", handle, strerror(-status)); #endif - EffectMap::getInstance().remove(mHandle); - mHandle = 0; + EffectMap::getInstance().remove(handle); } // static @@ -459,7 +458,19 @@ Result Effect::analyzeStatus(const char* funcName, const char* subFuncName, } } -void Effect::getConfigImpl(int commandCode, const char* commandName, GetConfigCallback cb) { +#define RETURN_IF_EFFECT_CLOSED() \ + if (mHandle == kInvalidEffectHandle) { \ + return Result::INVALID_STATE; \ + } +#define RETURN_RESULT_IF_EFFECT_CLOSED(result) \ + if (mHandle == kInvalidEffectHandle) { \ + _hidl_cb(Result::INVALID_STATE, result); \ + return Void(); \ + } + +Return Effect::getConfigImpl(int commandCode, const char* commandName, + GetConfigCallback _hidl_cb) { + RETURN_RESULT_IF_EFFECT_CLOSED(EffectConfig()); uint32_t halResultSize = sizeof(effect_config_t); effect_config_t halConfig{}; status_t status = @@ -468,7 +479,8 @@ void Effect::getConfigImpl(int commandCode, const char* commandName, GetConfigCa if (status == OK) { status = EffectUtils::effectConfigFromHal(halConfig, mIsInput, &config); } - cb(analyzeCommandStatus(commandName, sContextCallToCommand, status), config); + _hidl_cb(analyzeCommandStatus(commandName, sContextCallToCommand, status), config); + return Void(); } Result Effect::getCurrentConfigImpl(uint32_t featureId, uint32_t configSize, @@ -530,6 +542,7 @@ Result Effect::getSupportedConfigsImpl(uint32_t featureId, uint32_t maxConfigs, } Return Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) { + RETURN_RESULT_IF_EFFECT_CLOSED(StatusMQ::Descriptor()); status_t status; // Create message queue. if (mStatusMQ) { @@ -576,6 +589,7 @@ Return Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) { Return Effect::setProcessBuffers(const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) { + RETURN_IF_EFFECT_CLOSED(); AudioBufferManager& manager = AudioBufferManager::getInstance(); sp tempInBuffer, tempOutBuffer; if (!manager.wrap(inBuffer, &tempInBuffer)) { @@ -600,6 +614,7 @@ Result Effect::sendCommand(int commandCode, const char* commandName) { } Result Effect::sendCommand(int commandCode, const char* commandName, uint32_t size, void* data) { + RETURN_IF_EFFECT_CLOSED(); status_t status = (*mHandle)->command(mHandle, commandCode, size, data, 0, NULL); return analyzeCommandStatus(commandName, sContextCallToCommand, status); } @@ -611,6 +626,7 @@ Result Effect::sendCommandReturningData(int commandCode, const char* commandName Result Effect::sendCommandReturningData(int commandCode, const char* commandName, uint32_t size, void* data, uint32_t* replySize, void* replyData) { + RETURN_IF_EFFECT_CLOSED(); uint32_t expectedReplySize = *replySize; status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData); if (status == OK && *replySize != expectedReplySize) { @@ -635,6 +651,7 @@ Result Effect::sendCommandReturningStatusAndData(int commandCode, const char* co uint32_t size, void* data, uint32_t* replySize, void* replyData, uint32_t minReplySize, CommandSuccessCallback onSuccess) { + RETURN_IF_EFFECT_CLOSED(); status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData); Result retval; if (status == OK && minReplySize >= sizeof(uint32_t) && *replySize >= minReplySize) { @@ -792,13 +809,11 @@ Return Effect::setConfigReverse( } Return Effect::getConfig(getConfig_cb _hidl_cb) { - getConfigImpl(EFFECT_CMD_GET_CONFIG, "GET_CONFIG", _hidl_cb); - return Void(); + return getConfigImpl(EFFECT_CMD_GET_CONFIG, "GET_CONFIG", _hidl_cb); } Return Effect::getConfigReverse(getConfigReverse_cb _hidl_cb) { - getConfigImpl(EFFECT_CMD_GET_CONFIG_REVERSE, "GET_CONFIG_REVERSE", _hidl_cb); - return Void(); + return getConfigImpl(EFFECT_CMD_GET_CONFIG_REVERSE, "GET_CONFIG_REVERSE", _hidl_cb); } Return Effect::getSupportedAuxChannelsConfigs(uint32_t maxConfigs, @@ -845,6 +860,7 @@ Return Effect::offload(const EffectOffloadParameter& param) { } Return Effect::getDescriptor(getDescriptor_cb _hidl_cb) { + RETURN_RESULT_IF_EFFECT_CLOSED(EffectDescriptor()); effect_descriptor_t halDescriptor; memset(&halDescriptor, 0, sizeof(effect_descriptor_t)); status_t status = (*mHandle)->get_descriptor(mHandle, &halDescriptor); @@ -858,6 +874,10 @@ Return Effect::getDescriptor(getDescriptor_cb _hidl_cb) { Return Effect::command(uint32_t commandId, const hidl_vec& data, uint32_t resultMaxSize, command_cb _hidl_cb) { + if (mHandle == kInvalidEffectHandle) { + _hidl_cb(-ENODATA, hidl_vec()); + return Void(); + } uint32_t halDataSize; std::unique_ptr halData = hidlVecToHal(data, &halDataSize); uint32_t halResultSize = resultMaxSize; @@ -942,26 +962,33 @@ Return Effect::setCurrentConfigForFeature(uint32_t featureId, halCmd.size(), &halCmd[0]); } -Return Effect::close() { +std::tuple Effect::closeImpl() { if (mStopProcessThread.load(std::memory_order_relaxed)) { // only this thread modifies - return Result::INVALID_STATE; + return {Result::INVALID_STATE, kInvalidEffectHandle}; } mStopProcessThread.store(true, std::memory_order_release); if (mEfGroup) { mEfGroup->wake(static_cast(MessageQueueFlagBits::REQUEST_QUIT)); } + effect_handle_t handle = mHandle; + mHandle = kInvalidEffectHandle; #if MAJOR_VERSION <= 5 - return Result::OK; + return {Result::OK, handle}; #elif MAJOR_VERSION >= 6 // No need to join the processing thread, it is part of the API contract that the client // must finish processing before closing the effect. - Result retval = - analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(mHandle)); - EffectMap::getInstance().remove(mHandle); - return retval; + Result retval = analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(handle)); + EffectMap::getInstance().remove(handle); + return {retval, handle}; #endif } +Return Effect::close() { + RETURN_IF_EFFECT_CLOSED(); + auto [result, _] = closeImpl(); + return result; +} + Return Effect::debug(const hidl_handle& fd, const hidl_vec& /* options */) { if (fd.getNativeHandle() != nullptr && fd->numFds == 1) { uint32_t cmdData = fd->data[0]; diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h index 5d8dcccba6..2bcecec4c7 100644 --- a/audio/effect/all-versions/default/Effect.h +++ b/audio/effect/all-versions/default/Effect.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -186,6 +187,7 @@ struct Effect : public IEffect { // Sets the limit on the maximum size of vendor-provided data structures. static constexpr size_t kMaxDataSize = 1 << 20; + static constexpr effect_handle_t kInvalidEffectHandle = nullptr; static const char* sContextResultOfCommand; static const char* sContextCallToCommand; @@ -208,6 +210,7 @@ struct Effect : public IEffect { static size_t alignedSizeIn(size_t s); template std::unique_ptr hidlVecToHal(const hidl_vec& vec, uint32_t* halDataSize); + std::tuple closeImpl(); void effectAuxChannelsConfigFromHal(const channel_config_t& halConfig, EffectAuxChannelsConfig* config); static void effectAuxChannelsConfigToHal(const EffectAuxChannelsConfig& config, @@ -218,7 +221,8 @@ struct Effect : public IEffect { const void** valueData, std::vector* halParamBuffer); Result analyzeCommandStatus(const char* commandName, const char* context, status_t status); - void getConfigImpl(int commandCode, const char* commandName, GetConfigCallback cb); + Return getConfigImpl(int commandCode, const char* commandName, + GetConfigCallback _hidl_cb); Result getCurrentConfigImpl(uint32_t featureId, uint32_t configSize, GetCurrentConfigSuccessCallback onSuccess); Result getSupportedConfigsImpl(uint32_t featureId, uint32_t maxConfigs, uint32_t configSize, diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp index d95bb06c3a..ff84f9d562 100644 --- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp +++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp @@ -169,13 +169,15 @@ static const Uuid LOUDNESS_ENHANCER_EFFECT_TYPE = { 0xfe3199be, 0xaed0, 0x413f, 0x87bb, std::array{{0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}}; -enum { PARAM_FACTORY_NAME, PARAM_EFFECT_UUID }; -using EffectParameter = std::tuple; +enum { PARAM_FACTORY_NAME, PARAM_EFFECT_UUID, PARAM_USE_AFTER_CLOSE }; +using EffectParameter = std::tuple; static inline std::string EffectParameterToString( const ::testing::TestParamInfo& info) { - return ::android::hardware::PrintInstanceNameToString(::testing::TestParamInfo{ - std::get(info.param), info.index}); + std::string prefix = std::get(info.param) ? "UseAfterClose_" : ""; + return prefix.append( + ::android::hardware::PrintInstanceNameToString(::testing::TestParamInfo{ + std::get(info.param), info.index})); } // The main test class for Audio Effect HIDL HAL. @@ -191,6 +193,13 @@ class AudioEffectHidlTest : public ::testing::TestWithParam { Return ret = effect->init(); ASSERT_TRUE(ret.isOk()); ASSERT_EQ(Result::OK, ret); + + useAfterClose = std::get(GetParam()); + if (useAfterClose) { + Return ret = effect->close(); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(Result::OK, ret); + } } void TearDown() override { @@ -205,14 +214,34 @@ class AudioEffectHidlTest : public ::testing::TestWithParam { Uuid getEffectType() const { return std::get(GetParam()); } + void checkResult(const Result& result); + void checkResultForUseAfterClose(const Result& result); void findAndCreateEffect(const Uuid& type); void findEffectInstance(const Uuid& type, Uuid* uuid); void getChannelCount(uint32_t* channelCount); sp effectsFactory; sp effect; + bool useAfterClose; }; +void AudioEffectHidlTest::checkResult(const Result& result) { + if (!useAfterClose) { + ASSERT_EQ(Result::OK, result); + } else { + ASSERT_NO_FATAL_FAILURE(checkResultForUseAfterClose(result)); + } +} + +void AudioEffectHidlTest::checkResultForUseAfterClose(const Result& result) { + if (useAfterClose) { + // The actual error does not matter. It's important that the effect did not crash + // while executing any command after a call to "close", and that the returned status + // is not OK. + ASSERT_NE(Result::OK, result); + } +} + void AudioEffectHidlTest::findAndCreateEffect(const Uuid& type) { Uuid effectUuid; ASSERT_NO_FATAL_FAILURE(findEffectInstance(type, &effectUuid)); @@ -257,7 +286,11 @@ void AudioEffectHidlTest::getChannelCount(uint32_t* channelCount) { } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) { + *channelCount = 1; + return; + } #if MAJOR_VERSION <= 6 ASSERT_TRUE(audio_channel_mask_is_valid( static_cast(currentConfig.outputCfg.channels))); @@ -276,7 +309,7 @@ TEST_P(AudioEffectHidlTest, Close) { description("Verify that an effect can be closed"); Return ret = effect->close(); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + ASSERT_NO_FATAL_FAILURE(checkResult(ret)); } TEST_P(AudioEffectHidlTest, GetDescriptor) { @@ -290,7 +323,8 @@ TEST_P(AudioEffectHidlTest, GetDescriptor) { } }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) return; EXPECT_EQ(getEffectType(), actualType); } @@ -307,7 +341,8 @@ TEST_P(AudioEffectHidlTest, GetSetConfig) { } }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) return; Return ret2 = effect->setConfig(currentConfig, nullptr, nullptr); EXPECT_TRUE(ret2.isOk()); EXPECT_EQ(Result::OK, ret2); @@ -336,7 +371,8 @@ TEST_P(AudioEffectHidlTest, SetConfigInvalidArguments) { } }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) return; for (const auto& invalidInputCfg : generateInvalidConfigs(currentConfig.inputCfg)) { EffectConfig invalidConfig = currentConfig; invalidConfig.inputCfg = invalidInputCfg; @@ -356,27 +392,35 @@ TEST_P(AudioEffectHidlTest, SetConfigInvalidArguments) { TEST_P(AudioEffectHidlTest, GetConfigReverse) { description("Verify that GetConfigReverse does not crash"); - Return ret = effect->getConfigReverse([&](Result, const EffectConfig&) {}); + Result retval = Result::OK; + Return ret = effect->getConfigReverse([&](Result r, const EffectConfig&) { retval = r; }); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval)); } TEST_P(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) { description("Verify that GetSupportedAuxChannelsConfigs does not crash"); + Result retval = Result::OK; Return ret = effect->getSupportedAuxChannelsConfigs( - 0, [&](Result, const hidl_vec&) {}); + 0, [&](Result r, const hidl_vec&) { retval = r; }); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval)); } TEST_P(AudioEffectHidlTest, GetAuxChannelsConfig) { description("Verify that GetAuxChannelsConfig does not crash"); - Return ret = effect->getAuxChannelsConfig([&](Result, const EffectAuxChannelsConfig&) {}); + Result retval = Result::OK; + Return ret = effect->getAuxChannelsConfig( + [&](Result r, const EffectAuxChannelsConfig&) { retval = r; }); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval)); } TEST_P(AudioEffectHidlTest, SetAuxChannelsConfig) { description("Verify that SetAuxChannelsConfig does not crash"); Return ret = effect->setAuxChannelsConfig(EffectAuxChannelsConfig()); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } // Not generated automatically because AudioBuffer contains @@ -427,45 +471,56 @@ TEST_P(AudioEffectHidlTest, Reset) { description("Verify that Reset preserves effect configuration"); Result retval = Result::NOT_INITIALIZED; EffectConfig originalConfig; - Return ret = effect->getConfig([&](Result r, const EffectConfig& conf) { - retval = r; - if (r == Result::OK) { - originalConfig = conf; - } - }); - ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + if (!useAfterClose) { + Return ret = effect->getConfig([&](Result r, const EffectConfig& conf) { + retval = r; + if (r == Result::OK) { + originalConfig = conf; + } + }); + ASSERT_TRUE(ret.isOk()); + ASSERT_EQ(Result::OK, retval); + } Return ret2 = effect->reset(); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, ret2); - EffectConfig configAfterReset; - ret = effect->getConfig([&](Result r, const EffectConfig& conf) { - retval = r; - if (r == Result::OK) { - configAfterReset = conf; - } - }); - EXPECT_EQ(originalConfig, configAfterReset); + EXPECT_NO_FATAL_FAILURE(checkResult(ret2)); + if (!useAfterClose) { + EffectConfig configAfterReset; + Return ret = effect->getConfig([&](Result r, const EffectConfig& conf) { + retval = r; + if (r == Result::OK) { + configAfterReset = conf; + } + }); + EXPECT_EQ(originalConfig, configAfterReset); + } } TEST_P(AudioEffectHidlTest, DisableEnableDisable) { description("Verify Disable -> Enable -> Disable sequence for an effect"); Return ret = effect->disable(); EXPECT_TRUE(ret.isOk()); - // Note: some legacy effects may return -EINVAL (INVALID_ARGUMENTS), - // more canonical is to return -ENOSYS (NOT_SUPPORTED) - EXPECT_TRUE(ret == Result::NOT_SUPPORTED || ret == Result::INVALID_ARGUMENTS); + if (!useAfterClose) { + // Note: some legacy effects may return -EINVAL (INVALID_ARGUMENTS), + // more canonical is to return -ENOSYS (NOT_SUPPORTED) + EXPECT_TRUE(ret == Result::NOT_SUPPORTED || ret == Result::INVALID_ARGUMENTS); + } else { + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); + } ret = effect->enable(); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); ret = effect->disable(); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); } #if MAJOR_VERSION >= 7 TEST_P(AudioEffectHidlTest, SetDeviceInvalidDeviceAddress) { description("Verify that invalid device address is rejected by SetDevice"); + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } DeviceAddress device{.deviceType = "random_string"}; Return ret = effect->setDevice(device); EXPECT_TRUE(ret.isOk()); @@ -482,13 +537,13 @@ TEST_P(AudioEffectHidlTest, SetDevice) { Return ret = effect->setDevice(device); #endif EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); } TEST_P(AudioEffectHidlTest, SetAndGetVolume) { description("Verify that SetAndGetVolume method works for an effect"); uint32_t channelCount; - getChannelCount(&channelCount); + ASSERT_NO_FATAL_FAILURE(getChannelCount(&channelCount)); hidl_vec volumes; volumes.resize(channelCount); for (uint32_t i = 0; i < channelCount; ++i) { @@ -498,13 +553,13 @@ TEST_P(AudioEffectHidlTest, SetAndGetVolume) { Return ret = effect->setAndGetVolume(volumes, [&](Result r, const hidl_vec&) { retval = r; }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); } TEST_P(AudioEffectHidlTest, VolumeChangeNotification) { description("Verify that effect accepts VolumeChangeNotification"); uint32_t channelCount; - getChannelCount(&channelCount); + ASSERT_NO_FATAL_FAILURE(getChannelCount(&channelCount)); hidl_vec volumes; volumes.resize(channelCount); for (uint32_t i = 0; i < channelCount; ++i) { @@ -512,25 +567,29 @@ TEST_P(AudioEffectHidlTest, VolumeChangeNotification) { } Return ret = effect->volumeChangeNotification(volumes); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); } TEST_P(AudioEffectHidlTest, SetAudioMode) { description("Verify that SetAudioMode works for an effect"); Return ret = effect->setAudioMode(AudioMode::NORMAL); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); } TEST_P(AudioEffectHidlTest, SetConfigReverse) { description("Verify that SetConfigReverse does not crash"); Return ret = effect->setConfigReverse(EffectConfig(), nullptr, nullptr); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } #if MAJOR_VERSION >= 7 TEST_P(AudioEffectHidlTest, SetInputDeviceInvalidDeviceAddress) { description("Verify that invalid device address is rejected by SetInputDevice"); + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } DeviceAddress device{.deviceType = "random_string"}; Return ret = effect->setInputDevice(device); EXPECT_TRUE(ret.isOk()); @@ -548,11 +607,15 @@ TEST_P(AudioEffectHidlTest, SetInputDevice) { Return ret = effect->setInputDevice(device); #endif EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } #if MAJOR_VERSION >= 7 TEST_P(AudioEffectHidlTest, SetInvalidAudioSource) { description("Verify that an invalid audio source is rejected by SetAudioSource"); + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } Return ret = effect->setAudioSource("random_string"); ASSERT_TRUE(ret.isOk()); EXPECT_TRUE(ret == Result::INVALID_ARGUMENTS || ret == Result::NOT_SUPPORTED) @@ -568,12 +631,14 @@ TEST_P(AudioEffectHidlTest, SetAudioSource) { Return ret = effect->setAudioSource(toString(xsd::AudioSource::AUDIO_SOURCE_MIC)); #endif EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } TEST_P(AudioEffectHidlTest, Offload) { description("Verify that calling Offload method does not crash"); Return ret = effect->offload(EffectOffloadParameter{}); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } TEST_P(AudioEffectHidlTest, PrepareForProcessing) { @@ -582,7 +647,7 @@ TEST_P(AudioEffectHidlTest, PrepareForProcessing) { Return ret = effect->prepareForProcessing( [&](Result r, const MQDescriptorSync&) { retval = r; }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); } TEST_P(AudioEffectHidlTest, SetProcessBuffers) { @@ -601,7 +666,7 @@ TEST_P(AudioEffectHidlTest, SetProcessBuffers) { ASSERT_TRUE(success); Return ret2 = effect->setProcessBuffers(buffer, buffer); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, ret2); + EXPECT_NO_FATAL_FAILURE(checkResult(ret2)); } TEST_P(AudioEffectHidlTest, Command) { @@ -615,6 +680,7 @@ TEST_P(AudioEffectHidlTest, SetParameter) { description("Verify that SetParameter does not crash"); Return ret = effect->setParameter(hidl_vec(), hidl_vec()); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret)); } TEST_P(AudioEffectHidlTest, GetParameter) { @@ -630,6 +696,9 @@ TEST_P(AudioEffectHidlTest, GetParameterInvalidMaxReplySize) { if (!isNewDeviceLaunchingOnTPlus) { GTEST_SKIP() << "The test only applies to devices launching on T or later"; } + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } // Use a non-empty parameter to avoid being rejected by any earlier checks. hidl_vec parameter; parameter.resize(16); @@ -647,16 +716,20 @@ TEST_P(AudioEffectHidlTest, GetParameterInvalidMaxReplySize) { TEST_P(AudioEffectHidlTest, GetSupportedConfigsForFeature) { description("Verify that GetSupportedConfigsForFeature does not crash"); + Result retval = Result::OK; Return ret = effect->getSupportedConfigsForFeature( - 0, 0, 0, [&](Result, uint32_t, const hidl_vec&) {}); + 0, 0, 0, [&](Result r, uint32_t, const hidl_vec&) { retval = r; }); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval)); } TEST_P(AudioEffectHidlTest, GetCurrentConfigForFeature) { description("Verify that GetCurrentConfigForFeature does not crash"); - Return ret = - effect->getCurrentConfigForFeature(0, 0, [&](Result, const hidl_vec&) {}); + Result retval = Result::OK; + Return ret = effect->getCurrentConfigForFeature( + 0, 0, [&](Result r, const hidl_vec&) { retval = r; }); EXPECT_TRUE(ret.isOk()); + EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval)); } TEST_P(AudioEffectHidlTest, SetCurrentConfigForFeature) { @@ -671,6 +744,9 @@ TEST_P(AudioEffectHidlTest, GetSupportedConfigsForFeatureInvalidConfigSize) { if (!isNewDeviceLaunchingOnTPlus) { GTEST_SKIP() << "The test only applies to devices launching on T or later"; } + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } // Use very large size to ensure that the service does not crash. const uint32_t veryLargeConfigSize = std::numeric_limits::max() - 100; Result retval = Result::OK; @@ -687,6 +763,9 @@ TEST_P(AudioEffectHidlTest, GetCurrentConfigForFeatureInvalidConfigSize) { if (!isNewDeviceLaunchingOnTPlus) { GTEST_SKIP() << "The test only applies to devices launching on T or later"; } + if (useAfterClose) { + GTEST_SKIP() << "Does not make sense for the useAfterClose case"; + } // Use very large size to ensure that the service does not crash. const uint32_t veryLargeConfigSize = std::numeric_limits::max() - 100; Result retval = Result::OK; @@ -729,7 +808,8 @@ void EqualizerAudioEffectHidlTest::getNumBands(uint16_t* numBands) { } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) *numBands = 1; } void EqualizerAudioEffectHidlTest::getLevelRange(int16_t* minLevel, int16_t* maxLevel) { @@ -742,7 +822,11 @@ void EqualizerAudioEffectHidlTest::getLevelRange(int16_t* minLevel, int16_t* max } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) { + *minLevel = 0; + *maxLevel = 255; + } } void EqualizerAudioEffectHidlTest::getBandFrequencyRange(uint16_t band, uint32_t* minFreq, @@ -757,7 +841,7 @@ void EqualizerAudioEffectHidlTest::getBandFrequencyRange(uint16_t band, uint32_t } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); ret = equalizer->getBandCenterFrequency(band, [&](Result r, uint32_t center) { retval = r; if (retval == Result::OK) { @@ -765,7 +849,12 @@ void EqualizerAudioEffectHidlTest::getBandFrequencyRange(uint16_t band, uint32_t } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) { + *minFreq = 20; + *centerFreq = 10000; + *maxFreq = 20000; + } } void EqualizerAudioEffectHidlTest::getPresetCount(size_t* count) { @@ -777,37 +866,38 @@ void EqualizerAudioEffectHidlTest::getPresetCount(size_t* count) { } }); ASSERT_TRUE(ret.isOk()); - ASSERT_EQ(Result::OK, retval); + ASSERT_NO_FATAL_FAILURE(checkResult(retval)); + if (useAfterClose) *count = 1; } TEST_P(EqualizerAudioEffectHidlTest, GetNumBands) { description("Verify that Equalizer effect reports at least one band"); uint16_t numBands = 0; - getNumBands(&numBands); + ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands)); EXPECT_GT(numBands, 0); } TEST_P(EqualizerAudioEffectHidlTest, GetLevelRange) { description("Verify that Equalizer effect reports adequate band level range"); int16_t minLevel = 0x7fff, maxLevel = 0; - getLevelRange(&minLevel, &maxLevel); + ASSERT_NO_FATAL_FAILURE(getLevelRange(&minLevel, &maxLevel)); EXPECT_GT(maxLevel, minLevel); } TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) { description("Verify that manipulating band levels works for Equalizer effect"); uint16_t numBands = 0; - getNumBands(&numBands); + ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands)); ASSERT_GT(numBands, 0); int16_t levels[3]{0x7fff, 0, 0}; - getLevelRange(&levels[0], &levels[2]); + ASSERT_NO_FATAL_FAILURE(getLevelRange(&levels[0], &levels[2])); ASSERT_GT(levels[2], levels[0]); levels[1] = (levels[2] + levels[0]) / 2; for (uint16_t i = 0; i < numBands; ++i) { for (size_t j = 0; j < ARRAY_SIZE(levels); ++j) { Return ret = equalizer->setBandLevel(i, levels[j]); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); Result retval = Result::NOT_INITIALIZED; int16_t actualLevel; Return ret2 = equalizer->getBandLevel(i, [&](Result r, int16_t l) { @@ -817,8 +907,10 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) { } }); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(levels[j], actualLevel); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(levels[j], actualLevel); + } } } } @@ -826,11 +918,11 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) { TEST_P(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) { description("Verify that Equalizer effect reports adequate band frequency range"); uint16_t numBands = 0; - getNumBands(&numBands); + ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands)); ASSERT_GT(numBands, 0); for (uint16_t i = 0; i < numBands; ++i) { uint32_t minFreq = 0xffffffff, centerFreq = 0xffffffff, maxFreq = 0xffffffff; - getBandFrequencyRange(i, &minFreq, ¢erFreq, &maxFreq); + ASSERT_NO_FATAL_FAILURE(getBandFrequencyRange(i, &minFreq, ¢erFreq, &maxFreq)); // Note: NXP legacy implementation reports "1" as upper bound for last band, // so this check fails. EXPECT_GE(maxFreq, centerFreq); @@ -841,7 +933,7 @@ TEST_P(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) { TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) { description("Verify that Equalizer effect supports GetBandForFrequency correctly"); uint16_t numBands = 0; - getNumBands(&numBands); + ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands)); ASSERT_GT(numBands, 0); for (uint16_t i = 0; i < numBands; ++i) { uint32_t freqs[3]{0, 0, 0}; @@ -861,8 +953,10 @@ TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) { } }); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(i, actualBand) << "Frequency: " << freqs[j]; + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(i, actualBand) << "Frequency: " << freqs[j]; + } } } } @@ -870,19 +964,19 @@ TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) { TEST_P(EqualizerAudioEffectHidlTest, GetPresetNames) { description("Verify that Equalizer effect reports at least one preset"); size_t presetCount; - getPresetCount(&presetCount); + ASSERT_NO_FATAL_FAILURE(getPresetCount(&presetCount)); EXPECT_GT(presetCount, 0u); } TEST_P(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) { description("Verify that manipulating the current preset for Equalizer effect"); size_t presetCount; - getPresetCount(&presetCount); + ASSERT_NO_FATAL_FAILURE(getPresetCount(&presetCount)); ASSERT_GT(presetCount, 0u); for (uint16_t i = 0; i < presetCount; ++i) { Return ret = equalizer->setCurrentPreset(i); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); Result retval = Result::NOT_INITIALIZED; uint16_t actualPreset = 0xffff; Return ret2 = equalizer->getCurrentPreset([&](Result r, uint16_t p) { @@ -892,8 +986,10 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) { } }); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(i, actualPreset); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(i, actualPreset); + } } } @@ -904,7 +1000,7 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) { using AllProperties = ::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect::AllProperties; uint16_t numBands = 0; - getNumBands(&numBands); + ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands)); ASSERT_GT(numBands, 0); AllProperties props; props.bandLevels.resize(numBands); @@ -919,7 +1015,7 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) { props.curPreset = -1; Return ret = equalizer->setAllProperties(props); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); Return ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) { retval = r; if (retval == Result::OK) { @@ -927,14 +1023,16 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) { } }); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(props.bandLevels, actualProps.bandLevels); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(props.bandLevels, actualProps.bandLevels); + } // Verify setting of the current preset via properties. props.curPreset = 0; // Assuming there is at least one preset. ret = equalizer->setAllProperties(props); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) { retval = r; if (retval == Result::OK) { @@ -942,8 +1040,10 @@ TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) { } }); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(props.curPreset, actualProps.curPreset); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(props.curPreset, actualProps.curPreset); + } } // The main test class for Equalizer Audio Effect HIDL HAL. @@ -971,7 +1071,7 @@ TEST_P(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) { const int32_t gain = 100; Return ret = enhancer->setTargetGain(gain); EXPECT_TRUE(ret.isOk()); - EXPECT_EQ(Result::OK, ret); + EXPECT_NO_FATAL_FAILURE(checkResult(ret)); int32_t actualGain = 0; Result retval; Return ret2 = enhancer->getTargetGain([&](Result r, int32_t g) { @@ -981,8 +1081,10 @@ TEST_P(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) { } }); EXPECT_TRUE(ret2.isOk()); - EXPECT_EQ(Result::OK, retval); - EXPECT_EQ(gain, actualGain); + EXPECT_NO_FATAL_FAILURE(checkResult(retval)); + if (!useAfterClose) { + EXPECT_EQ(gain, actualGain); + } } INSTANTIATE_TEST_SUITE_P(EffectsFactory, AudioEffectsFactoryHidlTest, @@ -993,25 +1095,29 @@ INSTANTIATE_TEST_SUITE_P( Equalizer_IEffect, AudioEffectHidlTest, ::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames( IEffectsFactory::descriptor)), - ::testing::Values(EQUALIZER_EFFECT_TYPE)), + ::testing::Values(EQUALIZER_EFFECT_TYPE), + ::testing::Values(false, true) /*useAfterClose*/), EffectParameterToString); INSTANTIATE_TEST_SUITE_P( LoudnessEnhancer_IEffect, AudioEffectHidlTest, ::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames( IEffectsFactory::descriptor)), - ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE)), + ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE), + ::testing::Values(false, true) /*useAfterClose*/), EffectParameterToString); INSTANTIATE_TEST_SUITE_P( Equalizer, EqualizerAudioEffectHidlTest, ::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames( IEffectsFactory::descriptor)), - ::testing::Values(EQUALIZER_EFFECT_TYPE)), + ::testing::Values(EQUALIZER_EFFECT_TYPE), + ::testing::Values(false, true) /*useAfterClose*/), EffectParameterToString); INSTANTIATE_TEST_SUITE_P( LoudnessEnhancer, LoudnessEnhancerAudioEffectHidlTest, ::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames( IEffectsFactory::descriptor)), - ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE)), + ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE), + ::testing::Values(false, true) /*useAfterClose*/), EffectParameterToString); // When the VTS test runs on a device lacking the corresponding HAL version the parameter // list is empty, this isn't a problem. -- GitLab From 9ed20627b29525812f53a5c28f6389163f256f9d Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 22 Aug 2023 22:26:52 +0000 Subject: [PATCH 112/376] Mark some HALs as updatable-via-apex retroactively These are all marked updatable-via-apex in compatibility_matrix.9.xml. Adding them to compatibility_matrix.8.xml to allow Cuttlefish to build with the apexes on 'next' Test: m Bug: 296930312 Change-Id: I2910695dbb7a79ca7164f7ed69437f9636d4135b --- compatibility_matrices/compatibility_matrix.8.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 89f62f7c4e..40bd600bce 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -52,7 +52,7 @@ default - + android.hardware.authsecret 1 @@ -122,7 +122,7 @@ default - + android.hardware.biometrics.fingerprint 3 @@ -313,7 +313,7 @@ default - + android.hardware.security.keymint 1-3 @@ -322,7 +322,7 @@ strongbox - + android.hardware.security.keymint 1-3 @@ -519,7 +519,7 @@ SIM[1-9][0-9]* - + android.hardware.security.secureclock 1 @@ -527,7 +527,7 @@ default - + android.hardware.security.sharedsecret 1 @@ -679,7 +679,7 @@ default - + android.hardware.uwb 1 -- GitLab From 57c009e411a0555700a27fd64cc937245ce802d3 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 22 Aug 2023 22:39:18 +0000 Subject: [PATCH 113/376] Remove compatibility_matrix.9.xml from 'next' builds This compatibility matrix has not be finalized or released yet, so it's very important that releasing devices in the 'next' configuration don't use its contents. Test: m Bug: 296930312 Change-Id: I843a24308a1653bff0b4842ff71e657304bea2c8 --- compatibility_matrices/Android.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk index a82a421ff4..f1dd956222 100644 --- a/compatibility_matrices/Android.mk +++ b/compatibility_matrices/Android.mk @@ -103,9 +103,15 @@ my_system_matrix_deps := \ framework_compatibility_matrix.6.xml \ framework_compatibility_matrix.7.xml \ framework_compatibility_matrix.8.xml \ - framework_compatibility_matrix.9.xml \ framework_compatibility_matrix.device.xml \ +# Only allow the use of the unreleased compatibility matrix when we can use unfrozen +# interfaces (in the `next` release configuration). +ifeq ($(RELEASE_AIDL_USE_UNFROZEN),true) +my_system_matrix_deps += \ + framework_compatibility_matrix.9.xml +endif + my_framework_matrix_deps += \ $(my_system_matrix_deps) -- GitLab From 2b2ec50b56fb2134754fbeef8b96f1787c349313 Mon Sep 17 00:00:00 2001 From: ramindani Date: Fri, 25 Aug 2023 18:47:38 -0700 Subject: [PATCH 114/376] [Composer VTS] Check Vrr mode is the only mode in the Config Group BUG: 296636107 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: I4bdf7b0988673a13297d648dcf3360a6821aaecb --- .../aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 90944d5b68..1e6f34b534 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1231,13 +1231,20 @@ TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) { EXPECT_NE(-1, displayConfig.vsyncPeriod); EXPECT_NE(-1, displayConfig.configGroup); if (displayConfig.dpi) { - EXPECT_NE(-1, displayConfig.dpi->x); - EXPECT_NE(-1, displayConfig.dpi->y); + EXPECT_NE(-1.f, displayConfig.dpi->x); + EXPECT_NE(-1.f, displayConfig.dpi->y); } if (displayConfig.vrrConfig) { const auto& vrrConfig = *displayConfig.vrrConfig; EXPECT_GE(vrrConfig.minFrameIntervalNs, displayConfig.vsyncPeriod); + EXPECT_EQ(1, std::count_if( + displayConfigurations.cbegin(), displayConfigurations.cend(), + [displayConfig](const auto& config) { + return config.configGroup == displayConfig.configGroup; + })) + << "There should be only one VRR mode in one ConfigGroup"; + const auto verifyFrameIntervalIsDivisorOfVsync = [&](int32_t frameIntervalNs) { constexpr auto kThreshold = 0.05f; // 5% const auto ratio = -- GitLab From ad6f2cf6f999b1ed529fb6a0138d312eecbd6b70 Mon Sep 17 00:00:00 2001 From: Kangping Dong Date: Fri, 11 Aug 2023 15:31:20 +0800 Subject: [PATCH 115/376] [Thread] move ot-daemon into com.android.tethering Test: build Bug: 296211911 (cherry picked from https://android-review.googlesource.com/q/commit:72deb0fe8a23cbbfe52a89924aa335bfad762762) Change-Id: I52320be04ceb9855a37db59b7ef961d2c8555357 --- threadnetwork/aidl/Android.bp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/threadnetwork/aidl/Android.bp b/threadnetwork/aidl/Android.bp index 91c43c54b7..5aa16a7d65 100644 --- a/threadnetwork/aidl/Android.bp +++ b/threadnetwork/aidl/Android.bp @@ -15,9 +15,12 @@ aidl_interface { ndk: { apex_available: [ "//apex_available:platform", + "com.android.tethering", + // Keep the threadnetwork apex to make it buildable on udc-mainline-prod. + // TODO: remove it after moving ot-daemon into tethering. "com.android.threadnetwork", ], - min_sdk_version: "33", + min_sdk_version: "30", }, }, } -- GitLab From 3a129d7a3b323272ecf81572209718dc3bed0ea5 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 31 May 2023 16:33:07 -0700 Subject: [PATCH 116/376] Implement a host side TestWakeupClientService. Implement a host program that could be used to test the remote access feature. The program will provides grpc service that the remote access HAL running on device can talk to to get tasks. The program will also use adb/aemu command to control the power of the Android instance. This CL also changes the GRPC service address for the default remoteaccess HAL to 10.0.2.2 which points to the host's 127.0.0.1 from the emulator. Test: m -j TestWakeupClientServerHost, run manually. TestWakeupClientServerHost >>> inject task [clientID] taskdata verify emualtor boot up verify emulator shutdown after task finish >>> power on verify emualtor boot up >>> inject task [clientID] taskdata verify emulator does not shutdown after task finish >>> power off >>> inject task [clientID] taskdata verify emulator boot up >>> set vehicleInUse verify emulator does not shutdown after task finish >>> power off >>> genFakeTask start [clientID] verify emulator starts up to execute remote tasks. verify emulator shuts down after 300s. verify emulator restarts after shutdown. >>> genFakeTask stop verify emulator shuts down after finishing last task. Bug: 285205122 Change-Id: I22b660448d8b495cf3ced3378c1c1dc10051d87a --- .../remoteaccess/hal/default/Android.bp | 2 +- .../hal/default/src/RemoteAccessImpl.cpp | 7 +- .../test_grpc_server/impl/Android.bp | 22 +- .../include/TestWakeupClientServiceImpl.h | 48 +++- .../impl/src/TestWakeupClientServiceImpl.cpp | 87 +++++-- .../test_grpc_server/impl/src/main.cpp | 239 +++++++++++++++++- .../test_grpc_server/lib/Android.bp | 2 +- .../lib/ApPowerControlHost.cpp | 23 ++ 8 files changed, 386 insertions(+), 44 deletions(-) create mode 100644 automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp index 01556670ec..48a7309847 100644 --- a/automotive/remoteaccess/hal/default/Android.bp +++ b/automotive/remoteaccess/hal/default/Android.bp @@ -53,7 +53,7 @@ cc_binary { vintf_fragments: ["remoteaccess-default-service.xml"], init_rc: ["remoteaccess-default-service.rc"], cflags: [ - "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", + "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"", ], } diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp index b091162000..d4ba8641b7 100644 --- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp +++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp @@ -30,12 +30,12 @@ constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default"; int main(int /* argc */, char* /* argv */[]) { - LOG(INFO) << "Registering RemoteAccessService as service..."; - #ifndef GRPC_SERVICE_ADDRESS LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting"; exit(1); #endif + LOG(INFO) << "Registering RemoteAccessService as service, server: " << GRPC_SERVICE_ADDRESS + << "..."; grpc::ChannelArguments grpcargs = {}; #ifdef GRPC_SERVICE_IFNAME @@ -48,8 +48,7 @@ int main(int /* argc */, char* /* argv */[]) { android::netdevice::WaitCondition::PRESENT_AND_UP); LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done"; #endif - auto channel = grpc::CreateCustomChannel(GRPC_SERVICE_ADDRESS, - grpc::InsecureChannelCredentials(), grpcargs); + auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials()); auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel); auto service = ndk::SharedRefBase::make< android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get()); diff --git a/automotive/remoteaccess/test_grpc_server/impl/Android.bp b/automotive/remoteaccess/test_grpc_server/impl/Android.bp index 152b528490..74c810e7ba 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/Android.bp +++ b/automotive/remoteaccess/test_grpc_server/impl/Android.bp @@ -38,6 +38,26 @@ cc_binary { ], cflags: [ "-Wno-unused-parameter", - "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"", + "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"", + ], +} + +cc_binary_host { + name: "TestWakeupClientServerHost", + srcs: ["src/*.cpp"], + local_include_dirs: ["include"], + shared_libs: [ + "libbase", + "libutils", + "libgrpc++", + "libprotobuf-cpp-full", + ], + whole_static_libs: [ + "wakeup_client_protos", + ], + cflags: [ + "-Wno-unused-parameter", + "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"", + "-DHOST", ], } diff --git a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h index 6b86b35933..4159e83366 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h +++ b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h @@ -34,11 +34,9 @@ namespace remoteaccess { // implementation, the task should come from remote task server. This class is thread-safe. class FakeTaskGenerator final { public: - GetRemoteTasksResponse generateTask(); + GetRemoteTasksResponse generateTask(const std::string& clientId); private: - // Simulates the client ID for each task. - std::atomic mCurrentClientId = 0; constexpr static uint8_t DATA[] = {0xde, 0xad, 0xbe, 0xef}; }; @@ -99,7 +97,7 @@ class TaskQueue final { void waitForTaskWithLock(std::unique_lock& lock); }; -class TestWakeupClientServiceImpl final : public WakeupClient::Service { +class TestWakeupClientServiceImpl : public WakeupClient::Service { public: TestWakeupClientServiceImpl(); @@ -112,25 +110,57 @@ class TestWakeupClientServiceImpl final : public WakeupClient::Service { const NotifyWakeupRequiredRequest* request, NotifyWakeupRequiredResponse* response) override; + /** + * Starts generating fake tasks for the specific client repeatedly. + * + * The fake task will have {0xDE 0xAD 0xBE 0xEF} as payload. A new fake task will be sent + * to the client every 5s. + */ + void startGeneratingFakeTask(const std::string& clientId); + /** + * stops generating fake tasks. + */ + void stopGeneratingFakeTask(); + /** + * Returns whether we need to wakeup the target device to send remote tasks. + */ + bool isWakeupRequired(); + /** + * Returns whether we have an active connection with the target device. + */ + bool isRemoteTaskConnectionAlive(); + /** + * Injects a fake task with taskData to be sent to the specific client. + */ + void injectTask(const std::string& taskData, const std::string& clientId); + /** + * Wakes up the target device. + * + * This must be implemented by child class and contains device specific logic. E.g. this might + * be sending QEMU commands for the emulator device. + */ + virtual void wakeupApplicationProcessor() = 0; + private: // This is a thread for communicating with remote wakeup server (via network) and receive tasks // from it. std::thread mThread; // A variable to notify server is stopping. - std::condition_variable mServerStoppedCv; + std::condition_variable mTaskLoopStoppedCv; // Whether wakeup AP is required for executing tasks. std::atomic mWakeupRequired = true; + // Whether we currently have an active long-live connection to deliver remote tasks. + std::atomic mRemoteTaskConnectionAlive = false; std::mutex mLock; - bool mServerStopped GUARDED_BY(mLock); + bool mGeneratingFakeTask GUARDED_BY(mLock); // Thread-safe. For test impl only. FakeTaskGenerator mFakeTaskGenerator; // Thread-sfae. TaskQueue mTaskQueue; - void fakeTaskGenerateLoop(); - - void wakeupApplicationProcessor(); + void fakeTaskGenerateLoop(const std::string& clientId); + void injectTaskResponse(const GetRemoteTasksResponse& response); }; } // namespace remoteaccess diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp index 7dcd31e3b4..eb3871b6e0 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp +++ b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp @@ -16,8 +16,6 @@ #include "TestWakeupClientServiceImpl.h" -#include "ApPowerControl.h" - #include #include #include @@ -44,12 +42,10 @@ constexpr int64_t KTaskTimeoutInMs = 20'000; } // namespace -GetRemoteTasksResponse FakeTaskGenerator::generateTask() { - int clientId = mCurrentClientId++; +GetRemoteTasksResponse FakeTaskGenerator::generateTask(const std::string& clientId) { GetRemoteTasksResponse response; - response.set_data(std::string(reinterpret_cast(DATA), sizeof(DATA))); - std::string clientIdStr = StringPrintf("%d", clientId); - response.set_clientid(clientIdStr); + response.set_data(reinterpret_cast(DATA), sizeof(DATA)); + response.set_clientid(clientId); return response; } @@ -165,38 +161,68 @@ void TaskQueue::handleTaskTimeout() { } } -TestWakeupClientServiceImpl::TestWakeupClientServiceImpl() { - mThread = std::thread([this] { fakeTaskGenerateLoop(); }); -} +TestWakeupClientServiceImpl::TestWakeupClientServiceImpl() {} TestWakeupClientServiceImpl::~TestWakeupClientServiceImpl() { + { std::lock_guard lockGuard(mLock); } + mTaskQueue.stopWait(); + stopGeneratingFakeTask(); +} + +void TestWakeupClientServiceImpl::injectTask(const std::string& taskData, + const std::string& clientId) { + GetRemoteTasksResponse response; + response.set_data(taskData); + response.set_clientid(clientId); + injectTaskResponse(response); +} + +void TestWakeupClientServiceImpl::injectTaskResponse(const GetRemoteTasksResponse& response) { + printf("Received a new task\n"); + mTaskQueue.add(response); + if (mWakeupRequired) { + wakeupApplicationProcessor(); + } +} + +void TestWakeupClientServiceImpl::startGeneratingFakeTask(const std::string& clientId) { + std::lock_guard lockGuard(mLock); + if (mGeneratingFakeTask) { + printf("Fake task is already being generated\n"); + return; + } + mGeneratingFakeTask = true; + mThread = std::thread([this, clientId] { fakeTaskGenerateLoop(clientId); }); + printf("Started generating fake tasks\n"); +} + +void TestWakeupClientServiceImpl::stopGeneratingFakeTask() { { std::lock_guard lockGuard(mLock); - mServerStopped = true; - mServerStoppedCv.notify_all(); + if (!mGeneratingFakeTask) { + printf("Fake task is not being generated, do nothing\n"); + return; + } + mTaskLoopStoppedCv.notify_all(); + mGeneratingFakeTask = false; } - mTaskQueue.stopWait(); if (mThread.joinable()) { mThread.join(); } + printf("Stopped generating fake tasks\n"); } -void TestWakeupClientServiceImpl::fakeTaskGenerateLoop() { +void TestWakeupClientServiceImpl::fakeTaskGenerateLoop(const std::string& clientId) { // In actual implementation, this should communicate with the remote server and receives tasks // from it. Here we simulate receiving one remote task every {kTaskIntervalInMs}ms. while (true) { - mTaskQueue.add(mFakeTaskGenerator.generateTask()); - printf("Received a new task\n"); - if (mWakeupRequired) { - wakeupApplicationProcessor(); - } - + injectTaskResponse(mFakeTaskGenerator.generateTask(clientId)); printf("Sleeping for %d seconds until next task\n", kTaskIntervalInMs); std::unique_lock lk(mLock); - if (mServerStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] { + if (mTaskLoopStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] { ScopedLockAssertion lockAssertion(mLock); - return mServerStopped; + return !mGeneratingFakeTask; })) { // If the stopped flag is set, we are quitting, exit the loop. return; @@ -208,6 +234,7 @@ Status TestWakeupClientServiceImpl::GetRemoteTasks(ServerContext* context, const GetRemoteTasksRequest* request, ServerWriter* writer) { printf("GetRemoteTasks called\n"); + mRemoteTaskConnectionAlive = true; while (true) { mTaskQueue.waitForTask(); @@ -226,16 +253,19 @@ Status TestWakeupClientServiceImpl::GetRemoteTasks(ServerContext* context, // The task failed to be sent, add it back to the queue. The order might change, but // it is okay. mTaskQueue.add(response); + mRemoteTaskConnectionAlive = false; return Status::CANCELLED; } } } + mRemoteTaskConnectionAlive = false; return Status::OK; } Status TestWakeupClientServiceImpl::NotifyWakeupRequired(ServerContext* context, const NotifyWakeupRequiredRequest* request, NotifyWakeupRequiredResponse* response) { + printf("NotifyWakeupRequired called\n"); if (request->iswakeuprequired() && !mWakeupRequired && !mTaskQueue.isEmpty()) { // If wakeup is now required and previously not required, this means we have finished // shutting down the device. If there are still pending tasks, try waking up AP again @@ -243,11 +273,20 @@ Status TestWakeupClientServiceImpl::NotifyWakeupRequired(ServerContext* context, wakeupApplicationProcessor(); } mWakeupRequired = request->iswakeuprequired(); + if (mWakeupRequired) { + // We won't know the connection is down unless we try to send a task over. If wakeup is + // required, the connection is very likely already down. + mRemoteTaskConnectionAlive = false; + } return Status::OK; } -void TestWakeupClientServiceImpl::wakeupApplicationProcessor() { - wakeupAp(); +bool TestWakeupClientServiceImpl::isWakeupRequired() { + return mWakeupRequired; +} + +bool TestWakeupClientServiceImpl::isRemoteTaskConnectionAlive() { + return mRemoteTaskConnectionAlive; } } // namespace remoteaccess diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp index d3f519cef7..be285a870e 100644 --- a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp +++ b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp @@ -14,7 +14,17 @@ * limitations under the License. */ +#include +#include +#include +#include +#include #include +#include + +#ifndef HOST +#include "ApPowerControl.h" +#endif // #ifndef HOST #include "TestWakeupClientServiceImpl.h" @@ -28,10 +38,18 @@ using ::grpc::Server; using ::grpc::ServerBuilder; using ::grpc::ServerWriter; -void RunServer(const std::string& serviceAddr) { - std::shared_ptr service = - std::make_unique(); +constexpr int SHUTDOWN_REQUEST = 289410889; +constexpr int VEHICLE_IN_USE = 287313738; +const char* COMMAND_RUN_EMU = "source ~/.aae-toolbox/bin/bashrc && aae emulator run"; +const char* COMMAND_SET_VHAL_PROP = + "adb -s emulator-5554 wait-for-device && adb -s emulator-5554 root " + "&& sleep 1 && adb -s emulator-5554 wait-for-device && adb -s emulator-5554 shell " + "dumpsys android.hardware.automotive.vehicle.IVehicle/default --set %d -i %d"; + +pid_t emuPid = 0; +void RunServer(const std::string& serviceAddr, + std::shared_ptr service) { ServerBuilder builder; builder.AddListeningPort(serviceAddr, grpc::InsecureServerCredentials()); builder.RegisterService(service.get()); @@ -40,11 +58,224 @@ void RunServer(const std::string& serviceAddr) { server->Wait(); } +pid_t runCommand(const char* bashCommand) { + pid_t pid = fork(); + if (pid == 0) { + // In child process. Put it into a separate process group so we can kill it. + setpgid(0, 0); + execl("/bin/bash", "bash", "-c", bashCommand, /*terminateArg=*/nullptr); + exit(0); + } else { + return pid; + } +} + +void updateEmuStatus() { + if (emuPid == 0) { + return; + } + pid_t pid = waitpid(emuPid, nullptr, WNOHANG); + if (pid == emuPid) { + // Emu process already exited. If Emu process is still running, pid will be 0. + emuPid = 0; + } +} + +bool powerOnEmu() { + updateEmuStatus(); + if (emuPid != 0) { + printf("The emulator is already running\n"); + return false; + } + emuPid = runCommand(COMMAND_RUN_EMU); + printf("Emulator started in process: %d\n", emuPid); + return true; +} + +bool powerOn() { +#ifdef HOST + return powerOnEmu(); +#else + printf("power on is only supported on host\n"); + return false; +#endif +} + +const char* getSetPropCommand(int propId) { + int size = snprintf(nullptr, 0, COMMAND_SET_VHAL_PROP, propId, 1); + char* command = new char[size + 1]; + snprintf(command, size + 1, COMMAND_SET_VHAL_PROP, propId, 1); + return command; +} + +void powerOffEmu() { + updateEmuStatus(); + if (emuPid == 0) { + printf("The emulator is not running\n"); + return; + } + const char* command = getSetPropCommand(SHUTDOWN_REQUEST); + runCommand(command); + delete[] command; + waitpid(emuPid, nullptr, /*options=*/0); + emuPid = 0; +} + +void powerOff() { +#ifdef HOST + powerOffEmu(); +#else + printf("power off is only supported on host\n"); +#endif +} + +void setVehicleInUse(bool vehicleInUse) { +#ifdef HOST + printf("Set vehicleInUse to %d\n", vehicleInUse); + int value = 0; + if (vehicleInUse) { + value = 1; + } + const char* command = getSetPropCommand(VEHICLE_IN_USE); + runCommand(command); + delete[] command; +#else + printf("set vehicleInUse is only supported on host\n"); +#endif +} + +void help() { + std::cout << "Remote Access Host Test Utility" << std::endl + << "help:\t" + << "Print out this help info" << std::endl + << "genFakeTask start [clientID]:\t" + << "Start generating a fake task every 5s" << std::endl + << "genFakeTask stop:\t" + << "Stop the fake task generation" << std::endl + << "status:\t" + << "Print current status" << std::endl + << "power on:\t" + << "Power on the emulator, simulate user enters vehicle while AP is off" + << " (only supported on host)" << std::endl + << "power off:\t" + << "Power off the emulator, simulate user leaves vehicle" + << " (only supported on host)" << std::endl + << "inject task [clientID] [taskData]:\t" + << "Inject a remote task" << std::endl + << "set vehicleInUse:\t" + << "Set vehicle in use, simulate user enter vehicle while boot up for remote task " + << "(only supported on host)" << std::endl; +} + +void parseCommand(const std::string& userInput, + std::shared_ptr service) { + if (userInput == "") { + // ignore empty line. + } else if (userInput == "help") { + help(); + } else if (userInput.rfind("genFakeTask start", 0) == 0) { + std::string clientId; + std::stringstream ss; + ss << userInput; + int i = 0; + while (std::getline(ss, clientId, ' ')) { + i++; + if (i == 3) { + break; + } + } + if (i != 3) { + printf("Missing clientId, see 'help'\n"); + return; + } + service->startGeneratingFakeTask(clientId); + } else if (userInput == "genFakeTask stop") { + service->stopGeneratingFakeTask(); + } else if (userInput == "status") { + printf("isWakeupRequired: %B, isRemoteTaskConnectionAlive: %B\n", + service->isWakeupRequired(), service->isRemoteTaskConnectionAlive()); + } else if (userInput == "power on") { + powerOn(); + } else if (userInput == "power off") { + powerOff(); + } else if (userInput.rfind("inject task", 0) == 0) { + std::stringstream ss; + ss << userInput; + std::string data; + std::string taskData; + std::string clientId; + int i = 0; + while (std::getline(ss, data, ' ')) { + i++; + if (i == 3) { + clientId = data; + } + if (i == 4) { + taskData = data; + } + } + if (taskData == "" || clientId == "") { + printf("Missing taskData or clientId, see 'help'\n"); + return; + } + service->injectTask(taskData, clientId); + printf("Remote task with client ID: %s, data: %s injected\n", clientId.c_str(), + taskData.c_str()); + } else if (userInput == "set vehicleInUse") { + setVehicleInUse(true); + } else { + printf("Unknown command, see 'help'\n"); + } +} + +void saHandler(int signum) { + if (emuPid != 0) { + kill(-emuPid, signum); + waitpid(emuPid, nullptr, /*options=*/0); + // Sleep for 1 seconds to allow emulator to print out logs. + sleep(1); + } + exit(-1); +} + +class MyTestWakeupClientServiceImpl final : public TestWakeupClientServiceImpl { + public: + void wakeupApplicationProcessor() override { +#ifdef HOST + if (powerOnEmu()) { + // If we wake up AP to execute remote task, vehicle in use should be false. + setVehicleInUse(false); + } +#else + wakeupAp(); +#endif + }; +}; + int main(int argc, char** argv) { std::string serviceAddr = GRPC_SERVICE_ADDRESS; if (argc > 1) { serviceAddr = argv[1]; } - RunServer(serviceAddr); + // Let the server thread run, we will force kill the server when we exit the program. + std::shared_ptr service = + std::make_shared(); + std::thread serverThread([serviceAddr, service] { RunServer(serviceAddr, service); }); + + // Register the signal handler for SIGTERM and SIGINT so that we can stop the emulator before + // exit. + struct sigaction sa = {}; + sigemptyset(&sa.sa_mask); + sa.sa_handler = saHandler; + sigaction(SIGTERM, &sa, nullptr); + sigaction(SIGINT, &sa, nullptr); + + // Start processing the user inputs. + std::string userInput; + while (true) { + std::cout << ">>> "; + std::getline(std::cin, userInput); + parseCommand(userInput, service); + } return 0; } diff --git a/automotive/remoteaccess/test_grpc_server/lib/Android.bp b/automotive/remoteaccess/test_grpc_server/lib/Android.bp index 7e95f53dfe..8391018a30 100644 --- a/automotive/remoteaccess/test_grpc_server/lib/Android.bp +++ b/automotive/remoteaccess/test_grpc_server/lib/Android.bp @@ -26,7 +26,7 @@ package { cc_library_shared { name: "ApPowerControlLib", vendor: true, - srcs: ["*.cpp"], + srcs: ["ApPowerControl.cpp"], local_include_dirs: ["."], export_include_dirs: ["."], } diff --git a/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp new file mode 100644 index 0000000000..a475b00ecf --- /dev/null +++ b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ApPowerControl.h" + +#include + +void wakeupAp() { + printf("Waking up application processor...\n"); +} -- GitLab From 2fd9496ecd4fc432f103ccd73625aed4b7cec5c0 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 21 Aug 2023 19:46:23 -0700 Subject: [PATCH 117/376] Use AIDL for test vendor properties. Use AIDL enum instead of hard coding the test vendor property definitions so that we don't have to duplicate the value among VHAL and the clients. This also shows how vendor can uses a custom AIDL enum to define vendor properties. Test: atest FakeVehicleHardwareTest Bug: 296913406 Change-Id: Ief889b86bfbef136f8afd4a4f49405f2213b441c --- .../JsonConfigLoader/Android.bp | 7 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 54 ++++--- .../default_config/config/TestProperties.json | 28 ++-- .../config/VendorClusterTestProperties.json | 10 +- .../aidl/impl/fake_impl/hardware/Android.bp | 7 +- .../hardware/src/FakeVehicleHardware.cpp | 25 ++- .../impl/fake_impl/hardware/test/Android.bp | 11 +- .../hardware/test/FakeVehicleHardwareTest.cpp | 27 ++-- automotive/vehicle/aidl/impl/utils/README.md | 4 +- .../impl/utils/common/include/PropertyUtils.h | 16 -- .../aidl/impl/utils/common/test/Android.bp | 1 - .../utils/common/test/VehicleUtilsTest.cpp | 4 +- .../utils/test/include/TestPropertyUtils.h | 105 ------------- .../Android.bp | 16 +- .../vehicle/TestVendorProperty.aidl | 145 ++++++++++++++++++ 15 files changed, 258 insertions(+), 202 deletions(-) delete mode 100644 automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h rename automotive/vehicle/aidl/impl/utils/{test => test_vendor_properties}/Android.bp (68%) create mode 100644 automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp index 6984d5e2d5..75a3541cdd 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp @@ -35,14 +35,17 @@ cc_library { cc_library { name: "VehicleHalJsonConfigLoaderEnableTestProperties", vendor: true, - srcs: ["src/*.cpp"], + srcs: [ + "src/*.cpp", + ":VhalTestVendorProperties", + ], local_include_dirs: ["include"], export_include_dirs: ["include"], defaults: ["VehicleHalDefaults"], static_libs: ["VehicleHalUtils"], header_libs: [ - "VehicleHalTestUtilHeaders", "IVehicleGeneratedHeaders", + "libbinder_headers", ], cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], shared_libs: ["libjsoncpp"], diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 0a1f90414e..39ce10e64d 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -21,7 +21,7 @@ #include #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES -#include +#include #endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES #include @@ -91,10 +91,6 @@ const std::unordered_map CONSTANTS_BY_NAME = { {"HVAC_ALL", HVAC_ALL}, {"HVAC_LEFT", HVAC_LEFT}, {"HVAC_RIGHT", HVAC_RIGHT}, - {"VENDOR_EXTENSION_INT_PROPERTY", VENDOR_EXTENSION_INT_PROPERTY}, - {"VENDOR_EXTENSION_BOOLEAN_PROPERTY", VENDOR_EXTENSION_BOOLEAN_PROPERTY}, - {"VENDOR_EXTENSION_STRING_PROPERTY", VENDOR_EXTENSION_STRING_PROPERTY}, - {"VENDOR_EXTENSION_FLOAT_PROPERTY", VENDOR_EXTENSION_FLOAT_PROPERTY}, {"WINDOW_1_LEFT", WINDOW_1_LEFT}, {"WINDOW_1_RIGHT", WINDOW_1_RIGHT}, {"WINDOW_2_LEFT", WINDOW_2_LEFT}, @@ -133,24 +129,9 @@ const std::unordered_map CONSTANTS_BY_NAME = { {"EV_STOPPING_MODE_HOLD", EV_STOPPING_MODE_HOLD}, {"MIRROR_DRIVER_LEFT_RIGHT", toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)}, -#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES - // Following are test properties: - {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES}, - {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID}, - {"kMixedTypePropertyForTest", kMixedTypePropertyForTest}, - {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE}, - {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY}, - {"VENDOR_CLUSTER_SWITCH_UI", VENDOR_CLUSTER_SWITCH_UI}, - {"VENDOR_CLUSTER_DISPLAY_STATE", VENDOR_CLUSTER_DISPLAY_STATE}, - {"VENDOR_CLUSTER_REPORT_STATE", VENDOR_CLUSTER_REPORT_STATE}, - {"PLACEHOLDER_PROPERTY_INT", PLACEHOLDER_PROPERTY_INT}, - {"PLACEHOLDER_PROPERTY_FLOAT", PLACEHOLDER_PROPERTY_FLOAT}, - {"PLACEHOLDER_PROPERTY_BOOLEAN", PLACEHOLDER_PROPERTY_BOOLEAN}, - {"PLACEHOLDER_PROPERTY_STRING", PLACEHOLDER_PROPERTY_STRING} -#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES }; -// A class to parse constant values for type T. +// A class to parse constant values for type T where T is defined as an enum in NDK AIDL backend. template class ConstantParser final : public ConstantParserInterface { public: @@ -181,6 +162,33 @@ class ConstantParser final : public ConstantParserInterface { std::unordered_map mValueByName; }; +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES +// A class to parse constant values for type T where T is defined as an enum in CPP AIDL backend. +template +class CppConstantParser final : public ConstantParserInterface { + public: + CppConstantParser() { + for (const T& v : android::enum_range()) { + std::string name = android::hardware::automotive::vehicle::toString(v); + mValueByName[name] = toInt(v); + } + } + + ~CppConstantParser() = default; + + Result parseValue(const std::string& name) const override { + auto it = mValueByName.find(name); + if (it == mValueByName.end()) { + return Error() << "Constant name: " << name << " is not defined"; + } + return it->second; + } + + private: + std::unordered_map mValueByName; +}; +#endif + // A class to parse constant values defined in CONSTANTS_BY_NAME map. class LocalVariableParser final : public ConstantParserInterface { public: @@ -260,6 +268,10 @@ JsonValueParser::JsonValueParser() { mConstantParsersByType["LaneCenteringAssistState"] = std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); +#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES + mConstantParsersByType["TestVendorProperty"] = + std::make_unique>(); +#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES } template <> diff --git a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json index fd4b0026bd..73e4d44d0c 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json @@ -1,7 +1,7 @@ { "properties": [ { - "property": "Constants::kMixedTypePropertyForTest", + "property": "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST", "defaultValue": { "floatValues": [ 4.5 @@ -28,7 +28,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_EXTENSION_BOOLEAN_PROPERTY", + "property": "TestVendorProperty::VENDOR_EXTENSION_BOOLEAN_PROPERTY", "areas": [ { "defaultValue": { @@ -67,7 +67,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY", + "property": "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY", "areas": [ { "defaultValue": { @@ -94,7 +94,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_EXTENSION_INT_PROPERTY", + "property": "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY", "areas": [ { "defaultValue": { @@ -131,7 +131,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_EXTENSION_STRING_PROPERTY", + "property": "TestVendorProperty::VENDOR_EXTENSION_STRING_PROPERTY", "defaultValue": { "stringValue": "Vendor String Property" }, @@ -139,7 +139,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::PLACEHOLDER_PROPERTY_INT", + "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_INT", "defaultValue": { "int32Values": [ 0 @@ -149,7 +149,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::PLACEHOLDER_PROPERTY_FLOAT", + "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_FLOAT", "defaultValue": { "floatValues": [ 0.0 @@ -159,7 +159,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::PLACEHOLDER_PROPERTY_BOOLEAN", + "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_BOOLEAN", "defaultValue": { "int32Values": [ 0 @@ -169,7 +169,7 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::PLACEHOLDER_PROPERTY_STRING", + "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_STRING", "defaultValue": { "stringValue": "Test" }, @@ -177,12 +177,12 @@ "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::ECHO_REVERSE_BYTES", + "property": "TestVendorProperty::ECHO_REVERSE_BYTES", "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_PROPERTY_ID", + "property": "TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING", "access": "VehiclePropertyAccess::READ_WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, @@ -194,13 +194,13 @@ ] }, "configArray": [ - "Constants::kMixedTypePropertyForTest", + "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST", "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO", "VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO", - "Constants::VENDOR_EXTENSION_INT_PROPERTY", + "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY", "VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT", "VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE", - "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY", + "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY", "VehicleVendorPermission::PERMISSION_DEFAULT", "VehicleVendorPermission::PERMISSION_DEFAULT" ] diff --git a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json index 3a1a783b84..8c2bc93e1c 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json @@ -1,17 +1,17 @@ { "properties": [ { - "property": "Constants::VENDOR_CLUSTER_SWITCH_UI", + "property": "TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI", "access": "VehiclePropertyAccess::WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_CLUSTER_DISPLAY_STATE", + "property": "TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE", "access": "VehiclePropertyAccess::WRITE", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" }, { - "property": "Constants::VENDOR_CLUSTER_REPORT_STATE", + "property": "TestVendorProperty::VENDOR_CLUSTER_REPORT_STATE", "defaultValue": { "int32Values": [ 0, @@ -44,7 +44,7 @@ "Value means 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */, 0 /* ClusterHome */, -1 /* ClusterNone */" }, { - "property": "Constants::VENDOR_CLUSTER_REQUEST_DISPLAY", + "property": "TestVendorProperty::VENDOR_CLUSTER_REQUEST_DISPLAY", "defaultValue": { "int32Values": [ 0 @@ -55,7 +55,7 @@ "comment": "0 means ClusterHome" }, { - "property": "Constants::VENDOR_CLUSTER_NAVIGATION_STATE", + "property": "TestVendorProperty::VENDOR_CLUSTER_NAVIGATION_STATE", "access": "VehiclePropertyAccess::READ", "changeMode": "VehiclePropertyChangeMode::ON_CHANGE" } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp index 4c17cded42..e75f6485b8 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp @@ -21,7 +21,10 @@ package { cc_library { name: "FakeVehicleHardware", vendor: true, - srcs: ["src/*.cpp"], + srcs: [ + "src/*.cpp", + ":VhalTestVendorProperties", + ], local_include_dirs: ["include"], export_include_dirs: ["include"], cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], @@ -35,7 +38,7 @@ cc_defaults { name: "FakeVehicleHardwareDefaults", header_libs: [ "IVehicleHardware", - "VehicleHalTestUtilHeaders", + "libbinder_headers", ], export_header_lib_headers: ["IVehicleHardware"], static_libs: [ diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index efd7f8e6a3..82c3ea072e 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +63,7 @@ using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; +using ::aidl::android::hardware::automotive::vehicle::VehicleArea; using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; @@ -87,14 +88,12 @@ using ::android::base::StringPrintf; // getPropertiesAsync, and setPropertiesAsync. // 0x21403000 constexpr int32_t STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST = - 0x3000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::INT32); + 0x3000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) | + toInt(VehiclePropertyType::INT32); // 0x21405000 constexpr int32_t ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST = - 0x5000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::INT32); + 0x5000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) | + toInt(VehiclePropertyType::INT32); // The directory for default property configuration file. // For config file format, see impl/default_config/config/README.md. constexpr char DEFAULT_CONFIG_DIR[] = "/vendor/etc/automotive/vhalconfig/"; @@ -105,7 +104,7 @@ constexpr char OVERRIDE_CONFIG_DIR[] = "/vendor/etc/automotive/vhaloverride/"; // overwrite the default configs. constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override"; constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config"; -// The value to be returned if VENDOR_PROPERTY_ID is set as the property +// The value to be returned if VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING is set as the property constexpr int VENDOR_ERROR_CODE = 0x00ab0005; // A list of supported options for "--set" command. const std::unordered_set SET_PROP_OPTIONS = { @@ -668,10 +667,10 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue( result.value()->timestamp = elapsedRealtimeNano(); } return result; - case ECHO_REVERSE_BYTES: + case toInt(TestVendorProperty::ECHO_REVERSE_BYTES): *isSpecialValue = true; return getEchoReverseBytes(value); - case VENDOR_PROPERTY_ID: + case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING): *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); case toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED): @@ -835,7 +834,7 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case OBD2_FREEZE_FRAME_CLEAR: *isSpecialValue = true; return mFakeObd2Frame->clearObd2FreezeFrames(value); - case VENDOR_PROPERTY_ID: + case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING): *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); case toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION): @@ -900,9 +899,9 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu [[fallthrough]]; case toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE): [[fallthrough]]; - case VENDOR_CLUSTER_SWITCH_UI: + case toInt(TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI): [[fallthrough]]; - case VENDOR_CLUSTER_DISPLAY_STATE: + case toInt(TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE): *isSpecialValue = true; updatedValue = mValuePool->obtain(getPropType(value.prop)); updatedValue->prop = value.prop & ~toInt(VehiclePropertyGroup::MASK); diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp index 8d8fcf5908..b763d2f55d 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp @@ -21,11 +21,14 @@ package { cc_test { name: "FakeVehicleHardwareTest", vendor: true, - srcs: ["*.cpp"], + srcs: [ + "*.cpp", + ":VhalTestVendorProperties", + ], cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"], header_libs: [ "IVehicleHardware", - "VehicleHalTestUtilHeaders", + "libbinder_headers", ], static_libs: [ "VehicleHalJsonConfigLoaderEnableTestProperties", @@ -47,7 +50,9 @@ cc_test { ":FakeVehicleHardwareTestOverrideJson", ":FakeVehicleHardwareTestPropJson", ], - defaults: ["VehicleHalDefaults"], + defaults: [ + "VehicleHalDefaults", + ], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index a77d565d6e..6cc06bc3ac 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -19,9 +19,9 @@ #include #include #include -#include #include +#include #include #include @@ -429,13 +429,13 @@ TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { continue; } - if (propId == ECHO_REVERSE_BYTES) { + if (propId == toInt(TestVendorProperty::ECHO_REVERSE_BYTES)) { // Ignore ECHO_REVERSE_BYTES, it has special logic. continue; } - if (propId == VENDOR_PROPERTY_ID) { - // Ignore VENDOR_PROPERTY_ID, it has special logic. + if (propId == toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING)) { + // Ignore VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING, it has special logic. continue; } @@ -968,7 +968,8 @@ std::vector setSpecialValueTestCases() { .expectedValuesToGet = { VehiclePropValue{ - .prop = VENDOR_CLUSTER_REPORT_STATE, + .prop = toInt(TestVendorProperty:: + VENDOR_CLUSTER_REPORT_STATE), .value.int32Values = {1}, }, }, @@ -985,7 +986,8 @@ std::vector setSpecialValueTestCases() { .expectedValuesToGet = { VehiclePropValue{ - .prop = VENDOR_CLUSTER_REQUEST_DISPLAY, + .prop = toInt(TestVendorProperty:: + VENDOR_CLUSTER_REQUEST_DISPLAY), .value.int32Values = {1}, }, }, @@ -1003,7 +1005,8 @@ std::vector setSpecialValueTestCases() { .expectedValuesToGet = { VehiclePropValue{ - .prop = VENDOR_CLUSTER_NAVIGATION_STATE, + .prop = toInt(TestVendorProperty:: + VENDOR_CLUSTER_NAVIGATION_STATE), .value.byteValues = {0x1}, }, }, @@ -1013,7 +1016,8 @@ std::vector setSpecialValueTestCases() { .valuesToSet = { VehiclePropValue{ - .prop = VENDOR_CLUSTER_SWITCH_UI, + .prop = toInt( + TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI), .value.int32Values = {1}, }, }, @@ -1030,7 +1034,8 @@ std::vector setSpecialValueTestCases() { .valuesToSet = { VehiclePropValue{ - .prop = VENDOR_CLUSTER_DISPLAY_STATE, + .prop = toInt(TestVendorProperty:: + VENDOR_CLUSTER_DISPLAY_STATE), .value.int32Values = {1, 2}, }, }, @@ -2928,7 +2933,7 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) { TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { ASSERT_EQ(setValue(VehiclePropValue{ - .prop = ECHO_REVERSE_BYTES, + .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES), .value = { .byteValues = {0x01, 0x02, 0x03, 0x04}, @@ -2937,7 +2942,7 @@ TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { StatusCode::OK); auto result = getValue(VehiclePropValue{ - .prop = ECHO_REVERSE_BYTES, + .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES), }); ASSERT_TRUE(result.ok()) << "failed to get ECHO_REVERSE_BYTES value: " << getStatus(result); diff --git a/automotive/vehicle/aidl/impl/utils/README.md b/automotive/vehicle/aidl/impl/utils/README.md index 87bb7e3034..255131ddc1 100644 --- a/automotive/vehicle/aidl/impl/utils/README.md +++ b/automotive/vehicle/aidl/impl/utils/README.md @@ -57,6 +57,6 @@ delete and lookup. Defines many useful utility functions. -## test +## test_vendor_properties -Defines utility libraries for test only. +Contains vendor properties used for testing purpose in reference VHAL. diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h index 7275ba30f9..e41ec3074c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h @@ -77,22 +77,6 @@ constexpr int SEAT_1_RIGHT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_1_RI constexpr int SEAT_2_LEFT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_LEFT); constexpr int SEAT_2_RIGHT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_RIGHT); constexpr int SEAT_2_CENTER = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_CENTER); -constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY = - 0x101 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(propertyutils_impl::VehiclePropertyType::BOOLEAN) | - toInt(propertyutils_impl::VehicleArea::DOOR); -constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY = - 0x102 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(propertyutils_impl::VehiclePropertyType::FLOAT) | - toInt(propertyutils_impl::VehicleArea::SEAT); -constexpr int VENDOR_EXTENSION_INT_PROPERTY = - 0x103 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(propertyutils_impl::VehiclePropertyType::INT32) | - toInt(propertyutils_impl::VehicleArea::WINDOW); -constexpr int VENDOR_EXTENSION_STRING_PROPERTY = - 0x104 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(propertyutils_impl::VehiclePropertyType::STRING) | - toInt(propertyutils_impl::VehicleArea::GLOBAL); constexpr int FUEL_DOOR_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT); constexpr int CHARGE_PORT_FRONT_LEFT = toInt(propertyutils_impl::PortLocationType::FRONT_LEFT); constexpr int CHARGE_PORT_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp index 250b33135b..dd43712558 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp @@ -27,7 +27,6 @@ cc_test { "libgtest", "libgmock", ], - header_libs: ["VehicleHalTestUtilHeaders"], defaults: ["VehicleHalDefaults"], test_suites: ["device-tests"], } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp index 411539b38f..9abb2a2fe6 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -56,6 +55,9 @@ constexpr int32_t int64Prop = toInt(VehicleProperty::ANDROID_EPOCH_TIME); constexpr int32_t int64VecProp = toInt(VehicleProperty::WHEEL_TICK); constexpr int32_t floatProp = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE); constexpr int32_t floatVecProp = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION); +constexpr int32_t kMixedTypePropertyForTest = 0x1111 | toInt(VehiclePropertyGroup::VENDOR) | + toInt(VehicleArea::GLOBAL) | + toInt(VehiclePropertyType::MIXED); std::vector getInvalidPropValuesTestCases() { return std::vector( diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h deleted file mode 100644 index 14002884f5..0000000000 --- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_ -#define android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_ - -#include -#include - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { - -namespace testpropertyutils_impl { - -// These names are not part of the API since we only expose ints. -using ::aidl::android::hardware::automotive::vehicle::VehicleArea; -using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; -using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; - -} // namespace testpropertyutils_impl - -// Converts the system property to the vendor property. -// WARNING: This is only for the end-to-end testing, Should NOT include in the user build. -inline constexpr int32_t toVendor( - const aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) { - return (toInt(prop) & ~toInt(testpropertyutils_impl::VehiclePropertyGroup::MASK)) | - toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR); -} - -// These properties are used for the end-to-end testing of ClusterHomeService. -constexpr int32_t VENDOR_CLUSTER_SWITCH_UI = - toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_SWITCH_UI); -constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE = - toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_DISPLAY_STATE); -constexpr int32_t VENDOR_CLUSTER_REPORT_STATE = - toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REPORT_STATE); -constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY = - toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REQUEST_DISPLAY); -constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE = - toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_NAVIGATION_STATE); - -// These properties are placeholder properties for developers to test new features without -// implementing a real property. -constexpr int32_t PLACEHOLDER_PROPERTY_INT = - 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::INT32); -constexpr int32_t PLACEHOLDER_PROPERTY_FLOAT = - 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::FLOAT); -constexpr int32_t PLACEHOLDER_PROPERTY_BOOLEAN = - 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::BOOLEAN); -constexpr int32_t PLACEHOLDER_PROPERTY_STRING = - 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::STRING); - -// This property is used for testing LargeParcelable marshalling/unmarhsalling end to end. -// It acts as an regular property that stores the property value when setting and return the value -// when getting, except that all the byteValues used in the setValue response would be filled in -// the reverse order. -// 0x21702a12 -constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 | - toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::BYTES); - -// This property is used for testing vendor error codes end to end. -// 0x21402a13 -constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 | - toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::INT32); - -// This property is used for test purpose. End to end tests use this property to test set and get -// method for MIXED type properties. -constexpr int32_t kMixedTypePropertyForTest = - 0x1111 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) | - toInt(testpropertyutils_impl::VehicleArea::GLOBAL) | - toInt(testpropertyutils_impl::VehiclePropertyType::MIXED); -} // namespace vehicle -} // namespace automotive -} // namespace hardware -} // namespace android - -#endif // android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_ diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp similarity index 68% rename from automotive/vehicle/aidl/impl/utils/test/Android.bp rename to automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp index ad9954fbf2..62c89acff8 100644 --- a/automotive/vehicle/aidl/impl/utils/test/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,13 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -cc_library_headers { - name: "VehicleHalTestUtilHeaders", - vendor: true, - header_libs: ["VehicleHalUtilHeaders"], - export_include_dirs: ["include"], +filegroup { + name: "VhalTestVendorProperties", + srcs: [ + "**/*.aidl", + ], + visibility: [ + "//hardware/interfaces/automotive/vehicle/aidl:__subpackages__", + "//packages/services/Car:__subpackages__", + ], } diff --git a/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl new file mode 100644 index 0000000000..3c877fa1ce --- /dev/null +++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Test vendor properties used in reference VHAL implementation. + */ +@Backing(type="int") +enum TestVendorProperty { + + /** + * Vendor version of CLUSTER_SWITCH_UI, used for the end-to-end testing of ClusterHomeService. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32, + */ + VENDOR_CLUSTER_SWITCH_UI = 0x0F34 + 0x20000000 + 0x01000000 + 0x00400000, + + /** + * Vendor version of CLUSTER_DISPLAY_STATE, used for the end-to-end testing of + * ClusterHomeService. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32_VEC + */ + VENDOR_CLUSTER_DISPLAY_STATE = 0x0F35 + 0x20000000 + 0x01000000 + 0x00410000, + + /** + * Vendor version of CLUSTER_REPORT_STATE, used for the end-to-end testing of + * ClusterHomeService. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED + */ + VENDOR_CLUSTER_REPORT_STATE = 0x0F36 + 0x20000000 + 0x01000000 + 0x00E00000, + + /** + * Vendor version of CLUSTER_REQUEST_DISPLAY, used for the end-to-end testing of + * ClusterHomeService. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32 + */ + VENDOR_CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x20000000 + 0x01000000 + 0x00400000, + + /** + * Vendor version of CLUSTER_NAVIGATION_STATE, used for the end-to-end testing of + * ClusterHomeService. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES + */ + VENDOR_CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x20000000 + 0x01000000 + 0x00700000, + + // These properties are placeholder properties for developers to test new features without + // implementing a real property. + + /** + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32 + */ + PLACEHOLDER_PROPERTY_INT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00400000, + + /** + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.FLOAT + */ + PLACEHOLDER_PROPERTY_FLOAT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00600000, + + /** + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BOOLEAN + */ + PLACEHOLDER_PROPERTY_BOOLEAN = 0x2A11 + 0x20000000 + 0x01000000 + 0x00200000, + + /** + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.STRING + */ + PLACEHOLDER_PROPERTY_STRING = 0x2A11 + 0x20000000 + 0x01000000 + 0x00100000, + + /** + * This property is used for testing LargeParcelable marshalling/unmarhsalling end to end. + * It acts as an regular property that stores the property value when setting and return the + * value when getting, except that all the byteValues used in the setValue response would be + * filled in the reverse order. + * + * This is used in {@code VehicleHalLargeParcelableTest}. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES + * + * 0x21702a12 + */ + ECHO_REVERSE_BYTES = 0x2A12 + 0x20000000 + 0x01000000 + 0x00700000, + + /** + * This property is used for testing vendor error codes end to end. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32 + * + * 0x21402a13 + */ + VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING = 0x2A13 + 0x20000000 + 0x01000000 + 0x00400000, + + /** + * This property is used for test purpose. End to end tests use this property to test set and + * get method for MIXED type properties. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED + */ + MIXED_TYPE_PROPERTY_FOR_TEST = 0x1111 + 0x20000000 + 0x01000000 + 0x00E00000, + + /** + * Property used for {@code CarVendorPropertyCustomPermissionTest}. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.DOOR | VehiclePropertyGroup.BOOLEAN + */ + VENDOR_EXTENSION_BOOLEAN_PROPERTY = 0x0101 + 0x20000000 + 0x06000000 + 0x00200000, + + /** + * Property used for {@code CarVendorPropertyCustomPermissionTest}. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.SEAT | VehiclePropertyGroup.FLOAT + */ + VENDOR_EXTENSION_FLOAT_PROPERTY = 0x102 + 0x20000000 + 0x05000000 + 0x00600000, + + /** + * Property used for {@code CarVendorPropertyCustomPermissionTest}. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.WINDOW | VehiclePropertyGroup.INT32 + */ + VENDOR_EXTENSION_INT_PROPERTY = 0x103 + 0x20000000 + 0x03000000 + 0x00400000, + + /** + * Property used for {@code CarVendorPropertyCustomPermissionTest}. + * + * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.STRING + */ + VENDOR_EXTENSION_STRING_PROPERTY = 0x103 + 0x20000000 + 0x01000000 + 0x00100000, +} -- GitLab From 8cb81f70ecb0716adf7ff59a50f10192e517f73e Mon Sep 17 00:00:00 2001 From: Zhanghao Date: Tue, 8 Aug 2023 19:23:12 -0400 Subject: [PATCH 118/376] Update javadocs for RINEX4.0 Update the Javadocs based on doc:https://docs.google.com/document/d/1SliduwZ8TlV5kMDZpxM5CUg-Txsw3IxBe8JTnr_ZOl0/edit?resourcekey=0-HTfqV3iJLkQtaMp_lsy3Vg Test: Change Javadoc only. Bug: 277260039 Change-Id: Idb0f83885b3183812d54f6ec79da590c03c05b10 --- .../compatibility_matrix.9.xml | 2 +- gnss/1.1/default/Android.bp | 2 +- gnss/1.1/vts/functional/Android.bp | 2 +- gnss/2.0/default/Android.bp | 2 +- gnss/2.0/vts/functional/Android.bp | 2 +- gnss/2.1/default/Android.bp | 2 +- gnss/2.1/vts/functional/Android.bp | 2 +- gnss/aidl/Android.bp | 2 +- .../hardware/gnss/ElapsedRealtime.aidl | 4 +- .../android/hardware/gnss/GnssClock.aidl | 14 ++-- .../android/hardware/gnss/GnssLocation.aidl | 16 ++--- .../hardware/gnss/GnssMeasurement.aidl | 66 +++++++++---------- .../android/hardware/gnss/GnssSignalType.aidl | 1 + .../android/hardware/gnss/IAGnssRil.aidl | 4 +- .../current/android/hardware/gnss/IGnss.aidl | 26 ++++---- .../android/hardware/gnss/IGnssBatching.aidl | 2 +- .../android/hardware/gnss/IGnssCallback.aidl | 40 +++++------ .../hardware/gnss/IGnssConfiguration.aidl | 14 ++-- .../hardware/gnss/IGnssGeofenceCallback.aidl | 20 +++--- .../gnss/IGnssNavigationMessageCallback.aidl | 32 ++++----- .../gnss/IGnssPowerIndicationCallback.aidl | 12 ++-- .../android/hardware/gnss/SatellitePvt.aidl | 6 +- .../IMeasurementCorrectionsCallback.aidl | 6 +- .../SingleSatCorrection.aidl | 16 ++--- .../android/hardware/gnss/GnssSignalType.aidl | 46 ++++++++----- gnss/aidl/default/Android.bp | 2 +- gnss/aidl/default/gnss-default.xml | 2 +- gnss/aidl/vts/Android.bp | 2 +- gnss/common/utils/default/Android.bp | 2 +- gnss/common/utils/vts/Android.bp | 2 +- 30 files changed, 184 insertions(+), 167 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 0928f1489f..cf72202655 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -216,7 +216,7 @@ android.hardware.gnss - 2-3 + 2-4 IGnss default diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp index 300e8de3af..697cb91f4f 100644 --- a/gnss/1.1/default/Android.bp +++ b/gnss/1.1/default/Android.bp @@ -27,7 +27,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V3-ndk", + "android.hardware.gnss-V4-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp index 2414cbc4aa..f9fcbf1f51 100644 --- a/gnss/1.1/vts/functional/Android.bp +++ b/gnss/1.1/vts/functional/Android.bp @@ -36,7 +36,7 @@ cc_test { "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V3-cpp", + "android.hardware.gnss-V4-cpp", ], shared_libs: [ "android.hardware.gnss.measurement_corrections@1.0", diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp index 83bc2cc903..35c2e376ac 100644 --- a/gnss/2.0/default/Android.bp +++ b/gnss/2.0/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss@2.0", "android.hardware.gnss@1.1", "android.hardware.gnss@1.0", - "android.hardware.gnss-V3-ndk", + "android.hardware.gnss-V4-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp index e8db8862d2..0b543086d5 100644 --- a/gnss/2.0/vts/functional/Android.bp +++ b/gnss/2.0/vts/functional/Android.bp @@ -39,7 +39,7 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V3-cpp", + "android.hardware.gnss-V4-cpp", ], test_suites: [ "general-tests", diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp index 4a4ce544ae..1bb7512113 100644 --- a/gnss/2.1/default/Android.bp +++ b/gnss/2.1/default/Android.bp @@ -44,7 +44,7 @@ cc_binary { "android.hardware.gnss@1.0", "android.hardware.gnss@1.1", "android.hardware.gnss@2.0", - "android.hardware.gnss-V3-ndk", + "android.hardware.gnss-V4-ndk", ], static_libs: [ "android.hardware.gnss@common-default-lib", diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp index 76f9d07964..9906b276a0 100644 --- a/gnss/2.1/vts/functional/Android.bp +++ b/gnss/2.1/vts/functional/Android.bp @@ -40,7 +40,7 @@ cc_test { "android.hardware.gnss@2.0", "android.hardware.gnss@2.1", "android.hardware.gnss@common-vts-lib", - "android.hardware.gnss-V3-cpp", + "android.hardware.gnss-V4-cpp", ], shared_libs: [ "libvintf", diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp index cb2c001612..611c7e0683 100644 --- a/gnss/aidl/Android.bp +++ b/gnss/aidl/Android.bp @@ -52,6 +52,6 @@ aidl_interface { }, ], - frozen: true, + frozen: false, } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl index 559ed2915f..5d7f51e342 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl @@ -38,6 +38,6 @@ parcelable ElapsedRealtime { int flags; long timestampNs; double timeUncertaintyNs; - const int HAS_TIMESTAMP_NS = 1; - const int HAS_TIME_UNCERTAINTY_NS = 2; + const int HAS_TIMESTAMP_NS = (1 << 0) /* 1 */; + const int HAS_TIME_UNCERTAINTY_NS = (1 << 1) /* 2 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl index a8454ddfc0..63edd44a19 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl @@ -46,11 +46,11 @@ parcelable GnssClock { double driftUncertaintyNsps; int hwClockDiscontinuityCount; android.hardware.gnss.GnssSignalType referenceSignalTypeForIsb; - const int HAS_LEAP_SECOND = 1; - const int HAS_TIME_UNCERTAINTY = 2; - const int HAS_FULL_BIAS = 4; - const int HAS_BIAS = 8; - const int HAS_BIAS_UNCERTAINTY = 16; - const int HAS_DRIFT = 32; - const int HAS_DRIFT_UNCERTAINTY = 64; + const int HAS_LEAP_SECOND = (1 << 0) /* 1 */; + const int HAS_TIME_UNCERTAINTY = (1 << 1) /* 2 */; + const int HAS_FULL_BIAS = (1 << 2) /* 4 */; + const int HAS_BIAS = (1 << 3) /* 8 */; + const int HAS_BIAS_UNCERTAINTY = (1 << 4) /* 16 */; + const int HAS_DRIFT = (1 << 5) /* 32 */; + const int HAS_DRIFT_UNCERTAINTY = (1 << 6) /* 64 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl index ed9dcfa967..e64d98a297 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl @@ -47,12 +47,12 @@ parcelable GnssLocation { double bearingAccuracyDegrees; long timestampMillis; android.hardware.gnss.ElapsedRealtime elapsedRealtime; - const int HAS_LAT_LONG = 1; - const int HAS_ALTITUDE = 2; - const int HAS_SPEED = 4; - const int HAS_BEARING = 8; - const int HAS_HORIZONTAL_ACCURACY = 16; - const int HAS_VERTICAL_ACCURACY = 32; - const int HAS_SPEED_ACCURACY = 64; - const int HAS_BEARING_ACCURACY = 128; + const int HAS_LAT_LONG = 0x0001; + const int HAS_ALTITUDE = 0x0002; + const int HAS_SPEED = 0x0004; + const int HAS_BEARING = 0x0008; + const int HAS_HORIZONTAL_ACCURACY = 0x0010; + const int HAS_VERTICAL_ACCURACY = 0x0020; + const int HAS_SPEED_ACCURACY = 0x0040; + const int HAS_BEARING_ACCURACY = 0x0080; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl index 8a44887419..a2594af99a 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl @@ -61,39 +61,39 @@ parcelable GnssMeasurement { double satelliteInterSignalBiasUncertaintyNs; android.hardware.gnss.SatellitePvt satellitePvt; android.hardware.gnss.CorrelationVector[] correlationVectors; - const int HAS_SNR = 1; - const int HAS_CARRIER_FREQUENCY = 512; - const int HAS_CARRIER_CYCLES = 1024; - const int HAS_CARRIER_PHASE = 2048; - const int HAS_CARRIER_PHASE_UNCERTAINTY = 4096; - const int HAS_AUTOMATIC_GAIN_CONTROL = 8192; - const int HAS_FULL_ISB = 65536; - const int HAS_FULL_ISB_UNCERTAINTY = 131072; - const int HAS_SATELLITE_ISB = 262144; - const int HAS_SATELLITE_ISB_UNCERTAINTY = 524288; - const int HAS_SATELLITE_PVT = 1048576; - const int HAS_CORRELATION_VECTOR = 2097152; + const int HAS_SNR = (1 << 0) /* 1 */; + const int HAS_CARRIER_FREQUENCY = (1 << 9) /* 512 */; + const int HAS_CARRIER_CYCLES = (1 << 10) /* 1024 */; + const int HAS_CARRIER_PHASE = (1 << 11) /* 2048 */; + const int HAS_CARRIER_PHASE_UNCERTAINTY = (1 << 12) /* 4096 */; + const int HAS_AUTOMATIC_GAIN_CONTROL = (1 << 13) /* 8192 */; + const int HAS_FULL_ISB = (1 << 16) /* 65536 */; + const int HAS_FULL_ISB_UNCERTAINTY = (1 << 17) /* 131072 */; + const int HAS_SATELLITE_ISB = (1 << 18) /* 262144 */; + const int HAS_SATELLITE_ISB_UNCERTAINTY = (1 << 19) /* 524288 */; + const int HAS_SATELLITE_PVT = (1 << 20) /* 1048576 */; + const int HAS_CORRELATION_VECTOR = (1 << 21) /* 2097152 */; const int STATE_UNKNOWN = 0; - const int STATE_CODE_LOCK = 1; - const int STATE_BIT_SYNC = 2; - const int STATE_SUBFRAME_SYNC = 4; - const int STATE_TOW_DECODED = 8; - const int STATE_MSEC_AMBIGUOUS = 16; - const int STATE_SYMBOL_SYNC = 32; - const int STATE_GLO_STRING_SYNC = 64; - const int STATE_GLO_TOD_DECODED = 128; - const int STATE_BDS_D2_BIT_SYNC = 256; - const int STATE_BDS_D2_SUBFRAME_SYNC = 512; - const int STATE_GAL_E1BC_CODE_LOCK = 1024; - const int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; - const int STATE_GAL_E1B_PAGE_SYNC = 4096; - const int STATE_SBAS_SYNC = 8192; - const int STATE_TOW_KNOWN = 16384; - const int STATE_GLO_TOD_KNOWN = 32768; - const int STATE_2ND_CODE_LOCK = 65536; + const int STATE_CODE_LOCK = (1 << 0) /* 1 */; + const int STATE_BIT_SYNC = (1 << 1) /* 2 */; + const int STATE_SUBFRAME_SYNC = (1 << 2) /* 4 */; + const int STATE_TOW_DECODED = (1 << 3) /* 8 */; + const int STATE_MSEC_AMBIGUOUS = (1 << 4) /* 16 */; + const int STATE_SYMBOL_SYNC = (1 << 5) /* 32 */; + const int STATE_GLO_STRING_SYNC = (1 << 6) /* 64 */; + const int STATE_GLO_TOD_DECODED = (1 << 7) /* 128 */; + const int STATE_BDS_D2_BIT_SYNC = (1 << 8) /* 256 */; + const int STATE_BDS_D2_SUBFRAME_SYNC = (1 << 9) /* 512 */; + const int STATE_GAL_E1BC_CODE_LOCK = (1 << 10) /* 1024 */; + const int STATE_GAL_E1C_2ND_CODE_LOCK = (1 << 11) /* 2048 */; + const int STATE_GAL_E1B_PAGE_SYNC = (1 << 12) /* 4096 */; + const int STATE_SBAS_SYNC = (1 << 13) /* 8192 */; + const int STATE_TOW_KNOWN = (1 << 14) /* 16384 */; + const int STATE_GLO_TOD_KNOWN = (1 << 15) /* 32768 */; + const int STATE_2ND_CODE_LOCK = (1 << 16) /* 65536 */; const int ADR_STATE_UNKNOWN = 0; - const int ADR_STATE_VALID = 1; - const int ADR_STATE_RESET = 2; - const int ADR_STATE_CYCLE_SLIP = 4; - const int ADR_STATE_HALF_CYCLE_RESOLVED = 8; + const int ADR_STATE_VALID = (1 << 0) /* 1 */; + const int ADR_STATE_RESET = (1 << 1) /* 2 */; + const int ADR_STATE_CYCLE_SLIP = (1 << 2) /* 4 */; + const int ADR_STATE_HALF_CYCLE_RESOLVED = (1 << 3) /* 8 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl index 4a49547b49..a17f933e76 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl @@ -42,6 +42,7 @@ parcelable GnssSignalType { const @utf8InCpp String CODE_TYPE_B = "B"; const @utf8InCpp String CODE_TYPE_C = "C"; const @utf8InCpp String CODE_TYPE_D = "D"; + const @utf8InCpp String CODE_TYPE_E = "E"; const @utf8InCpp String CODE_TYPE_I = "I"; const @utf8InCpp String CODE_TYPE_L = "L"; const @utf8InCpp String CODE_TYPE_M = "M"; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl index c782b6f8ff..c8634ec2b0 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl @@ -40,8 +40,8 @@ interface IAGnssRil { void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid); void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes); void injectNiSuplMessageData(in byte[] msgData, in int slotIndex); - const int NETWORK_CAPABILITY_NOT_METERED = 1; - const int NETWORK_CAPABILITY_NOT_ROAMING = 2; + const int NETWORK_CAPABILITY_NOT_METERED = 0x01; + const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02; @Backing(type="int") @VintfStability enum AGnssRefLocationType { GSM_CELLID = 1, diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl index 0e6405ea7c..d1aaf2c457 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl @@ -77,19 +77,19 @@ interface IGnss { } @Backing(type="int") @VintfStability enum GnssAidingData { - EPHEMERIS = 1, - ALMANAC = 2, - POSITION = 4, - TIME = 8, - IONO = 16, - UTC = 32, - HEALTH = 64, - SVDIR = 128, - SVSTEER = 256, - SADATA = 512, - RTI = 1024, - CELLDB_INFO = 32768, - ALL = 65535, + EPHEMERIS = 0x0001, + ALMANAC = 0x0002, + POSITION = 0x0004, + TIME = 0x0008, + IONO = 0x0010, + UTC = 0x0020, + HEALTH = 0x0040, + SVDIR = 0x0080, + SVSTEER = 0x0100, + SADATA = 0x0200, + RTI = 0x0400, + CELLDB_INFO = 0x8000, + ALL = 0xFFFF, } @VintfStability parcelable PositionModeOptions { diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl index d82aa1fe07..a021f55918 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl @@ -41,7 +41,7 @@ interface IGnssBatching { void flush(); void stop(); void cleanup(); - const int WAKEUP_ON_FIFO_FULL = 1; + const int WAKEUP_ON_FIFO_FULL = 0x01; @VintfStability parcelable Options { long periodNanos; diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl index 0247182207..61710d3e25 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl @@ -46,22 +46,22 @@ interface IGnssCallback { void gnssRequestTimeCb(); void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency); void gnssSetSignalTypeCapabilitiesCb(in android.hardware.gnss.GnssSignalType[] gnssSignalTypes); - const int CAPABILITY_SCHEDULING = 1; - const int CAPABILITY_MSB = 2; - const int CAPABILITY_MSA = 4; - const int CAPABILITY_SINGLE_SHOT = 8; - const int CAPABILITY_ON_DEMAND_TIME = 16; - const int CAPABILITY_GEOFENCING = 32; - const int CAPABILITY_MEASUREMENTS = 64; - const int CAPABILITY_NAV_MESSAGES = 128; - const int CAPABILITY_LOW_POWER_MODE = 256; - const int CAPABILITY_SATELLITE_BLOCKLIST = 512; - const int CAPABILITY_MEASUREMENT_CORRECTIONS = 1024; - const int CAPABILITY_ANTENNA_INFO = 2048; - const int CAPABILITY_CORRELATION_VECTOR = 4096; - const int CAPABILITY_SATELLITE_PVT = 8192; - const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 16384; - const int CAPABILITY_ACCUMULATED_DELTA_RANGE = 32768; + const int CAPABILITY_SCHEDULING = (1 << 0) /* 1 */; + const int CAPABILITY_MSB = (1 << 1) /* 2 */; + const int CAPABILITY_MSA = (1 << 2) /* 4 */; + const int CAPABILITY_SINGLE_SHOT = (1 << 3) /* 8 */; + const int CAPABILITY_ON_DEMAND_TIME = (1 << 4) /* 16 */; + const int CAPABILITY_GEOFENCING = (1 << 5) /* 32 */; + const int CAPABILITY_MEASUREMENTS = (1 << 6) /* 64 */; + const int CAPABILITY_NAV_MESSAGES = (1 << 7) /* 128 */; + const int CAPABILITY_LOW_POWER_MODE = (1 << 8) /* 256 */; + const int CAPABILITY_SATELLITE_BLOCKLIST = (1 << 9) /* 512 */; + const int CAPABILITY_MEASUREMENT_CORRECTIONS = (1 << 10) /* 1024 */; + const int CAPABILITY_ANTENNA_INFO = (1 << 11) /* 2048 */; + const int CAPABILITY_CORRELATION_VECTOR = (1 << 12) /* 4096 */; + const int CAPABILITY_SATELLITE_PVT = (1 << 13) /* 8192 */; + const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = (1 << 14) /* 16384 */; + const int CAPABILITY_ACCUMULATED_DELTA_RANGE = (1 << 15) /* 32768 */; @Backing(type="int") @VintfStability enum GnssStatusValue { NONE = 0, @@ -73,10 +73,10 @@ interface IGnssCallback { @Backing(type="int") @VintfStability enum GnssSvFlags { NONE = 0, - HAS_EPHEMERIS_DATA = 1, - HAS_ALMANAC_DATA = 2, - USED_IN_FIX = 4, - HAS_CARRIER_FREQUENCY = 8, + HAS_EPHEMERIS_DATA = (1 << 0) /* 1 */, + HAS_ALMANAC_DATA = (1 << 1) /* 2 */, + USED_IN_FIX = (1 << 2) /* 4 */, + HAS_CARRIER_FREQUENCY = (1 << 3) /* 8 */, } @VintfStability parcelable GnssSvInfo { diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl index 1d6399e52b..70df11afa9 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl @@ -42,11 +42,11 @@ interface IGnssConfiguration { void setEmergencySuplPdn(in boolean enable); void setEsExtensionSec(in int emergencyExtensionSeconds); void setBlocklist(in android.hardware.gnss.BlocklistedSource[] blocklist); - const int SUPL_MODE_MSB = 1; - const int SUPL_MODE_MSA = 2; - const int LPP_PROFILE_USER_PLANE = 1; - const int LPP_PROFILE_CONTROL_PLANE = 2; - const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 1; - const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 2; - const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 4; + const int SUPL_MODE_MSB = 0x01; + const int SUPL_MODE_MSA = 0x02; + const int LPP_PROFILE_USER_PLANE = 0x01; + const int LPP_PROFILE_CONTROL_PLANE = 0x02; + const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 0x01; + const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 0x02; + const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 0x04; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl index df5dc2d919..90f9ebce43 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl @@ -41,15 +41,15 @@ interface IGnssGeofenceCallback { void gnssGeofenceRemoveCb(in int geofenceId, in int status); void gnssGeofencePauseCb(in int geofenceId, in int status); void gnssGeofenceResumeCb(in int geofenceId, in int status); - const int ENTERED = 1; - const int EXITED = 2; - const int UNCERTAIN = 4; - const int UNAVAILABLE = 1; - const int AVAILABLE = 2; + const int ENTERED = (1 << 0) /* 1 */; + const int EXITED = (1 << 1) /* 2 */; + const int UNCERTAIN = (1 << 2) /* 4 */; + const int UNAVAILABLE = (1 << 0) /* 1 */; + const int AVAILABLE = (1 << 1) /* 2 */; const int OPERATION_SUCCESS = 0; - const int ERROR_TOO_MANY_GEOFENCES = -100; - const int ERROR_ID_EXISTS = -101; - const int ERROR_ID_UNKNOWN = -102; - const int ERROR_INVALID_TRANSITION = -103; - const int ERROR_GENERIC = -149; + const int ERROR_TOO_MANY_GEOFENCES = (-100) /* -100 */; + const int ERROR_ID_EXISTS = (-101) /* -101 */; + const int ERROR_ID_UNKNOWN = (-102) /* -102 */; + const int ERROR_INVALID_TRANSITION = (-103) /* -103 */; + const int ERROR_GENERIC = (-149) /* -149 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl index c65cff21be..57d0e68d44 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -44,26 +44,26 @@ interface IGnssNavigationMessageCallback { int messageId; int submessageId; byte[] data; - const int STATUS_PARITY_PASSED = 1; - const int STATUS_PARITY_REBUILT = 2; + const int STATUS_PARITY_PASSED = (1 << 0) /* 1 */; + const int STATUS_PARITY_REBUILT = (1 << 1) /* 2 */; const int STATUS_UNKNOWN = 0; @Backing(type="int") @VintfStability enum GnssNavigationMessageType { UNKNOWN = 0, - GPS_L1CA = 257, - GPS_L2CNAV = 258, - GPS_L5CNAV = 259, - SBS = 513, - GPS_CNAV2 = 260, - GLO_L1CA = 769, - QZS_L1CA = 1025, - BDS_D1 = 1281, - BDS_D2 = 1282, - BDS_CNAV1 = 1283, - BDS_CNAV2 = 1284, - GAL_I = 1537, - GAL_F = 1538, - IRN_L5CA = 1793, + GPS_L1CA = 0x0101, + GPS_L2CNAV = 0x0102, + GPS_L5CNAV = 0x0103, + SBS = 0x0201, + GPS_CNAV2 = 0x0104, + GLO_L1CA = 0x0301, + QZS_L1CA = 0x0401, + BDS_D1 = 0x0501, + BDS_D2 = 0x0502, + BDS_CNAV1 = 0x0503, + BDS_CNAV2 = 0x0504, + GAL_I = 0x0601, + GAL_F = 0x0602, + IRN_L5CA = 0x0701, } } } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl index d35c77fdf1..07b10ad201 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl @@ -37,10 +37,10 @@ package android.hardware.gnss; interface IGnssPowerIndicationCallback { void setCapabilitiesCb(in int capabilities); oneway void gnssPowerStatsCb(in android.hardware.gnss.GnssPowerStats gnssPowerStats); - const int CAPABILITY_TOTAL = 1; - const int CAPABILITY_SINGLEBAND_TRACKING = 2; - const int CAPABILITY_MULTIBAND_TRACKING = 4; - const int CAPABILITY_SINGLEBAND_ACQUISITION = 8; - const int CAPABILITY_MULTIBAND_ACQUISITION = 16; - const int CAPABILITY_OTHER_MODES = 32; + const int CAPABILITY_TOTAL = (1 << 0) /* 1 */; + const int CAPABILITY_SINGLEBAND_TRACKING = (1 << 1) /* 2 */; + const int CAPABILITY_MULTIBAND_TRACKING = (1 << 2) /* 4 */; + const int CAPABILITY_SINGLEBAND_ACQUISITION = (1 << 3) /* 8 */; + const int CAPABILITY_MULTIBAND_ACQUISITION = (1 << 4) /* 16 */; + const int CAPABILITY_OTHER_MODES = (1 << 5) /* 32 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl index 5fd411fa84..ae65f39e3a 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl @@ -46,9 +46,9 @@ parcelable SatellitePvt { long timeOfEphemerisSeconds; int issueOfDataEphemeris; android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER; - const int HAS_POSITION_VELOCITY_CLOCK_INFO = 1; - const int HAS_IONO = 2; - const int HAS_TROPO = 4; + const int HAS_POSITION_VELOCITY_CLOCK_INFO = (1 << 0) /* 1 */; + const int HAS_IONO = (1 << 1) /* 2 */; + const int HAS_TROPO = (1 << 2) /* 4 */; @Backing(type="int") @VintfStability enum SatelliteEphemerisSource { DEMODULATED = 0, diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl index 4126702a2d..61909d05f7 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl @@ -36,7 +36,7 @@ package android.hardware.gnss.measurement_corrections; @VintfStability interface IMeasurementCorrectionsCallback { void setCapabilitiesCb(in int capabilities); - const int CAPABILITY_LOS_SATS = 1; - const int CAPABILITY_EXCESS_PATH_LENGTH = 2; - const int CAPABILITY_REFLECTING_PLANE = 4; + const int CAPABILITY_LOS_SATS = (1 << 0) /* 1 */; + const int CAPABILITY_EXCESS_PATH_LENGTH = (1 << 1) /* 2 */; + const int CAPABILITY_REFLECTING_PLANE = (1 << 2) /* 4 */; } diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl index ebbe6846e9..72d32e434c 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl @@ -44,10 +44,10 @@ parcelable SingleSatCorrection { float combinedExcessPathLengthUncertaintyMeters; float combinedAttenuationDb; android.hardware.gnss.measurement_corrections.SingleSatCorrection.ExcessPathInfo[] excessPathInfos; - const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 1; - const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 2; - const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 4; - const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 16; + const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 0x0002; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 0x0004; + const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 0x0010; @VintfStability parcelable ExcessPathInfo { int excessPathInfoFlags; @@ -55,9 +55,9 @@ parcelable SingleSatCorrection { float excessPathLengthUncertaintyMeters; android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane; float attenuationDb; - const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 1; - const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 2; - const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 4; - const int EXCESS_PATH_INFO_HAS_ATTENUATION = 8; + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 0x0001; + const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 0x0002; + const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 0x0004; + const int EXCESS_PATH_INFO_HAS_ATTENUATION = 0x0008; } } diff --git a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl index 241971fe93..c66d9e8e98 100644 --- a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl +++ b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl @@ -46,26 +46,35 @@ parcelable GnssSignalType { double carrierFrequencyHz; /** - * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA. + * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A SPS, IRNSS SA SPS, + * GLONASS G1a L1OCd, GLONASS G2a L2CSI. */ const @utf8InCpp String CODE_TYPE_A = "A"; /** - * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB. + * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B RS (D), + * IRNSS SB RS (D), GLONASS G1a L1OCp, GLONASS G2a L2OCp, QZSS L1Sb. */ const @utf8InCpp String CODE_TYPE_B = "B"; /** * GNSS signal code type "C" representing GPS L1 C/A, GPS L2 C/A, GLONASS G1 C/A, - * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C. + * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C RS (P), + * IRNSS SC RS (P). */ const @utf8InCpp String CODE_TYPE_C = "C"; /** - * GNSS signal code type "D" representing BDS B1C D. + * GNSS signal code type "D" representing GPS L2 (L1(C/A) + (P2-P1) (semi-codeless)), + * QZSS L5S(I), BDS B1C Data, BDS B2a Data, BDS B2b Data, BDS B2 (B2a+B2b) Data, BDS B3a Data. */ const @utf8InCpp String CODE_TYPE_D = "D"; + /** + * GNSS signal code type "E" representing QZSS L1 C/B, QZSS L6E. + */ + const @utf8InCpp String CODE_TYPE_E = "E"; + /** * GNSS signal code type "I" representing GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I, * GALILEO E5a+b I, SBAS L5 I, QZSS L5 I, BDS B1 I, BDS B2 I, BDS B3 I. @@ -74,7 +83,7 @@ parcelable GnssSignalType { /** * GNSS signal code type "L" representing GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L), - * LEX(6) L. + * QZSS L6P, BDS B1a Pilot. */ const @utf8InCpp String CODE_TYPE_L = "L"; @@ -89,7 +98,9 @@ parcelable GnssSignalType { const @utf8InCpp String CODE_TYPE_N = "N"; /** - * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P, BDS B1C P. + * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P, + * BDS B1C Pilot, BDS B2a Pilot, BDS B2b Pilot, BDS B2 (B2a+B2b) Pilot, BDS B3a Pilot, + * QZSS L5S(Q). */ const @utf8InCpp String CODE_TYPE_P = "P"; @@ -101,7 +112,7 @@ parcelable GnssSignalType { /** * GNSS signal code type "S" represents GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M), - * LEX(6) S. + * QZSS L6D, BDS B1a Data. */ const @utf8InCpp String CODE_TYPE_S = "S"; @@ -112,9 +123,11 @@ parcelable GnssSignalType { /** * GNSS signal code type "X" representing GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q), - * GLONASS G3 (I+Q), GALILEO E1 (B+C), GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b(I+Q), - * GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), - * LEX(6) (S+L), BDS B1 (I+Q), BDS B1C (D+P), BDS B2 (I+Q), BDS B3 (I+Q), IRNSS L5 (B+C). + * GLONASS G1a L1OCd+L1OCp, GLONASS G2a L2CSI+L2OCp, GLONASS G3 (I+Q), GALILEO E1 (B+C), + * GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b (I+Q), GALILEO E6 (B+C), SBAS L5 (I+Q), + * QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), QZSS L6 (D+P), BDS B1 (I+Q), + * BDS B1C Data+Pilot, BDS B2a Data+Pilot, BDS B2 (I+Q), BDS B2 (B2a+B2b) Data+Pilot, + * BDS B3 (I+Q), IRNSS L5 (B+C), IRNSS S (B+C). */ const @utf8InCpp String CODE_TYPE_X = "X"; @@ -124,7 +137,9 @@ parcelable GnssSignalType { const @utf8InCpp String CODE_TYPE_Y = "Y"; /** - * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF. + * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), + * QZSS L1S/L1-SAIF, QZSS L5S (I+Q), QZSS L6 (D+E), BDS B1A Data+Pilot, BDS B2b Data+Pilot, + * BDS B3a Data+Pilot. */ const @utf8InCpp String CODE_TYPE_Z = "Z"; @@ -142,10 +157,11 @@ parcelable GnssSignalType { * The value is one of the constant Strings with prefix CODE_TYPE_ defined in this parcelable. * * This is used to specify the observation descriptor defined in GNSS Observation Data File - * Header Section Description in the RINEX standard (Version 3.XX). In RINEX Version 3.03, - * in Appendix Table A2 Attributes are listed as uppercase letters (for instance, "A" for - * "A channel"). In the future, if for instance a code "G" was added in the official RINEX - * standard, "G" could be specified here. + * Header Section Description in the RINEX standard (Version 4.00) e.g., in Tables 9-16 (see + * https://igs.org/wg/rinex/#documents-formats). In cases where the code type does not align + * with the above listed values, the code type from the most recent version of RINEX should be + * used. In the future, if for instance a code "G" was added in the official RINEX standard, + * "G" could be specified here. */ @utf8InCpp String codeType; } diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index ca5a41f8e5..542796fc93 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -50,7 +50,7 @@ cc_binary { "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.visibility_control@1.0", - "android.hardware.gnss-V3-ndk", + "android.hardware.gnss-V4-ndk", ], srcs: [ "AGnssRil.cpp", diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml index 73b841e479..c01069e4fe 100644 --- a/gnss/aidl/default/gnss-default.xml +++ b/gnss/aidl/default/gnss-default.xml @@ -1,7 +1,7 @@ android.hardware.gnss - 3 + 4 IGnss default diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp index 2a09a56866..fd1d853bc2 100644 --- a/gnss/aidl/vts/Android.bp +++ b/gnss/aidl/vts/Android.bp @@ -51,7 +51,7 @@ cc_test { "libbinder", ], static_libs: [ - "android.hardware.gnss-V3-cpp", + "android.hardware.gnss-V4-cpp", "android.hardware.gnss@common-vts-lib", ], test_suites: [ diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp index 4cf17a66cd..208bc593f3 100644 --- a/gnss/common/utils/default/Android.bp +++ b/gnss/common/utils/default/Android.bp @@ -57,6 +57,6 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.1", "android.hardware.gnss.measurement_corrections@1.0", - "android.hardware.gnss-V3-ndk", + "android.hardware.gnss-V4-ndk", ], } diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp index b5325b2881..ed5674cf99 100644 --- a/gnss/common/utils/vts/Android.bp +++ b/gnss/common/utils/vts/Android.bp @@ -44,7 +44,7 @@ cc_library_static { "android.hardware.gnss@2.1", "android.hardware.gnss.measurement_corrections@1.0", "android.hardware.gnss.measurement_corrections@1.1", - "android.hardware.gnss-V3-cpp", + "android.hardware.gnss-V4-cpp", ], static_libs: [ "libgtest", -- GitLab From b1fc8c914f1d6dcdcbada7a147388b4eae225fa4 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 30 Aug 2023 11:51:04 -0700 Subject: [PATCH 119/376] Allow empty preuload_files. When a CL only removes file, the PREUPLOAD_FILES in repohook might be empty. Test: None Bug: 298222655 Change-Id: I70bb347c02c5d09a0525313087acb9c38b9a2ff2 --- automotive/vehicle/tools/generate_annotation_enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index c432e9d6b6..fddc55b5f4 100755 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -328,7 +328,7 @@ def main(): parser = argparse.ArgumentParser( description='Generate Java and C++ enums based on annotations in VehicleProperty.aidl') parser.add_argument('--android_build_top', required=False, help='Path to ANDROID_BUILD_TOP') - parser.add_argument('--preupload_files', nargs='+', required=False, help='modified files') + parser.add_argument('--preupload_files', nargs='*', required=False, help='modified files') parser.add_argument('--check_only', required=False, action='store_true', help='only check whether the generated files need update') parser.add_argument('--output_csv', required=False, -- GitLab From f850701be095f780d9f987c8a9e125425f5b5797 Mon Sep 17 00:00:00 2001 From: ramindani Date: Wed, 30 Aug 2023 18:51:19 -0700 Subject: [PATCH 120/376] [Composer AIDL] Rename notifyExpectedPresentTimeoutNs and notifyExpectedPresentHeadsUpNs Renamed to timeoutNs and headsUpNs respectively BUG: 294102485 Test: atest VtsHalGraphicsComposer3_TargetTest Change-Id: Id890d9634d80700ad2515c9b4fe2a423b6b75d96 --- .../android/hardware/graphics/composer3/VrrConfig.aidl | 4 ++-- .../android/hardware/graphics/composer3/IComposerClient.aidl | 4 ++-- .../aidl/android/hardware/graphics/composer3/VrrConfig.aidl | 4 ++-- .../composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl index bb2569f342..7377b4b3e5 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl @@ -42,7 +42,7 @@ parcelable VrrConfig { int averageRefreshPeriodNs; } parcelable NotifyExpectedPresentConfig { - int notifyExpectedPresentHeadsUpNs; - int notifyExpectedPresentTimeoutNs; + int headsUpNs; + int timeoutNs; } } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index 725c9475c9..ec54f2ab81 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -895,9 +895,9 @@ interface IComposerClient { * * The framework will call this function based on the parameters specified in * DisplayConfiguration.VrrConfig: - * - notifyExpectedPresentTimeoutNs specifies the idle time from the previous present command + * - timeoutNs specifies the idle time from the previous present command * where the framework must send the early hint for the next frame. - * - notifyExpectedPresentHeadsUpNs specifies minimal time that framework must send + * - headsUpNs specifies minimal time that framework must send * the early hint before the next frame. * * The framework can omit calling this API when the next present command matches diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl index 3b241ba0c9..93667e0a56 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl @@ -45,7 +45,7 @@ parcelable VrrConfig { * The minimal time in nanoseconds that IComposerClient.notifyExpectedPresent needs to be * called ahead of an expectedPresentTime provided on a presentDisplay command. */ - int notifyExpectedPresentHeadsUpNs; + int headsUpNs; /** * The time in nanoseconds that represents a timeout from the previous presentDisplay, which @@ -53,7 +53,7 @@ parcelable VrrConfig { * sending the next frame. If set to 0, there is no need to call * IComposerClient.notifyExpectedPresent for timeout. */ - int notifyExpectedPresentTimeoutNs; + int timeoutNs; } /** diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 1e6f34b534..4a8e3b422f 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1274,8 +1274,8 @@ TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) { if (vrrConfig.notifyExpectedPresentConfig) { const auto& notifyExpectedPresentConfig = *vrrConfig.notifyExpectedPresentConfig; - EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs); - EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs); + EXPECT_GT(0, notifyExpectedPresentConfig.headsUpNs); + EXPECT_GE(0, notifyExpectedPresentConfig.timeoutNs); } } } -- GitLab From d1cb6df2b620cff831beb739dab620bbf0d18cb6 Mon Sep 17 00:00:00 2001 From: "yanggang.yang" Date: Wed, 31 May 2023 13:59:04 +0800 Subject: [PATCH 121/376] Fix bluetooth AIDL restart fail when open HCI Fail [Description] If aidl open HCI fail at the first time, the aidl state can not change to enable for the next time to initialize. [Root Cause] Bluetooth AIDL State is always equal to INITIALIZING after open hci fail at the first time. [Solution] When open HCI fail at the first time, initialize the mstate to ready Bug: 285517442 Test: pass (cherry picked from https://android-review.googlesource.com/q/commit:6ebe25132221a389a3df8b0b197a9efff7a211f2) Merged-In: I19756d6602ba931242d0f95942db55c505a210bb Change-Id: I19756d6602ba931242d0f95942db55c505a210bb --- bluetooth/aidl/default/BluetoothHci.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp index ac2eabc86d..47886bf460 100644 --- a/bluetooth/aidl/default/BluetoothHci.cpp +++ b/bluetooth/aidl/default/BluetoothHci.cpp @@ -221,6 +221,7 @@ ndk::ScopedAStatus BluetoothHci::initialize( ALOGI("Unable to open Linux interface, trying default path."); mFd = getFdFromDevPath(); if (mFd < 0) { + mState = HalState::READY; cb->initializationComplete(Status::UNABLE_TO_OPEN_INTERFACE); return ndk::ScopedAStatus::ok(); } @@ -278,6 +279,7 @@ ndk::ScopedAStatus BluetoothHci::close() { { std::lock_guard guard(mStateMutex); if (mState != HalState::ONE_CLIENT) { + ASSERT(mState != HalState::INITIALIZING); ALOGI("Already closed"); return ndk::ScopedAStatus::ok(); } -- GitLab From 810c89be092e476e6f2745b63703bdf70209a2f5 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Mon, 28 Aug 2023 11:53:31 -0700 Subject: [PATCH 122/376] Remove PDL from the HAL The benefit is small and it's painful to make libraries available to apexes and the platform. Bug: 296427840 Test: mma -j32 (cherry picked from https://android-review.googlesource.com/q/commit:47c0282de8af17ed5c3e7048a7fe5c7e137dd618) Merged-In: I7f2ed8636b90de415b8d5635dcd7c568810323bd Change-Id: I7f2ed8636b90de415b8d5635dcd7c568810323bd --- bluetooth/aidl/default/Android.bp | 7 ------- bluetooth/aidl/default/BluetoothHci.cpp | 28 +++++++++++-------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/bluetooth/aidl/default/Android.bp b/bluetooth/aidl/default/Android.bp index 32d1a139e5..3f4ba9903a 100644 --- a/bluetooth/aidl/default/Android.bp +++ b/bluetooth/aidl/default/Android.bp @@ -30,15 +30,8 @@ cc_library_static { defaults: ["android.hardware.bluetooth-service-build-defaults"], srcs: [ "BluetoothHci.cpp", - ":BluetoothPacketSources", "net_bluetooth_mgmt.cpp", ], - generated_headers: [ - "BluetoothGeneratedPackets_h", - ], - include_dirs: [ - "packages/modules/Bluetooth/system/gd", - ], } cc_binary { diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp index 47886bf460..afe153ab14 100644 --- a/bluetooth/aidl/default/BluetoothHci.cpp +++ b/bluetooth/aidl/default/BluetoothHci.cpp @@ -29,11 +29,6 @@ #include "log/log.h" -// TODO: Remove custom logging defines from PDL packets. -#undef LOG_INFO -#undef LOG_DEBUG -#include "hci/hci_packets.h" - namespace { int SetTerminalRaw(int fd) { termios terminal_settings; @@ -127,9 +122,7 @@ int BluetoothHci::getFdFromDevPath() { void BluetoothHci::reset() { // Send a reset command and wait until the command complete comes back. - std::vector reset; - ::bluetooth::packet::BitInserter bi{reset}; - ::bluetooth::hci::ResetBuilder::Create()->Serialize(bi); + std::vector reset = {0x03, 0x0c, 0x00}; auto resetPromise = std::make_shared>(); auto resetFuture = resetPromise->get_future(); @@ -149,13 +142,15 @@ void BluetoothHci::reset() { static_cast(raw_sco.size())); }, [resetPromise](const std::vector& raw_event) { - bool valid = ::bluetooth::hci::ResetCompleteView::Create( - ::bluetooth::hci::CommandCompleteView::Create( - ::bluetooth::hci::EventView::Create( - ::bluetooth::hci::PacketView( - std::make_shared>( - raw_event))))) - .IsValid(); + std::vector reset_complete = {0x0e, 0x04, 0x01, + 0x03, 0x0c, 0x00}; + bool valid = raw_event.size() == 6 && + raw_event[0] == reset_complete[0] && + raw_event[1] == reset_complete[1] && + // Don't compare the number of packets field. + raw_event[3] == reset_complete[3] && + raw_event[4] == reset_complete[4] && + raw_event[5] == reset_complete[5]; if (valid) { resetPromise->set_value(); } else { @@ -279,7 +274,8 @@ ndk::ScopedAStatus BluetoothHci::close() { { std::lock_guard guard(mStateMutex); if (mState != HalState::ONE_CLIENT) { - ASSERT(mState != HalState::INITIALIZING); + LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING, + "mState is INITIALIZING"); ALOGI("Already closed"); return ndk::ScopedAStatus::ok(); } -- GitLab From 130d5a3aa0cc0810075c0e87c3196fb8f34d4dd6 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Tue, 29 Aug 2023 14:55:03 -0700 Subject: [PATCH 123/376] Update the default EVS HAL implementation Remove H2BGraphicBufferProducer usages from the default EVS HAL implementation. Bug: 297601247 Bug: 298091684 Test: Run evs_app on the cuttlefish emulator. Change-Id: Ibca21d8e9cf87deb79c0050f9adcf02b5f16d34b --- automotive/evs/aidl/impl/default/Android.bp | 5 ++- .../aidl/impl/default/include/EvsEnumerator.h | 1 + .../aidl/impl/default/include/EvsGlDisplay.h | 1 + .../evs/aidl/impl/default/include/GlWrapper.h | 9 +--- .../aidl/impl/default/src/EvsGlDisplay.cpp | 2 +- .../evs/aidl/impl/default/src/GlWrapper.cpp | 43 ++++++------------- 6 files changed, 20 insertions(+), 41 deletions(-) diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp index 70c523b5fa..79ee956641 100644 --- a/automotive/evs/aidl/impl/default/Android.bp +++ b/automotive/evs/aidl/impl/default/Android.bp @@ -60,12 +60,15 @@ cc_binary { "libyuv", ], static_libs: [ - "android.frameworks.automotive.display-V1-ndk", + "android.frameworks.automotive.display-V2-ndk", "android.hardware.automotive.evs-V2-ndk", "android.hardware.common-V2-ndk", "libaidlcommonsupport", "libcutils", ], + header_libs: [ + "libgui_aidl_headers", + ], local_include_dirs: ["include"], include_dirs: ["frameworks/native/include/"], required: ["evs_mock_hal_configuration.xml"], diff --git a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h index 259c266721..3897b4e7c6 100644 --- a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h +++ b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h index ceabd9e863..0865a04109 100644 --- a/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h +++ b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/automotive/evs/aidl/impl/default/include/GlWrapper.h b/automotive/evs/aidl/impl/default/include/GlWrapper.h index adb250c8e1..7ff6104bb9 100644 --- a/automotive/evs/aidl/impl/default/include/GlWrapper.h +++ b/automotive/evs/aidl/impl/default/include/GlWrapper.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace aidl::android::hardware::automotive::evs::implementation { @@ -33,7 +33,6 @@ namespace automotivedisplay = ::aidl::android::frameworks::automotive::display; class GlWrapper { public: - GlWrapper() : mSurfaceHolder(::android::SurfaceHolderUniquePtr(nullptr, nullptr)) {} bool initialize(const std::shared_ptr& svc, uint64_t displayId); void shutdown(); @@ -53,9 +52,6 @@ class GlWrapper { unsigned getHeight() { return mHeight; }; private: - ::android::sp<::android::hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer> - mGfxBufferProducer; - EGLDisplay mDisplay; EGLSurface mSurface; EGLContext mContext; @@ -71,9 +67,6 @@ class GlWrapper { // Opaque handle for a native hardware buffer defined in // frameworks/native/opengl/include/EGL/eglplatform.h ANativeWindow* mWindow; - - // Pointer to a Surface wrapper. - ::android::SurfaceHolderUniquePtr mSurfaceHolder; }; } // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp index e5f8e4c84a..5b5cbcc9ae 100644 --- a/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp @@ -352,8 +352,8 @@ ScopedAStatus EvsGlDisplay::getTargetBuffer(BufferDesc* _aidl_return) { BufferDesc bufferDescToSend = { .buffer = { - .handle = std::move(::android::dupToAidl(mBuffer.handle)), .description = mBuffer.description, + .handle = std::move(::android::dupToAidl(mBuffer.handle)), }, .pixelSizeBytes = 4, // RGBA_8888 is 4-byte-per-pixel format .bufferId = mBuffer.fingerprint, diff --git a/automotive/evs/aidl/impl/default/src/GlWrapper.cpp b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp index 0ee5ecb734..a9d02138b2 100644 --- a/automotive/evs/aidl/impl/default/src/GlWrapper.cpp +++ b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -183,20 +184,6 @@ GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) { return program; } -::android::sp convertNativeHandleToHGBP(const NativeHandle& aidlHandle) { - native_handle_t* handle = ::android::dupFromAidl(aidlHandle); - if (handle->numFds != 0 || handle->numInts < std::ceil(sizeof(size_t) / sizeof(int))) { - LOG(ERROR) << "Invalid native handle"; - return nullptr; - } - ::android::hardware::hidl_vec halToken; - halToken.setToExternal(reinterpret_cast(const_cast(&(handle->data[1]))), - handle->data[0]); - ::android::sp hgbp = - HGraphicBufferProducer::castFrom(::android::retrieveHalInterface(halToken)); - return std::move(hgbp); -} - } // namespace namespace aidl::android::hardware::automotive::evs::implementation { @@ -226,30 +213,19 @@ bool GlWrapper::initialize(const std::shared_ptr& pWindowProxy } LOG(INFO) << "Display resolution is " << mWidth << "x" << mHeight; - NativeHandle aidlHandle; - status = pWindowProxy->getHGraphicBufferProducer(displayId, &aidlHandle); + aidl::android::view::Surface shimSurface; + status = pWindowProxy->getSurface(displayId, &shimSurface); if (!status.isOk()) { - LOG(ERROR) << "Failed to get IGraphicBufferProducer from ICarDisplayProxy."; - return false; - } - - mGfxBufferProducer = convertNativeHandleToHGBP(aidlHandle); - if (!mGfxBufferProducer) { - LOG(ERROR) << "Failed to convert a NativeHandle to HGBP."; + LOG(ERROR) << "Failed to obtain the surface."; return false; } - mSurfaceHolder = getSurfaceFromHGBP(mGfxBufferProducer); - if (mSurfaceHolder == nullptr) { - LOG(ERROR) << "Failed to get a Surface from HGBP."; - return false; - } - - mWindow = getNativeWindow(mSurfaceHolder.get()); + mWindow = shimSurface.get(); if (mWindow == nullptr) { LOG(ERROR) << "Failed to get a native window from Surface."; return false; } + ANativeWindow_acquire(mWindow); // Set up our OpenGL ES context associated with the default display mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); @@ -350,7 +326,12 @@ void GlWrapper::shutdown() { mDisplay = EGL_NO_DISPLAY; // Release the window - mSurfaceHolder = nullptr; + if (mWindow == nullptr) { + return; + } + + ANativeWindow_release(mWindow); + mWindow = nullptr; } void GlWrapper::showWindow(const std::shared_ptr& pWindowProxy, uint64_t id) { -- GitLab From 9db00ec784950ad50aefa794d370670dafef62f1 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 31 Aug 2023 17:41:18 -0400 Subject: [PATCH 124/376] Clarify GPU API requirements for BufferUsage Bug: 283989374 Test: n/a doc only change Change-Id: I4caec722420d4fa2089d1f297f377408a1e674ae --- .../hardware/graphics/common/BufferUsage.aidl | 124 ++++++++++-------- 1 file changed, 68 insertions(+), 56 deletions(-) diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl index 12bc441b72..0d1a094b36 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl @@ -24,35 +24,47 @@ package android.hardware.graphics.common; @Backing(type="long") enum BufferUsage { /** bit 0-3 is an enum */ - CPU_READ_MASK = 0xf, + CPU_READ_MASK = 0xf, /** buffer is never read by CPU */ - CPU_READ_NEVER = 0, + CPU_READ_NEVER = 0, /** buffer is rarely read by CPU */ - CPU_READ_RARELY = 2, + CPU_READ_RARELY = 2, /** buffer is often read by CPU */ - CPU_READ_OFTEN = 3, + CPU_READ_OFTEN = 3, /** bit 4-7 is an enum */ - CPU_WRITE_MASK = 0xf << 4, + CPU_WRITE_MASK = 0xf << 4, /** buffer is never written by CPU */ - CPU_WRITE_NEVER = 0 << 4, + CPU_WRITE_NEVER = 0 << 4, /** buffer is rarely written by CPU */ - CPU_WRITE_RARELY = 2 << 4, + CPU_WRITE_RARELY = 2 << 4, /** buffer is often written by CPU */ - CPU_WRITE_OFTEN = 3 << 4, + CPU_WRITE_OFTEN = 3 << 4, - /** buffer is used as a GPU texture */ - GPU_TEXTURE = 1 << 8, + /** + * Buffer may be used as a GPU texture + * + * Buffers allocated with this flag must be + * texturable both in EGL/GL & Vulkan via + * their respective external memory extensions + */ + GPU_TEXTURE = 1 << 8, - /** buffer is used as a GPU render target */ - GPU_RENDER_TARGET = 1 << 9, + /** + * Buffer may be used as a GPU render target + * + * Buffers allocated with this flag must be + * renderable both in EGL/GL & Vulkan via + * their respective external memory extensions + */ + GPU_RENDER_TARGET = 1 << 9, /** bit 10 must be zero */ /** buffer is used as a composer HAL overlay layer */ - COMPOSER_OVERLAY = 1 << 11, + COMPOSER_OVERLAY = 1 << 11, /** buffer is used as a composer HAL client target */ - COMPOSER_CLIENT_TARGET = 1 << 12, + COMPOSER_CLIENT_TARGET = 1 << 12, /** bit 13 must be zero */ @@ -61,86 +73,86 @@ enum BufferUsage { * contents (or information derived from the contents) into unprotected * memory. */ - PROTECTED = 1 << 14, + PROTECTED = 1 << 14, /** buffer is used as a hwcomposer HAL cursor layer */ - COMPOSER_CURSOR = 1 << 15, + COMPOSER_CURSOR = 1 << 15, /** buffer is used as a video encoder input */ - VIDEO_ENCODER = 1 << 16, + VIDEO_ENCODER = 1 << 16, /** buffer is used as a camera HAL output */ - CAMERA_OUTPUT = 1 << 17, + CAMERA_OUTPUT = 1 << 17, /** buffer is used as a camera HAL input */ - CAMERA_INPUT = 1 << 18, + CAMERA_INPUT = 1 << 18, /** bit 19 must be zero */ /** buffer is used as a renderscript allocation */ - RENDERSCRIPT = 1 << 20, + RENDERSCRIPT = 1 << 20, /** bit 21 must be zero */ /** buffer is used as a video decoder output */ - VIDEO_DECODER = 1 << 22, + VIDEO_DECODER = 1 << 22, /** buffer is used as a sensor direct report output */ - SENSOR_DIRECT_DATA = 1 << 23, + SENSOR_DIRECT_DATA = 1 << 23, /** * buffer is used as as an OpenGL shader storage or uniform * buffer object */ - GPU_DATA_BUFFER = 1 << 24, + GPU_DATA_BUFFER = 1 << 24, /** buffer is used as a cube map texture */ - GPU_CUBE_MAP = 1 << 25, + GPU_CUBE_MAP = 1 << 25, /** buffer contains a complete mipmap hierarchy */ - GPU_MIPMAP_COMPLETE = 1 << 26, + GPU_MIPMAP_COMPLETE = 1 << 26, /** * Buffer is used as input for HEIC encoder. */ - HW_IMAGE_ENCODER = 1 << 27, + HW_IMAGE_ENCODER = 1 << 27, /* Bits 28-31 are reserved for vendor usage */ /** - * Buffer is used for front-buffer rendering. - * - * To satisfy an allocation with this usage, the resulting buffer - * must operate as equivalent to shared memory for all targets. - * - * For CPU_USAGE_* other than NEVER, this means the buffer must - * "lock in place". The buffers must be directly accessible via mapping. - * - * For GPU_RENDER_TARGET the buffer must behave equivalent to a - * single-buffered EGL surface. For example glFlush must perform - * a flush, same as if the default framebuffer was single-buffered. - * - * For COMPOSER_* the HWC must not perform any caching for this buffer - * when submitted for composition. HWCs do not need to do any form - * of auto-refresh, and they are allowed to cache composition results between - * presents from SF (such as for panel self-refresh), but for any given - * present the buffer must be composited from even if it otherwise appears - * to be the same as a previous composition. - * - * If the GPU & HWC supports EGL_SINGLE_BUFFER, then it is recommended that - * FRONT_BUFFER usage is supported for the same formats as supported by - * EGL_SINGLE_BUFFER. In particular, it is recommended that the following - * combination is supported when possible: - * Format = RGBA_8888 - * Usage = FRONT_BUFFER | GPU_RENDER_TARGET | COMPOSER_OVERLAY - * - */ - FRONT_BUFFER = 1L << 32, + * Buffer is used for front-buffer rendering. + * + * To satisfy an allocation with this usage, the resulting buffer + * must operate as equivalent to shared memory for all targets. + * + * For CPU_USAGE_* other than NEVER, this means the buffer must + * "lock in place". The buffers must be directly accessible via mapping. + * + * For GPU_RENDER_TARGET the buffer must behave equivalent to a + * single-buffered EGL surface. For example glFlush must perform + * a flush, same as if the default framebuffer was single-buffered. + * + * For COMPOSER_* the HWC must not perform any caching for this buffer + * when submitted for composition. HWCs do not need to do any form + * of auto-refresh, and they are allowed to cache composition results between + * presents from SF (such as for panel self-refresh), but for any given + * present the buffer must be composited from even if it otherwise appears + * to be the same as a previous composition. + * + * If the GPU & HWC supports EGL_SINGLE_BUFFER, then it is recommended that + * FRONT_BUFFER usage is supported for the same formats as supported by + * EGL_SINGLE_BUFFER. In particular, it is recommended that the following + * combination is supported when possible: + * Format = RGBA_8888 + * Usage = FRONT_BUFFER | GPU_RENDER_TARGET | COMPOSER_OVERLAY + * + */ + FRONT_BUFFER = 1L << 32, /** bits 28-31 are reserved for vendor extensions */ - VENDOR_MASK = 0xf << 28, + VENDOR_MASK = 0xf << 28, /** bits 33-47 must be zero and are reserved for future versions */ /** bits 48-63 are reserved for vendor extensions */ - VENDOR_MASK_HI = (1L * 0xffff) << 48, + VENDOR_MASK_HI = (1L * 0xffff) << 48, } -- GitLab From 515af9d8ba49fd596f37e5b61aab407d8ae25007 Mon Sep 17 00:00:00 2001 From: William Escande Date: Fri, 1 Sep 2023 00:21:59 +0000 Subject: [PATCH 125/376] Use the PDL library for HCI packets Bug: 296427840 Test: mma -j32 Ignore-AOSP-First: Get around auto-merger conflict with udc-mainline-prod (cherry picked from https://android-review.googlesource.com/q/commit:3943ed1876c07c4af8e23bb5f1636df74678e8c3) Change-Id: I5dc1d6cd24890e4558ace5b8de4ed6d93a6abc86 --- bluetooth/aidl/vts/Android.bp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bluetooth/aidl/vts/Android.bp b/bluetooth/aidl/vts/Android.bp index 5fc0b2eef7..ade3bef1a2 100644 --- a/bluetooth/aidl/vts/Android.bp +++ b/bluetooth/aidl/vts/Android.bp @@ -16,10 +16,6 @@ cc_test { srcs: [ "VtsHalBluetoothTargetTest.cpp", ":BluetoothPacketSources", - ":BluetoothHciPacketSources", - ], - generated_headers: [ - "BluetoothGeneratedPackets_h", ], include_dirs: [ "packages/modules/Bluetooth/system/gd", @@ -31,7 +27,7 @@ cc_test { ], static_libs: [ "android.hardware.bluetooth-V1-ndk", - "libbluetooth-types", + "libbluetooth_hci_pdl", ], test_config: "VtsHalBluetoothTargetTest.xml", test_suites: [ @@ -57,6 +53,5 @@ cc_test { ], tidy_disabled_srcs: [ ":BluetoothPacketSources", - ":BluetoothHciPacketSources", ], } -- GitLab From dd390faa2fcb49ce0e0ebc6ef180118ec370f957 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Thu, 31 Aug 2023 01:32:07 -0700 Subject: [PATCH 126/376] Undefine NAN before defining it again After upgrading libc++, math.h happens to be included at the point where this file tries to define NAN. Redefining a macro to a different value is an error, but #undef'ing a macro is OK even if the macro isn't actually defined. Bug: b/175635923 Test: treehugger Change-Id: Ie8e3e87189bcd7ed8fccccfc0a79e04a5bfda16b --- wifi/aidl/default/wifi_feature_flags.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wifi/aidl/default/wifi_feature_flags.cpp b/wifi/aidl/default/wifi_feature_flags.cpp index 3c9f042607..35b4b4a4ba 100644 --- a/wifi/aidl/default/wifi_feature_flags.cpp +++ b/wifi/aidl/default/wifi_feature_flags.cpp @@ -122,6 +122,7 @@ std::vector legacyToChipConcurrencyComboL #define AP IfaceConcurrencyType::AP #define AP_BRIDGED IfaceConcurrencyType::AP_BRIDGED #define P2P IfaceConcurrencyType::P2P +#undef NAN // undefine NAN from math.h #define NAN IfaceConcurrencyType::NAN_IFACE static const std::vector kChipModesPrimary{ {kMainModeId, legacyToChipConcurrencyComboList({WIFI_HAL_INTERFACE_COMBINATIONS})}, -- GitLab From 82426a4a40b83ad55fbce46142c90c336213bded Mon Sep 17 00:00:00 2001 From: Ram Indani Date: Fri, 1 Sep 2023 20:02:50 +0000 Subject: [PATCH 127/376] Revert "[Composer AIDL] Rename notifyExpectedPresentTimeoutNs and" This reverts commit f850701be095f780d9f987c8a9e125425f5b5797. Reason for revert: Delaying rename to avoid churn for external partner work. Change-Id: If96786d074a61ac0f781540e98d020a6f7fd673b --- .../android/hardware/graphics/composer3/VrrConfig.aidl | 4 ++-- .../android/hardware/graphics/composer3/IComposerClient.aidl | 4 ++-- .../aidl/android/hardware/graphics/composer3/VrrConfig.aidl | 4 ++-- .../composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl index 7377b4b3e5..bb2569f342 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl @@ -42,7 +42,7 @@ parcelable VrrConfig { int averageRefreshPeriodNs; } parcelable NotifyExpectedPresentConfig { - int headsUpNs; - int timeoutNs; + int notifyExpectedPresentHeadsUpNs; + int notifyExpectedPresentTimeoutNs; } } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl index ec54f2ab81..725c9475c9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl @@ -895,9 +895,9 @@ interface IComposerClient { * * The framework will call this function based on the parameters specified in * DisplayConfiguration.VrrConfig: - * - timeoutNs specifies the idle time from the previous present command + * - notifyExpectedPresentTimeoutNs specifies the idle time from the previous present command * where the framework must send the early hint for the next frame. - * - headsUpNs specifies minimal time that framework must send + * - notifyExpectedPresentHeadsUpNs specifies minimal time that framework must send * the early hint before the next frame. * * The framework can omit calling this API when the next present command matches diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl index 93667e0a56..3b241ba0c9 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl @@ -45,7 +45,7 @@ parcelable VrrConfig { * The minimal time in nanoseconds that IComposerClient.notifyExpectedPresent needs to be * called ahead of an expectedPresentTime provided on a presentDisplay command. */ - int headsUpNs; + int notifyExpectedPresentHeadsUpNs; /** * The time in nanoseconds that represents a timeout from the previous presentDisplay, which @@ -53,7 +53,7 @@ parcelable VrrConfig { * sending the next frame. If set to 0, there is no need to call * IComposerClient.notifyExpectedPresent for timeout. */ - int timeoutNs; + int notifyExpectedPresentTimeoutNs; } /** diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 4a8e3b422f..1e6f34b534 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1274,8 +1274,8 @@ TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) { if (vrrConfig.notifyExpectedPresentConfig) { const auto& notifyExpectedPresentConfig = *vrrConfig.notifyExpectedPresentConfig; - EXPECT_GT(0, notifyExpectedPresentConfig.headsUpNs); - EXPECT_GE(0, notifyExpectedPresentConfig.timeoutNs); + EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs); + EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs); } } } -- GitLab From 89b26e7623f7385b507976c0e7ca173f47a97d32 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 1 Sep 2023 16:32:22 -0400 Subject: [PATCH 128/376] Add deprecation note Flag: DOCS_ONLY Test: doc-only && make Change-Id: I16638c3772269e4946a002a7e821735423df5084 --- .../android/hardware/graphics/common/HardwareBuffer.aidl | 5 ++++- .../android/hardware/graphics/common/HardwareBuffer.aidl | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl index 1817769af2..0fe949304c 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl @@ -32,7 +32,10 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.graphics.common; -/* @hide */ +/** + * @hide + * @deprecated : Use instead android.hardware.HardwareBuffer in frameworks/base + */ @VintfStability parcelable HardwareBuffer { android.hardware.graphics.common.HardwareBufferDescription description; diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl index 50306dcadd..ac95b1c941 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl @@ -20,11 +20,13 @@ import android.hardware.common.NativeHandle; import android.hardware.graphics.common.HardwareBufferDescription; /** - * Stable AIDL counterpart of AHardwareBuffer. + * [Deprecated] Stable AIDL counterpart of AHardwareBuffer. * - * @note This is different from the public HardwareBuffer. - * @sa +ndk libnativewindow#AHardwareBuffer + * @note This is different from the public HardwareBuffer. As the public + HardwareBuffer now supports being used in stable-aidl interfaces, + that is strongly preferred for new usages. * @hide + * @deprecated: Use instead android.hardware.HardwareBuffer in frameworks/base */ @VintfStability parcelable HardwareBuffer { -- GitLab From b22a2745426a88dc286c28f3c403de7a922c3c14 Mon Sep 17 00:00:00 2001 From: Antonio Kantek Date: Tue, 5 Sep 2023 18:02:46 +0000 Subject: [PATCH 129/376] Add visibility to "//cts/tests/tests/car_permission_tests" Bug: 298100097 Test: atest CarSecurityPermissionTest Change-Id: Ia613cbb47fe2a6efd1c518aeee8b0cca15af7e13 --- .../vehicle/aidl/impl/utils/test_vendor_properties/Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp index 62c89acff8..f7da7e078b 100644 --- a/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp +++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp @@ -26,5 +26,6 @@ filegroup { visibility: [ "//hardware/interfaces/automotive/vehicle/aidl:__subpackages__", "//packages/services/Car:__subpackages__", + "//cts/tests/tests/car_permission_tests", ], } -- GitLab From e279306e5788502386a62940d405a9866b5d6fa2 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 5 Sep 2023 17:20:49 -0700 Subject: [PATCH 130/376] Add missing status codes Bug: 299191602 Test: m Change-Id: I65a74ac6e93ec5ffcf32b54b6a11c983b1c32262 --- .../automotive/vehicle/StatusCode.proto | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto index 63d7933e7d..95e766a2ea 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto @@ -38,6 +38,37 @@ enum StatusCode { /* Something unexpected has happened in Vehicle HAL */ INTERNAL_ERROR = 5; + + /** + * For features that are not available because the underlying feature is + * disabled. + */ + NOT_AVAILABLE_DISABLED = 6; + + /** + * For features that are not available because the vehicle speed is too low. + */ + NOT_AVAILABLE_SPEED_LOW = 7; + + /** + * For features that are not available because the vehicle speed is too + * high. + */ + NOT_AVAILABLE_SPEED_HIGH = 8; + + /** + * For features that are not available because of bad camera or sensor + * visibility. Examples might be bird poop blocking the camera or a bumper + * cover blocking an ultrasonic sensor. + */ + NOT_AVAILABLE_POOR_VISIBILITY = 9; + + /** + * The feature cannot be accessed due to safety reasons. Eg. System could be + * in a faulty state, an object or person could be blocking the requested + * operation such as closing a trunk door, etc. + */ + NOT_AVAILABLE_SAFETY = 10; }; message VehicleHalCallStatus { -- GitLab From 810144a1682f9f0dfde64c08c04cdef16e234611 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 5 Sep 2023 17:49:55 -0700 Subject: [PATCH 131/376] Add missing supportedEnumValues Bug: 299192013 Test: m Change-Id: I36d1e4942cb44604539e384bde9300ac8ca8eba2 --- .../src/ProtoMessageConverter.cpp | 10 +++++++++- .../automotive/vehicle/VehicleAreaConfig.proto | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp index 6cbc7e523e..6b789bb7a9 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp @@ -73,6 +73,11 @@ void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropCo protoACfg->set_max_float_value(areaConfig.maxFloatValue); protoACfg->set_min_int32_value(areaConfig.minInt32Value); protoACfg->set_max_int32_value(areaConfig.maxInt32Value); + if (areaConfig.supportedEnumValues.has_value()) { + for (auto& supportedEnumValue : areaConfig.supportedEnumValues.value()) { + protoACfg->add_supported_enum_values(supportedEnumValue); + } + } } } @@ -87,7 +92,7 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, config_array, out, configArray); auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) { - return aidl_vehicle::VehicleAreaConfig{ + auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{ .areaId = protoAcfg.area_id(), .minInt32Value = protoAcfg.min_int32_value(), .maxInt32Value = protoAcfg.max_int32_value(), @@ -96,6 +101,9 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo .minFloatValue = protoAcfg.min_float_value(), .maxFloatValue = protoAcfg.max_float_value(), }; + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig), + supportedEnumValues.value()); + return vehicleAreaConfig; }; CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg); } diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto index b5b7e8070a..ddc64d940d 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto @@ -36,4 +36,11 @@ message VehicleAreaConfig { float min_float_value = 6; float max_float_value = 7; + + /** + * If the property has a @data_enum, then it is possible to specify a supported subset of the + * @data_enum. If the property has a @data_enum and supported_enum_values is null, then it is + * assumed all @data_enum values are supported unless specified through another mechanism. + */ + repeated int64 supported_enum_values = 8; }; -- GitLab From 4b5e5ce4066aec98057e6413c30ce0f29bae3d34 Mon Sep 17 00:00:00 2001 From: Jeff Pu Date: Wed, 6 Sep 2023 14:47:49 +0000 Subject: [PATCH 132/376] Face Biometric Virtual HAL Bug: 294254230 Test: Manual Change-Id: I00813b1313510e0965cb91864163e182e10aea22 --- biometrics/face/aidl/default/Android.bp | 12 +-- biometrics/face/aidl/default/FakeFaceEngine.h | 4 +- biometrics/face/aidl/default/README.md | 82 ++++++++---------- biometrics/face/aidl/default/Session.cpp | 3 + biometrics/face/aidl/default/apex/Android.bp | 41 ++++----- ...ardware.biometrics.face.virtual.avbpubkey} | Bin ...roid.hardware.biometrics.face.virtual.pem} | 0 ...roid.hardware.biometrics.face.virtual.pk8} | Bin ...hardware.biometrics.face.virtual.x509.pem} | 0 .../face/aidl/default/apex/manifest.json | 2 +- biometrics/face/aidl/default/face-default.rc | 5 -- biometrics/face/aidl/default/face-example.rc | 8 ++ .../{face-default.xml => face-example.xml} | 2 +- biometrics/face/aidl/default/main.cpp | 6 +- .../compatibility_matrix.9.xml | 1 + 15 files changed, 79 insertions(+), 87 deletions(-) rename biometrics/face/aidl/default/apex/{com.android.hardware.biometrics.face.avbpubkey => com.android.hardware.biometrics.face.virtual.avbpubkey} (100%) rename biometrics/face/aidl/default/apex/{com.android.hardware.biometrics.face.pem => com.android.hardware.biometrics.face.virtual.pem} (100%) rename biometrics/face/aidl/default/apex/{com.android.hardware.biometrics.face.pk8 => com.android.hardware.biometrics.face.virtual.pk8} (100%) rename biometrics/face/aidl/default/apex/{com.android.hardware.biometrics.face.x509.pem => com.android.hardware.biometrics.face.virtual.x509.pem} (100%) delete mode 100644 biometrics/face/aidl/default/face-default.rc create mode 100644 biometrics/face/aidl/default/face-example.rc rename biometrics/face/aidl/default/{face-default.xml => face-example.xml} (81%) diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index 82ad9174a5..7bc219855c 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -8,20 +8,20 @@ package { } filegroup { - name: "face-default.rc", - srcs: ["face-default.rc"], + name: "face-example.rc", + srcs: ["face-example.rc"], } filegroup { - name: "face-default.xml", - srcs: ["face-default.xml"], + name: "face-example.xml", + srcs: ["face-example.xml"], } cc_binary { name: "android.hardware.biometrics.face-service.example", relative_install_path: "hw", - init_rc: [":face-default.rc"], - vintf_fragments: [":face-default.xml"], + init_rc: [":face-example.rc"], + vintf_fragments: [":face-example.xml"], vendor: true, shared_libs: [ "libbase", diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h index edb54ce0f8..eb9944172f 100644 --- a/biometrics/face/aidl/default/FakeFaceEngine.h +++ b/biometrics/face/aidl/default/FakeFaceEngine.h @@ -16,6 +16,8 @@ #pragma once +#define LOG_TAG "FaceVirtualHal" + #include #include #include @@ -62,4 +64,4 @@ class FakeFaceEngine { std::mt19937 mRandom; }; -} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file +} // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md index 16559733c0..77bfe57209 100644 --- a/biometrics/face/aidl/default/README.md +++ b/biometrics/face/aidl/default/README.md @@ -1,77 +1,63 @@ -# Virtual Face HAL +# Face Virtual HAL (VHAL) This is a virtual HAL implementation that is backed by system properties instead of actual hardware. It's intended for testing and UI development on debuggable builds to allow devices to masquerade as alternative device types and for emulators. +Note: The virtual face HAL feature development will be done in phases. Refer to this doc often for +the latest supported features -## Device Selection +## Supported Devices -You can either run the FakeFaceEngine on a [real device](#actual-device) or a [virtual device/cuttlefish](#getting-started-on-a-virtual-device-cuttlefish). This document should -help you to get started on either one. +The face virtual hal is automatically built in in all debug builds (userdebug and eng) for the latest pixel devices and CF. +The instructions in this doc applies to all -After setting up a device, go ahead and try out [enrolling](#enrolling) & [authenticating](#authenticating) +## Enabling Face Virtual HAL -### Getting started on a Virtual Device (cuttlefish) +On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is not enabled. Therefore real Face HAL is used. +Face VHAL enabling is gated by the following two AND conditions: +1. The Face VHAL feature flag (as part of Trunk-development strategy) must be tured until the flags life-cycle ends. +2. The Face VHAL must be enabled via sysprop +##Getting Stared -Note, I'm running this via a cloudtop virtual device. - -1. Setup cuttlefish on cloudtop, See [this](https://g3doc.corp.google.com/company/teams/android/teampages/acloud/getting_started.md?cl=head) for more details. -2. acloud create --local-image -3. Enter in the shell command to disable hidl +A basic use case for a successful authentication via Face VHAL is given as an exmple below. +### Enabling VHAL ```shell $ adb root -$ adb shell settings put secure com.android.server.biometrics.AuthService.hidlDisabled 1 +$ adb shell device_config put biometrics_framework com.android.server.biometrics.face_vhal_feature true +$ adb shell settings put secure biometric_virtual_enabled 1 +$ adb shell setprop persist.vendor.face.virtual.strength strong +$ adb shell setprop persist.vendor.face.virtual.type RGB $ adb reboot ``` -4. You should now be able to do fake enrollments and authentications (as seen down below) - -### Actual Device - -1. Modify your real devices make file (I.E. vendor/google/products/{YOUR_DEVICE}.mk) -2. Ensure that there is no other face HAL that is being included by the device -3. Add the following -``` -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.biometrics.face.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.biometrics.face.xml - -PRODUCT_PACKAGES += \ - android.hardware.biometrics.face-service.example \ +### Direct Enrollment +```shell +$ adb shell locksettings set-pin 0000 +$ adb shell setprop persist.vendor.face.virtual.enrollments 1 +$ adb shell cmd face syncadb shell cmd face sync ``` -4. Now build and flash m -j120 && flash -5. Run the following commands +## Authenticating +To authenticate successfully, the captured (hit) must match the enrollment id set above. To trigger +authentication failure, set the hit id to a different value. ```shell -# This is a temporary workaround -$ adb root -$ adb shell setprop persist.vendor.face.virtual.type RGB -$ adb shell setprop persist.vendor.face.virtual.strength strong -$ adb shell locksettings set-pin 0000 -$ adb reboot +$ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 +$ adb shell setprop vendor.face.virtual.enrollment_hit 1 ``` +Note: At the initial phase of the Face VHAL development, Face-on-camera simulation is not supported, hence +the authentication immediately occurrs as soon as the authentication request arriving at VHAL. -## Enrolling + +## Enrollment via Setup ```shell # authenticar_id,bucket_id:duration:(true|false).... $ adb shell setprop vendor.face.virtual.next_enrollment 1,0:500:true,5:250:true,10:150:true,15:500:true -$ adb shell am start -n com.android.settings/.biometrics.face.FaceEnrollIntroduction +$ walk thru the manual enrollment process by following screen instructions + # If you would like to get rid of the enrollment, run the follwoing command $ adb shell setprop persist.vendor.face.virtual.enrollments \"\" ``` - -## Authenticating - -```shell -# If enrollment hasn't been setup -$ adb shell setprop persist.vendor.face.virtual.enrollments 1 -$ adb shell cmd face sync -# After enrollment has been setup -$ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 -$ adb shell setprop vendor.face.virtual.enrollment_hit 1 -# Power button press to simulate auth -$ adb shell input keyevent 26 -``` diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp index 1188459f3f..6235b83195 100644 --- a/biometrics/face/aidl/default/Session.cpp +++ b/biometrics/face/aidl/default/Session.cpp @@ -18,6 +18,9 @@ #include "Session.h" +#undef LOG_TAG +#define LOG_TAG "FaceVirtualHalSession" + namespace aidl::android::hardware::biometrics::face { constexpr size_t MAX_WORKER_QUEUE_SIZE = 5; diff --git a/biometrics/face/aidl/default/apex/Android.bp b/biometrics/face/aidl/default/apex/Android.bp index 2f39a0839a..9c031a35d7 100644 --- a/biometrics/face/aidl/default/apex/Android.bp +++ b/biometrics/face/aidl/default/apex/Android.bp @@ -17,24 +17,23 @@ package { } apex_key { - name: "com.android.hardware.biometrics.face.key", - public_key: "com.android.hardware.biometrics.face.avbpubkey", - private_key: "com.android.hardware.biometrics.face.pem", + name: "com.android.hardware.biometrics.face.virtual.key", + public_key: "com.android.hardware.biometrics.face.virtual.avbpubkey", + private_key: "com.android.hardware.biometrics.face.virtual.pem", } android_app_certificate { - name: "com.android.hardware.biometrics.face.certificate", - certificate: "com.android.hardware.biometrics.face", + name: "com.android.hardware.biometrics.face.virtual.certificate", + certificate: "com.android.hardware.biometrics.face.virtual", } apex { - name: "com.android.hardware.biometrics.face", + name: "com.android.hardware.biometrics.face.virtual", manifest: "manifest.json", file_contexts: "file_contexts", - key: "com.android.hardware.biometrics.face.key", - certificate: ":com.android.hardware.biometrics.face.certificate", + key: "com.android.hardware.biometrics.face.virtual.key", + certificate: ":com.android.hardware.biometrics.face.virtual.certificate", updatable: false, - vendor: true, use_vndk_as_stable: true, @@ -44,11 +43,9 @@ apex { ], prebuilts: [ // init_rc - "face-default-apex.rc", + "face-example-apex.rc", // vintf_fragment - "face-default-apex.xml", - // permission - "android.hardware.biometrics.face.prebuilt.xml", + "face-example-apex.xml", ], overrides: [ @@ -57,23 +54,21 @@ apex { } prebuilt_etc { - name: "face-default-apex.rc", - src: ":gen-face-default-apex.rc", - vendor: true, + name: "face-example-apex.rc", + src: ":gen-face-example-apex.rc", installable: false, } genrule { - name: "gen-face-default-apex.rc", - srcs: [":face-default.rc"], - out: ["face-default-apex.rc"], - cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.face/bin/@' $(in) > $(out)", + name: "gen-face-example-apex.rc", + srcs: [":face-example.rc"], + out: ["face-example-apex.rc"], + cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.face.virtual/bin/@' $(in) > $(out)", } prebuilt_etc { - name: "face-default-apex.xml", - src: ":face-default.xml", + name: "face-example-apex.xml", + src: ":face-example.xml", sub_dir: "vintf", - vendor: true, installable: false, } diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.avbpubkey b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.avbpubkey similarity index 100% rename from biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.avbpubkey rename to biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.avbpubkey diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.pem b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem similarity index 100% rename from biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.pem rename to biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.pk8 b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pk8 similarity index 100% rename from biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.pk8 rename to biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pk8 diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.x509.pem b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem similarity index 100% rename from biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.x509.pem rename to biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem diff --git a/biometrics/face/aidl/default/apex/manifest.json b/biometrics/face/aidl/default/apex/manifest.json index 4d46896a15..ecdc2990cc 100644 --- a/biometrics/face/aidl/default/apex/manifest.json +++ b/biometrics/face/aidl/default/apex/manifest.json @@ -1,4 +1,4 @@ { - "name": "com.android.hardware.biometrics.face", + "name": "com.android.hardware.biometrics.face.virtual", "version": 1 } diff --git a/biometrics/face/aidl/default/face-default.rc b/biometrics/face/aidl/default/face-default.rc deleted file mode 100644 index f6499f0a09..0000000000 --- a/biometrics/face/aidl/default/face-default.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.face-default /vendor/bin/hw/android.hardware.biometrics.face-service.example - class hal - user nobody - group nobody - diff --git a/biometrics/face/aidl/default/face-example.rc b/biometrics/face/aidl/default/face-example.rc new file mode 100644 index 0000000000..b0d82c60c5 --- /dev/null +++ b/biometrics/face/aidl/default/face-example.rc @@ -0,0 +1,8 @@ +service vendor.face-example /vendor/bin/hw/android.hardware.biometrics.face-service.example + class hal + user nobody + group nobody + interface aidl android.hardware.biometrics.face.IFace/virtual + oneshot + disabled + diff --git a/biometrics/face/aidl/default/face-default.xml b/biometrics/face/aidl/default/face-example.xml similarity index 81% rename from biometrics/face/aidl/default/face-default.xml rename to biometrics/face/aidl/default/face-example.xml index 8f2fbb8def..1c5071ad3d 100644 --- a/biometrics/face/aidl/default/face-default.xml +++ b/biometrics/face/aidl/default/face-example.xml @@ -2,6 +2,6 @@ android.hardware.biometrics.face 3 - IFace/default + IFace/virtual diff --git a/biometrics/face/aidl/default/main.cpp b/biometrics/face/aidl/default/main.cpp index b7274e386a..38e1c6311d 100644 --- a/biometrics/face/aidl/default/main.cpp +++ b/biometrics/face/aidl/default/main.cpp @@ -27,9 +27,11 @@ int main() { ABinderProcess_setThreadPoolMaxThreadCount(0); std::shared_ptr hal = ndk::SharedRefBase::make(); - const std::string instance = std::string(Face::descriptor) + "/default"; - binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str()); + const std::string instance = std::string(Face::descriptor) + "/virtual"; + binder_status_t status = + AServiceManager_registerLazyService(hal->asBinder().get(), instance.c_str()); CHECK_EQ(status, STATUS_OK); + AServiceManager_forceLazyServicesPersist(true); ABinderProcess_joinThreadPool(); return EXIT_FAILURE; // should not reach diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 9a9af1c109..57fa2bf805 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -120,6 +120,7 @@ IFace default + virtual -- GitLab From 664048f21856ab30d5b713e524ef588f35747938 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Thu, 7 Sep 2023 11:26:38 -0700 Subject: [PATCH 133/376] Fix bcradio HAL unsigned int comparison error Bug: 299489486 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I87fe60a593800535e0aadb0baf87696ee6844004 --- broadcastradio/aidl/default/VirtualRadio.cpp | 26 +++++++++---------- broadcastradio/common/utilsaidl/Utils.cpp | 18 ++++++------- .../include/broadcastradio-utils-aidl/Utils.h | 6 ++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/broadcastradio/aidl/default/VirtualRadio.cpp b/broadcastradio/aidl/default/VirtualRadio.cpp index 126bcff621..86c5a962bc 100644 --- a/broadcastradio/aidl/default/VirtualRadio.cpp +++ b/broadcastradio/aidl/default/VirtualRadio.cpp @@ -53,18 +53,18 @@ const VirtualRadio& VirtualRadio::getAmFmRadio() { static VirtualRadio amFmRadioMock( "AM/FM radio mock", { - {makeSelectorAmfm(/* frequency= */ 94900), "Wild 94.9", "Drake ft. Rihanna", + {makeSelectorAmfm(/* frequency= */ 94900u), "Wild 94.9", "Drake ft. Rihanna", "Too Good"}, - {makeSelectorAmfm(/* frequency= */ 96500), "KOIT", "Celine Dion", "All By Myself"}, - {makeSelectorAmfm(/* frequency= */ 97300), "Alice@97.3", "Drops of Jupiter", "Train"}, - {makeSelectorAmfm(/* frequency= */ 99700), "99.7 Now!", "The Chainsmokers", "Closer"}, - {makeSelectorAmfm(/* frequency= */ 101300), "101-3 KISS-FM", "Justin Timberlake", + {makeSelectorAmfm(/* frequency= */ 96500u), "KOIT", "Celine Dion", "All By Myself"}, + {makeSelectorAmfm(/* frequency= */ 97300u), "Alice@97.3", "Drops of Jupiter", "Train"}, + {makeSelectorAmfm(/* frequency= */ 99700u), "99.7 Now!", "The Chainsmokers", "Closer"}, + {makeSelectorAmfm(/* frequency= */ 101300u), "101-3 KISS-FM", "Justin Timberlake", "Rock Your Body"}, - {makeSelectorAmfm(/* frequency= */ 103700), "iHeart80s @ 103.7", "Michael Jackson", + {makeSelectorAmfm(/* frequency= */ 103700u), "iHeart80s @ 103.7", "Michael Jackson", "Billie Jean"}, - {makeSelectorAmfm(/* frequency= */ 106100), "106 KMEL", "Drake", "Marvins Room"}, - {makeSelectorAmfm(/* frequency= */ 700), "700 AM", "Artist700", "Title700"}, - {makeSelectorAmfm(/* frequency= */ 1700), "1700 AM", "Artist1700", "Title1700"}, + {makeSelectorAmfm(/* frequency= */ 106100u), "106 KMEL", "Drake", "Marvins Room"}, + {makeSelectorAmfm(/* frequency= */ 700u), "700 AM", "Artist700", "Title700"}, + {makeSelectorAmfm(/* frequency= */ 1700u), "1700 AM", "Artist1700", "Title1700"}, }); // clang-format on return amFmRadioMock; @@ -77,13 +77,13 @@ const VirtualRadio& VirtualRadio::getDabRadio() { "DAB radio mock", { {makeSelectorDab(/* sidExt= */ 0xA000000001u, /* ensemble= */ 0x0001u, - /* freq= */ 225648), "BBC Radio 1", "Khalid", "Talk"}, + /* freq= */ 225648u), "BBC Radio 1", "Khalid", "Talk"}, {makeSelectorDab(/* sidExt= */ 0xB000000001u, /* ensemble= */ 0x1001u, - /* freq= */ 222064), "Classic FM", "Jean Sibelius", "Andante Festivo"}, + /* freq= */ 222064u), "Classic FM", "Jean Sibelius", "Andante Festivo"}, {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u, - /* freq= */ 227360), "Absolute Radio", "Coldplay", "Clocks"}, + /* freq= */ 227360u), "Absolute Radio", "Coldplay", "Clocks"}, {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u, - /* freq= */ 222064), "Absolute Radio", "Coldplay", "Clocks"}, + /* freq= */ 222064u), "Absolute Radio", "Coldplay", "Clocks"}, }); // clang-format on return dabRadioMock; diff --git a/broadcastradio/common/utilsaidl/Utils.cpp b/broadcastradio/common/utilsaidl/Utils.cpp index 0551badc45..de4f52926d 100644 --- a/broadcastradio/common/utilsaidl/Utils.cpp +++ b/broadcastradio/common/utilsaidl/Utils.cpp @@ -204,7 +204,7 @@ bool isSupported(const Properties& prop, const ProgramSelector& sel) { } bool isValid(const ProgramIdentifier& id) { - int64_t val = id.value; + uint64_t val = static_cast(id.value); bool valid = true; auto expect = [&valid](bool condition, const string& message) { @@ -231,11 +231,11 @@ bool isValid(const ProgramIdentifier& id) { expect(val <= 0xFFFFu, "16bit id"); break; case IdentifierType::HD_STATION_ID_EXT: { - int64_t stationId = val & 0xFFFFFFFF; // 32bit + uint64_t stationId = val & 0xFFFFFFFF; // 32bit val >>= 32; - int64_t subchannel = val & 0xF; // 4bit + uint64_t subchannel = val & 0xF; // 4bit val >>= 4; - int64_t freq = val & 0x3FFFF; // 18bit + uint64_t freq = val & 0x3FFFF; // 18bit expect(stationId != 0u, "HD station id != 0"); expect(subchannel < 8u, "HD subch < 8"); expect(freq > 100u, "f > 100kHz"); @@ -252,9 +252,9 @@ bool isValid(const ProgramIdentifier& id) { break; } case IdentifierType::DAB_SID_EXT: { - int64_t sid = val & 0xFFFFFFFF; // 32bit + uint64_t sid = val & 0xFFFFFFFF; // 32bit val >>= 32; - int64_t ecc = val & 0xFF; // 8bit + uint64_t ecc = val & 0xFF; // 8bit expect(sid != 0u, "DAB SId != 0"); expect(ecc >= 0xA0u && ecc <= 0xF6u, "Invalid ECC, see ETSI TS 101 756 V2.1.1"); break; @@ -305,19 +305,19 @@ ProgramIdentifier makeIdentifier(IdentifierType type, int64_t value) { return {type, value}; } -ProgramSelector makeSelectorAmfm(int32_t frequency) { +ProgramSelector makeSelectorAmfm(uint32_t frequency) { ProgramSelector sel = {}; sel.primaryId = makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, frequency); return sel; } -ProgramSelector makeSelectorDab(int64_t sidExt) { +ProgramSelector makeSelectorDab(uint64_t sidExt) { ProgramSelector sel = {}; sel.primaryId = makeIdentifier(IdentifierType::DAB_SID_EXT, sidExt); return sel; } -ProgramSelector makeSelectorDab(int64_t sidExt, int32_t ensemble, int64_t freq) { +ProgramSelector makeSelectorDab(uint64_t sidExt, uint32_t ensemble, uint64_t freq) { ProgramSelector sel = {}; sel.primaryId = makeIdentifier(IdentifierType::DAB_SID_EXT, sidExt); vector secondaryIds = { diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h index ad075f2943..ee85a178da 100644 --- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h +++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h @@ -137,9 +137,9 @@ bool isValid(const ProgramIdentifier& id); bool isValid(const ProgramSelector& sel); ProgramIdentifier makeIdentifier(IdentifierType type, int64_t value); -ProgramSelector makeSelectorAmfm(int32_t frequency); -ProgramSelector makeSelectorDab(int64_t sidExt); -ProgramSelector makeSelectorDab(int64_t sidExt, int32_t ensemble, int64_t freq); +ProgramSelector makeSelectorAmfm(uint32_t frequency); +ProgramSelector makeSelectorDab(uint64_t sidExt); +ProgramSelector makeSelectorDab(uint64_t sidExt, uint32_t ensemble, uint64_t freq); bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel); -- GitLab From 7373343a1aaa5b8ffa2f4675f6ff4832cf382b5f Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Thu, 7 Sep 2023 19:52:06 +0000 Subject: [PATCH 134/376] Check for null pointers in all public methods in wifi_aidl_test_utils. Bug: 298747174 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: I042f024a30f3afb1425816c350fddf98fbe526ef --- wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp index ca3c4b74f1..594ea0385d 100644 --- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp +++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp @@ -197,6 +197,9 @@ std::shared_ptr getBridgedWifiApIface(const char* instance_name) { bool configureChipToSupportConcurrencyType(const std::shared_ptr& wifi_chip, IfaceConcurrencyType type, int* configured_mode_id) { + if (!wifi_chip.get()) { + return false; + } return configureChipToSupportConcurrencyTypeInternal(wifi_chip, type, configured_mode_id); } @@ -208,6 +211,9 @@ void stopWifiService(const char* instance_name) { } int32_t getChipFeatureSet(const std::shared_ptr& wifi_chip) { + if (!wifi_chip.get()) { + return 0; + } int32_t features = 0; if (wifi_chip->getFeatureSet(&features).isOk()) { return features; -- GitLab From 40a58baa2cf0380dcab908a6f1e3cf8fd11d351c Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Fri, 8 Sep 2023 09:27:25 -0700 Subject: [PATCH 135/376] Clarify unsigned int type in AIDL program id Clarified that the value in ProgramIdentifier in AIDL broadcast radio HAL should be unsigned 64-bit int, but is represented as signed int since unsigned int types are not supported in AIDL. Bug: 299489486 Test: m -j Change-Id: I2f35cefebdf1b5e39bf48cab896b077c4cb6c2e4 --- .../android/hardware/broadcastradio/ProgramIdentifier.aidl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl index 2057d97eb0..a2de5d6e21 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramIdentifier.aidl @@ -30,8 +30,10 @@ parcelable ProgramIdentifier { IdentifierType type = IdentifierType.INVALID; /** - * The uint64_t value field holds the value in format described in comments - * for IdentifierType enum. + * The value field holds the value in format described in comments for IdentifierType enum. + * + * The value should be 64-bit unsigned integer, but is represented as 64-bit signed integer + * in AIDL. */ long value; } -- GitLab From 70b126cd25b299dcf6371f683f02e27eb29cad51 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Fri, 8 Sep 2023 18:03:05 +0000 Subject: [PATCH 136/376] Add AIDL VTS helper method to check whether the specified iface type is supported. Bug: 297959416 Test: atest VtsHalWifiChipTargetTest \ VtsHalWifiStaIfaceTargetTest \ VtsHalWifiApIfaceTargetTest \ VtsHalWifiNanIfaceTargetTest \ VtsHalWifiRttControllerTargetTest Change-Id: Ia10d3805c5ebb5dd3e3e07b6106c0879f1764943 --- wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp | 14 ++++++++++++++ wifi/aidl/vts/functional/wifi_aidl_test_utils.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp index ca3c4b74f1..7bd1397097 100644 --- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp +++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp @@ -200,6 +200,20 @@ bool configureChipToSupportConcurrencyType(const std::shared_ptr& wif return configureChipToSupportConcurrencyTypeInternal(wifi_chip, type, configured_mode_id); } +bool doesChipSupportConcurrencyType(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type) { + if (!wifi_chip.get()) { + return false; + } + std::vector chip_modes; + auto status = wifi_chip->getAvailableModes(&chip_modes); + if (!status.isOk()) { + return false; + } + int mode_id; + return findAnyModeSupportingConcurrencyType(type, chip_modes, &mode_id); +} + void stopWifiService(const char* instance_name) { std::shared_ptr wifi = getWifi(instance_name); if (wifi != nullptr) { diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.h b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h index 0d70c3b557..921d689926 100644 --- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.h +++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h @@ -42,6 +42,9 @@ std::shared_ptr getBridgedWifiApIface(std::shared_ptr w // Configure the chip in a mode to support the creation of the provided iface type. bool configureChipToSupportConcurrencyType(const std::shared_ptr& wifi_chip, IfaceConcurrencyType type, int* configured_mode_id); +// Check whether the chip supports the creation of the provided iface type. +bool doesChipSupportConcurrencyType(const std::shared_ptr& wifi_chip, + IfaceConcurrencyType type); // Used to trigger IWifi.stop() at the end of every test. void stopWifiService(const char* instance_name); int32_t getChipFeatureSet(const std::shared_ptr& wifi_chip); -- GitLab From ec9012dd2de375e10dcb4828440ba9dea71b7e82 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Fri, 8 Sep 2023 21:33:29 +0000 Subject: [PATCH 137/376] Remove HIDL graphics.mapper service from V+ The native HAL is used instead. Test: m Bug: 285605852 Change-Id: Ic2db38dff80b709aff7cc85fcd426a123e6f84df --- compatibility_matrices/compatibility_matrix.9.xml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 9a9af1c109..59fd2b0a1e 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -238,15 +238,6 @@ default - - - android.hardware.graphics.mapper - 4.0 - - IMapper - default - - android.hardware.health 1-2 @@ -686,7 +677,7 @@ default - + mapper 5.0 -- GitLab From e8e161e255c72dac6aa58ad4e7eac4e9b4190d12 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Mon, 11 Sep 2023 17:15:28 +0000 Subject: [PATCH 138/376] Skip AP and P2P tests in wifi_chip_aidl_test if those iface types cannot be created. Bug: 297959416 Test: atest VtsHalWifiChipTargetTest Change-Id: I917be24bb46b74fe3fb9d08e8af099b782e19469 --- .../vts/functional/wifi_chip_aidl_test.cpp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp index bbd27f95e3..740f8332b7 100644 --- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp +++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp @@ -63,6 +63,10 @@ class WifiChipAidlTest : public testing::TestWithParam { return mode_id; } + bool isConcurrencyTypeSupported(IfaceConcurrencyType type) { + return doesChipSupportConcurrencyType(wifi_chip_, type); + } + std::shared_ptr configureChipForStaAndGetIface() { std::shared_ptr iface; configureChipForConcurrencyType(IfaceConcurrencyType::STA); @@ -532,6 +536,9 @@ TEST_P(WifiChipAidlTest, CreateStaIface) { * CreateApIface */ TEST_P(WifiChipAidlTest, CreateApIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) { + GTEST_SKIP() << "AP is not supported"; + } configureChipForApAndGetIface(); } @@ -549,6 +556,9 @@ TEST_P(WifiChipAidlTest, CreateNanIface) { * CreateP2pIface */ TEST_P(WifiChipAidlTest, CreateP2pIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) { + GTEST_SKIP() << "P2P is not supported"; + } configureChipForP2pAndGetIface(); } @@ -583,6 +593,9 @@ TEST_P(WifiChipAidlTest, GetStaIfaceNames) { * GetP2pIfaceNames */ TEST_P(WifiChipAidlTest, GetP2pIfaceNames) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) { + GTEST_SKIP() << "P2P is not supported"; + } configureChipForConcurrencyType(IfaceConcurrencyType::P2P); std::vector iface_names; @@ -607,6 +620,9 @@ TEST_P(WifiChipAidlTest, GetP2pIfaceNames) { * GetApIfaceNames */ TEST_P(WifiChipAidlTest, GetApIfaceNames) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) { + GTEST_SKIP() << "AP is not supported"; + } configureChipForConcurrencyType(IfaceConcurrencyType::AP); std::vector iface_names; @@ -679,6 +695,9 @@ TEST_P(WifiChipAidlTest, GetStaIface) { * GetP2pIface */ TEST_P(WifiChipAidlTest, GetP2pIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) { + GTEST_SKIP() << "P2P is not supported"; + } std::shared_ptr iface = configureChipForP2pAndGetIface(); std::string iface_name = getP2pIfaceName(iface); @@ -697,6 +716,9 @@ TEST_P(WifiChipAidlTest, GetP2pIface) { * GetApIface */ TEST_P(WifiChipAidlTest, GetApIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) { + GTEST_SKIP() << "AP is not supported"; + } std::shared_ptr iface = configureChipForApAndGetIface(); std::string iface_name = getApIfaceName(iface); @@ -755,6 +777,9 @@ TEST_P(WifiChipAidlTest, RemoveStaIface) { * RemoveP2pIface */ TEST_P(WifiChipAidlTest, RemoveP2pIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) { + GTEST_SKIP() << "P2P is not supported"; + } std::shared_ptr iface = configureChipForP2pAndGetIface(); std::string iface_name = getP2pIfaceName(iface); @@ -771,6 +796,9 @@ TEST_P(WifiChipAidlTest, RemoveP2pIface) { * RemoveApIface */ TEST_P(WifiChipAidlTest, RemoveApIface) { + if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) { + GTEST_SKIP() << "AP is not supported"; + } std::shared_ptr iface = configureChipForApAndGetIface(); std::string iface_name = getApIfaceName(iface); -- GitLab From 1491721640ef25f54ff18cc973a8372bb3c39755 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 12 Sep 2023 20:55:18 +0000 Subject: [PATCH 139/376] Revert "Remove HIDL graphics.mapper service from V+" Revert submission 24707439-mapper5_cf Reason for revert: Camera CTS tests fail b/300115646 Reverted changes: /q/submissionid:24707439-mapper5_cf Change-Id: I00f0e4ef363455e68f838b0d9a967fbee8b272a6 --- compatibility_matrices/compatibility_matrix.9.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 59fd2b0a1e..9a9af1c109 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -238,6 +238,15 @@ default + + + android.hardware.graphics.mapper + 4.0 + + IMapper + default + + android.hardware.health 1-2 @@ -677,7 +686,7 @@ default - + mapper 5.0 -- GitLab From 1e467c28493e6306dc48d5822db8ea7cc7d28fbc Mon Sep 17 00:00:00 2001 From: jiabin Date: Tue, 12 Sep 2023 21:23:44 +0000 Subject: [PATCH 140/376] AHAL: fix stack overflow when connecting usb device. Bug: 300146600 Test: manually Change-Id: Ic904a5f9d4d61a2b7dc896ed593c12da4793f1cb --- audio/aidl/default/usb/StreamUsb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/aidl/default/usb/StreamUsb.cpp b/audio/aidl/default/usb/StreamUsb.cpp index b60b4fd020..9b10432b18 100644 --- a/audio/aidl/default/usb/StreamUsb.cpp +++ b/audio/aidl/default/usb/StreamUsb.cpp @@ -52,7 +52,7 @@ ndk::ScopedAStatus StreamUsb::setConnectedDevices( } connectedDeviceProfiles.push_back(*profile); } - RETURN_STATUS_IF_ERROR(setConnectedDevices(connectedDevices)); + RETURN_STATUS_IF_ERROR(StreamCommonImpl::setConnectedDevices(connectedDevices)); std::lock_guard guard(mLock); mConnectedDeviceProfiles = std::move(connectedDeviceProfiles); mConnectedDevicesUpdated.store(true, std::memory_order_release); -- GitLab From 4206d28b886ca2cfc611730da27b4359fd99eea1 Mon Sep 17 00:00:00 2001 From: jimmyshiu Date: Thu, 31 Aug 2023 18:25:07 +0000 Subject: [PATCH 141/376] Power: add a DISPLAY_CHANGE mode Bug: 298150450 Test: build pass Change-Id: Ibdfb5bc071c17809bc35e892e8450406b2acdb70 --- .../current/android/hardware/power/Mode.aidl | 1 + power/aidl/android/hardware/power/Mode.aidl | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl index efbb300f8d..b8a071096f 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl @@ -51,4 +51,5 @@ enum Mode { CAMERA_STREAMING_HIGH, GAME, GAME_LOADING, + DISPLAY_CHANGE, } diff --git a/power/aidl/android/hardware/power/Mode.aidl b/power/aidl/android/hardware/power/Mode.aidl index cc4b1308d2..78f03632dc 100644 --- a/power/aidl/android/hardware/power/Mode.aidl +++ b/power/aidl/android/hardware/power/Mode.aidl @@ -133,11 +133,6 @@ enum Mode { */ DISPLAY_INACTIVE, - /** - * Below hints are currently not sent in Android framework but OEM might choose to - * implement for power/perf optimizations. - */ - /** * This mode indicates that low latency audio is active. */ @@ -172,4 +167,10 @@ enum Mode { * This mode indicates that the user is waiting for loading in a game. */ GAME_LOADING, + + /** + * This mode indicates that the display layout is changing due to rotation + * or switching between inner and outer panels. + */ + DISPLAY_CHANGE, } -- GitLab From 8db0bc013112a463db31f3c50a78a4ff347b7830 Mon Sep 17 00:00:00 2001 From: Tom Bergan Date: Mon, 11 Sep 2023 21:45:21 +0000 Subject: [PATCH 142/376] Fix crash in SthalCli SthalCli does not set all String fields of Properties, which results in some fields being null, which causes a NullPointerExecption when the Properties is converted to a SoundTrigger.ModuleProperties: https://cs.android.com/android/platform/superproject/+/main:frameworks/base/core/java/android/hardware/soundtrigger/SoundTrigger.java;drc=e6ac0c57d7261d83870571c7198518998e0f1732;l=164 This CL fixes that problem by setting the uuid and model arch fields. The uuid is set to a static randomly-generated UUID, instead of a dynamic randomly-generated UUID, so the UUID is more easily grep-able. Fixes: 300518031 Test: manually Change-Id: I3746470551aed1e0e5a806195c124a70037f1baf --- .../cli/java/android/hardware/soundtrigger3/cli/SthalCli.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java index 127f0629ff..41e25336c0 100644 --- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java +++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java @@ -289,6 +289,8 @@ public class SthalCli { Properties properties = new Properties(); properties.implementor = "Android"; properties.description = "Mock STHAL"; + properties.uuid = "a5af2d2a-4cc4-4b69-a22f-c9d5b6d492c3"; + properties.supportedModelArch = "Mock arch"; properties.maxSoundModels = 2; properties.maxKeyPhrases = 1; properties.recognitionModes = -- GitLab From 02a18250285d24f9e8c771ab8771f84a92da4e98 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Mon, 21 Aug 2023 22:52:12 +0000 Subject: [PATCH 143/376] Add EVS Camera Device Type to the Default Implementation Test: Build Bug: 277861838 Change-Id: I8f9c076e0d03f541587015c71aeb8a9335d37733 --- .../aidl/impl/default/include/ConfigManager.h | 15 +++++++++++++++ .../evs/aidl/impl/default/src/ConfigManager.cpp | 16 ++++++++++++++++ .../evs/aidl/impl/default/src/EvsEnumerator.cpp | 17 ++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/automotive/evs/aidl/impl/default/include/ConfigManager.h b/automotive/evs/aidl/impl/default/include/ConfigManager.h index 1d5fe772b2..37a17dc230 100644 --- a/automotive/evs/aidl/impl/default/include/ConfigManager.h +++ b/automotive/evs/aidl/impl/default/include/ConfigManager.h @@ -25,8 +25,10 @@ #include +#include #include #include +#include #include #include #include @@ -54,6 +56,15 @@ class ConfigManager final { /* Camera device's capabilities and metadata */ class CameraInfo { public: + enum class DeviceType : std::int32_t { + NONE = 0, + MOCK = 1, + V4L2 = 2, + VIDEO = 3, + + UNKNOWN = std::numeric_limits>::max(), + }; + CameraInfo() : characteristics(nullptr) {} virtual ~CameraInfo(); @@ -69,6 +80,10 @@ class ConfigManager final { return characteristics != nullptr; } + static DeviceType deviceTypeFromSV(const std::string_view sv); + + DeviceType deviceType{DeviceType::NONE}; + /* * List of supported controls that the primary client can program. * Paraemters are stored with its valid range diff --git a/automotive/evs/aidl/impl/default/src/ConfigManager.cpp b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp index da791ed0b9..ba4cdc0c16 100644 --- a/automotive/evs/aidl/impl/default/src/ConfigManager.cpp +++ b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp @@ -40,6 +40,18 @@ std::string_view ConfigManager::sConfigDefaultPath = std::string_view ConfigManager::sConfigOverridePath = "/vendor/etc/automotive/evs/evs_configuration_override.xml"; +ConfigManager::CameraInfo::DeviceType ConfigManager::CameraInfo::deviceTypeFromSV( + const std::string_view sv) { + using namespace std::string_view_literals; + static const std::unordered_map nameToType = { + {"mock"sv, DeviceType::MOCK}, + {"v4l2"sv, DeviceType::V4L2}, + {"video"sv, DeviceType::VIDEO}, + }; + const auto search = nameToType.find(sv); + return search == nameToType.end() ? DeviceType::UNKNOWN : search->second; +} + void ConfigManager::printElementNames(const XMLElement* rootElem, const std::string& prefix) const { const XMLElement* curElem = rootElem; @@ -128,6 +140,10 @@ bool ConfigManager::readCameraDeviceInfo(CameraInfo* aCamera, const XMLElement* return false; } + if (const auto typeAttr = aDeviceElem->FindAttribute("type")) { + aCamera->deviceType = CameraInfo::deviceTypeFromSV(typeAttr->Value()); + } + /* size information to allocate camera_metadata_t */ size_t totalEntries = 0; size_t totalDataSize = 0; diff --git a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp index 5178958675..3a81346832 100644 --- a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp @@ -253,7 +253,22 @@ ScopedAStatus EvsEnumerator::openCamera(const std::string& id, const Stream& cfg if (!sConfigManager) { pActiveCamera = EvsMockCamera::Create(id.data()); } else { - pActiveCamera = EvsMockCamera::Create(id.data(), sConfigManager->getCameraInfo(id), &cfg); + auto& cameraInfo = sConfigManager->getCameraInfo(id); + switch (cameraInfo->deviceType) { + using DeviceType = ConfigManager::CameraInfo::DeviceType; + + // Default to MOCK for backward compatibility. + case DeviceType::NONE: + case DeviceType::MOCK: + pActiveCamera = EvsMockCamera::Create(id.data(), cameraInfo, &cfg); + break; + + default: + LOG(ERROR) << __func__ << ": camera device type " + << static_cast(cameraInfo->deviceType) + << " is not supported."; + break; + } } pRecord->activeInstance = pActiveCamera; -- GitLab From c5d5d7565d16e5afe830c4efc8cff2f3d18122b1 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 22 Aug 2023 22:38:36 +0000 Subject: [PATCH 144/376] Add the abstraction layer for the camera classes Test: Build Bug: 277861838 Change-Id: I2ca960022916ef5db2896625208e74d4c0db5d36 --- .../aidl/impl/default/include/EvsCameraBase.h | 43 +++++++++++++++++++ .../aidl/impl/default/include/EvsEnumerator.h | 4 +- .../aidl/impl/default/include/EvsMockCamera.h | 15 +++---- .../aidl/impl/default/src/EvsEnumerator.cpp | 7 +-- 4 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 automotive/evs/aidl/impl/default/include/EvsCameraBase.h diff --git a/automotive/evs/aidl/impl/default/include/EvsCameraBase.h b/automotive/evs/aidl/impl/default/include/EvsCameraBase.h new file mode 100644 index 0000000000..c3e9dfc47d --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsCameraBase.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsCameraBase : public evs::BnEvsCamera { + private: + using Base = evs::BnEvsCamera; + using Self = EvsCameraBase; + + public: + using Base::Base; + + ~EvsCameraBase() override = default; + + virtual void shutdown() = 0; + + protected: + // This is used for the derived classes and it prevents constructors from direct access + // while it allows this class to be instantiated via ndk::SharedRefBase::make<>. + struct Sigil { + explicit Sigil() = default; + }; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h index 259c266721..7202bf837e 100644 --- a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h +++ b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h @@ -17,8 +17,8 @@ #pragma once #include "ConfigManager.h" +#include "EvsCameraBase.h" #include "EvsGlDisplay.h" -#include "EvsMockCamera.h" #include #include @@ -72,7 +72,7 @@ class EvsEnumerator final : public ::aidl::android::hardware::automotive::evs::B private: struct CameraRecord { evs::CameraDesc desc; - std::weak_ptr activeInstance; + std::weak_ptr activeInstance; CameraRecord(const char* cameraId) : desc() { desc.id = cameraId; } }; diff --git a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h index 7e010a29e0..c7b9e0fd92 100644 --- a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h +++ b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h @@ -17,8 +17,8 @@ #pragma once #include "ConfigManager.h" +#include "EvsCameraBase.h" -#include #include #include #include @@ -36,14 +36,7 @@ namespace aidl::android::hardware::automotive::evs::implementation { -class EvsMockCamera : public evs::BnEvsCamera { - // This prevents constructors from direct access while it allows this class to - // be instantiated via ndk::SharedRefBase::make<>. - private: - struct Sigil { - explicit Sigil() = default; - }; - +class EvsMockCamera : public EvsCameraBase { public: // Methods from ::android::hardware::automotive::evs::IEvsCamera follow. ndk::ScopedAStatus doneWithFrame(const std::vector& buffers) override; @@ -81,7 +74,9 @@ class EvsMockCamera : public evs::BnEvsCamera { EvsMockCamera& operator=(const EvsMockCamera&) = delete; virtual ~EvsMockCamera() override; - void shutdown(); + + // Methods from EvsCameraBase follow. + void shutdown() override; const evs::CameraDesc& getDesc() { return mDescription; } diff --git a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp index 3a81346832..ec4b18f906 100644 --- a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp @@ -17,6 +17,7 @@ #include "EvsEnumerator.h" #include "ConfigManager.h" +#include "EvsCameraBase.h" #include "EvsGlDisplay.h" #include "EvsMockCamera.h" @@ -243,7 +244,7 @@ ScopedAStatus EvsEnumerator::openCamera(const std::string& id, const Stream& cfg } // Has this camera already been instantiated by another caller? - std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); + std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); if (pActiveCamera) { LOG(WARNING) << "Killing previous camera because of new caller"; closeCamera(pActiveCamera); @@ -273,7 +274,7 @@ ScopedAStatus EvsEnumerator::openCamera(const std::string& id, const Stream& cfg pRecord->activeInstance = pActiveCamera; if (!pActiveCamera) { - LOG(ERROR) << "Failed to create new EvsMockCamera object for " << id; + LOG(ERROR) << "Failed to create new EVS camera object for " << id; return ScopedAStatus::fromServiceSpecificError( static_cast(EvsResult::UNDERLYING_SERVICE_ERROR)); } @@ -460,7 +461,7 @@ void EvsEnumerator::closeCamera_impl(const std::shared_ptr& pCamera, if (!pRecord) { LOG(ERROR) << "Asked to close a camera whose name isn't recognized"; } else { - std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); + std::shared_ptr pActiveCamera = pRecord->activeInstance.lock(); if (!pActiveCamera) { LOG(WARNING) << "Somehow a camera is being destroyed " << "when the enumerator didn't know one existed"; -- GitLab From 94950dc20d0c64f458d87d72c895e253e2d4ad11 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Thu, 14 Sep 2023 23:41:45 +0000 Subject: [PATCH 145/376] Rename toggleWifiFramework in the Hostapd AIDL test utils in order to avoid having an ambigous function call. aosp/2728874 adds a method of the same name, which is causing pre-submit issues. Bug: 297820612 Test: atest VtsHalHostapdTargetTest Change-Id: Ie4da0a0037e7411e7908401f021b48246ea227bd --- wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h b/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h index feee2c89b2..50a38d33fd 100644 --- a/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h +++ b/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h @@ -63,7 +63,7 @@ void waitForSupplicantState(bool enable) { LOG(ERROR) << "Unable to " << (enable ? "start" : "stop") << " supplicant"; } -void toggleWifiFramework(bool enable) { +void toggleWifiFrameworkAndScan(bool enable) { if (enable) { std::system("svc wifi enable"); std::system("cmd wifi set-scan-always-available enabled"); @@ -89,7 +89,7 @@ std::shared_ptr getHostapd(const std::string& hostapd_instance_name) { * any other clients to the HALs during testing. */ void disableHalsAndFramework() { - toggleWifiFramework(false); + toggleWifiFrameworkAndScan(false); stopHostapd(); stopVendorHal(); @@ -110,7 +110,7 @@ void stopHostapdAndVendorHal() { } void startWifiFramework() { - toggleWifiFramework(true); + toggleWifiFrameworkAndScan(true); } std::string setupApIfaceAndGetName(bool isBridged) { -- GitLab From c07cdae9bb7a33952031c9dd958e64e5e3150daa Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 18 Aug 2023 15:36:31 -0700 Subject: [PATCH 146/376] Add task schedule API to remote access HAL. These APIs allows a client to schedule a task to be executed later. If the vehicle is off when the task is to be exectued, the vehicle will be woken up, execute the task and shutdown. If the vehicle is already up, the task will be exectued. Test: None Bug: 282792374 Change-Id: I97c4fdbe2cba035e8bd9ddede4c94d0331c39eef --- automotive/remoteaccess/Android.bp | 3 +- .../remoteaccess/IRemoteAccess.aidl | 6 ++ .../automotive/remoteaccess/ScheduleInfo.aidl | 43 ++++++++++++ .../remoteaccess/IRemoteAccess.aidl | 66 +++++++++++++++++++ .../automotive/remoteaccess/ScheduleInfo.aidl | 62 +++++++++++++++++ .../compatibility_matrix.9.xml | 1 + 6 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl create mode 100644 automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl diff --git a/automotive/remoteaccess/Android.bp b/automotive/remoteaccess/Android.bp index 7cd6f60fe9..e1e90414c6 100644 --- a/automotive/remoteaccess/Android.bp +++ b/automotive/remoteaccess/Android.bp @@ -42,6 +42,5 @@ aidl_interface { imports: [], }, ], - frozen: true, - + frozen: false, } diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index b0935c2fb2..ccfa22de4e 100644 --- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -40,4 +40,10 @@ interface IRemoteAccess { void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback); void clearRemoteTaskCallback(); void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state); + boolean isTaskScheduleSupported(); + void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo); + void unscheduleTask(String clientId, String scheduleId); + void unscheduleAllTasks(String clientId); + boolean isTaskScheduled(String clientId, String scheduleId); + List getAllScheduledTasks(String clientId); } diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl new file mode 100644 index 0000000000..a929e10827 --- /dev/null +++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.remoteaccess; +@JavaDerive(equals=true, toString=true) @VintfStability +parcelable ScheduleInfo { + String clientId; + String scheduleId; + byte[] taskData; + int count; + long startTimeInEpochSeconds; + long periodicInSeconds; +} diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl index 0f4125f475..4912651294 100644 --- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl @@ -18,6 +18,7 @@ package android.hardware.automotive.remoteaccess; import android.hardware.automotive.remoteaccess.ApState; import android.hardware.automotive.remoteaccess.IRemoteTaskCallback; +import android.hardware.automotive.remoteaccess.ScheduleInfo; /** * Interface representing a remote wakeup client. @@ -96,4 +97,69 @@ interface IRemoteAccess { *

If {@code isWakeupRequired} is false, it must not try to wake up AP. */ void notifyApStateChange(in ApState state); + + /** + * Returns whether task scheduling is supported. + * + *

If this returns {@code true}, user may use {@link scheduleTask} to schedule a task to be + * executed at a later time. If the device is off when the task is scheduled to be executed, + * the device will be woken up to execute the task. + * + * @return {@code true} if serverless remote task scheduling is supported. + */ + boolean isTaskScheduleSupported(); + + /** + * Schedules a task to be executed later even when the vehicle is off. + * + *

If {@link isTaskScheduleSupported} returns {@code false}. This is no-op. + * + *

This sends a scheduled task message to a device external to Android so that the device + * can wake up Android and deliver the task through {@link IRemoteTaskCallback}. + * + *

Note that the scheduled task execution is on a best-effort basis. Multiple situations + * might cause the task not to execute successfully: + * + *

    + *
  • The vehicle is low on battery and the other device decides not to wake up Android. + *
  • User turns off vehicle while the task is executing. + *
  • The task logic itself fails. + * + *

    Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same + * {@code scheduleId} for this client exists. + */ + void scheduleTask(in ScheduleInfo scheduleInfo); + + /** + * Unschedules a scheduled task. + * + *

    If {@link isTaskScheduleSupported} returns {@code false}. This is no-op. + * + *

    Does nothing if a pending schedule with {@code clientId} and {@code scheduleId} does not + * exist. + */ + void unscheduleTask(String clientId, String scheduleId); + + /** + * Unschedules all scheduled tasks for the client. + * + *

    If {@link isTaskScheduleSupported} returns {@code false}. This is no-op. + */ + void unscheduleAllTasks(String clientId); + + /** + * Returns whether the specified task is scheduled. + * + *

    If {@link isTaskScheduleSupported} returns {@code false}, This must return {@code false}. + */ + boolean isTaskScheduled(String clientId, String scheduleId); + + /** + * Gets all pending scheduled tasks for the client. + * + *

    If {@link isTaskScheduleSupported} returns {@code false}. This must return empty array. + * + *

    The finished scheduled tasks will not be included. + */ + List getAllScheduledTasks(String clientId); } diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl new file mode 100644 index 0000000000..cf1437bf1b --- /dev/null +++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.remoteaccess; + +@VintfStability +@JavaDerive(equals=true, toString=true) +parcelable ScheduleInfo { + /** + * The ID used to identify the client this schedule is for. This must be one of the + * preconfigured remote access serverless client ID defined in car service resource + * {@code R.xml.remote_access_serverless_client_map}. + */ + String clientId; + /** + * A unique scheduling ID (among the same client). Adding a new schedule info with a duplicate + * scheduleId will return {@code EX_ILLEGAL_ARGUMENT}. + */ + String scheduleId; + /** + * The opaque task data that will be sent back to the remote task client app when the task is + * executed. It is not interpreted/parsed by the Android system. + */ + byte[] taskData; + /** + * How many times this task will be executed. 0 means infinite. + * + *

    This must be >= 0. + */ + int count; + /** + * The start time in epoch seconds. + * + *

    The external device issuing remote task must have a clock synced with the + * {@code System.currentTimeMillis()} used in Android system. + * + *

    Optionally, the VHAL property {@code EPOCH_TIME} can be used to sync the time. + * + *

    This must be >= 0. + */ + long startTimeInEpochSeconds; + /** + * The interval (in seconds) between scheduled task execution. + * + *

    This must be >=0. This is not useful when {@code count} is 1. If this is 0, + * The tasks will be delivered multiple times with no interval in between. + */ + long periodicInSeconds; +} diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 06ba9538ad..a201e8c991 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -102,6 +102,7 @@ android.hardware.automotive.remoteaccess + 1-2 IRemoteAccess default -- GitLab From c1ee98677e807b461a99fd3f101098fce5648bb7 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 15 Sep 2023 17:32:59 -0700 Subject: [PATCH 147/376] Rename reference VHAL to V3. The current target is actually supporting VHAL v2 interface, but we did not update the name. Update its name to V3 since it is going to support VHAL v3 interface. Test: Presubmit Bug: 300694866 Change-Id: I54bd15edb83add03b0fe8272b6e8787fef7003cf --- automotive/vehicle/aidl/impl/README.md | 2 +- automotive/vehicle/aidl/impl/vhal/Android.bp | 4 ++-- automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/automotive/vehicle/aidl/impl/README.md b/automotive/vehicle/aidl/impl/README.md index 121ffd15e7..2cd3a3eb5b 100644 --- a/automotive/vehicle/aidl/impl/README.md +++ b/automotive/vehicle/aidl/impl/README.md @@ -46,7 +46,7 @@ implementations (including reference VHAL). Vendor VHAL implementation could use this library, along with their own implementation for `IVehicleHardware` interface. -Also defines a binary `android.hardware.automotive.vehicle@V1-default-service` +Also defines a binary `android.hardware.automotive.vehicle@V3-default-service` which is the reference VHAL implementation. It implements `IVehicle.aidl` interface. It uses `DefaultVehicleHal`, along with `FakeVehicleHardware` (in fake_impl). It simulates the vehicle bus interaction by using an diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp index 4feea79490..c29345f622 100644 --- a/automotive/vehicle/aidl/impl/vhal/Android.bp +++ b/automotive/vehicle/aidl/impl/vhal/Android.bp @@ -19,7 +19,7 @@ package { } cc_binary { - name: "android.hardware.automotive.vehicle@V1-default-service", + name: "android.hardware.automotive.vehicle@V3-default-service", vendor: true, defaults: [ "FakeVehicleHardwareDefaults", @@ -68,7 +68,7 @@ cc_library { } cc_fuzz { - name: "android.hardware.automotive.vehicle@V1-default-service_fuzzer", + name: "android.hardware.automotive.vehicle-default-service_fuzzer", vendor: true, defaults: [ "FakeVehicleHardwareDefaults", diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc index 19267cd383..9fa7b98302 100644 --- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc +++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc @@ -1,4 +1,4 @@ -service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V1-default-service +service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V3-default-service class early_hal user vehicle_network group system inet -- GitLab From 5e154097aa6291f9f2cd413c51b872d4b81b16aa Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Wed, 13 Sep 2023 16:18:30 +0000 Subject: [PATCH 148/376] Convert from HIDL mapper to libui GraphicBufferMapper HIDL mapper HAL is deprecated and instead of adding more support for the new replacement explicitly, we can move the GraphicBufferMapper which handles all of the backwards compatbility with the HIDL HALs for us. Test: atest CtsCameraTestCases CtsAppOpsTestCases Bug: 285605852 Bug: 300115646 Change-Id: Ib97e429a0f3dd1c66ec008fbf3860c9c5667bddd --- camera/common/default/Android.bp | 5 +- camera/common/default/HandleImporter.cpp | 399 +++--------------- .../common/default/include/HandleImporter.h | 26 +- camera/device/1.0/default/Android.bp | 1 + camera/device/3.2/default/Android.bp | 1 + camera/device/3.4/default/Android.bp | 1 + .../default/ExternalCameraDeviceSession.cpp | 25 +- camera/device/3.5/default/Android.bp | 2 + camera/device/3.6/default/Android.bp | 1 + .../default/ExternalCameraOfflineSession.cpp | 25 +- camera/device/default/Android.bp | 3 +- .../default/ExternalCameraDeviceSession.cpp | 20 +- .../default/ExternalCameraDeviceSession.h | 4 + .../default/ExternalCameraOfflineSession.cpp | 22 +- camera/device/default/ExternalCameraUtils.h | 6 + 15 files changed, 157 insertions(+), 384 deletions(-) diff --git a/camera/common/default/Android.bp b/camera/common/default/Android.bp index e8c8f9dba0..b5d3095cff 100644 --- a/camera/common/default/Android.bp +++ b/camera/common/default/Android.bp @@ -30,13 +30,12 @@ cc_library_static { "libgralloctypes", "libhardware", "libcamera_metadata", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", "libexif", + "libui", ], include_dirs: ["system/media/private/camera/include"], export_include_dirs: ["include"], + export_shared_lib_headers: ["libui"], } // NOTE: Deprecated module kept for compatibility reasons. diff --git a/camera/common/default/HandleImporter.cpp b/camera/common/default/HandleImporter.cpp index 1145baa5f1..9c579e59a1 100644 --- a/camera/common/default/HandleImporter.cpp +++ b/camera/common/default/HandleImporter.cpp @@ -17,9 +17,10 @@ #define LOG_TAG "HandleImporter" #include "HandleImporter.h" +#include #include #include -#include "aidl/android/hardware/graphics/common/Smpte2086.h" +#include namespace android { namespace hardware { @@ -31,12 +32,6 @@ using aidl::android::hardware::graphics::common::PlaneLayout; using aidl::android::hardware::graphics::common::PlaneLayoutComponent; using aidl::android::hardware::graphics::common::PlaneLayoutComponentType; using aidl::android::hardware::graphics::common::Smpte2086; -using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType; -using MapperErrorV2 = android::hardware::graphics::mapper::V2_0::Error; -using MapperErrorV3 = android::hardware::graphics::mapper::V3_0::Error; -using MapperErrorV4 = android::hardware::graphics::mapper::V4_0::Error; -using IMapperV3 = android::hardware::graphics::mapper::V3_0::IMapper; -using IMapperV4 = android::hardware::graphics::mapper::V4_0::IMapper; HandleImporter::HandleImporter() : mInitialized(false) {} @@ -45,51 +40,20 @@ void HandleImporter::initializeLocked() { return; } - mMapperV4 = IMapperV4::getService(); - if (mMapperV4 != nullptr) { - mInitialized = true; - return; - } - - mMapperV3 = IMapperV3::getService(); - if (mMapperV3 != nullptr) { - mInitialized = true; - return; - } - - mMapperV2 = IMapper::getService(); - if (mMapperV2 == nullptr) { - ALOGE("%s: cannnot acccess graphics mapper HAL!", __FUNCTION__); - return; - } - + GraphicBufferMapper::preloadHal(); mInitialized = true; return; } void HandleImporter::cleanup() { - mMapperV4.clear(); - mMapperV3.clear(); - mMapperV2.clear(); mInitialized = false; } -template -bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& handle) { - E error; +bool HandleImporter::importBufferInternal(buffer_handle_t& handle) { buffer_handle_t importedHandle; - auto ret = mapper->importBuffer( - hidl_handle(handle), [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - importedHandle = static_cast(tmpBufferHandle); - }); - - if (!ret.isOk()) { - ALOGE("%s: mapper importBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - return false; - } - - if (error != E::NONE) { + auto status = GraphicBufferMapper::get().importBufferNoValidate(handle, &importedHandle); + if (status != OK) { + ALOGE("%s: mapper importBuffer failed: %d", __FUNCTION__, status); return false; } @@ -97,170 +61,32 @@ bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& h return true; } -template -YCbCrLayout HandleImporter::lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, - uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - YCbCrLayout layout = {}; - - typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - mapper->lockYCbCr(buffer, cpuUsage, accessRegionCopy, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpLayout) { - if (tmpError == E::NONE) { - // Member by member copy from different versions of YCbCrLayout. - layout.y = tmpLayout.y; - layout.cb = tmpLayout.cb; - layout.cr = tmpLayout.cr; - layout.yStride = tmpLayout.yStride; - layout.cStride = tmpLayout.cStride; - layout.chromaStep = tmpLayout.chromaStep; - } else { - ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError); - } - }); - return layout; -} +android_ycbcr HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const android::Rect& accessRegion) { + Mutex::Autolock lock(mLock); -bool isMetadataPesent(const sp mapper, const buffer_handle_t& buf, - MetadataType metadataType) { - auto buffer = const_cast(buf); - bool ret = false; - hidl_vec vec; - mapper->get(buffer, metadataType, [&](const auto& tmpError, const auto& tmpMetadata) { - if (tmpError == MapperErrorV4::NONE) { - vec = tmpMetadata; - } else { - ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); - } - }); - - if (vec.size() > 0) { - if (metadataType == gralloc4::MetadataType_Smpte2086) { - std::optional realSmpte2086; - gralloc4::decodeSmpte2086(vec, &realSmpte2086); - ret = realSmpte2086.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) { - std::optional> realSmpte2094_10; - gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10); - ret = realSmpte2094_10.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) { - std::optional> realSmpte2094_40; - gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40); - ret = realSmpte2094_40.has_value(); - } else { - ALOGE("%s: Unknown metadata type!", __FUNCTION__); - } + if (!mInitialized) { + initializeLocked(); } + android_ycbcr layout; - return ret; -} + status_t status = GraphicBufferMapper::get().lockYCbCr(buf, cpuUsage, accessRegion, &layout); -std::vector getPlaneLayouts(const sp mapper, buffer_handle_t& buf) { - auto buffer = const_cast(buf); - std::vector planeLayouts; - hidl_vec encodedPlaneLayouts; - mapper->get(buffer, gralloc4::MetadataType_PlaneLayouts, - [&](const auto& tmpError, const auto& tmpEncodedPlaneLayouts) { - if (tmpError == MapperErrorV4::NONE) { - encodedPlaneLayouts = tmpEncodedPlaneLayouts; - } else { - ALOGE("%s: failed to get plane layouts %d!", __FUNCTION__, tmpError); - } - }); - - gralloc4::decodePlaneLayouts(encodedPlaneLayouts, &planeLayouts); - - return planeLayouts; -} - -template <> -YCbCrLayout HandleImporter::lockYCbCrInternal( - const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - YCbCrLayout layout = {}; - void* mapped = nullptr; - - typename IMapperV4::Rect accessRegionV4 = {accessRegion.left, accessRegion.top, - accessRegion.width, accessRegion.height}; - mapper->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV4::NONE) { - mapped = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - - if (mapped == nullptr) { - return layout; - } - - std::vector planeLayouts = getPlaneLayouts(mapper, buf); - for (const auto& planeLayout : planeLayouts) { - for (const auto& planeLayoutComponent : planeLayout.components) { - const auto& type = planeLayoutComponent.type; - - if (!gralloc4::isStandardPlaneLayoutComponentType(type)) { - continue; - } - - uint8_t* data = reinterpret_cast(mapped); - data += planeLayout.offsetInBytes; - data += planeLayoutComponent.offsetInBits / 8; - - switch (static_cast(type.value)) { - case PlaneLayoutComponentType::Y: - layout.y = data; - layout.yStride = planeLayout.strideInBytes; - break; - case PlaneLayoutComponentType::CB: - layout.cb = data; - layout.cStride = planeLayout.strideInBytes; - layout.chromaStep = planeLayout.sampleIncrementInBits / 8; - break; - case PlaneLayoutComponentType::CR: - layout.cr = data; - layout.cStride = planeLayout.strideInBytes; - layout.chromaStep = planeLayout.sampleIncrementInBits / 8; - break; - default: - break; - } - } + if (status != OK) { + ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, status); } return layout; } -template -int HandleImporter::unlockInternal(const sp mapper, buffer_handle_t& buf) { - int releaseFence = -1; - auto buffer = const_cast(buf); - - mapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) { - if (tmpError == E::NONE) { - auto fenceHandle = tmpReleaseFence.getNativeHandle(); - if (fenceHandle) { - if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) { - ALOGE("%s: bad release fence numInts %d numFds %d", __FUNCTION__, - fenceHandle->numInts, fenceHandle->numFds); - return; - } - releaseFence = dup(fenceHandle->data[0]); - if (releaseFence < 0) { - ALOGE("%s: bad release fence FD %d", __FUNCTION__, releaseFence); - } - } - } else { - ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError); - } - }); - return releaseFence; +std::vector getPlaneLayouts(buffer_handle_t& buf) { + std::vector planeLayouts; + status_t status = GraphicBufferMapper::get().getPlaneLayouts(buf, &planeLayouts); + if (status != OK) { + ALOGE("%s: failed to get PlaneLayouts! Status %d", __FUNCTION__, status); + } + + return planeLayouts; } // In IComposer, any buffer_handle_t is owned by the caller and we need to @@ -277,20 +103,7 @@ bool HandleImporter::importBuffer(buffer_handle_t& handle) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return importBufferInternal(mMapperV4, handle); - } - - if (mMapperV3 != nullptr) { - return importBufferInternal(mMapperV3, handle); - } - - if (mMapperV2 != nullptr) { - return importBufferInternal(mMapperV2, handle); - } - - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return false; + return importBufferInternal(handle); } void HandleImporter::freeBuffer(buffer_handle_t handle) { @@ -303,21 +116,9 @@ void HandleImporter::freeBuffer(buffer_handle_t handle) { initializeLocked(); } - if (mMapperV4 != nullptr) { - auto ret = mMapperV4->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } - } else if (mMapperV3 != nullptr) { - auto ret = mMapperV3->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } - } else { - auto ret = mMapperV2->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } + status_t status = GraphicBufferMapper::get().freeBuffer(handle); + if (status != OK) { + ALOGE("%s: mapper freeBuffer failed. Status %d", __FUNCTION__, status); } } @@ -345,12 +146,12 @@ void HandleImporter::closeFence(int fd) const { } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size) { - IMapper::Rect accessRegion{0, 0, static_cast(size), 1}; + android::Rect accessRegion{0, 0, static_cast(size), 1}; return lock(buf, cpuUsage, accessRegion); } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { + const android::Rect& accessRegion) { Mutex::Autolock lock(mLock); if (!mInitialized) { @@ -358,81 +159,18 @@ void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, } void* ret = nullptr; - - if (mMapperV4 == nullptr && mMapperV3 == nullptr && mMapperV2 == nullptr) { - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return ret; - } - - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - if (mMapperV4 != nullptr) { - IMapperV4::Rect accessRegionV4{accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - - mMapperV4->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV4::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - } else if (mMapperV3 != nullptr) { - IMapperV3::Rect accessRegionV3{accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - - mMapperV3->lock(buffer, cpuUsage, accessRegionV3, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr, const auto& /*bytesPerPixel*/, - const auto& /*bytesPerStride*/) { - if (tmpError == MapperErrorV3::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - } else { - mMapperV2->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV2::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); + status_t status = GraphicBufferMapper::get().lock(buf, cpuUsage, accessRegion, &ret); + if (status != OK) { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, status); } ALOGV("%s: ptr %p accessRegion.top: %d accessRegion.left: %d accessRegion.width: %d " "accessRegion.height: %d", - __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width, - accessRegion.height); + __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width(), + accessRegion.height()); return ret; } -YCbCrLayout HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - Mutex::Autolock lock(mLock); - - if (!mInitialized) { - initializeLocked(); - } - - if (mMapperV4 != nullptr) { - return lockYCbCrInternal(mMapperV4, buf, cpuUsage, accessRegion); - } - - if (mMapperV3 != nullptr) { - return lockYCbCrInternal(mMapperV3, buf, cpuUsage, accessRegion); - } - - if (mMapperV2 != nullptr) { - return lockYCbCrInternal(mMapperV2, buf, cpuUsage, accessRegion); - } - - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return {}; -} - status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/) { if (stride == nullptr) { return BAD_VALUE; @@ -444,35 +182,26 @@ status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t initializeLocked(); } - if (mMapperV4 != nullptr) { - std::vector planeLayouts = getPlaneLayouts(mMapperV4, buf); - if (planeLayouts.size() != 1) { - ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); - return BAD_VALUE; - } - - *stride = planeLayouts[0].strideInBytes; - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); - return NO_INIT; + std::vector planeLayouts = getPlaneLayouts(buf); + if (planeLayouts.size() != 1) { + ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); + return BAD_VALUE; } + *stride = planeLayouts[0].strideInBytes; + return OK; } int HandleImporter::unlock(buffer_handle_t& buf) { - if (mMapperV4 != nullptr) { - return unlockInternal(mMapperV4, buf); - } - if (mMapperV3 != nullptr) { - return unlockInternal(mMapperV3, buf); - } - if (mMapperV2 != nullptr) { - return unlockInternal(mMapperV2, buf); + int releaseFence = -1; + + status_t status = GraphicBufferMapper::get().unlockAsync(buf, &releaseFence); + if (status != OK) { + ALOGE("%s: failed to unlock error %d!", __FUNCTION__, status); } - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return -1; + return releaseFence; } bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { @@ -481,14 +210,14 @@ bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { if (!mInitialized) { initializeLocked(); } - - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2086); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional metadata; + status_t status = GraphicBufferMapper::get().getSmpte2086(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { @@ -498,13 +227,14 @@ bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_10); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional> metadata; + status_t status = GraphicBufferMapper::get().getSmpte2094_10(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { @@ -514,13 +244,14 @@ bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_40); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional> metadata; + status_t status = GraphicBufferMapper::get().getSmpte2094_40(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } } // namespace helper diff --git a/camera/common/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h index 5408ba92e6..df01202224 100644 --- a/camera/common/default/include/HandleImporter.h +++ b/camera/common/default/include/HandleImporter.h @@ -17,15 +17,11 @@ #ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H #define CAMERA_COMMON_1_0_HANDLEIMPORTED_H -#include -#include -#include #include +#include +#include #include -using android::hardware::graphics::mapper::V2_0::IMapper; -using android::hardware::graphics::mapper::V2_0::YCbCrLayout; - namespace android { namespace hardware { namespace camera { @@ -49,11 +45,11 @@ class HandleImporter { void* lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size); // Locks 2-D buffer. Assumes caller has waited for acquire fences. - void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const IMapper::Rect& accessRegion); + void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const android::Rect& accessRegion); // Assumes caller has waited for acquire fences. - YCbCrLayout lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion); + android_ycbcr lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const android::Rect& accessRegion); // Query the stride of the first plane in bytes. status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/); @@ -69,19 +65,11 @@ class HandleImporter { void initializeLocked(); void cleanup(); - template - bool importBufferInternal(const sp mapper, buffer_handle_t& handle); - template - YCbCrLayout lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion); - template - int unlockInternal(const sp mapper, buffer_handle_t& buf); + bool importBufferInternal(buffer_handle_t& handle); + int unlockInternal(buffer_handle_t& buf); Mutex mLock; bool mInitialized; - sp mMapperV2; - sp mMapperV3; - sp mMapperV4; }; } // namespace helper diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp index 9ff6480d4b..6992ff0294 100644 --- a/camera/device/1.0/default/Android.bp +++ b/camera/device/1.0/default/Android.bp @@ -32,6 +32,7 @@ cc_library_shared { "libgralloctypes", "libhardware", "libcamera_metadata", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp index a1962915ff..adf834ac53 100644 --- a/camera/device/3.2/default/Android.bp +++ b/camera/device/3.2/default/Android.bp @@ -30,6 +30,7 @@ cc_library_shared { "libhardware", "libcamera_metadata", "libfmq", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/Android.bp b/camera/device/3.4/default/Android.bp index 9f0c77739a..100106e437 100644 --- a/camera/device/3.4/default/Android.bp +++ b/camera/device/3.4/default/Android.bp @@ -106,6 +106,7 @@ cc_library_shared { "libjpeg", "libexif", "libtinyxml2", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp index ca7186b18d..01b3d41ff7 100644 --- a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp @@ -1574,14 +1574,23 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect {0, 0, - static_cast(halBuf.width), - static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( - *(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", - __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, - outLayout.yStride, outLayout.cStride, outLayout.chromaStep); + android::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + android_ycbcr result = + sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/3.5/default/Android.bp b/camera/device/3.5/default/Android.bp index 9d27b321e0..bc15629da0 100644 --- a/camera/device/3.5/default/Android.bp +++ b/camera/device/3.5/default/Android.bp @@ -46,6 +46,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", @@ -81,6 +82,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/Android.bp b/camera/device/3.6/default/Android.bp index 89ee145820..b4a486ff26 100644 --- a/camera/device/3.6/default/Android.bp +++ b/camera/device/3.6/default/Android.bp @@ -41,6 +41,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp index e606fda832..1f1dfee146 100644 --- a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp @@ -222,14 +222,23 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect {0, 0, - static_cast(halBuf.width), - static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( - *(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", - __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, - outLayout.yStride, outLayout.cStride, outLayout.chromaStep); + android::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + android_ycbcr result = + sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = V3_4::implementation::getFourCcFromLayout(outLayout); diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp index b9f10d6fd6..5fbcb5d89a 100644 --- a/camera/device/default/Android.bp +++ b/camera/device/default/Android.bp @@ -40,7 +40,7 @@ cc_library_shared { shared_libs: [ "android.hardware.camera.common-V1-ndk", "android.hardware.camera.device-V1-ndk", - "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.allocator-V2-ndk", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@4.0", @@ -60,6 +60,7 @@ cc_library_shared { "libsync", "libtinyxml2", "libutils", + "libui", "libyuv", ], static_libs: [ diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp index 95a36f0615..896e0daa0b 100644 --- a/camera/device/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/default/ExternalCameraDeviceSession.cpp @@ -2882,13 +2882,23 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + android::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + android_ycbcr result = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, - outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, - outLayout.chromaStep); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h index 836266f3de..736bfd1528 100644 --- a/camera/device/default/ExternalCameraDeviceSession.h +++ b/camera/device/default/ExternalCameraDeviceSession.h @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -55,6 +58,7 @@ using ::android::base::unique_fd; using ::android::hardware::camera::common::helper::SimpleThread; using ::android::hardware::camera::external::common::ExternalCameraConfig; using ::android::hardware::camera::external::common::SizeHasher; +using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; using ::ndk::ScopedAStatus; class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputThreadInterface { diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp index 4c7f732f87..53bd44f4fa 100644 --- a/camera/device/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/default/ExternalCameraOfflineSession.cpp @@ -486,13 +486,23 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + android::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + android_ycbcr result = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, - outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, - outLayout.chromaStep); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); @@ -544,4 +554,4 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } // namespace device } // namespace camera } // namespace hardware -} // namespace android \ No newline at end of file +} // namespace android diff --git a/camera/device/default/ExternalCameraUtils.h b/camera/device/default/ExternalCameraUtils.h index b37933ce7e..d434905bd8 100644 --- a/camera/device/default/ExternalCameraUtils.h +++ b/camera/device/default/ExternalCameraUtils.h @@ -25,7 +25,11 @@ #include #include #include +#include +#include +#include #include +#include #include #include @@ -37,6 +41,8 @@ using ::aidl::android::hardware::graphics::common::BufferUsage; using ::aidl::android::hardware::graphics::common::PixelFormat; using ::android::hardware::camera::common::V1_0::helper::CameraMetadata; using ::android::hardware::camera::common::V1_0::helper::HandleImporter; +using ::android::hardware::graphics::mapper::V2_0::IMapper; +using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; namespace android { namespace hardware { -- GitLab From 5d0f9d16e3725124c79b6db12fd39399f0561770 Mon Sep 17 00:00:00 2001 From: Rucha Katakwar Date: Fri, 11 Aug 2023 13:35:21 -0700 Subject: [PATCH 149/376] Camera: Flash strength control during camera use. Auto-generated file from changes in metadata_definitions.xml Bug: 238348881 Test: Build Successful Change-Id: Ic6aec9b2135b0b2a2d24d8204900b8bad52d6725 --- camera/metadata/aidl/Android.bp | 2 +- .../camera/metadata/CameraMetadataTag.aidl | 5 ++++ .../camera/metadata/CameraMetadataTag.aidl | 30 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp index 5872a86727..2b2be55914 100644 --- a/camera/metadata/aidl/Android.bp +++ b/camera/metadata/aidl/Android.bp @@ -11,7 +11,7 @@ aidl_interface { name: "android.hardware.camera.metadata", vendor_available: true, srcs: ["android/hardware/camera/metadata/*.aidl"], - frozen: true, + frozen: false, stability: "vintf", backend: { cpp: { diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl index 71d4e41c44..0290aef136 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -108,6 +108,11 @@ enum CameraMetadataTag { ANDROID_FLASH_COLOR_TEMPERATURE, ANDROID_FLASH_MAX_ENERGY, ANDROID_FLASH_STATE, + ANDROID_FLASH_STRENGTH_LEVEL, + ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL, + ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL, + ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL, + ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL, ANDROID_FLASH_INFO_AVAILABLE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_FLASH_INFO_START /* 327680 */, ANDROID_FLASH_INFO_CHARGE_DURATION, ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL, diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index 56aa690777..dd679f34f1 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -559,6 +559,36 @@ enum CameraMetadataTag { * unit.

    */ ANDROID_FLASH_STATE, + /** + * android.flash.strengthLevel [dynamic, int32, public] + * + *

    Flash strength level to be used when manual flash control is active.

    + */ + ANDROID_FLASH_STRENGTH_LEVEL, + /** + * android.flash.singleStrengthMaxLevel [static, int32, public] + * + *

    Maximum flash brightness level for manual flash control in SINGLE mode.

    + */ + ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL, + /** + * android.flash.singleStrengthDefaultLevel [static, int32, public] + * + *

    Default flash brightness level for manual flash control in SINGLE mode.

    + */ + ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL, + /** + * android.flash.torchStrengthMaxLevel [static, int32, public] + * + *

    Maximum flash brightness level for manual flash control in TORCH mode

    + */ + ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL, + /** + * android.flash.torchStrengthDefaultLevel [static, int32, public] + * + *

    Default flash brightness level for manual flash control in TORCH mode

    + */ + ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL, /** * android.flash.info.available [static, enum, public] * -- GitLab From 06ddbc6d52ca7afd8777d5c0fdfbc3fc1642547d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 23 Aug 2023 18:05:26 -0700 Subject: [PATCH 150/376] Define IRemoteAccess V2 reference impl. Rename remote access HAL to V2 and implement V2 interface. Test: Presubmit Bug: 297271235 Change-Id: I4b21fce3c18f7697f62229107b210b7675749b68 --- .../remoteaccess/hal/default/Android.bp | 27 ++++++++++++-- .../hal/default/include/RemoteAccessService.h | 20 +++++++++++ .../remoteaccess-default-service-v1.rc | 4 +++ .../remoteaccess-default-service-v1.xml | 7 ++++ .../default/remoteaccess-default-service.rc | 2 +- .../default/remoteaccess-default-service.xml | 2 +- .../remoteaccess-tcu-test-service-v1.rc | 5 +++ .../default/remoteaccess-tcu-test-service.rc | 2 +- .../hal/default/src/RemoteAccessService.cpp | 36 +++++++++++++++++++ .../remoteaccess/test_grpc_server/README.md | 2 +- 10 files changed, 101 insertions(+), 6 deletions(-) create mode 100644 automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc create mode 100644 automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml create mode 100644 automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp index 48a7309847..70dba3071a 100644 --- a/automotive/remoteaccess/hal/default/Android.bp +++ b/automotive/remoteaccess/hal/default/Android.bp @@ -47,9 +47,20 @@ cc_defaults { ], } +// TODO(b/295393732): remove this once we finish the migration from V1 to V2. cc_binary { name: "android.hardware.automotive.remoteaccess@V1-default-service", defaults: ["remote-access-hal-defaults"], + vintf_fragments: ["remoteaccess-default-service-v1.xml"], + init_rc: ["remoteaccess-default-service-v1.rc"], + cflags: [ + "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"", + ], +} + +cc_binary { + name: "android.hardware.automotive.remoteaccess@V2-default-service", + defaults: ["remote-access-hal-defaults"], vintf_fragments: ["remoteaccess-default-service.xml"], init_rc: ["remoteaccess-default-service.rc"], cflags: [ @@ -57,9 +68,21 @@ cc_binary { ], } +// TODO(b/295393732): remove this once we finish the migration from V1 to V2. cc_binary { name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service", defaults: ["remote-access-hal-defaults"], + vintf_fragments: ["remoteaccess-default-service-v1.xml"], + init_rc: ["remoteaccess-tcu-test-service-v1.rc"], + cflags: [ + "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"", + "-DGRPC_SERVICE_IFNAME=\"eth1\"", + ], +} + +cc_binary { + name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service", + defaults: ["remote-access-hal-defaults"], vintf_fragments: ["remoteaccess-default-service.xml"], init_rc: ["remoteaccess-tcu-test-service.rc"], cflags: [ @@ -77,7 +100,7 @@ cc_library { "src/RemoteAccessService.cpp", ], whole_static_libs: [ - "android.hardware.automotive.remoteaccess-V1-ndk", + "android.hardware.automotive.remoteaccess-V2-ndk", "wakeup_client_protos", "libvhalclient", ], @@ -99,7 +122,7 @@ cc_library { } cc_fuzz { - name: "android.hardware.automotive.remoteaccess@V1-default-service.aidl_fuzzer", + name: "android.hardware.automotive.remoteaccess@V2-default-service.aidl_fuzzer", srcs: ["fuzzer/fuzzer.cpp"], whole_static_libs: [ "RemoteAccessService", diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h index b18986adac..1fc4037ae2 100644 --- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h +++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,25 @@ class RemoteAccessService ndk::ScopedAStatus notifyApStateChange( const aidl::android::hardware::automotive::remoteaccess::ApState& newState) override; + ndk::ScopedAStatus isTaskScheduleSupported(bool* out) override; + + ndk::ScopedAStatus scheduleTask( + const aidl::android::hardware::automotive::remoteaccess::ScheduleInfo& scheduleInfo) + override; + + ndk::ScopedAStatus unscheduleTask(const std::string& clientId, + const std::string& scheduleId) override; + + ndk::ScopedAStatus unscheduleAllTasks(const std::string& clientId) override; + + ndk::ScopedAStatus isTaskScheduled(const std::string& clientId, const std::string& scheduleId, + bool* out) override; + + ndk::ScopedAStatus getAllScheduledTasks( + const std::string& clientId, + std::vector* out) + override; + binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; private: diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc new file mode 100644 index 0000000000..b7a9cdc82a --- /dev/null +++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc @@ -0,0 +1,4 @@ +service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service + class hal + user vehicle_network + group system inet diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml new file mode 100644 index 0000000000..d050a1b646 --- /dev/null +++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml @@ -0,0 +1,7 @@ + + + android.hardware.automotive.remoteaccess + 1 + IRemoteAccess/default + + diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc index b7a9cdc82a..c9b282ce24 100644 --- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc +++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc @@ -1,4 +1,4 @@ -service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service +service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-default-service class hal user vehicle_network group system inet diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml index d050a1b646..44ac30996e 100644 --- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml +++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml @@ -1,7 +1,7 @@ android.hardware.automotive.remoteaccess - 1 + 2 IRemoteAccess/default diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc new file mode 100644 index 0000000000..59315ebe0b --- /dev/null +++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc @@ -0,0 +1,5 @@ +service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service + class hal + user vehicle_network + group system inet + capabilities NET_RAW diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc index 59315ebe0b..19faaf4c5f 100644 --- a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc +++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc @@ -1,4 +1,4 @@ -service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service +service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-tcu-test-service class hal user vehicle_network group system inet diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp index 5081ac0a9b..7721bf404a 100644 --- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp +++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp @@ -39,6 +39,7 @@ namespace { using ::aidl::android::hardware::automotive::remoteaccess::ApState; using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback; +using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::android::base::Error; using ::android::base::ParseInt; @@ -313,6 +314,41 @@ ScopedAStatus RemoteAccessService::notifyApStateChange(const ApState& newState) return ScopedAStatus::ok(); } +ScopedAStatus RemoteAccessService::isTaskScheduleSupported([[maybe_unused]] bool* out) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::scheduleTask([[maybe_unused]] const ScheduleInfo& scheduleInfo) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::unscheduleTask([[maybe_unused]] const std::string& clientId, + [[maybe_unused]] const std::string& scheduleId) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::unscheduleAllTasks( + [[maybe_unused]] const std::string& clientId) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::isTaskScheduled([[maybe_unused]] const std::string& clientId, + [[maybe_unused]] const std::string& scheduleId, + [[maybe_unused]] bool* out) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + +ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId, + std::vector* out) { + // TODO(b/297271235): implement this. + return ScopedAStatus::ok(); +} + bool RemoteAccessService::checkDumpPermission() { uid_t uid = AIBinder_getCallingUid(); return uid == AID_ROOT || uid == AID_SHELL || uid == AID_SYSTEM; diff --git a/automotive/remoteaccess/test_grpc_server/README.md b/automotive/remoteaccess/test_grpc_server/README.md index af3d54ac5b..d2b6bbef6a 100644 --- a/automotive/remoteaccess/test_grpc_server/README.md +++ b/automotive/remoteaccess/test_grpc_server/README.md @@ -141,7 +141,7 @@ interface. * The android lunch target: sdk_car_x86_64-userdebug and cf_x86_64_auto-userdebug already contains the default remote access HAL. For other lunch target, you can add the default remote access HAL by adding - 'android.hardware.automotive.remoteaccess@V1-default-service' to + 'android.hardware.automotive.remoteaccess@V2-default-service' to 'PRODUCT_PACKAGES' variable in mk file, see `device/generic/car/common/car.mk` as example. -- GitLab From 5ed789cd71536dc8289246f286bbe5f48eda83e0 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Thu, 24 Aug 2023 20:07:29 +0000 Subject: [PATCH 151/376] Add EvsCamera Class and Buffer Manipulation Test: Build and `atest android.hardware.automotive.evs-aidl-default-service_cam_buffer_test` Bug: 277861838 Change-Id: I28218f8e22e7daca3d8ce0bbec64c054a4462564 --- automotive/evs/aidl/impl/default/Android.bp | 70 +++-- .../evs/aidl/impl/default/include/EvsCamera.h | 98 +++++++ .../evs/aidl/impl/default/src/EvsCamera.cpp | 266 ++++++++++++++++++ .../default/tests/EvsCameraBufferTest.cpp | 208 ++++++++++++++ 4 files changed, 620 insertions(+), 22 deletions(-) create mode 100644 automotive/evs/aidl/impl/default/include/EvsCamera.h create mode 100644 automotive/evs/aidl/impl/default/src/EvsCamera.cpp create mode 100644 automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp index 79ee956641..c56fe2bfc7 100644 --- a/automotive/evs/aidl/impl/default/Android.bp +++ b/automotive/evs/aidl/impl/default/Android.bp @@ -21,45 +21,41 @@ package { default_applicable_licenses: ["hardware_interfaces_license"], } -cc_binary { - name: "android.hardware.automotive.evs-aidl-default-service", +cc_defaults { + name: "android.hardware.automotive.evs-aidl-default-service-default", defaults: ["EvsHalDefaults"], - vintf_fragments: ["manifest_evs-default-service.xml"], - init_rc: ["evs-default-service.rc"], - vendor: true, - relative_install_path: "hw", - cflags: [ - "-DGL_GLEXT_PROTOTYPES", - "-DEGL_EGLEXT_PROTOTYPES", - "-Wall", - "-Wextra", - "-Werror", - "-Wthread-safety", - ], - srcs: [ - ":libgui_frame_event_aidl", - "src/*.cpp", - ], shared_libs: [ "android.hardware.graphics.bufferqueue@1.0", "android.hardware.graphics.bufferqueue@2.0", "android.hidl.token@1.0-utils", "libEGL", "libGLESv2", - "libbase", "libbinder_ndk", "libbufferqueueconverter", "libcamera_metadata", "libhardware_legacy", "libhidlbase", - "liblog", "libnativewindow", "libtinyxml2", "libui", - "libutils", "libyuv", ], - static_libs: [ +} + +cc_library { + name: "android.hardware.automotive.evs-aidl-default-service-lib", + defaults: ["android.hardware.automotive.evs-aidl-default-service-default"], + vendor: true, + cflags: [ + "-DGL_GLEXT_PROTOTYPES", + "-DEGL_EGLEXT_PROTOTYPES", + ], + srcs: [ + ":libgui_frame_event_aidl", + "src/*.cpp", + ], + exclude_srcs: ["src/service.cpp"], + whole_static_libs: [ "android.frameworks.automotive.display-V2-ndk", "android.hardware.automotive.evs-V2-ndk", "android.hardware.common-V2-ndk", @@ -71,6 +67,25 @@ cc_binary { ], local_include_dirs: ["include"], include_dirs: ["frameworks/native/include/"], + export_include_dirs: ["include"], +} + +cc_binary { + name: "android.hardware.automotive.evs-aidl-default-service", + defaults: ["android.hardware.automotive.evs-aidl-default-service-default"], + vintf_fragments: ["manifest_evs-default-service.xml"], + init_rc: ["evs-default-service.rc"], + vendor: true, + relative_install_path: "hw", + cflags: [ + "-DGL_GLEXT_PROTOTYPES", + "-DEGL_EGLEXT_PROTOTYPES", + ], + srcs: ["src/service.cpp"], + static_libs: [ + "android.hardware.automotive.evs-aidl-default-service-lib", + ], + include_dirs: ["frameworks/native/include/"], required: ["evs_mock_hal_configuration.xml"], } @@ -80,3 +95,14 @@ prebuilt_etc { src: "resources/evs_mock_configuration.xml", sub_dir: "automotive/evs", } + +cc_test { + name: "android.hardware.automotive.evs-aidl-default-service_cam_buffer_test", + defaults: ["android.hardware.automotive.evs-aidl-default-service-default"], + vendor: true, + srcs: ["tests/EvsCameraBufferTest.cpp"], + static_libs: [ + "android.hardware.automotive.evs-aidl-default-service-lib", + "libgmock", + ], +} diff --git a/automotive/evs/aidl/impl/default/include/EvsCamera.h b/automotive/evs/aidl/impl/default/include/EvsCamera.h new file mode 100644 index 0000000000..3663e3d05a --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsCamera.h @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "EvsCameraBase.h" + +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsCamera : public EvsCameraBase { + private: + using Base = EvsCameraBase; + using Self = EvsCamera; + + public: + using Base::Base; + + ~EvsCamera() override; + + // Methods from ::android::hardware::automotive::evs::IEvsCamera follow. + ndk::ScopedAStatus doneWithFrame(const std::vector& buffers) override; + + ndk::ScopedAStatus importExternalBuffers(const std::vector& buffers, + int32_t* _aidl_return) override; + + ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override; + + protected: + virtual ::android::status_t allocateOneFrame(buffer_handle_t* handle) = 0; + + virtual void freeOneFrame(const buffer_handle_t handle); + + void shutdown() override; + + void closeAllBuffers_unsafe(); + + // Returns (ID, handle) if succeeds. (static_cast(-1), nullptr) otherwise. + [[nodiscard]] std::pair useBuffer_unsafe(); + + void returnBuffer_unsafe(const std::size_t id); + + bool increaseAvailableFrames_unsafe(const buffer_handle_t handle); + + bool decreaseAvailableFrames_unsafe(); + + bool setAvailableFrames_unsafe(const std::size_t bufferCount); + + void swapBufferFrames_unsafe(const std::size_t pos1, const std::size_t pos2); + + struct BufferRecord { + BufferRecord() = default; + BufferRecord(const BufferRecord&) = default; + BufferRecord(BufferRecord&&) = default; + BufferRecord& operator=(const BufferRecord&) = default; + BufferRecord& operator=(BufferRecord&&) = default; + ~BufferRecord() = default; + + explicit BufferRecord(buffer_handle_t h) : handle(h) {} + + buffer_handle_t handle{nullptr}; + bool inUse{false}; + }; + + std::mutex mMutex; + + // Graphics buffers to transfer images, always in the order of: + // In use buffers ... available buffers ... unavailable (unallocated) buffers. + std::vector mBuffers; + + // Double-mapping between buffer position and ID. + std::vector mBufferPosToId; + std::vector mBufferIdToPos; + + std::size_t mAvailableFrames{0}; + std::size_t mFramesInUse{0}; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp new file mode 100644 index 0000000000..db3be8fb36 --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp @@ -0,0 +1,266 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsCamera.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +// Arbitrary limit on number of graphics buffers allowed to be allocated +// Safeguards against unreasonable resource consumption and provides a testable limit +constexpr std::size_t kMaxBuffersInFlight = 100; + +EvsCamera::~EvsCamera() { + shutdown(); +} + +ndk::ScopedAStatus EvsCamera::doneWithFrame(const std::vector& buffers) { + std::lock_guard lck(mMutex); + for (const auto& desc : buffers) { + returnBuffer_unsafe(desc.bufferId); + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsCamera::importExternalBuffers(const std::vector& buffers, + int32_t* _aidl_return) { + if (buffers.empty()) { + LOG(DEBUG) << __func__ + << ": Ignoring a request to import external buffers with an empty list."; + return ndk::ScopedAStatus::ok(); + } + static auto& mapper = ::android::GraphicBufferMapper::get(); + std::lock_guard lck(mMutex); + std::size_t numBuffersToAdd = std::min(buffers.size(), kMaxBuffersInFlight - mAvailableFrames); + if (numBuffersToAdd == 0) { + LOG(WARNING) << __func__ << ": The number of buffers has hit the upper limit (" + << kMaxBuffersInFlight << "). Stop importing."; + return ndk::ScopedAStatus::ok(); + } else if (numBuffersToAdd < buffers.size()) { + LOG(WARNING) << "Exceeds the limit on the number of buffers. Only " << numBuffersToAdd + << " buffers will be imported. " << buffers.size() << " are asked."; + } + const size_t before = mAvailableFrames; + for (std::size_t idx = 0; idx < numBuffersToAdd; ++idx) { + auto& buffer = buffers[idx]; + const AHardwareBuffer_Desc* pDesc = + reinterpret_cast(&buffer.buffer.description); + + buffer_handle_t handleToImport = ::android::dupFromAidl(buffer.buffer.handle); + buffer_handle_t handleToStore = nullptr; + if (handleToImport == nullptr) { + LOG(WARNING) << "Failed to duplicate a memory handle. Ignoring a buffer " + << buffer.bufferId; + continue; + } + + ::android::status_t result = + mapper.importBuffer(handleToImport, pDesc->width, pDesc->height, pDesc->layers, + pDesc->format, pDesc->usage, pDesc->stride, &handleToStore); + if (result != ::android::NO_ERROR || handleToStore == nullptr || + !increaseAvailableFrames_unsafe(handleToStore)) { + LOG(WARNING) << "Failed to import a buffer " << buffer.bufferId; + } + } + *_aidl_return = mAvailableFrames - before; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsCamera::setMaxFramesInFlight(int32_t bufferCount) { + std::lock_guard lock(mMutex); + if (bufferCount < 1) { + LOG(ERROR) << "Ignoring setMaxFramesInFlight with less than one buffer requested."; + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::INVALID_ARG)); + } + if (!setAvailableFrames_unsafe(bufferCount)) { + LOG(ERROR) << "Failed to adjust the maximum number of frames in flight."; + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + } + return ndk::ScopedAStatus::ok(); +} + +void EvsCamera::freeOneFrame(const buffer_handle_t handle) { + static auto& alloc = ::android::GraphicBufferAllocator::get(); + alloc.free(handle); +} + +bool EvsCamera::setAvailableFrames_unsafe(const std::size_t bufferCount) { + if (bufferCount < 1) { + LOG(ERROR) << "Ignoring request to set buffer count to zero."; + return false; + } + if (bufferCount > kMaxBuffersInFlight) { + LOG(ERROR) << "Rejecting buffer request in excess of internal limit"; + return false; + } + + if (bufferCount > mAvailableFrames) { + bool success = true; + const std::size_t numBufferBeforeAlloc = mAvailableFrames; + for (int numBufferToAllocate = bufferCount - mAvailableFrames; + success && numBufferToAllocate > 0; --numBufferToAllocate) { + buffer_handle_t handle = nullptr; + const auto result = allocateOneFrame(&handle); + if (result != ::android::NO_ERROR || !handle) { + LOG(ERROR) << __func__ << ": Failed to allocate a graphics buffer. Error " << result + << ", handle: " << handle; + success = false; + break; + } + success &= increaseAvailableFrames_unsafe(handle); + } + if (!success) { + // Rollback when failure. + for (int numBufferToRelease = mAvailableFrames - numBufferBeforeAlloc; + numBufferToRelease > 0; --numBufferToRelease) { + decreaseAvailableFrames_unsafe(); + } + return false; + } + } else { + for (int numBufferToRelease = mAvailableFrames - std::max(bufferCount, mFramesInUse); + numBufferToRelease > 0; --numBufferToRelease) { + decreaseAvailableFrames_unsafe(); + } + if (mAvailableFrames > bufferCount) { + // This shouldn't happen with a properly behaving client because the client + // should only make this call after returning sufficient outstanding buffers + // to allow a clean resize. + LOG(ERROR) << "Buffer queue shrink failed, asked: " << bufferCount + << ", actual: " << mAvailableFrames + << " -- too many buffers currently in use?"; + } + } + return true; +} + +void EvsCamera::shutdown() { + std::lock_guard lck(mMutex); + closeAllBuffers_unsafe(); +} + +void EvsCamera::closeAllBuffers_unsafe() { + if (mFramesInUse > 0) { + LOG(WARNING) << __func__ << ": Closing while " << mFramesInUse + << " frame(s) are still in use."; + } + for (auto& buffer : mBuffers) { + freeOneFrame(buffer.handle); + buffer.handle = nullptr; + } + mBuffers.clear(); + mBufferPosToId.clear(); + mBufferIdToPos.clear(); +} + +std::pair EvsCamera::useBuffer_unsafe() { + if (mFramesInUse >= mAvailableFrames) { + DCHECK_EQ(mFramesInUse, mAvailableFrames); + return {static_cast(-1), nullptr}; + } + const std::size_t pos = mFramesInUse++; + auto& buffer = mBuffers[pos]; + DCHECK(!buffer.inUse); + DCHECK(buffer.handle); + buffer.inUse = true; + return {mBufferPosToId[pos], buffer.handle}; +} + +void EvsCamera::returnBuffer_unsafe(const std::size_t id) { + if (id >= mBuffers.size()) { + LOG(ERROR) << __func__ << ": ID out-of-bound. id: " << id + << " max: " << mBuffers.size() - 1; + return; + } + const std::size_t pos = mBufferIdToPos[id]; + + if (!mBuffers[pos].inUse) { + LOG(ERROR) << __func__ << ": Ignoring returning frame " << id << " which is already free."; + return; + } + DCHECK_LT(pos, mFramesInUse); + const std::size_t last_in_use_pos = --mFramesInUse; + swapBufferFrames_unsafe(pos, last_in_use_pos); + mBuffers[last_in_use_pos].inUse = false; +} + +bool EvsCamera::increaseAvailableFrames_unsafe(const buffer_handle_t handle) { + if (mAvailableFrames >= kMaxBuffersInFlight) { + LOG(WARNING) << __func__ << ": The number of buffers has hit the upper limit (" + << kMaxBuffersInFlight << "). Stop increasing."; + return false; + } + const std::size_t pos = mAvailableFrames++; + if (mAvailableFrames > mBuffers.size()) { + const std::size_t oldBufferSize = mBuffers.size(); + mBuffers.resize(mAvailableFrames); + mBufferPosToId.resize(mAvailableFrames); + mBufferIdToPos.resize(mAvailableFrames); + // Build position/ID mapping. + for (std::size_t idx = oldBufferSize; idx < mBuffers.size(); ++idx) { + mBufferPosToId[idx] = idx; + mBufferIdToPos[idx] = idx; + } + } + auto& buffer = mBuffers[pos]; + DCHECK(!buffer.inUse); + DCHECK(!buffer.handle); + buffer.handle = handle; + return true; +} + +bool EvsCamera::decreaseAvailableFrames_unsafe() { + if (mFramesInUse >= mAvailableFrames) { + DCHECK_EQ(mFramesInUse, mAvailableFrames); + return false; + } + const std::size_t pos = --mAvailableFrames; + auto& buffer = mBuffers[pos]; + DCHECK(!buffer.inUse); + DCHECK(buffer.handle); + freeOneFrame(buffer.handle); + buffer.handle = nullptr; + return true; +} + +void EvsCamera::swapBufferFrames_unsafe(const std::size_t pos1, const std::size_t pos2) { + if (pos1 == pos2) { + return; + } + if (pos1 >= mBuffers.size() || pos2 >= mBuffers.size()) { + LOG(ERROR) << __func__ << ": Index out-of-bound. pos1: " << pos1 << ", pos2: " << pos2 + << ", buffer size: " << mBuffers.size(); + return; + } + const std::size_t id1 = mBufferPosToId[pos1]; + const std::size_t id2 = mBufferPosToId[pos2]; + std::swap(mBufferPosToId[pos1], mBufferPosToId[pos2]); + std::swap(mBufferIdToPos[id1], mBufferIdToPos[id2]); + std::swap(mBuffers[pos1], mBuffers[pos2]); +} + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp new file mode 100644 index 0000000000..48f0890e69 --- /dev/null +++ b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp @@ -0,0 +1,208 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsCamera.h" + +#include +#include + +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsCameraForTest : public EvsCamera { + public: + using EvsCamera::increaseAvailableFrames_unsafe; + using EvsCamera::returnBuffer_unsafe; + using EvsCamera::useBuffer_unsafe; + + ~EvsCameraForTest() override { shutdown(); } + + ::android::status_t allocateOneFrame(buffer_handle_t* handle) override { + static std::intptr_t handle_cnt = 0; + *handle = reinterpret_cast(++handle_cnt); + return ::android::OK; + } + + void freeOneFrame(const buffer_handle_t /* handle */) override { + // Nothing to free because the handles are fake. + } + + void checkBufferOrder() { + for (std::size_t idx = 0; idx < mBuffers.size(); ++idx) { + const auto& buffer = mBuffers[idx]; + EXPECT_EQ(idx < mFramesInUse, buffer.inUse); + EXPECT_EQ(idx < mAvailableFrames, buffer.handle != nullptr); + EXPECT_LE(mFramesInUse, mAvailableFrames); + } + } + + MOCK_METHOD(::ndk::ScopedAStatus, forcePrimaryClient, + (const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& + in_display), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getCameraInfo, + (::aidl::android::hardware::automotive::evs::CameraDesc * _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getExtendedInfo, + (int32_t in_opaqueIdentifier, std::vector* _aidl_return), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getIntParameter, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, + std::vector* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getIntParameterRange, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, + ::aidl::android::hardware::automotive::evs::ParameterRange* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getParameterList, + (std::vector<::aidl::android::hardware::automotive::evs::CameraParam> * + _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getPhysicalCameraInfo, + (const std::string& in_deviceId, + ::aidl::android::hardware::automotive::evs::CameraDesc* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, pauseVideoStream, (), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, resumeVideoStream, (), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setExtendedInfo, + (int32_t in_opaqueIdentifier, const std::vector& in_opaqueValue), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setIntParameter, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, int32_t in_value, + std::vector* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setPrimaryClient, (), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, startVideoStream, + (const std::shared_ptr< + ::aidl::android::hardware::automotive::evs::IEvsCameraStream>& in_receiver), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, stopVideoStream, (), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, unsetPrimaryClient, (), (override)); +}; + +TEST(EvsCameraBufferTest, ChangeBufferPoolSize) { + auto evsCam = ndk::SharedRefBase::make(); + EXPECT_TRUE(evsCam->setMaxFramesInFlight(100).isOk()); + evsCam->checkBufferOrder(); + EXPECT_TRUE(evsCam->setMaxFramesInFlight(50).isOk()); + evsCam->checkBufferOrder(); + + // 2 buffers in use. + const auto [id1, handle1] = evsCam->useBuffer_unsafe(); + const auto [id2, handle2] = evsCam->useBuffer_unsafe(); + std::ignore = evsCam->useBuffer_unsafe(); + + // It allows you to set the buffer pool size to 1, but it will keep the space for the in use + // buffers. + EXPECT_TRUE(evsCam->setMaxFramesInFlight(1).isOk()); + evsCam->checkBufferOrder(); + + evsCam->returnBuffer_unsafe(id1); + evsCam->checkBufferOrder(); + evsCam->returnBuffer_unsafe(id2); + evsCam->checkBufferOrder(); +} + +TEST(EvsCameraForTest, UseAndReturn) { + constexpr std::size_t kNumOfHandles = 20; + auto evsCam = ndk::SharedRefBase::make(); + + // Our "fake handles" of this test case is 1 to kNumOfHandles. + for (std::size_t i = 1; i <= kNumOfHandles; ++i) { + evsCam->increaseAvailableFrames_unsafe(reinterpret_cast(i)); + } + evsCam->checkBufferOrder(); + + { + std::vector> inUseIDHandlePairs; + std::unordered_set inUseIDs; + std::unordered_set inUseHandles; + for (std::size_t i = 0; i < kNumOfHandles; ++i) { + const auto [id, handle] = evsCam->useBuffer_unsafe(); + const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_NE(handle, nullptr); + EXPECT_LT(id, kNumOfHandles); + + // handleInt must be between [1, kNumOfHandles] as we "allocated" above. + EXPECT_LT(0u, handleInt); + EXPECT_LE(handleInt, kNumOfHandles); + + inUseIDHandlePairs.push_back({id, handleInt}); + EXPECT_TRUE(inUseIDs.insert(id).second); + EXPECT_TRUE(inUseHandles.insert(handleInt).second); + evsCam->checkBufferOrder(); + } + // Return buffers in the order of acquiring. + for (const auto [id, handleInt] : inUseIDHandlePairs) { + evsCam->returnBuffer_unsafe(id); + evsCam->checkBufferOrder(); + } + } + + { + std::vector> inUseIDHandlePairs; + std::unordered_set inUseIDs; + std::unordered_set inUseHandles; + for (std::size_t i = 0; i < kNumOfHandles; ++i) { + const auto [id, handle] = evsCam->useBuffer_unsafe(); + const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_NE(handle, nullptr); + EXPECT_LT(id, kNumOfHandles); + + // handleInt must be between [1, kNumOfHandles] as we "allocated" above. + EXPECT_LT(0u, handleInt); + EXPECT_LE(handleInt, kNumOfHandles); + + inUseIDHandlePairs.push_back({id, handleInt}); + EXPECT_TRUE(inUseIDs.insert(id).second); + EXPECT_TRUE(inUseHandles.insert(handleInt).second); + evsCam->checkBufferOrder(); + } + // Return buffers in the reverse order of acquiring. + std::reverse(inUseIDHandlePairs.begin(), inUseIDHandlePairs.end()); + for (const auto [id, handleInt] : inUseIDHandlePairs) { + evsCam->returnBuffer_unsafe(id); + evsCam->checkBufferOrder(); + } + } + + { + // Making sure the handles are still in [1, kNumOfHandles] and IDs are still [0, + // kNumOfHandles). The mapping may be different, though. + std::vector> inUseIDHandlePairs; + std::unordered_set inUseIDs; + std::unordered_set inUseHandles; + for (std::size_t i = 0; i < kNumOfHandles; ++i) { + const auto [id, handle] = evsCam->useBuffer_unsafe(); + const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_NE(handle, nullptr); + EXPECT_LT(id, kNumOfHandles); + + // handleInt must be between [1, kNumOfHandles] as we "allocated" above. + EXPECT_LT(0u, handleInt); + EXPECT_LE(handleInt, kNumOfHandles); + + inUseIDHandlePairs.push_back({id, handleInt}); + EXPECT_TRUE(inUseIDs.insert(id).second); + EXPECT_TRUE(inUseHandles.insert(handleInt).second); + evsCam->checkBufferOrder(); + } + } +} + +} // namespace aidl::android::hardware::automotive::evs::implementation -- GitLab From 0d14a8297b2fb614ac12c56e6cf86a781790ec26 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Tue, 29 Aug 2023 20:34:08 +0000 Subject: [PATCH 152/376] Hanlding Streams and States Test: Build && `atest android.hardware.automotive.evs-aidl-default-service_cam_state_test` Bug: 277861838 Change-Id: Idd8fe8e76876dfd93a177d3529ccf118b626001d --- automotive/evs/aidl/impl/default/Android.bp | 17 ++ .../evs/aidl/impl/default/include/EvsCamera.h | 40 ++++ .../evs/aidl/impl/default/src/EvsCamera.cpp | 112 ++++++++++ .../default/tests/EvsCameraBufferTest.cpp | 15 +- .../impl/default/tests/EvsCameraStateTest.cpp | 202 ++++++++++++++++++ 5 files changed, 378 insertions(+), 8 deletions(-) create mode 100644 automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp index c56fe2bfc7..6b638a3e19 100644 --- a/automotive/evs/aidl/impl/default/Android.bp +++ b/automotive/evs/aidl/impl/default/Android.bp @@ -105,4 +105,21 @@ cc_test { "android.hardware.automotive.evs-aidl-default-service-lib", "libgmock", ], + test_suites: [ + "general-tests", + ], +} + +cc_test { + name: "android.hardware.automotive.evs-aidl-default-service_cam_state_test", + defaults: ["android.hardware.automotive.evs-aidl-default-service-default"], + vendor: true, + srcs: ["tests/EvsCameraStateTest.cpp"], + static_libs: [ + "android.hardware.automotive.evs-aidl-default-service-lib", + "libgmock", + ], + test_suites: [ + "general-tests", + ], } diff --git a/automotive/evs/aidl/impl/default/include/EvsCamera.h b/automotive/evs/aidl/impl/default/include/EvsCamera.h index 3663e3d05a..5774db5590 100644 --- a/automotive/evs/aidl/impl/default/include/EvsCamera.h +++ b/automotive/evs/aidl/impl/default/include/EvsCamera.h @@ -18,6 +18,7 @@ #include "EvsCameraBase.h" +#include #include #include @@ -45,11 +46,41 @@ class EvsCamera : public EvsCameraBase { ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override; + ndk::ScopedAStatus startVideoStream( + const std::shared_ptr& receiver) override; + + ndk::ScopedAStatus stopVideoStream() override; + + ndk::ScopedAStatus pauseVideoStream() override; + + ndk::ScopedAStatus resumeVideoStream() override; + protected: virtual ::android::status_t allocateOneFrame(buffer_handle_t* handle) = 0; virtual void freeOneFrame(const buffer_handle_t handle); + virtual bool preVideoStreamStart_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck); + + virtual bool startVideoStreamImpl_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck) = 0; + + virtual bool postVideoStreamStart_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck); + + virtual bool preVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck); + + virtual bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) = 0; + + virtual bool postVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck); + void shutdown() override; void closeAllBuffers_unsafe(); @@ -81,6 +112,15 @@ class EvsCamera : public EvsCameraBase { bool inUse{false}; }; + enum class StreamState { + STOPPED = 0, + RUNNING = 1, + STOPPING = 2, + DEAD = 3, + }; + + StreamState mStreamState{StreamState::STOPPED}; + std::mutex mMutex; // Graphics buffers to transfer images, always in the order of: diff --git a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp index db3be8fb36..208a1a4a8c 100644 --- a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp @@ -32,6 +32,9 @@ namespace aidl::android::hardware::automotive::evs::implementation { // Safeguards against unreasonable resource consumption and provides a testable limit constexpr std::size_t kMaxBuffersInFlight = 100; +// Minimum number of buffers to run a video stream +constexpr int kMinimumBuffersInFlight = 1; + EvsCamera::~EvsCamera() { shutdown(); } @@ -108,6 +111,113 @@ void EvsCamera::freeOneFrame(const buffer_handle_t handle) { alloc.free(handle); } +bool EvsCamera::preVideoStreamStart_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& /* lck */) { + if (!receiver) { + LOG(ERROR) << __func__ << ": Null receiver."; + status = ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::INVALID_ARG)); + return false; + } + + // If we've been displaced by another owner of the camera, then we can't do anything else + if (mStreamState == StreamState::DEAD) { + LOG(ERROR) << __func__ << ": Ignoring when camera has been lost."; + status = ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::OWNERSHIP_LOST)); + return false; + } + + if (mStreamState != StreamState::STOPPED) { + LOG(ERROR) << __func__ << ": Ignoring when a stream is already running."; + status = ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::STREAM_ALREADY_RUNNING)); + return false; + } + + // If the client never indicated otherwise, configure ourselves for a single streaming buffer + if (mAvailableFrames < kMinimumBuffersInFlight && + !setAvailableFrames_unsafe(kMinimumBuffersInFlight)) { + LOG(ERROR) << __func__ << "Failed to because we could not get a graphics buffer."; + status = ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); + return false; + } + mStreamState = StreamState::RUNNING; + return true; +} + +bool EvsCamera::postVideoStreamStart_locked( + const std::shared_ptr& /* receiver */, + ndk::ScopedAStatus& /* status */, std::unique_lock& /* lck */) { + return true; +} + +bool EvsCamera::preVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& /* lck */) { + if (mStreamState != StreamState::RUNNING) { + // Terminate the stop process because a stream is not running. + status = ndk::ScopedAStatus::ok(); + return false; + } + mStreamState = StreamState::STOPPING; + return true; +} + +bool EvsCamera::postVideoStreamStop_locked(ndk::ScopedAStatus& /* status */, + std::unique_lock& /* lck */) { + mStreamState = StreamState::STOPPED; + return true; +} + +ndk::ScopedAStatus EvsCamera::startVideoStream( + const std::shared_ptr& receiver) { + bool needShutdown = false; + auto status = ndk::ScopedAStatus::ok(); + { + std::unique_lock lck(mMutex); + if (!preVideoStreamStart_locked(receiver, status, lck)) { + return status; + } + + if ((!startVideoStreamImpl_locked(receiver, status, lck) || + !postVideoStreamStart_locked(receiver, status, lck)) && + !status.isOk()) { + needShutdown = true; + } + } + if (needShutdown) { + shutdown(); + } + return status; +} + +ndk::ScopedAStatus EvsCamera::stopVideoStream() { + bool needShutdown = false; + auto status = ndk::ScopedAStatus::ok(); + { + std::unique_lock lck(mMutex); + if ((!preVideoStreamStop_locked(status, lck) || !stopVideoStreamImpl_locked(status, lck) || + !postVideoStreamStop_locked(status, lck)) && + !status.isOk()) { + needShutdown = true; + } + } + if (needShutdown) { + shutdown(); + } + return status; +} + +ndk::ScopedAStatus EvsCamera::pauseVideoStream() { + return ndk::ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); +} + +ndk::ScopedAStatus EvsCamera::resumeVideoStream() { + return ndk::ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); +} + bool EvsCamera::setAvailableFrames_unsafe(const std::size_t bufferCount) { if (bufferCount < 1) { LOG(ERROR) << "Ignoring request to set buffer count to zero."; @@ -159,8 +269,10 @@ bool EvsCamera::setAvailableFrames_unsafe(const std::size_t bufferCount) { } void EvsCamera::shutdown() { + stopVideoStream(); std::lock_guard lck(mMutex); closeAllBuffers_unsafe(); + mStreamState = StreamState::DEAD; } void EvsCamera::closeAllBuffers_unsafe() { diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp index 48f0890e69..3cbc04a9c9 100644 --- a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp +++ b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp @@ -77,8 +77,6 @@ class EvsCameraForTest : public EvsCamera { (const std::string& in_deviceId, ::aidl::android::hardware::automotive::evs::CameraDesc* _aidl_return), (override)); - MOCK_METHOD(::ndk::ScopedAStatus, pauseVideoStream, (), (override)); - MOCK_METHOD(::ndk::ScopedAStatus, resumeVideoStream, (), (override)); MOCK_METHOD(::ndk::ScopedAStatus, setExtendedInfo, (int32_t in_opaqueIdentifier, const std::vector& in_opaqueValue), (override)); @@ -87,12 +85,13 @@ class EvsCameraForTest : public EvsCamera { std::vector* _aidl_return), (override)); MOCK_METHOD(::ndk::ScopedAStatus, setPrimaryClient, (), (override)); - MOCK_METHOD(::ndk::ScopedAStatus, startVideoStream, - (const std::shared_ptr< - ::aidl::android::hardware::automotive::evs::IEvsCameraStream>& in_receiver), - (override)); - MOCK_METHOD(::ndk::ScopedAStatus, stopVideoStream, (), (override)); MOCK_METHOD(::ndk::ScopedAStatus, unsetPrimaryClient, (), (override)); + MOCK_METHOD(bool, startVideoStreamImpl_locked, + (const std::shared_ptr& receiver, ndk::ScopedAStatus& status, + std::unique_lock& lck), + (override)); + MOCK_METHOD(bool, stopVideoStreamImpl_locked, + (ndk::ScopedAStatus & status, std::unique_lock& lck), (override)); }; TEST(EvsCameraBufferTest, ChangeBufferPoolSize) { @@ -118,7 +117,7 @@ TEST(EvsCameraBufferTest, ChangeBufferPoolSize) { evsCam->checkBufferOrder(); } -TEST(EvsCameraForTest, UseAndReturn) { +TEST(EvsCameraBufferTest, UseAndReturn) { constexpr std::size_t kNumOfHandles = 20; auto evsCam = ndk::SharedRefBase::make(); diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp new file mode 100644 index 0000000000..1925c793f7 --- /dev/null +++ b/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsCamera.h" + +#include +#include + +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsCameraForTest : public EvsCamera { + private: + using Base = EvsCamera; + + public: + using EvsCamera::mStreamState; + using EvsCamera::shutdown; + using EvsCamera::StreamState; + + ~EvsCameraForTest() override { shutdown(); } + + ::android::status_t allocateOneFrame(buffer_handle_t* handle) override { + static std::intptr_t handle_cnt = 0; + *handle = reinterpret_cast(++handle_cnt); + return ::android::OK; + } + + void freeOneFrame(const buffer_handle_t /* handle */) override { + // Nothing to free because the handles are fake. + } + + bool preVideoStreamStart_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck) override { + mPreStartCalled = true; + EXPECT_EQ(mStreamState, StreamState::STOPPED); + EXPECT_FALSE(mStreamStarted); + EXPECT_FALSE(mStreamStopped); + return Base::preVideoStreamStart_locked(receiver, status, lck); + } + + bool startVideoStreamImpl_locked(const std::shared_ptr& /* receiver */, + ndk::ScopedAStatus& /* status */, + std::unique_lock& /* lck */) override { + EXPECT_EQ(mStreamState, StreamState::RUNNING); + EXPECT_FALSE(mStreamStarted); + EXPECT_FALSE(mStreamStopped); + mStreamStarted = true; + return true; + } + + bool postVideoStreamStart_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck) override { + mPostStartCalled = true; + EXPECT_EQ(mStreamState, StreamState::RUNNING); + EXPECT_TRUE(mStreamStarted); + EXPECT_FALSE(mStreamStopped); + return Base::postVideoStreamStart_locked(receiver, status, lck); + } + + bool preVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) override { + // Skip the check if stop was called before. + if (!mPreStopCalled) { + mPreStopCalled = true; + EXPECT_EQ(mStreamState, StreamState::RUNNING); + EXPECT_TRUE(mStreamStarted); + EXPECT_FALSE(mStreamStopped); + } + return Base::preVideoStreamStop_locked(status, lck); + } + + bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */, + std::unique_lock& /* lck */) override { + EXPECT_EQ(mStreamState, StreamState::STOPPING); + EXPECT_TRUE(mStreamStarted); + EXPECT_FALSE(mStreamStopped); + mStreamStopped = true; + return true; + } + + bool postVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) override { + mPostStopCalled = true; + const auto ret = Base::postVideoStreamStop_locked(status, lck); + EXPECT_EQ(mStreamState, StreamState::STOPPED); + EXPECT_TRUE(mStreamStarted); + EXPECT_TRUE(mStreamStopped); + return ret; + } + + MOCK_METHOD(::ndk::ScopedAStatus, forcePrimaryClient, + (const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>& + in_display), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getCameraInfo, + (::aidl::android::hardware::automotive::evs::CameraDesc * _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getExtendedInfo, + (int32_t in_opaqueIdentifier, std::vector* _aidl_return), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getIntParameter, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, + std::vector* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getIntParameterRange, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, + ::aidl::android::hardware::automotive::evs::ParameterRange* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getParameterList, + (std::vector<::aidl::android::hardware::automotive::evs::CameraParam> * + _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getPhysicalCameraInfo, + (const std::string& in_deviceId, + ::aidl::android::hardware::automotive::evs::CameraDesc* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setExtendedInfo, + (int32_t in_opaqueIdentifier, const std::vector& in_opaqueValue), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setIntParameter, + (::aidl::android::hardware::automotive::evs::CameraParam in_id, int32_t in_value, + std::vector* _aidl_return), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, setPrimaryClient, (), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, unsetPrimaryClient, (), (override)); + + bool mStreamStarted = false; + bool mStreamStopped = false; + bool mPreStartCalled = false; + bool mPostStartCalled = false; + bool mPreStopCalled = false; + bool mPostStopCalled = false; +}; + +class MockEvsCameraStream : public evs::IEvsCameraStream { + MOCK_METHOD(::ndk::SpAIBinder, asBinder, (), (override)); + MOCK_METHOD(bool, isRemote, (), (override)); + MOCK_METHOD( + ::ndk::ScopedAStatus, deliverFrame, + (const std::vector<::aidl::android::hardware::automotive::evs::BufferDesc>& in_buffer), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, notify, + (const ::aidl::android::hardware::automotive::evs::EvsEventDesc& in_event), + (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getInterfaceVersion, (int32_t * _aidl_return), (override)); + MOCK_METHOD(::ndk::ScopedAStatus, getInterfaceHash, (std::string * _aidl_return), (override)); +}; + +using StreamState = EvsCameraForTest::StreamState; + +TEST(EvsCameraStateTest, StateChangeHooks) { + auto evsCam = ndk::SharedRefBase::make(); + auto mockStream = ndk::SharedRefBase::make(); + EXPECT_FALSE(evsCam->mPreStartCalled); + EXPECT_FALSE(evsCam->mPostStartCalled); + EXPECT_FALSE(evsCam->mPreStopCalled); + EXPECT_FALSE(evsCam->mPostStopCalled); + EXPECT_FALSE(evsCam->mStreamStarted); + EXPECT_FALSE(evsCam->mStreamStopped); + EXPECT_EQ(evsCam->mStreamState, StreamState::STOPPED); + evsCam->startVideoStream(mockStream); + + EXPECT_TRUE(evsCam->mPreStartCalled); + EXPECT_TRUE(evsCam->mPostStartCalled); + EXPECT_FALSE(evsCam->mPreStopCalled); + EXPECT_FALSE(evsCam->mPostStopCalled); + EXPECT_TRUE(evsCam->mStreamStarted); + EXPECT_FALSE(evsCam->mStreamStopped); + EXPECT_EQ(evsCam->mStreamState, StreamState::RUNNING); + evsCam->stopVideoStream(); + + EXPECT_TRUE(evsCam->mPreStartCalled); + EXPECT_TRUE(evsCam->mPostStartCalled); + EXPECT_TRUE(evsCam->mPreStopCalled); + EXPECT_TRUE(evsCam->mPostStopCalled); + EXPECT_TRUE(evsCam->mStreamStarted); + EXPECT_TRUE(evsCam->mStreamStopped); + EXPECT_EQ(evsCam->mStreamState, StreamState::STOPPED); + + evsCam->shutdown(); + EXPECT_EQ(evsCam->mStreamState, StreamState::DEAD); +} + +} // namespace aidl::android::hardware::automotive::evs::implementation -- GitLab From 224446bcad3e3d42c8c3de5bec690216b1fb944f Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 23 Aug 2023 21:50:30 +0000 Subject: [PATCH 153/376] Add EVS Video Emulated Camera Class Test: Build Bug: 277861838 Change-Id: Ic9ce648b857eddefccc24065397af5b2056426c7 --- .../aidl/impl/default/include/EvsAllCameras.h | 20 ++ .../default/include/EvsVideoEmulatedCamera.h | 108 ++++++++++ .../aidl/impl/default/src/EvsEnumerator.cpp | 6 +- .../default/src/EvsVideoEmulatedCamera.cpp | 198 ++++++++++++++++++ 4 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 automotive/evs/aidl/impl/default/include/EvsAllCameras.h create mode 100644 automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h create mode 100644 automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp diff --git a/automotive/evs/aidl/impl/default/include/EvsAllCameras.h b/automotive/evs/aidl/impl/default/include/EvsAllCameras.h new file mode 100644 index 0000000000..a76501d758 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsAllCameras.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "EvsMockCamera.h" +#include "EvsVideoEmulatedCamera.h" diff --git a/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h b/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h new file mode 100644 index 0000000000..356a42ae36 --- /dev/null +++ b/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ConfigManager.h" +#include "EvsCamera.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +class EvsVideoEmulatedCamera : public EvsCamera { + public: + EvsVideoEmulatedCamera(Sigil sigil, const char* deviceName, + std::unique_ptr& camInfo); + + ~EvsVideoEmulatedCamera() override; + + // Methods from ::android::hardware::automotive::evs::IEvsCamera follow. + ndk::ScopedAStatus forcePrimaryClient( + const std::shared_ptr& display) override; + ndk::ScopedAStatus getCameraInfo(evs::CameraDesc* _aidl_return) override; + ndk::ScopedAStatus getExtendedInfo(int32_t opaqueIdentifier, + std::vector* value) override; + ndk::ScopedAStatus getIntParameter(evs::CameraParam id, std::vector* value) override; + ndk::ScopedAStatus getIntParameterRange(evs::CameraParam id, + evs::ParameterRange* _aidl_return) override; + ndk::ScopedAStatus getParameterList(std::vector* _aidl_return) override; + ndk::ScopedAStatus getPhysicalCameraInfo(const std::string& deviceId, + evs::CameraDesc* _aidl_return) override; + ndk::ScopedAStatus setExtendedInfo(int32_t opaqueIdentifier, + const std::vector& opaqueValue) override; + ndk::ScopedAStatus setIntParameter(evs::CameraParam id, int32_t value, + std::vector* effectiveValue) override; + ndk::ScopedAStatus setPrimaryClient() override; + ndk::ScopedAStatus unsetPrimaryClient() override; + + const evs::CameraDesc& getDesc() { return mDescription; } + + static std::shared_ptr Create(const char* deviceName); + static std::shared_ptr Create( + const char* deviceName, std::unique_ptr& camInfo, + const evs::Stream* streamCfg = nullptr); + + private: + // For the camera parameters. + struct CameraParameterDesc { + CameraParameterDesc(int min = 0, int max = 0, int step = 0, int value = 0) { + this->range.min = min; + this->range.max = max; + this->range.step = step; + this->value = value; + } + + ParameterRange range; + int32_t value; + }; + + void initializeParameters(); + + ::android::status_t allocateOneFrame(buffer_handle_t* handle) override; + + bool startVideoStreamImpl_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck) override; + + bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) override; + + // The properties of this camera. + CameraDesc mDescription = {}; + + // Camera parameters. + std::unordered_map> mParams; + + // Static camera module information + std::unique_ptr& mCameraInfo; + + // For the extended info + std::unordered_map> mExtInfo; +}; + +} // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp index ec4b18f906..80e72a73b5 100644 --- a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp @@ -17,9 +17,9 @@ #include "EvsEnumerator.h" #include "ConfigManager.h" +#include "EvsAllCameras.h" #include "EvsCameraBase.h" #include "EvsGlDisplay.h" -#include "EvsMockCamera.h" #include #include @@ -264,6 +264,10 @@ ScopedAStatus EvsEnumerator::openCamera(const std::string& id, const Stream& cfg pActiveCamera = EvsMockCamera::Create(id.data(), cameraInfo, &cfg); break; + case DeviceType::VIDEO: + pActiveCamera = EvsVideoEmulatedCamera::Create(id.data(), cameraInfo, &cfg); + break; + default: LOG(ERROR) << __func__ << ": camera device type " << static_cast(cameraInfo->deviceType) diff --git a/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp new file mode 100644 index 0000000000..f198a64e5b --- /dev/null +++ b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EvsVideoEmulatedCamera.h" + +#include + +#include + +#include +#include + +namespace aidl::android::hardware::automotive::evs::implementation { + +EvsVideoEmulatedCamera::EvsVideoEmulatedCamera(Sigil, const char* deviceName, + std::unique_ptr& camInfo) + : mCameraInfo(camInfo) { + mDescription.id = deviceName; + + /* set camera metadata */ + if (camInfo) { + uint8_t* ptr = reinterpret_cast(camInfo->characteristics); + const size_t len = get_camera_metadata_size(camInfo->characteristics); + mDescription.metadata.insert(mDescription.metadata.end(), ptr, ptr + len); + } + + initializeParameters(); +} + +void EvsVideoEmulatedCamera::initializeParameters() { + mParams.emplace( + CameraParam::BRIGHTNESS, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); + mParams.emplace( + CameraParam::CONTRAST, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); + mParams.emplace( + CameraParam::SHARPNESS, + new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); +} + +::android::status_t EvsVideoEmulatedCamera::allocateOneFrame(buffer_handle_t* /* handle */) { + LOG(FATAL) << __func__ << ": Not implemented yet."; + return ::android::UNKNOWN_ERROR; +} + +bool EvsVideoEmulatedCamera::startVideoStreamImpl_locked( + const std::shared_ptr& /* receiver */, + ndk::ScopedAStatus& /* status */, std::unique_lock& /* lck */) { + LOG(FATAL) << __func__ << ": Not implemented yet."; + return false; +} + +bool EvsVideoEmulatedCamera::stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */, + std::unique_lock& /* lck */) { + LOG(FATAL) << __func__ << ": Not implemented yet."; + return false; +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::forcePrimaryClient( + const std::shared_ptr& /* display */) { + /* Because EVS HW module reference implementation expects a single client at + * a time, this returns a success code always. + */ + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getCameraInfo(evs::CameraDesc* _aidl_return) { + *_aidl_return = mDescription; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getExtendedInfo(int32_t opaqueIdentifier, + std::vector* value) { + const auto it = mExtInfo.find(opaqueIdentifier); + if (it == mExtInfo.end()) { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::INVALID_ARG)); + } else { + *value = mExtInfo[opaqueIdentifier]; + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getIntParameter(evs::CameraParam id, + std::vector* value) { + const auto it = mParams.find(id); + if (it == mParams.end()) { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::NOT_SUPPORTED)); + } + value->push_back(it->second->value); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getIntParameterRange(evs::CameraParam id, + evs::ParameterRange* _aidl_return) { + const auto it = mParams.find(id); + if (it == mParams.end()) { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::NOT_SUPPORTED)); + } + _aidl_return->min = it->second->range.min; + _aidl_return->max = it->second->range.max; + _aidl_return->step = it->second->range.step; + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getParameterList( + std::vector* _aidl_return) { + if (mCameraInfo) { + _aidl_return->resize(mCameraInfo->controls.size()); + std::size_t idx = 0; + for (const auto& [name, range] : mCameraInfo->controls) { + (*_aidl_return)[idx++] = name; + } + } + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::getPhysicalCameraInfo(const std::string& /* deviceId */, + evs::CameraDesc* _aidl_return) { + return getCameraInfo(_aidl_return); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::setExtendedInfo( + int32_t opaqueIdentifier, const std::vector& opaqueValue) { + mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::setIntParameter(evs::CameraParam id, int32_t value, + std::vector* effectiveValue) { + const auto it = mParams.find(id); + if (it == mParams.end()) { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::NOT_SUPPORTED)); + } + // Rounding down to the closest value. + int32_t candidate = value / it->second->range.step * it->second->range.step; + if (candidate < it->second->range.min || candidate > it->second->range.max) { + return ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(EvsResult::INVALID_ARG)); + } + it->second->value = candidate; + effectiveValue->push_back(candidate); + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::setPrimaryClient() { + /* Because EVS HW module reference implementation expects a single client at + * a time, this returns a success code always. + */ + return ndk::ScopedAStatus::ok(); +} + +ndk::ScopedAStatus EvsVideoEmulatedCamera::unsetPrimaryClient() { + /* Because EVS HW module reference implementation expects a single client at + * a time, there is no chance that this is called by the secondary client and + * therefore returns a success code always. + */ + return ndk::ScopedAStatus::ok(); +} + +std::shared_ptr EvsVideoEmulatedCamera::Create(const char* deviceName) { + std::unique_ptr nullCamInfo = nullptr; + return Create(deviceName, nullCamInfo); +} + +std::shared_ptr EvsVideoEmulatedCamera::Create( + const char* deviceName, std::unique_ptr& camInfo, + const evs::Stream* /* streamCfg */) { + std::shared_ptr c = + ndk::SharedRefBase::make(Sigil{}, deviceName, camInfo); + if (!c) { + LOG(ERROR) << "Failed to instantiate EvsVideoEmulatedCamera."; + return nullptr; + } + c->mDescription.vendorFlags = 0xFFFFFFFF; // Arbitrary test value + return c; +} + +EvsVideoEmulatedCamera::~EvsVideoEmulatedCamera() {} + +} // namespace aidl::android::hardware::automotive::evs::implementation -- GitLab From ca2f39be70499bbe624cd901392e293004527232 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 22 Sep 2023 19:26:27 -0700 Subject: [PATCH 154/376] Remove remoteaccess V1 impl. We have migrated all the ref to V2. Test: Presubmit Bug: 295393732 Change-Id: I358d6380664dac13412b2706652de9726441adae --- .../remoteaccess/hal/default/Android.bp | 23 ------------------- .../remoteaccess-default-service-v1.rc | 4 ---- .../remoteaccess-default-service-v1.xml | 7 ------ .../remoteaccess-tcu-test-service-v1.rc | 5 ---- 4 files changed, 39 deletions(-) delete mode 100644 automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc delete mode 100644 automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml delete mode 100644 automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp index 70dba3071a..97ed2c12f0 100644 --- a/automotive/remoteaccess/hal/default/Android.bp +++ b/automotive/remoteaccess/hal/default/Android.bp @@ -47,17 +47,6 @@ cc_defaults { ], } -// TODO(b/295393732): remove this once we finish the migration from V1 to V2. -cc_binary { - name: "android.hardware.automotive.remoteaccess@V1-default-service", - defaults: ["remote-access-hal-defaults"], - vintf_fragments: ["remoteaccess-default-service-v1.xml"], - init_rc: ["remoteaccess-default-service-v1.rc"], - cflags: [ - "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"", - ], -} - cc_binary { name: "android.hardware.automotive.remoteaccess@V2-default-service", defaults: ["remote-access-hal-defaults"], @@ -68,18 +57,6 @@ cc_binary { ], } -// TODO(b/295393732): remove this once we finish the migration from V1 to V2. -cc_binary { - name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service", - defaults: ["remote-access-hal-defaults"], - vintf_fragments: ["remoteaccess-default-service-v1.xml"], - init_rc: ["remoteaccess-tcu-test-service-v1.rc"], - cflags: [ - "-DGRPC_SERVICE_ADDRESS=\"10.10.10.1:50051\"", - "-DGRPC_SERVICE_IFNAME=\"eth1\"", - ], -} - cc_binary { name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service", defaults: ["remote-access-hal-defaults"], diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc deleted file mode 100644 index b7a9cdc82a..0000000000 --- a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.rc +++ /dev/null @@ -1,4 +0,0 @@ -service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service - class hal - user vehicle_network - group system inet diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml deleted file mode 100644 index d050a1b646..0000000000 --- a/automotive/remoteaccess/hal/default/remoteaccess-default-service-v1.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - android.hardware.automotive.remoteaccess - 1 - IRemoteAccess/default - - diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc deleted file mode 100644 index 59315ebe0b..0000000000 --- a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service-v1.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service - class hal - user vehicle_network - group system inet - capabilities NET_RAW -- GitLab From e04a700d86150986a528943373f00131a3cb542f Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Thu, 14 Sep 2023 23:18:45 +0000 Subject: [PATCH 155/376] Use EvsCamera as the base of EvsMockCamera Test: Build and run (mock) evs_app tests Bug: 300533205 Change-Id: I8e43c5879dee9942c27d69cdfb3012d35b123441 --- .../evs/aidl/impl/default/include/EvsCamera.h | 8 +- .../aidl/impl/default/include/EvsMockCamera.h | 84 ++-- .../evs/aidl/impl/default/src/EvsCamera.cpp | 2 +- .../aidl/impl/default/src/EvsMockCamera.cpp | 472 +++--------------- .../default/tests/EvsCameraBufferTest.cpp | 3 + 5 files changed, 97 insertions(+), 472 deletions(-) diff --git a/automotive/evs/aidl/impl/default/include/EvsCamera.h b/automotive/evs/aidl/impl/default/include/EvsCamera.h index 5774db5590..539d5f6f9c 100644 --- a/automotive/evs/aidl/impl/default/include/EvsCamera.h +++ b/automotive/evs/aidl/impl/default/include/EvsCamera.h @@ -85,7 +85,7 @@ class EvsCamera : public EvsCameraBase { void closeAllBuffers_unsafe(); - // Returns (ID, handle) if succeeds. (static_cast(-1), nullptr) otherwise. + // Returns (ID, handle) if succeeds. (kInvalidBufferID, nullptr) otherwise. [[nodiscard]] std::pair useBuffer_unsafe(); void returnBuffer_unsafe(const std::size_t id); @@ -133,6 +133,12 @@ class EvsCamera : public EvsCameraBase { std::size_t mAvailableFrames{0}; std::size_t mFramesInUse{0}; + + // We use all 1's as a reserved invalid buffer ID. + static constexpr std::size_t kInvalidBufferID = ~static_cast(0); + + public: + static bool IsBufferIDValid(const std::size_t bufferId) { return ~bufferId; } }; } // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h index c7b9e0fd92..cd685324be 100644 --- a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h +++ b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h @@ -17,29 +17,36 @@ #pragma once #include "ConfigManager.h" -#include "EvsCameraBase.h" +#include "EvsCamera.h" -#include #include #include -#include #include #include #include #include -// #include #include #include -#include +#include +#include #include +#include +#include namespace aidl::android::hardware::automotive::evs::implementation { -class EvsMockCamera : public EvsCameraBase { +class EvsMockCamera : public EvsCamera { + private: + using Base = EvsCamera; + public: + EvsMockCamera(Sigil sigil, const char* deviceName, + std::unique_ptr& camInfo); + EvsMockCamera(const EvsMockCamera&) = delete; + EvsMockCamera& operator=(const EvsMockCamera&) = delete; + // Methods from ::android::hardware::automotive::evs::IEvsCamera follow. - ndk::ScopedAStatus doneWithFrame(const std::vector& buffers) override; ndk::ScopedAStatus forcePrimaryClient( const std::shared_ptr& display) override; ndk::ScopedAStatus getCameraInfo(evs::CameraDesc* _aidl_return) override; @@ -51,49 +58,37 @@ class EvsMockCamera : public EvsCameraBase { ndk::ScopedAStatus getParameterList(std::vector* _aidl_return) override; ndk::ScopedAStatus getPhysicalCameraInfo(const std::string& deviceId, evs::CameraDesc* _aidl_return) override; - ndk::ScopedAStatus importExternalBuffers(const std::vector& buffers, - int32_t* _aidl_return) override; - ndk::ScopedAStatus pauseVideoStream() override; - ndk::ScopedAStatus resumeVideoStream() override; ndk::ScopedAStatus setExtendedInfo(int32_t opaqueIdentifier, const std::vector& opaqueValue) override; ndk::ScopedAStatus setIntParameter(evs::CameraParam id, int32_t value, std::vector* effectiveValue) override; ndk::ScopedAStatus setPrimaryClient() override; - ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override; - ndk::ScopedAStatus startVideoStream( - const std::shared_ptr& receiver) override; - ndk::ScopedAStatus stopVideoStream() override; ndk::ScopedAStatus unsetPrimaryClient() override; + const evs::CameraDesc& getDesc() { return mDescription; } + static std::shared_ptr Create(const char* deviceName); static std::shared_ptr Create( const char* deviceName, std::unique_ptr& camInfo, const evs::Stream* streamCfg = nullptr); - EvsMockCamera(const EvsMockCamera&) = delete; - EvsMockCamera& operator=(const EvsMockCamera&) = delete; - virtual ~EvsMockCamera() override; + private: + void generateFrames(); + void fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_Desc* pDesc); - // Methods from EvsCameraBase follow. - void shutdown() override; + ::android::status_t allocateOneFrame(buffer_handle_t* handle) override; - const evs::CameraDesc& getDesc() { return mDescription; } + bool startVideoStreamImpl_locked(const std::shared_ptr& receiver, + ndk::ScopedAStatus& status, + std::unique_lock& lck) override; - // Constructors - EvsMockCamera(Sigil sigil, const char* deviceName, - std::unique_ptr& camInfo); + bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) override; - private: - // These three functions are expected to be called while mAccessLock is held - bool setAvailableFrames_Locked(unsigned bufferCount); - unsigned increaseAvailableFrames_Locked(unsigned numToAdd); - unsigned decreaseAvailableFrames_Locked(unsigned numToRemove); + bool postVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) override; - void generateFrames(); - void fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_Desc* pDesc); - void returnBufferLocked(const uint32_t bufferId); - ndk::ScopedAStatus stopVideoStream_impl(); + void initializeParameters(); CameraDesc mDescription = {}; // The properties of this camera @@ -114,28 +109,6 @@ class EvsMockCamera : public EvsCameraBase { // Bytes per line in the buffers uint32_t mStride = 0; - struct BufferRecord { - buffer_handle_t handle; - bool inUse; - - explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false){}; - }; - - std::vector mBuffers; // Graphics buffers to transfer images - unsigned mFramesAllowed; // How many buffers are we currently using - unsigned mFramesInUse; // How many buffers are currently outstanding - - enum StreamStateValues { - STOPPED, - RUNNING, - STOPPING, - DEAD, - }; - StreamStateValues mStreamState; - - // Synchronization necessary to deconflict mCaptureThread from the main service thread - std::mutex mAccessLock; - // Static camera module information std::unique_ptr& mCameraInfo; @@ -155,7 +128,6 @@ class EvsMockCamera : public EvsCameraBase { int32_t value; }; std::unordered_map> mParams; - void initializeParameters(); }; } // namespace aidl::android::hardware::automotive::evs::implementation diff --git a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp index 208a1a4a8c..bc3bfdd367 100644 --- a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp @@ -292,7 +292,7 @@ void EvsCamera::closeAllBuffers_unsafe() { std::pair EvsCamera::useBuffer_unsafe() { if (mFramesInUse >= mAvailableFrames) { DCHECK_EQ(mFramesInUse, mAvailableFrames); - return {static_cast(-1), nullptr}; + return {kInvalidBufferID, nullptr}; } const std::size_t pos = mFramesInUse++; auto& buffer = mBuffers[pos]; diff --git a/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp index 797b22154b..ef43925321 100644 --- a/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp +++ b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp @@ -15,28 +15,25 @@ */ #include "EvsMockCamera.h" -#include "ConfigManager.h" -#include "EvsEnumerator.h" + +#include #include +#include #include #include #include +#include +#include #include +#include namespace { using ::aidl::android::hardware::graphics::common::BufferUsage; using ::ndk::ScopedAStatus; -// Arbitrary limit on number of graphics buffers allowed to be allocated -// Safeguards against unreasonable resource consumption and provides a testable limit -constexpr unsigned kMaxBuffersInFlight = 100; - -// Minimum number of buffers to run a video stream -constexpr int kMinimumBuffersInFlight = 1; - // Colors for the colorbar test pattern in ABGR format constexpr uint32_t kColors[] = { 0xFFFFFFFF, // white @@ -56,7 +53,7 @@ namespace aidl::android::hardware::automotive::evs::implementation { EvsMockCamera::EvsMockCamera([[maybe_unused]] Sigil sigil, const char* id, std::unique_ptr& camInfo) - : mFramesAllowed(0), mFramesInUse(0), mStreamState(STOPPED), mCameraInfo(camInfo) { + : mCameraInfo(camInfo) { LOG(DEBUG) << __FUNCTION__; /* set a camera id */ @@ -73,11 +70,6 @@ EvsMockCamera::EvsMockCamera([[maybe_unused]] Sigil sigil, const char* id, initializeParameters(); } -EvsMockCamera::~EvsMockCamera() { - LOG(DEBUG) << __FUNCTION__; - shutdown(); -} - void EvsMockCamera::initializeParameters() { mParams.emplace( CameraParam::BRIGHTNESS, @@ -90,35 +82,6 @@ void EvsMockCamera::initializeParameters() { new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255)); } -// This gets called if another caller "steals" ownership of the camera -void EvsMockCamera::shutdown() { - LOG(DEBUG) << __FUNCTION__; - - // Make sure our output stream is cleaned up - // (It really should be already) - stopVideoStream_impl(); - - // Claim the lock while we work on internal state - std::lock_guard lock(mAccessLock); - - // Drop all the graphics buffers we've been using - if (mBuffers.size() > 0) { - ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); - for (auto&& rec : mBuffers) { - if (rec.inUse) { - LOG(WARNING) << "WARNING: releasing a buffer remotely owned."; - } - alloc.free(rec.handle); - rec.handle = nullptr; - } - mBuffers.clear(); - } - - // Put this object into an unrecoverable error state since somebody else - // is going to own the underlying camera now - mStreamState = DEAD; -} - // Methods from ::aidl::android::hardware::automotive::evs::IEvsCamera follow. ScopedAStatus EvsMockCamera::getCameraInfo(CameraDesc* _aidl_return) { LOG(DEBUG) << __FUNCTION__; @@ -128,115 +91,6 @@ ScopedAStatus EvsMockCamera::getCameraInfo(CameraDesc* _aidl_return) { return ScopedAStatus::ok(); } -ScopedAStatus EvsMockCamera::setMaxFramesInFlight(int32_t bufferCount) { - LOG(DEBUG) << __FUNCTION__ << ", bufferCount = " << bufferCount; - ; - - std::lock_guard lock(mAccessLock); - - // If we've been displaced by another owner of the camera, then we can't do anything else - if (mStreamState == DEAD) { - LOG(ERROR) << "Ignoring setMaxFramesInFlight call when camera has been lost."; - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); - } - - // We cannot function without at least one video buffer to send data - if (bufferCount < 1) { - LOG(ERROR) << "Ignoring setMaxFramesInFlight with less than one buffer requested."; - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); - } - - // Update our internal state - if (!setAvailableFrames_Locked(bufferCount)) { - LOG(ERROR) << "Failed to adjust the maximum number of frames in flight."; - return ScopedAStatus::fromServiceSpecificError( - static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); - } - - return ScopedAStatus::ok(); -} - -ScopedAStatus EvsMockCamera::startVideoStream(const std::shared_ptr& cb) { - LOG(DEBUG) << __FUNCTION__; - - if (!cb) { - LOG(ERROR) << "A given stream callback is invalid."; - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::INVALID_ARG)); - } - - std::lock_guard lock(mAccessLock); - - // If we've been displaced by another owner of the camera, then we can't do anything else - if (mStreamState == DEAD) { - LOG(ERROR) << "Ignoring startVideoStream call when camera has been lost."; - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::OWNERSHIP_LOST)); - } - - if (mStreamState != STOPPED) { - LOG(ERROR) << "Ignoring startVideoStream call when a stream is already running."; - return ScopedAStatus::fromServiceSpecificError( - static_cast(EvsResult::STREAM_ALREADY_RUNNING)); - } - - // If the client never indicated otherwise, configure ourselves for a single streaming buffer - if (mFramesAllowed < kMinimumBuffersInFlight && - !setAvailableFrames_Locked(kMinimumBuffersInFlight)) { - LOG(ERROR) << "Failed to start stream because we couldn't get a graphics buffer"; - return ScopedAStatus::fromServiceSpecificError( - static_cast(EvsResult::BUFFER_NOT_AVAILABLE)); - } - - // Record the user's callback for use when we have a frame ready - mStream = cb; - - // Start the frame generation thread - mStreamState = RUNNING; - mCaptureThread = std::thread([this]() { generateFrames(); }); - - return ScopedAStatus::ok(); -} - -ScopedAStatus EvsMockCamera::doneWithFrame(const std::vector& list) { - std::lock_guard lock(mAccessLock); - for (const auto& desc : list) { - returnBufferLocked(desc.bufferId); - } - - return ScopedAStatus::ok(); -} - -ScopedAStatus EvsMockCamera::stopVideoStream() { - LOG(DEBUG) << __FUNCTION__; - return stopVideoStream_impl(); -} - -ScopedAStatus EvsMockCamera::stopVideoStream_impl() { - std::unique_lock lock(mAccessLock); - - if (mStreamState != RUNNING) { - // Safely return here because a stream is not running. - return ScopedAStatus::ok(); - } - - // Tell the GenerateFrames loop we want it to stop - mStreamState = STOPPING; - - // Block outside the mutex until the "stop" flag has been acknowledged - // We won't send any more frames, but the client might still get some already in flight - LOG(DEBUG) << "Waiting for stream thread to end..."; - lock.unlock(); - if (mCaptureThread.joinable()) { - mCaptureThread.join(); - } - lock.lock(); - - mStreamState = STOPPED; - mStream = nullptr; - LOG(DEBUG) << "Stream marked STOPPED."; - - return ScopedAStatus::ok(); -} - ScopedAStatus EvsMockCamera::getExtendedInfo(int32_t opaqueIdentifier, std::vector* opaqueValue) { const auto it = mExtInfo.find(opaqueIdentifier); @@ -264,14 +118,6 @@ ScopedAStatus EvsMockCamera::getPhysicalCameraInfo([[maybe_unused]] const std::s return ScopedAStatus::ok(); } -ScopedAStatus EvsMockCamera::pauseVideoStream() { - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); -} - -ScopedAStatus EvsMockCamera::resumeVideoStream() { - return ScopedAStatus::fromServiceSpecificError(static_cast(EvsResult::NOT_SUPPORTED)); -} - ScopedAStatus EvsMockCamera::setPrimaryClient() { /* Because EVS HW module reference implementation expects a single client at * a time, this returns a success code always. @@ -346,232 +192,27 @@ ScopedAStatus EvsMockCamera::getIntParameter(CameraParam id, std::vector& buffers, - int32_t* _aidl_return) { - size_t numBuffersToAdd = buffers.size(); - if (numBuffersToAdd < 1) { - LOG(DEBUG) << "Ignoring a request to import external buffers with an empty list."; - return ScopedAStatus::ok(); - } - - std::lock_guard lock(mAccessLock); - if (numBuffersToAdd > (kMaxBuffersInFlight - mFramesAllowed)) { - numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed); - LOG(WARNING) << "Exceed the limit on the number of buffers. " << numBuffersToAdd - << " buffers will be imported only."; - } - - ::android::GraphicBufferMapper& mapper = ::android::GraphicBufferMapper::get(); - const size_t before = mFramesAllowed; - for (size_t i = 0; i < numBuffersToAdd; ++i) { - auto& b = buffers[i]; - const AHardwareBuffer_Desc* pDesc = - reinterpret_cast(&b.buffer.description); - - buffer_handle_t handleToImport = ::android::dupFromAidl(b.buffer.handle); - buffer_handle_t handleToStore = nullptr; - if (handleToImport == nullptr) { - LOG(WARNING) << "Failed to duplicate a memory handle. Ignoring a buffer " << b.bufferId; - continue; - } - - ::android::status_t result = - mapper.importBuffer(handleToImport, pDesc->width, pDesc->height, pDesc->layers, - pDesc->format, pDesc->usage, pDesc->stride, &handleToStore); - if (result != ::android::NO_ERROR || handleToStore == nullptr) { - LOG(WARNING) << "Failed to import a buffer " << b.bufferId; - continue; - } - - bool stored = false; - for (auto&& rec : mBuffers) { - if (rec.handle != nullptr) { - continue; - } - - // Use this existing entry. - rec.handle = handleToStore; - rec.inUse = false; - stored = true; - break; - } - - if (!stored) { - // Add a BufferRecord wrapping this handle to our set of available buffers. - mBuffers.push_back(BufferRecord(handleToStore)); - } - ++mFramesAllowed; - } - - *_aidl_return = mFramesAllowed - before; - return ScopedAStatus::ok(); -} - -bool EvsMockCamera::setAvailableFrames_Locked(unsigned bufferCount) { - if (bufferCount < 1) { - LOG(ERROR) << "Ignoring request to set buffer count to zero"; - return false; - } - if (bufferCount > kMaxBuffersInFlight) { - LOG(ERROR) << "Rejecting buffer request in excess of internal limit"; - return false; - } - - // Is an increase required? - if (mFramesAllowed < bufferCount) { - // An increase is required - auto needed = bufferCount - mFramesAllowed; - LOG(INFO) << "Allocating " << needed << " buffers for camera frames"; - - auto added = increaseAvailableFrames_Locked(needed); - if (added != needed) { - // If we didn't add all the frames we needed, then roll back to the previous state - LOG(ERROR) << "Rolling back to previous frame queue size"; - decreaseAvailableFrames_Locked(added); - return false; - } - } else if (mFramesAllowed > bufferCount) { - // A decrease is required - auto framesToRelease = mFramesAllowed - bufferCount; - LOG(INFO) << "Returning " << framesToRelease << " camera frame buffers"; - - auto released = decreaseAvailableFrames_Locked(framesToRelease); - if (released != framesToRelease) { - // This shouldn't happen with a properly behaving client because the client - // should only make this call after returning sufficient outstanding buffers - // to allow a clean resize. - LOG(ERROR) << "Buffer queue shrink failed -- too many buffers currently in use?"; - } - } - - return true; -} - -unsigned EvsMockCamera::increaseAvailableFrames_Locked(unsigned numToAdd) { - // Acquire the graphics buffer allocator - ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); - - unsigned added = 0; - while (added < numToAdd) { - unsigned pixelsPerLine = 0; - buffer_handle_t memHandle = nullptr; - auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, &memHandle, - &pixelsPerLine, 0, "EvsMockCamera"); - if (result != ::android::NO_ERROR) { - LOG(ERROR) << "Error " << result << " allocating " << mWidth << " x " << mHeight - << " graphics buffer"; - break; - } - if (memHandle == nullptr) { - LOG(ERROR) << "We didn't get a buffer handle back from the allocator"; - break; - } - if (mStride > 0) { - if (mStride != pixelsPerLine) { - LOG(ERROR) << "We did not expect to get buffers with different strides!"; - } - } else { - // Gralloc defines stride in terms of pixels per line - mStride = pixelsPerLine; - } - - // Find a place to store the new buffer - auto stored = false; - for (auto&& rec : mBuffers) { - if (rec.handle == nullptr) { - // Use this existing entry - rec.handle = memHandle; - rec.inUse = false; - stored = true; - break; - } - } - if (!stored) { - // Add a BufferRecord wrapping this handle to our set of available buffers - mBuffers.push_back(BufferRecord(memHandle)); - } - - ++mFramesAllowed; - ++added; - } - - return added; -} - -unsigned EvsMockCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) { - // Acquire the graphics buffer allocator - ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get()); - - unsigned removed = 0; - for (auto&& rec : mBuffers) { - // Is this record not in use, but holding a buffer that we can free? - if ((rec.inUse == false) && (rec.handle != nullptr)) { - // Release buffer and update the record so we can recognize it as "empty" - alloc.free(rec.handle); - rec.handle = nullptr; - - --mFramesAllowed; - ++removed; - - if (removed == numToRemove) { - break; - } - } - } - - return removed; -} - // This is the asynchronous frame generation thread that runs in parallel with the // main serving thread. There is one for each active camera instance. void EvsMockCamera::generateFrames() { LOG(DEBUG) << "Frame generation loop started."; - unsigned idx = 0; while (true) { - bool timeForFrame = false; const nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC); - - // Lock scope for updating shared state + std::size_t bufferId = kInvalidBufferID; + buffer_handle_t bufferHandle = nullptr; { - std::lock_guard lock(mAccessLock); - - if (mStreamState != RUNNING) { - // Break out of our main thread loop + std::lock_guard lock(mMutex); + if (mStreamState != StreamState::RUNNING) { break; } - - // Are we allowed to issue another buffer? - if (mFramesInUse >= mFramesAllowed) { - // Can't do anything right now -- skip this frame - LOG(WARNING) << "Skipped a frame because too many are in flight."; - } else { - // Identify an available buffer to fill - for (idx = 0; idx < mBuffers.size(); idx++) { - if (!mBuffers[idx].inUse) { - if (mBuffers[idx].handle != nullptr) { - // Found an available record, so stop looking - break; - } - } - } - if (idx >= mBuffers.size()) { - // This shouldn't happen since we already checked mFramesInUse vs mFramesAllowed - ALOGE("Failed to find an available buffer slot\n"); - } else { - // We're going to make the frame busy - mBuffers[idx].inUse = true; - mFramesInUse++; - timeForFrame = true; - } - } + std::tie(bufferId, bufferHandle) = useBuffer_unsafe(); } - if (timeForFrame) { + if (bufferHandle != nullptr) { using AidlPixelFormat = ::aidl::android::hardware::graphics::common::PixelFormat; // Assemble the buffer description we'll transmit below - buffer_handle_t memHandle = mBuffers[idx].handle; BufferDesc newBuffer = { .buffer = { @@ -584,39 +225,31 @@ void EvsMockCamera::generateFrames() { .usage = static_cast(mUsage), .stride = static_cast(mStride), }, - .handle = ::android::dupToAidl(memHandle), + .handle = ::android::dupToAidl(bufferHandle), }, - .bufferId = static_cast(idx), + .bufferId = static_cast(bufferId), .deviceId = mDescription.id, .timestamp = static_cast(::android::elapsedRealtimeNano() * 1e+3), // timestamps is in microseconds }; // Write test data into the image buffer - fillMockFrame(memHandle, reinterpret_cast( - &newBuffer.buffer.description)); + fillMockFrame(bufferHandle, reinterpret_cast( + &newBuffer.buffer.description)); - // Issue the (asynchronous) callback to the client -- can't be holding the lock - auto flag = false; - if (mStream) { - std::vector frames; - frames.push_back(std::move(newBuffer)); - flag = mStream->deliverFrame(frames).isOk(); - } + std::vector frames; + frames.push_back(std::move(newBuffer)); - if (flag) { - LOG(DEBUG) << "Delivered " << memHandle << ", id = " << mBuffers[idx].handle; + // Issue the (asynchronous) callback to the client -- can't be holding the lock + if (mStream && mStream->deliverFrame(frames).isOk()) { + LOG(DEBUG) << "Delivered " << bufferHandle << ", id = " << bufferId; } else { // This can happen if the client dies and is likely unrecoverable. // To avoid consuming resources generating failing calls, we stop sending // frames. Note, however, that the stream remains in the "STREAMING" state // until cleaned up on the main thread. LOG(ERROR) << "Frame delivery call failed in the transport layer."; - - // Since we didn't actually deliver it, mark the frame as available - std::lock_guard lock(mAccessLock); - mBuffers[idx].inUse = false; - mFramesInUse--; + doneWithFrame(frames); } } @@ -671,34 +304,45 @@ void EvsMockCamera::fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_ mapper.unlock(handle); } -void EvsMockCamera::returnBufferLocked(const uint32_t bufferId) { - if (bufferId >= mBuffers.size()) { - ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", bufferId, - mBuffers.size() - 1); - return; - } +::android::status_t EvsMockCamera::allocateOneFrame(buffer_handle_t* handle) { + static auto& alloc = ::android::GraphicBufferAllocator::get(); + unsigned pixelsPerLine = 0; + const auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, handle, &pixelsPerLine, + 0, "EvsMockCamera"); + if (mStride < mWidth) { + // Gralloc defines stride in terms of pixels per line + mStride = pixelsPerLine; + } else if (mStride != pixelsPerLine) { + LOG(ERROR) << "We did not expect to get buffers with different strides!"; + } + return result; +} - if (!mBuffers[bufferId].inUse) { - ALOGE("ignoring doneWithFrame called on frame %d which is already free", bufferId); - return; +bool EvsMockCamera::startVideoStreamImpl_locked( + const std::shared_ptr& receiver, ndk::ScopedAStatus& /* status */, + std::unique_lock& /* lck */) { + mStream = receiver; + mCaptureThread = std::thread([this]() { generateFrames(); }); + return true; +} + +bool EvsMockCamera::stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */, + std::unique_lock& lck) { + lck.unlock(); + if (mCaptureThread.joinable()) { + mCaptureThread.join(); } + lck.lock(); + return true; +} - // Mark the frame as available - mBuffers[bufferId].inUse = false; - mFramesInUse--; - - // If this frame's index is high in the array, try to move it down - // to improve locality after mFramesAllowed has been reduced. - if (bufferId >= mFramesAllowed) { - // Find an empty slot lower in the array (which should always exist in this case) - for (auto&& rec : mBuffers) { - if (rec.handle == nullptr) { - rec.handle = mBuffers[bufferId].handle; - mBuffers[bufferId].handle = nullptr; - break; - } - } +bool EvsMockCamera::postVideoStreamStop_locked(ndk::ScopedAStatus& status, + std::unique_lock& lck) { + if (!Base::postVideoStreamStop_locked(status, lck)) { + return false; } + mStream = nullptr; + return true; } std::shared_ptr EvsMockCamera::Create(const char* deviceName) { diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp index 3cbc04a9c9..8b4676ea8a 100644 --- a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp +++ b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp @@ -134,6 +134,7 @@ TEST(EvsCameraBufferTest, UseAndReturn) { for (std::size_t i = 0; i < kNumOfHandles; ++i) { const auto [id, handle] = evsCam->useBuffer_unsafe(); const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_TRUE(EvsCamera::IsBufferIDValid(id)); EXPECT_NE(handle, nullptr); EXPECT_LT(id, kNumOfHandles); @@ -160,6 +161,7 @@ TEST(EvsCameraBufferTest, UseAndReturn) { for (std::size_t i = 0; i < kNumOfHandles; ++i) { const auto [id, handle] = evsCam->useBuffer_unsafe(); const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_TRUE(EvsCamera::IsBufferIDValid(id)); EXPECT_NE(handle, nullptr); EXPECT_LT(id, kNumOfHandles); @@ -189,6 +191,7 @@ TEST(EvsCameraBufferTest, UseAndReturn) { for (std::size_t i = 0; i < kNumOfHandles; ++i) { const auto [id, handle] = evsCam->useBuffer_unsafe(); const std::size_t handleInt = reinterpret_cast(handle); + EXPECT_TRUE(EvsCamera::IsBufferIDValid(id)); EXPECT_NE(handle, nullptr); EXPECT_LT(id, kNumOfHandles); -- GitLab From 484d2e70c3fdedc41642b523d64fe37d08e191f8 Mon Sep 17 00:00:00 2001 From: Jeff Pu Date: Mon, 25 Sep 2023 15:11:19 +0000 Subject: [PATCH 156/376] Face Biometric Virtual HAL Authentication Implementation Bug: 294254230 Test: atest VtsHalBiometricsFaceTargetTest Test: atest VtsHalBiometricsFingerprintTargetTest Test: atest android.hardware.biometrics.face.FakeFaceEngineTest Test: atest android.hardware.biometrics.fingerprint.FakeFingerprintEngineTest Change-Id: Id7a4698730307235c5de94811f5e396ff4b9c5ae --- biometrics/common/util/include/util/Util.h | 84 ++++++++++ .../face/aidl/default/FakeFaceEngine.cpp | 149 +++++++++++++----- biometrics/face/aidl/default/FakeFaceEngine.h | 6 + biometrics/face/aidl/default/README.md | 4 +- biometrics/face/aidl/default/face.sysprop | 19 +++ .../aidl/default/tests/FakeFaceEngineTest.cpp | 4 +- .../aidl/default/FakeFingerprintEngine.cpp | 76 +-------- .../default/include/FakeFingerprintEngine.h | 6 - .../tests/FakeFingerprintEngineTest.cpp | 28 ++-- 9 files changed, 240 insertions(+), 136 deletions(-) diff --git a/biometrics/common/util/include/util/Util.h b/biometrics/common/util/include/util/Util.h index da19dc6afe..efd66bc373 100644 --- a/biometrics/common/util/include/util/Util.h +++ b/biometrics/common/util/include/util/Util.h @@ -23,6 +23,9 @@ #include #include +#include +using ::android::base::ParseInt; + namespace aidl::android::hardware::biometrics { #define SLEEP_MS(x) \ @@ -64,6 +67,87 @@ class Util { std::sregex_token_iterator()); return parts; } + + // Returns a vector of integers for the string separated by comma, + // Empty vector is returned if there is any parsing error + static std::vector parseIntSequence(const std::string& str, + const std::string& sep = ",") { + std::vector seqs = Util::split(str, sep); + std::vector res; + + for (const auto& seq : seqs) { + int32_t val; + if (ParseInt(seq, &val)) { + res.push_back(val); + } else { + LOG(WARNING) << "Invalid int sequence:" + str + " seq:" + seq; + res.clear(); + break; + } + } + + return res; + } + + // Parses a single enrollment stage string in the format of + // enroll_stage_spec: [-acquiredInfos] + // duration: integerInMs + // acquiredInfos: [info1,info2,...] + // + // Returns false if there is parsing error + // + static bool parseEnrollmentCaptureSingle(const std::string& str, + std::vector>& res) { + std::vector defaultAcquiredInfo = {1}; + bool aborted = true; + + do { + std::smatch sms; + // Parses strings like "1000-[5,1]" or "500" + std::regex ex("((\\d+)(-\\[([\\d|,]+)\\])?)"); + if (!regex_match(str.cbegin(), str.cend(), sms, ex)) break; + int32_t duration; + if (!ParseInt(sms.str(2), &duration)) break; + res.push_back({duration}); + if (!sms.str(4).empty()) { + auto acqv = parseIntSequence(sms.str(4)); + if (acqv.empty()) break; + res.push_back(acqv); + } else + res.push_back(defaultAcquiredInfo); + aborted = false; + } while (0); + + return !aborted; + } + + // Parses enrollment string consisting of one or more stages in the formst of + // [,enroll_stage_spec,...] + // Empty vector is returned in case of parsing error + static std::vector> parseEnrollmentCapture(const std::string& str) { + std::vector> res; + + std::string s(str); + s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end()); + bool aborted = false; + std::smatch sms; + // Parses strings like "1000-[5,1],500,800-[6,5,1]" + // -------------- ----- --------------- + // into parts: A B C + while (regex_search(s, sms, std::regex("^(,)?(\\d+(-\\[[\\d|,]+\\])?)"))) { + if (!parseEnrollmentCaptureSingle(sms.str(2), res)) { + aborted = true; + break; + } + s = sms.suffix(); + } + if (aborted || s.length() != 0) { + res.clear(); + LOG(ERROR) << "Failed to parse enrollment captures:" + str; + } + + return res; + } }; } // namespace aidl::android::hardware::biometrics diff --git a/biometrics/face/aidl/default/FakeFaceEngine.cpp b/biometrics/face/aidl/default/FakeFaceEngine.cpp index 0f088f4331..578231d1ca 100644 --- a/biometrics/face/aidl/default/FakeFaceEngine.cpp +++ b/biometrics/face/aidl/default/FakeFaceEngine.cpp @@ -136,56 +136,127 @@ void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationI const std::future& cancel) { BEGIN_OP(FaceHalProperties::operation_authenticate_latency().value_or(0)); - // Signal to the framework that we have begun authenticating. - AuthenticationFrame frame; - frame.data.acquiredInfo = AcquiredInfo::START; - frame.data.vendorCode = 0; - cb->onAuthenticationFrame(frame); - - // Also signal that we have opened the camera. - frame = {}; - frame.data.acquiredInfo = AcquiredInfo::FIRST_FRAME_RECEIVED; - frame.data.vendorCode = 0; - cb->onAuthenticationFrame(frame); + auto id = FaceHalProperties::enrollment_hit().value_or(0); + auto enrolls = FaceHalProperties::enrollments(); + auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); - auto now = Util::getSystemNanoTime(); - int64_t duration = FaceHalProperties::operation_authenticate_duration().value_or(0); - if (duration > 0) { - do { - SLEEP_MS(5); - } while (!Util::hasElapsed(now, duration)); + auto vec2str = [](std::vector va) { + std::stringstream ss; + bool isFirst = true; + for (auto ac : va) { + if (!isFirst) ss << ","; + ss << std::to_string((int8_t)ac); + isFirst = false; + } + return ss.str(); + }; + + // default behavior mimic face sensor in U + int64_t defaultAuthDuration = 500; + std::string defaultAcquiredInfo = + vec2str({AcquiredInfo::START, AcquiredInfo::FIRST_FRAME_RECEIVED}); + if (!isEnrolled) { + std::vector v; + for (int i = 0; i < 56; i++) v.push_back(AcquiredInfo::NOT_DETECTED); + defaultAcquiredInfo += "," + vec2str(v); + defaultAuthDuration = 2100; + } else { + defaultAcquiredInfo += "," + vec2str({AcquiredInfo::TOO_BRIGHT, AcquiredInfo::TOO_BRIGHT, + AcquiredInfo::TOO_BRIGHT, AcquiredInfo::TOO_BRIGHT, + AcquiredInfo::GOOD, AcquiredInfo::GOOD}); } - if (FaceHalProperties::operation_authenticate_fails().value_or(false)) { - LOG(ERROR) << "Fail: operation_authenticate_fails"; - cb->onError(Error::VENDOR, 0 /* vendorError */); - return; - } + int64_t now = Util::getSystemNanoTime(); + int64_t duration = + FaceHalProperties::operation_authenticate_duration().value_or(defaultAuthDuration); + auto acquired = + FaceHalProperties::operation_authenticate_acquired().value_or(defaultAcquiredInfo); + auto acquiredInfos = Util::parseIntSequence(acquired); + int N = acquiredInfos.size(); - if (FaceHalProperties::lockout().value_or(false)) { - LOG(ERROR) << "Fail: lockout"; - cb->onLockoutPermanent(); - cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */); + if (N == 0) { + LOG(ERROR) << "Fail to parse authentiate acquired info: " + acquired; + cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); return; } - if (shouldCancel(cancel)) { - LOG(ERROR) << "Fail: cancel"; - cb->onError(Error::CANCELED, 0 /* vendorCode */); - return; - } + int i = 0; + do { + if (FaceHalProperties::lockout().value_or(false)) { + LOG(ERROR) << "Fail: lockout"; + cb->onLockoutPermanent(); + cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */); + return; + } - auto id = FaceHalProperties::enrollment_hit().value_or(0); - auto enrolls = FaceHalProperties::enrollments(); - auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); - if (id < 0 || !isEnrolled) { - LOG(ERROR) << (isEnrolled ? "invalid enrollment hit" : "Fail: not enrolled"); + if (FaceHalProperties::operation_authenticate_fails().value_or(false)) { + LOG(ERROR) << "Fail: operation_authenticate_fails"; + cb->onAuthenticationFailed(); + return; + } + + auto err = FaceHalProperties::operation_authenticate_error().value_or(0); + if (err != 0) { + LOG(ERROR) << "Fail: operation_authenticate_error"; + auto ec = convertError(err); + cb->onError(ec.first, ec.second); + return; /* simply terminating current operation for any user inserted error, + revisit if tests need*/ + } + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + + if (i < N) { + auto ac = convertAcquiredInfo(acquiredInfos[i]); + AuthenticationFrame frame; + frame.data.acquiredInfo = ac.first; + frame.data.vendorCode = ac.second; + cb->onAuthenticationFrame(frame); + LOG(INFO) << "AcquiredInfo:" << i << ": (" << (int)ac.first << "," << (int)ac.second + << ")"; + i++; + } + + SLEEP_MS(duration / N); + } while (!Util::hasElapsed(now, duration)); + + if (id > 0 && isEnrolled) { + cb->onAuthenticationSucceeded(id, {} /* hat */); + return; + } else { + LOG(ERROR) << "Fail: face not enrolled"; cb->onAuthenticationFailed(); - cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); + cb->onError(Error::TIMEOUT, 0 /* vendorError*/); return; } +} + +std::pair FakeFaceEngine::convertAcquiredInfo(int32_t code) { + std::pair res; + if (code > FACE_ACQUIRED_VENDOR_BASE) { + res.first = AcquiredInfo::VENDOR; + res.second = code - FACE_ACQUIRED_VENDOR_BASE; + } else { + res.first = (AcquiredInfo)code; + res.second = 0; + } + return res; +} - cb->onAuthenticationSucceeded(id, {} /* hat */); +std::pair FakeFaceEngine::convertError(int32_t code) { + std::pair res; + if (code > FACE_ERROR_VENDOR_BASE) { + res.first = Error::VENDOR; + res.second = code - FACE_ERROR_VENDOR_BASE; + } else { + res.first = (Error)code; + res.second = 0; + } + return res; } void FakeFaceEngine::detectInteractionImpl(ISessionCallback* cb, const std::future& cancel) { @@ -315,4 +386,4 @@ void FakeFaceEngine::resetLockoutImpl(ISessionCallback* cb, cb->onLockoutCleared(); } -} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file +} // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h index eb9944172f..06dd396c70 100644 --- a/biometrics/face/aidl/default/FakeFaceEngine.h +++ b/biometrics/face/aidl/default/FakeFaceEngine.h @@ -62,6 +62,12 @@ class FakeFaceEngine { void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/); std::mt19937 mRandom; + + private: + static constexpr int32_t FACE_ACQUIRED_VENDOR_BASE = 1000; + static constexpr int32_t FACE_ERROR_VENDOR_BASE = 1000; + std::pair convertAcquiredInfo(int32_t code); + std::pair convertError(int32_t code); }; } // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md index 77bfe57209..516a7aaea7 100644 --- a/biometrics/face/aidl/default/README.md +++ b/biometrics/face/aidl/default/README.md @@ -18,6 +18,7 @@ On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is no Face VHAL enabling is gated by the following two AND conditions: 1. The Face VHAL feature flag (as part of Trunk-development strategy) must be tured until the flags life-cycle ends. 2. The Face VHAL must be enabled via sysprop +See adb commands below ##Getting Stared @@ -47,8 +48,7 @@ authentication failure, set the hit id to a different value. $ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 $ adb shell setprop vendor.face.virtual.enrollment_hit 1 ``` -Note: At the initial phase of the Face VHAL development, Face-on-camera simulation is not supported, hence -the authentication immediately occurrs as soon as the authentication request arriving at VHAL. +Refer to face.sysprop for full supported features of authentication, such as error and acquiredInfo insertion ## Enrollment via Setup diff --git a/biometrics/face/aidl/default/face.sysprop b/biometrics/face/aidl/default/face.sysprop index 6b0f37fec5..be320151af 100644 --- a/biometrics/face/aidl/default/face.sysprop +++ b/biometrics/face/aidl/default/face.sysprop @@ -157,3 +157,22 @@ prop { access: ReadWrite api_name: "operation_authenticate_duration" } + +# insert error for authenticate operations +prop { + prop_name: "vendor.face.virtual.operation_authenticate_error" + type: Integer + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_error" +} + +# acquired info during authentication in format of sequence +prop { + prop_name: "vendor.face.virtual.operation_authenticate_acquired" + type: String + scope: Internal + access: ReadWrite + api_name: "operation_authenticate_acquired" +} + diff --git a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp index c8ad6b7dc3..6897dc4aba 100644 --- a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp +++ b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp @@ -245,7 +245,7 @@ TEST_F(FakeFaceEngineTest, AuthenticateFailedForUnEnrolled) { FaceHalProperties::enrollments({3}); FaceHalProperties::enrollment_hit(100); mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, mCancel.get_future()); - ASSERT_EQ(Error::UNABLE_TO_PROCESS, mCallback->mError); + ASSERT_EQ(Error::TIMEOUT, mCallback->mError); ASSERT_TRUE(mCallback->mAuthenticateFailed); } @@ -380,4 +380,4 @@ TEST_F(FakeFaceEngineTest, ResetLockoutWithAuth) { ASSERT_FALSE(mCallback->mAuthenticateFailed); } -} // namespace aidl::android::hardware::biometrics::face \ No newline at end of file +} // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp index 54076c88e3..574570e961 100644 --- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp @@ -142,7 +142,7 @@ bool FakeFingerprintEngine::onEnrollFingerDown(ISessionCallback* cb, return true; } auto enrollmentId = std::stoi(parts[0]); - auto progress = parseEnrollmentCapture(parts[1]); + auto progress = Util::parseEnrollmentCapture(parts[1]); for (size_t i = 0; i < progress.size(); i += 2) { auto left = (progress.size() - i) / 2 - 1; auto duration = progress[i][0]; @@ -193,7 +193,7 @@ bool FakeFingerprintEngine::onAuthenticateFingerDown(ISessionCallback* cb, int64_t now = Util::getSystemNanoTime(); int64_t duration = FingerprintHalProperties::operation_authenticate_duration().value_or(10); auto acquired = FingerprintHalProperties::operation_authenticate_acquired().value_or("1"); - auto acquiredInfos = parseIntSequence(acquired); + auto acquiredInfos = Util::parseIntSequence(acquired); int N = acquiredInfos.size(); if (N == 0) { @@ -271,7 +271,7 @@ bool FakeFingerprintEngine::onDetectInteractFingerDown(ISessionCallback* cb, FingerprintHalProperties::operation_detect_interaction_duration().value_or(10); auto acquired = FingerprintHalProperties::operation_detect_interaction_acquired().value_or("1"); - auto acquiredInfos = parseIntSequence(acquired); + auto acquiredInfos = Util::parseIntSequence(acquired); int N = acquiredInfos.size(); int64_t now = Util::getSystemNanoTime(); @@ -450,76 +450,6 @@ SensorLocation FakeFingerprintEngine::defaultSensorLocation() { return SensorLocation(); } -std::vector FakeFingerprintEngine::parseIntSequence(const std::string& str, - const std::string& sep) { - std::vector seqs = Util::split(str, sep); - std::vector res; - - for (const auto& seq : seqs) { - int32_t val; - if (ParseInt(seq, &val)) { - res.push_back(val); - } else { - LOG(WARNING) << "Invalid int sequence:" + str; - res.clear(); - break; - } - } - - return res; -} - -bool FakeFingerprintEngine::parseEnrollmentCaptureSingle(const std::string& str, - std::vector>& res) { - std::vector defaultAcquiredInfo = {(int32_t)AcquiredInfo::GOOD}; - bool aborted = true; - - do { - std::smatch sms; - // Parses strings like "1000-[5,1]" or "500" - std::regex ex("((\\d+)(-\\[([\\d|,]+)\\])?)"); - if (!regex_match(str.cbegin(), str.cend(), sms, ex)) break; - int32_t duration; - if (!ParseInt(sms.str(2), &duration)) break; - res.push_back({duration}); - if (!sms.str(4).empty()) { - auto acqv = parseIntSequence(sms.str(4)); - if (acqv.empty()) break; - res.push_back(acqv); - } else - res.push_back(defaultAcquiredInfo); - aborted = false; - } while (0); - - return !aborted; -} - -std::vector> FakeFingerprintEngine::parseEnrollmentCapture( - const std::string& str) { - std::vector> res; - - std::string s(str); - s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end()); - bool aborted = false; - std::smatch sms; - // Parses strings like "1000-[5,1],500,800-[6,5,1]" - // ---------- --- ----------- - // into parts: A B C - while (regex_search(s, sms, std::regex("^(,)?(\\d+(-\\[[\\d|,]+\\])?)"))) { - if (!parseEnrollmentCaptureSingle(sms.str(2), res)) { - aborted = true; - break; - } - s = sms.suffix(); - } - if (aborted || s.length() != 0) { - res.clear(); - LOG(ERROR) << "Failed to parse enrollment captures:" + str; - } - - return res; -} - std::pair FakeFingerprintEngine::convertAcquiredInfo(int32_t code) { std::pair res; if (code > FINGERPRINT_ACQUIRED_VENDOR_BASE) { diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h index 2450115aaf..15d83604d5 100644 --- a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h +++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h @@ -68,10 +68,6 @@ class FakeFingerprintEngine { virtual void fingerDownAction(); - std::vector parseIntSequence(const std::string& str, const std::string& sep = ","); - - std::vector> parseEnrollmentCapture(const std::string& str); - int32_t getLatency(const std::vector>& latencyVec); std::mt19937 mRandom; @@ -110,8 +106,6 @@ class FakeFingerprintEngine { static constexpr int32_t FINGERPRINT_ERROR_VENDOR_BASE = 1000; std::pair convertAcquiredInfo(int32_t code); std::pair convertError(int32_t code); - bool parseEnrollmentCaptureSingle(const std::string& str, - std::vector>& res); int32_t getRandomInRange(int32_t bound1, int32_t bound2); bool checkSensorLockout(ISessionCallback*); void clearLockout(ISessionCallback* cb); diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp index fe405f4110..45b5be8d2e 100644 --- a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp +++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp @@ -421,29 +421,29 @@ TEST_F(FakeFingerprintEngineTest, RemoveEnrolled) { TEST_F(FakeFingerprintEngineTest, parseIntSequence) { std::vector seqV; - seqV = mEngine.parseIntSequence(""); + seqV = Util::parseIntSequence(""); ASSERT_EQ(0, seqV.size()); - seqV = mEngine.parseIntSequence("2"); + seqV = Util::parseIntSequence("2"); ASSERT_EQ(1, seqV.size()); ASSERT_EQ(2, seqV[0]); - seqV = mEngine.parseIntSequence("2,3,4"); + seqV = Util::parseIntSequence("2,3,4"); std::vector expV{2, 3, 4}; ASSERT_EQ(expV, seqV); - seqV = mEngine.parseIntSequence("2,3,a"); + seqV = Util::parseIntSequence("2,3,a"); ASSERT_EQ(0, seqV.size()); - seqV = mEngine.parseIntSequence("2, 3, 4"); + seqV = Util::parseIntSequence("2, 3, 4"); ASSERT_EQ(expV, seqV); - seqV = mEngine.parseIntSequence("123,456"); + seqV = Util::parseIntSequence("123,456"); ASSERT_EQ(2, seqV.size()); std::vector expV1{123, 456}; ASSERT_EQ(expV1, seqV); - seqV = mEngine.parseIntSequence("12f3,456"); + seqV = Util::parseIntSequence("12f3,456"); ASSERT_EQ(0, seqV.size()); } TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureOk) { std::vector> ecV; - ecV = mEngine.parseEnrollmentCapture("100,200,300"); + ecV = Util::parseEnrollmentCapture("100,200,300"); ASSERT_EQ(6, ecV.size()); std::vector> expE{{100}, {200}, {300}}; std::vector defC{1}; @@ -451,26 +451,26 @@ TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureOk) { ASSERT_EQ(expE[i / 2], ecV[i]); ASSERT_EQ(defC, ecV[i + 1]); } - ecV = mEngine.parseEnrollmentCapture("100"); + ecV = Util::parseEnrollmentCapture("100"); ASSERT_EQ(2, ecV.size()); ASSERT_EQ(expE[0], ecV[0]); ASSERT_EQ(defC, ecV[1]); - ecV = mEngine.parseEnrollmentCapture("100-[5,6,7]"); + ecV = Util::parseEnrollmentCapture("100-[5,6,7]"); std::vector expC{5, 6, 7}; ASSERT_EQ(2, ecV.size()); for (int i = 0; i < ecV.size(); i += 2) { ASSERT_EQ(expE[i / 2], ecV[i]); ASSERT_EQ(expC, ecV[i + 1]); } - ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200, 300-[9,10]"); + ecV = Util::parseEnrollmentCapture("100-[5,6,7], 200, 300-[9,10]"); std::vector> expC1{{5, 6, 7}, {1}, {9, 10}}; ASSERT_EQ(6, ecV.size()); for (int i = 0; i < ecV.size(); i += 2) { ASSERT_EQ(expE[i / 2], ecV[i]); ASSERT_EQ(expC1[i / 2], ecV[i + 1]); } - ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200-[2,1], 300-[9]"); + ecV = Util::parseEnrollmentCapture("100-[5,6,7], 200-[2,1], 300-[9]"); std::vector> expC2{{5, 6, 7}, {2, 1}, {9}}; ASSERT_EQ(ecV.size(), 6); for (int i = 0; i < ecV.size(); i += 2) { @@ -484,7 +484,7 @@ TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureFail) { "100,2x0,300", "200-[f]", "a,b"}; std::vector> ecV; for (const auto& s : badStr) { - ecV = mEngine.parseEnrollmentCapture(s); + ecV = Util::parseEnrollmentCapture(s); ASSERT_EQ(ecV.size(), 0); } } @@ -508,7 +508,7 @@ TEST_F(FakeFingerprintEngineTest, randomLatency) { TEST_F(FakeFingerprintEngineTest, lockoutTimer) { mEngine.startLockoutTimer(200, mCallback.get()); ASSERT_TRUE(mEngine.getLockoutTimerStarted()); - std::this_thread::sleep_for(std::chrono::milliseconds(210)); + std::this_thread::sleep_for(std::chrono::milliseconds(230)); ASSERT_FALSE(mEngine.getLockoutTimerStarted()); ASSERT_TRUE(mCallback->mLockoutCleared); } -- GitLab From 987a69a8591ba4cc4a6f77ed933ab16a8c742ce0 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Sun, 24 Sep 2023 14:31:15 -0700 Subject: [PATCH 157/376] Send CarPropertyValue status when HVAC power state changes Bug: 301001111 Test: atest FakeVehicleHardwareTest Test: atest CarPropertyManagerTest Change-Id: I274d4480e6b1f264fd0b6eefd5926311a65f883a --- .../hardware/include/FakeVehicleHardware.h | 2 +- .../hardware/src/FakeVehicleHardware.cpp | 22 +++--- .../hardware/test/FakeVehicleHardwareTest.cpp | 76 ++++++++++++------- 3 files changed, 64 insertions(+), 36 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index e8da43ae47..21ca72e8cb 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -253,7 +253,7 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::SetValueRequest& request); std::string genFakeDataCommand(const std::vector& options); - void sendHvacPropertiesCurrentValues(int32_t areaId); + void sendHvacPropertiesCurrentValues(int32_t areaId, int32_t hvacPowerOnVal); void sendAdasPropertiesState(int32_t propertyId, int32_t state); void generateVendorConfigs( std::vector&) const; diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 13c48c6e04..9868f27e29 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -731,7 +731,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getEchoReverseBytes( return std::move(gotValue); } -void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId) { +void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId, int32_t hvacPowerOnVal) { for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { int powerPropId = HVAC_POWER_PROPERTIES[i]; auto powerPropResults = mServerSidePropStore->readValuesForProperty(powerPropId); @@ -744,7 +744,8 @@ void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId) { for (size_t j = 0; j < powerPropValues.size(); j++) { auto powerPropValue = std::move(powerPropValues[j]); if ((powerPropValue->areaId & areaId) == powerPropValue->areaId) { - powerPropValue->status = VehiclePropertyStatus::AVAILABLE; + powerPropValue->status = hvacPowerOnVal ? VehiclePropertyStatus::AVAILABLE + : VehiclePropertyStatus::UNAVAILABLE; powerPropValue->timestamp = elapsedRealtimeNano(); // This will trigger a property change event for the current hvac property value. mServerSidePropStore->writeValue(std::move(powerPropValue), /*updateStatus=*/true, @@ -796,13 +797,6 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu return setUserHalProp(value); } - if (propId == toInt(VehicleProperty::HVAC_POWER_ON) && value.value.int32Values.size() == 1 && - value.value.int32Values[0] == 1) { - // If we are turning HVAC power on, send current hvac property values through on change - // event. - sendHvacPropertiesCurrentValues(value.areaId); - } - if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) { *isSpecialValue = true; return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available"; @@ -841,6 +835,16 @@ VhalResult FakeVehicleHardware::maybeSetSpecialValue(const VehiclePropValu case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING): *isSpecialValue = true; return StatusError((StatusCode)VENDOR_ERROR_CODE); + case toInt(VehicleProperty::HVAC_POWER_ON): + if (value.value.int32Values.size() != 1) { + *isSpecialValue = true; + return StatusError(StatusCode::INVALID_ARG) + << "HVAC_POWER_ON requires only one int32 value"; + } + // When changing HVAC power state, send current hvac property values + // through on change event. + sendHvacPropertiesCurrentValues(value.areaId, value.value.int32Values[0]); + return {}; case toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION): *isSpecialValue = true; return setHvacTemperatureValueSuggestion(value); diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 6cc06bc3ac..df1f5bb261 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -390,6 +391,25 @@ class FakeVehicleHardwareTest : public ::testing::Test { } } mPropValueCmp; + std::unique_ptr getVehiclePropConfig(int32_t propertyId) { + auto configs = mHardware->getAllPropertyConfigs(); + for (auto& config : configs) { + if (config.prop == propertyId) { + auto ptr = std::make_unique(); + ptr->prop = config.prop; + ptr->access = config.access; + ptr->changeMode = config.changeMode; + ptr->areaConfigs = config.areaConfigs; + ptr->configArray = config.configArray; + ptr->configString = config.configString; + ptr->minSampleRate = config.minSampleRate; + ptr->maxSampleRate = config.maxSampleRate; + return ptr; + } + } + return std::unique_ptr(nullptr); + } + private: std::unique_ptr mHardware; std::shared_ptr mSetValuesCallback; @@ -1755,32 +1775,41 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) { } TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { - int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; - for (int areaId : seatAreaIds) { + auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON))); + EXPECT_NE(hvacPowerOnConfig, nullptr); + for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) { + int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId; StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, + .areaId = hvacPowerAreaId, .value.int32Values = {0}}); - - ASSERT_EQ(status, StatusCode::OK); - - clearChangedProperties(); - setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, - .value.int32Values = {1}}); - + EXPECT_EQ(status, StatusCode::OK); auto events = getChangedProperties(); - // If we turn HVAC power on, we expect to receive one property event for every HVAC prop - // areas plus one event for HVAC_POWER_ON. - std::vector changedPropIds; - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - changedPropIds.push_back(HVAC_POWER_PROPERTIES[i]); + for (const auto& event : events) { + // Ignore HVAC_POWER_ON event + if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) { + continue; + } + EXPECT_THAT(event.prop, AnyOfArray(HVAC_POWER_PROPERTIES)); + EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId); + EXPECT_EQ(event.status, VehiclePropertyStatus::UNAVAILABLE); } - changedPropIds.push_back(toInt(VehicleProperty::HVAC_POWER_ON)); + clearChangedProperties(); + status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), + .areaId = hvacPowerAreaId, + .value.int32Values = {1}}); + EXPECT_EQ(status, StatusCode::OK); + events = getChangedProperties(); for (const auto& event : events) { - EXPECT_EQ(event.areaId, areaId); - EXPECT_THAT(event.prop, AnyOfArray(changedPropIds)); + // Ignore HVAC_POWER_ON event + if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) { + continue; + } + EXPECT_THAT(event.prop, AnyOfArray(HVAC_POWER_PROPERTIES)); + EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId); + EXPECT_EQ(event.status, VehiclePropertyStatus::AVAILABLE); } + clearChangedProperties(); } } @@ -3016,13 +3045,8 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { // Config array values from HVAC_TEMPERATURE_SET in DefaultProperties.json auto configs = getHardware()->getAllPropertyConfigs(); - VehiclePropConfig* hvacTemperatureSetConfig = nullptr; - for (auto& config : configs) { - if (config.prop == toInt(VehicleProperty::HVAC_TEMPERATURE_SET)) { - hvacTemperatureSetConfig = &config; - break; - } - } + auto hvacTemperatureSetConfig = + std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET))); EXPECT_NE(hvacTemperatureSetConfig, nullptr); auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfig->configArray; -- GitLab From 35616e4de74d4e96b3838eeb032c0175a8cd5cf2 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Mon, 25 Sep 2023 16:11:26 -0700 Subject: [PATCH 158/376] Use HVAC_POWER_ON config array for determining power dependent props Bug: 302024222 Test: atest FakeVehicleHardwareTest Test: atest CarPropertyManagerTest Change-Id: I35dd253e804a244e28debad162e39602dcd01d5a --- .../hardware/include/FakeVehicleHardware.h | 4 + .../hardware/src/FakeVehicleHardware.cpp | 12 +-- .../hardware/test/FakeVehicleHardwareTest.cpp | 86 +++++++++++++------ .../impl/utils/common/include/PropertyUtils.h | 5 -- 4 files changed, 72 insertions(+), 35 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 21ca72e8cb..844bea5a81 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -36,6 +36,7 @@ #include #include #include +#include #include namespace android { @@ -161,6 +162,9 @@ class FakeVehicleHardware : public IVehicleHardware { aidl::android::hardware::automotive::vehicle::SetValueRequest> mPendingSetValueRequests; + // Set of HVAC properties dependent on HVAC_POWER_ON + std::unordered_set hvacPowerDependentProps; + const bool mForceOverride; bool mAddExtraTestVendorConfigs; diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 9868f27e29..ee24fbda9c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -200,6 +200,11 @@ void FakeVehicleHardware::storePropInitialValue(const ConfigDeclaration& config) bool globalProp = isGlobalProp(propId); size_t numAreas = globalProp ? 1 : vehiclePropConfig.areaConfigs.size(); + if (propId == toInt(VehicleProperty::HVAC_POWER_ON)) { + const auto& configArray = vehiclePropConfig.configArray; + hvacPowerDependentProps.insert(configArray.begin(), configArray.end()); + } + for (size_t i = 0; i < numAreas; i++) { int32_t curArea = globalProp ? 0 : vehiclePropConfig.areaConfigs[i].areaId; @@ -511,9 +516,7 @@ VhalResult FakeVehicleHardware::setHvacTemperatureValueSuggestion( } bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const { - std::unordered_set powerProps(std::begin(HVAC_POWER_PROPERTIES), - std::end(HVAC_POWER_PROPERTIES)); - if (powerProps.count(propId)) { + if (hvacPowerDependentProps.count(propId)) { auto hvacPowerOnResults = mServerSidePropStore->readValuesForProperty(toInt(VehicleProperty::HVAC_POWER_ON)); if (!hvacPowerOnResults.ok()) { @@ -732,8 +735,7 @@ FakeVehicleHardware::ValueResultType FakeVehicleHardware::getEchoReverseBytes( } void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId, int32_t hvacPowerOnVal) { - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - int powerPropId = HVAC_POWER_PROPERTIES[i]; + for (auto& powerPropId : hvacPowerDependentProps) { auto powerPropResults = mServerSidePropStore->readValuesForProperty(powerPropId); if (!powerPropResults.ok()) { ALOGW("failed to get power prop 0x%x, error: %s", powerPropId, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index df1f5bb261..cf9beee0fb 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -79,7 +79,9 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehicleUnit; using ::android::base::expected; @@ -110,6 +112,10 @@ class FakeVehicleHardwareTestHelper { return mHardware->loadConfigDeclarations(); } + std::unordered_set getHvacPowerDependentProps() { + return mHardware->hvacPowerDependentProps; + } + private: FakeVehicleHardware* mHardware; }; @@ -1707,23 +1713,35 @@ TEST_F(FakeVehicleHardwareTest, testSetVehicleMapService) { } TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) { - int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; - for (int areaId : seatAreaIds) { + FakeVehicleHardwareTestHelper helper(getHardware()); + auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON))); + EXPECT_NE(hvacPowerOnConfig, nullptr); + for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) { + int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId; + // Turn off HVAC_POWER_ON for only 1 area ID StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, + .areaId = hvacPowerAreaId, .value.int32Values = {0}}); + EXPECT_EQ(status, StatusCode::OK); - ASSERT_EQ(status, StatusCode::OK); - - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - int powerPropId = HVAC_POWER_PROPERTIES[i]; - for (int powerDependentAreaId : seatAreaIds) { + for (auto& powerPropId : helper.getHvacPowerDependentProps()) { + auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId)); + EXPECT_NE(powerPropConfig, nullptr); + if (powerPropConfig->access == VehiclePropertyAccess::WRITE) { + continue; + } + // Try getting a value at each area ID supported by the power dependent property + for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) { + int powerDependentAreaId = powerPropAreaConfig.areaId; auto getValueResult = getValue(VehiclePropValue{ .prop = powerPropId, .areaId = powerDependentAreaId, }); - if (areaId == powerDependentAreaId) { + // If the current area ID is contained within the HVAC_POWER_ON area ID + // turned off, then getValue should fail and a StatusCode error should be + // returned. Otherwise, a value should be returned. + if ((hvacPowerAreaId & powerDependentAreaId) == powerDependentAreaId) { EXPECT_FALSE(getValueResult.ok()); EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED); } else { @@ -1736,28 +1754,45 @@ TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) { // on this value from any power dependent property values other than those with the same // areaId. setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, + .areaId = hvacPowerAreaId, .value.int32Values = {1}}); } } TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) { - int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT}; - for (int areaId : seatAreaIds) { + FakeVehicleHardwareTestHelper helper(getHardware()); + auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON))); + EXPECT_NE(hvacPowerOnConfig, nullptr); + for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) { + int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId; + // Turn off HVAC_POWER_ON for only 1 area ID StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, + .areaId = hvacPowerAreaId, .value.int32Values = {0}}); + EXPECT_EQ(status, StatusCode::OK); - ASSERT_EQ(status, StatusCode::OK); - - for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) { - int powerPropId = HVAC_POWER_PROPERTIES[i]; - for (int powerDependentAreaId : seatAreaIds) { - StatusCode status = setValue(VehiclePropValue{.prop = powerPropId, - .areaId = powerDependentAreaId, - .value.int32Values = {1}}); + for (auto& powerPropId : helper.getHvacPowerDependentProps()) { + auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId)); + EXPECT_NE(powerPropConfig, nullptr); + if (powerPropConfig->access == VehiclePropertyAccess::READ) { + continue; + } + auto propType = getPropType(powerPropId); + // Try setting a value at each area ID supported by the power dependent property + for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) { + int powerDependentAreaId = powerPropAreaConfig.areaId; + auto val = VehiclePropValue{.prop = powerPropId, .areaId = powerDependentAreaId}; + if (propType == VehiclePropertyType::FLOAT) { + val.value.floatValues.emplace_back(20); + } else { + val.value.int32Values.emplace_back(1); + } + status = setValue(val); - if (areaId == powerDependentAreaId) { + // If the current area ID is contained within the HVAC_POWER_ON area ID + // turned off, then setValue should fail and a StatusCode error should be + // returned. Otherwise, an ok StatusCode should be returned. + if ((hvacPowerAreaId & powerDependentAreaId) == powerDependentAreaId) { EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED); } else { EXPECT_EQ(status, StatusCode::OK); @@ -1769,12 +1804,13 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) { // on this value from any power dependent property values other than those with the same // areaId. setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON), - .areaId = areaId, + .areaId = hvacPowerAreaId, .value.int32Values = {1}}); } } TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { + FakeVehicleHardwareTestHelper helper(getHardware()); auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON))); EXPECT_NE(hvacPowerOnConfig, nullptr); for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) { @@ -1789,7 +1825,7 @@ TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) { continue; } - EXPECT_THAT(event.prop, AnyOfArray(HVAC_POWER_PROPERTIES)); + EXPECT_THAT(event.prop, AnyOfArray(helper.getHvacPowerDependentProps())); EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId); EXPECT_EQ(event.status, VehiclePropertyStatus::UNAVAILABLE); } @@ -1805,7 +1841,7 @@ TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) { if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) { continue; } - EXPECT_THAT(event.prop, AnyOfArray(HVAC_POWER_PROPERTIES)); + EXPECT_THAT(event.prop, AnyOfArray(helper.getHvacPowerDependentProps())); EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId); EXPECT_EQ(event.status, VehiclePropertyStatus::AVAILABLE); } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h index e41ec3074c..78b61f714e 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h @@ -98,11 +98,6 @@ constexpr int HVAC_LEFT = SEAT_1_LEFT | SEAT_2_LEFT | SEAT_2_CENTER; constexpr int HVAC_RIGHT = SEAT_1_RIGHT | SEAT_2_RIGHT; constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; -const int32_t HVAC_POWER_PROPERTIES[] = { - toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_SPEED), - toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_DIRECTION), -}; - } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From 325527baeb618622dbbfe9704dcd6623a8d9265c Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 26 Sep 2023 08:31:19 -0700 Subject: [PATCH 159/376] Add additional HVAC_POWER_ON dependent properties Bug: 302024222 Test: atest FakeVehicleHardwareTest Test: atest CarPropertyManagerTest Change-Id: I3ac938154a38ec23151f142be463e69c34c6d92b --- .../impl/default_config/config/DefaultProperties.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index b9f784b717..2dd960ce2d 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1899,8 +1899,16 @@ } ], "configArray": [ + "VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM", + "VehicleProperty::HVAC_AC_ON", + "VehicleProperty::HVAC_AUTO_ON", + "VehicleProperty::HVAC_AUTO_RECIRC_ON", + "VehicleProperty::HVAC_FAN_DIRECTION", "VehicleProperty::HVAC_FAN_SPEED", - "VehicleProperty::HVAC_FAN_DIRECTION" + "VehicleProperty::HVAC_MAX_AC_ON", + "VehicleProperty::HVAC_RECIRC_ON", + "VehicleProperty::HVAC_TEMPERATURE_CURRENT", + "VehicleProperty::HVAC_TEMPERATURE_SET" ] }, { -- GitLab From 8fbbfd13576a44197ddeb04ce0d3c7d25f833949 Mon Sep 17 00:00:00 2001 From: Yuncheol Heo Date: Wed, 27 Sep 2023 15:43:59 -0700 Subject: [PATCH 160/376] Add CLUSTER_HEARTBEAT to VHAL Bug: 285415531 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I94e3ee63f8f677dd734c9a509e257a2cc5719eaa --- .../generated_lib/cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../default_config/config/DefaultProperties.json | 15 +++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 14 ++++++++++++++ .../src/VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 40 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index d0c6e83ebe..92c27077be 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -247,6 +247,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess::READ}, {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE}, {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 48532c93ca..e1bdf7d597 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -247,6 +247,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 758670d588..b5c3de98be 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -239,6 +239,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 29069f8de4..0f126e7c08 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -239,6 +239,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index b9f784b717..4a16bf7444 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3620,6 +3620,21 @@ { "property": "VehicleProperty::CLUSTER_NAVIGATION_STATE" }, + { + "property": "VehicleProperty::CLUSTER_HEARTBEAT", + "configArray": [ + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 16 + ], + "comment": "configArray specifies it consists of int64[2] and byte[16]." + }, { "property": "VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT", "defaultValue": { 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 ba75e7b261..231186fa07 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 @@ -245,6 +245,7 @@ enum VehicleProperty { SUPPORTED_PROPERTY_IDS = (((0x0F48 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476424 */, SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410889 */, VEHICLE_IN_USE = (((0x0F4A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313738 */, + CLUSTER_HEARTBEAT = (((0x0F4B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 299896651 */, AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */, AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */, FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */, 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 7d88810911..545df4b96a 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -4487,6 +4487,20 @@ enum VehicleProperty { VEHICLE_IN_USE = 0x0F4A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Sends the heartbeat signal to ClusterOS. + * + * int64[0]: epochTimeNs + * int64[1]: the visibility of ClusterUI, 0 - invisible, 1 - visible + * bytes: the app specific metadata, this can be empty when ClusterHomeService use the heartbeat + * to deliver the change of the visibility. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.WRITE + */ + CLUSTER_HEARTBEAT = + 0x0F4B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.MIXED, + /*********************************************************************************************** * Start of ADAS Properties * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 8bcad1e0cb..6e6d05cd61 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -865,6 +865,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLaneCenteringAssistStateConfig) VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) { + verifyProperty(VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::MIXED); +} + std::vector getDescriptors() { std::vector descriptors; for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { -- GitLab From 712b3d9880b6aff51ab17d539bfcbdf3785cc6ca Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 29 Sep 2023 00:21:37 +0000 Subject: [PATCH 161/376] Setting layer brightness doesn't need nit info for readback tests The nit information was used when we set exact nit values rather than a relative brightness per layer. But we only need nit values for the renderengine interface, which isn't tied to any hwc or panel capabilities. Bug: 301261125 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: I770dc5620648df2eab608e030c5e76cf190f315d --- graphics/composer/aidl/vts/Android.bp | 1 - .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 143 +----------------- 2 files changed, 5 insertions(+), 139 deletions(-) diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp index e60e1a7e65..d71999df6e 100644 --- a/graphics/composer/aidl/vts/Android.bp +++ b/graphics/composer/aidl/vts/Android.bp @@ -54,7 +54,6 @@ cc_test { "libgui", "libhidlbase", "libprocessgroup", - "libtinyxml2", "libvndksupport", ], header_libs: [ diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index a83b833eeb..4b0f336d29 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -31,12 +31,6 @@ #include "RenderEngineVts.h" #include "VtsComposerClient.h" -// tinyxml2 does implicit conversions >:( -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wconversion" -#include -#pragma clang diagnostic pop - namespace aidl::android::hardware::graphics::composer3::vts { namespace { @@ -128,63 +122,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { return {false, graphicBuffer}; } - // Gets the per-display XML config - std::unique_ptr getDisplayConfigXml(int64_t display) { - - if (auto document = getDisplayConfigXmlByStableId(getStableDisplayId(display)); - document != nullptr) { - return document; - } - - // Fallback to looking up a per-port config if no config exists for the full ID - if (auto document = getDisplayConfigXmlByPort(getPort(display)); document != nullptr) { - return document; - } - - return nullptr; - } - - // Gets the max display brightness for this display. - // If the display config xml does not exist, then assume that the display is not well-configured - // enough to provide a display brightness, so return nullopt. - std::optional getMaxDisplayBrightnessNits(int64_t display) { - const auto document = getDisplayConfigXml(display); - if (!document) { - // Assume the device doesn't support display brightness - return std::nullopt; - } - - const auto root = document->RootElement(); - if (!root) { - // If there's somehow no root element, then this isn't a valid config - return std::nullopt; - } - - const auto screenBrightnessMap = root->FirstChildElement("screenBrightnessMap"); - if (!screenBrightnessMap) { - // A valid display config must have a screen brightness map - return std::nullopt; - } - - auto point = screenBrightnessMap->FirstChildElement("point"); - float maxNits = -1.f; - while (point != nullptr) { - const auto nits = point->FirstChildElement("nits"); - if (nits) { - maxNits = std::max(maxNits, nits->FloatText(-1.f)); - } - point = point->NextSiblingElement("point"); - } - - if (maxNits < 0.f) { - // If we got here, then there were no point elements containing a nit value, so this - // config isn't valid - return std::nullopt; - } - - return maxNits; - } - void writeLayers(const std::vector>& layers) { for (const auto& layer : layers) { layer->write(*mWriter); @@ -242,53 +179,6 @@ class GraphicsCompositionTestBase : public ::testing::Test { } } } - - uint8_t getPort(int64_t display) { - const auto& [status, identification] = - mComposerClient->getDisplayIdentificationData(display); - EXPECT_TRUE(status.isOk()); - return static_cast(identification.port); - } - - uint64_t getStableDisplayId(int64_t display) { - const auto& [status, identification] = - mComposerClient->getDisplayIdentificationData(display); - EXPECT_TRUE(status.isOk()); - - if (const auto info = ::android::parseDisplayIdentificationData( - static_cast(identification.port), identification.data)) { - return info->id.value; - } - - return ::android::PhysicalDisplayId::fromPort(static_cast(identification.port)) - .value; - } - - std::unique_ptr loadXml(const std::string& path) { - auto document = std::make_unique(); - const tinyxml2::XMLError error = document->LoadFile(path.c_str()); - if (error != tinyxml2::XML_SUCCESS) { - ALOGD("%s: Failed to load config file: %s", __func__, path.c_str()); - return nullptr; - } - - ALOGD("%s: Successfully loaded config file: %s", __func__, path.c_str()); - return document; - } - - std::unique_ptr getDisplayConfigXmlByPort(uint8_t port) { - std::stringstream pathBuilder; - pathBuilder << "/vendor/etc/displayconfig/display_port_" << static_cast(port) - << ".xml"; - return loadXml(pathBuilder.str()); - } - - std::unique_ptr getDisplayConfigXmlByStableId(uint64_t stableId) { - std::stringstream pathBuilder; - pathBuilder << "/vendor/etc/displayconfig/display_id_" << stableId - << ".xml"; - return loadXml(pathBuilder.str()); - } }; class GraphicsCompositionTest : public GraphicsCompositionTestBase, @@ -990,32 +880,6 @@ TEST_P(GraphicsCompositionTest, SetLayerZOrder) { } TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { - const auto& [status, capabilities] = - mComposerClient->getDisplayCapabilities(getPrimaryDisplayId()); - ASSERT_TRUE(status.isOk()); - - const bool brightnessSupport = std::find(capabilities.begin(), capabilities.end(), - DisplayCapability::BRIGHTNESS) != capabilities.end(); - - if (!brightnessSupport) { - GTEST_SUCCEED() << "Cannot verify dimming behavior without brightness support"; - return; - } - - const std::optional maxBrightnessNitsOptional = - getMaxDisplayBrightnessNits(getPrimaryDisplayId()); - - ASSERT_TRUE(maxBrightnessNitsOptional.has_value()); - - const float maxBrightnessNits = *maxBrightnessNitsOptional; - - // Preconditions to successfully run are knowing the max brightness and successfully applying - // the max brightness - ASSERT_GT(maxBrightnessNits, 0.f); - mWriter->setDisplayBrightness(getPrimaryDisplayId(), /*brightness*/ 1.f, maxBrightnessNits); - execute(); - ASSERT_TRUE(mReader.takeErrors().empty()); - for (ColorMode mode : mTestColorModes) { EXPECT_TRUE(mComposerClient ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) @@ -1032,11 +896,14 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { const common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2}; const common::Rect dimmerRedRect = {0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}; + + static constexpr float kMaxBrightnessNits = 300.f; + const auto redLayer = std::make_shared(mComposerClient, getPrimaryDisplayId()); redLayer->setColor(RED); redLayer->setDisplayFrame(redRect); - redLayer->setWhitePointNits(maxBrightnessNits); + redLayer->setWhitePointNits(kMaxBrightnessNits); redLayer->setBrightness(1.f); const auto dimmerRedLayer = @@ -1046,7 +913,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBrightnessDims) { // Intentionally use a small dimming ratio as some implementations may be more likely to // kick into GPU composition to apply dithering when the dimming ratio is high. static constexpr float kDimmingRatio = 0.9f; - dimmerRedLayer->setWhitePointNits(maxBrightnessNits * kDimmingRatio); + dimmerRedLayer->setWhitePointNits(kMaxBrightnessNits * kDimmingRatio); dimmerRedLayer->setBrightness(kDimmingRatio); const std::vector> layers = {redLayer, dimmerRedLayer}; -- GitLab From 4be4471d469faccd448fae3cb3604800df3e91d7 Mon Sep 17 00:00:00 2001 From: Tang Lee Date: Tue, 12 Sep 2023 14:10:40 +0800 Subject: [PATCH 162/376] Return ILLEGAL_ARGUMENT for setting null callback Bug: 299182872 Test: Run VTS with external USB camera vts-tradefed > run vts -m VtsAidlHalCameraProvider_TargetTest -t \ PerInstance/CameraAidlTest#setCallback/0_android_hardware_camera_provider_ICameraProvider_external_0 \ --logcat-on-failure --logcat-on-failure-size 8192000 \ --bugreport-on-failure --screenshot-on-failure Change-Id: I013e3770ddbdcf6475e0927449af6183dcc37a8e --- .../2.4/default/ExternalCameraProviderImpl_2_4.cpp | 7 ++++--- .../provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp | 6 +++--- .../2.7/default/ExternalCameraProviderImpl_2_7.cpp | 6 +++--- camera/provider/default/ExternalCameraProvider.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp index 04db7f33ee..2d919cccff 100644 --- a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp +++ b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp @@ -95,13 +95,14 @@ ExternalCameraProviderImpl_2_4::~ExternalCameraProviderImpl_2_4() { Return ExternalCameraProviderImpl_2_4::setCallback( const sp& callback) { + if (callback == nullptr) { + return Status::ILLEGAL_ARGUMENT; + } + { Mutex::Autolock _l(mLock); mCallbacks = callback; } - if (mCallbacks == nullptr) { - return Status::OK; - } // Send a callback for all devices to initialize { for (const auto& pair : mCameraStatusMap) { diff --git a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp index 69318c7368..07ed689c98 100644 --- a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp +++ b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp @@ -448,11 +448,11 @@ bool LegacyCameraProviderImpl_2_4::setUpVendorTags() { // Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow. Return LegacyCameraProviderImpl_2_4::setCallback( const sp& callback) { + if (callback == nullptr) { + return Status::ILLEGAL_ARGUMENT; + } Mutex::Autolock _l(mCbLock); mCallbacks = callback; - if (mCallbacks == nullptr) { - return Status::OK; - } // Add and report all presenting external cameras. for (auto const& statusPair : mCameraStatusMap) { int id = std::stoi(statusPair.first); diff --git a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp index 62ce074404..eba49a5649 100644 --- a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp +++ b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp @@ -91,11 +91,11 @@ ExternalCameraProviderImpl_2_7::~ExternalCameraProviderImpl_2_7() { Return ExternalCameraProviderImpl_2_7::setCallback( const sp& callback) { + if (callback == nullptr) { + return Status::ILLEGAL_ARGUMENT; + } Mutex::Autolock _l(mLock); mCallbacks = callback; - if (mCallbacks == nullptr) { - return Status::OK; - } // Send a callback for all devices to initialize { for (const auto& pair : mCameraStatusMap) { diff --git a/camera/provider/default/ExternalCameraProvider.cpp b/camera/provider/default/ExternalCameraProvider.cpp index 4d2c847255..54875abb20 100644 --- a/camera/provider/default/ExternalCameraProvider.cpp +++ b/camera/provider/default/ExternalCameraProvider.cpp @@ -75,15 +75,15 @@ ExternalCameraProvider::~ExternalCameraProvider() { ndk::ScopedAStatus ExternalCameraProvider::setCallback( const std::shared_ptr& in_callback) { + if (in_callback == nullptr) { + return fromStatus(Status::ILLEGAL_ARGUMENT); + } + { Mutex::Autolock _l(mLock); mCallback = in_callback; } - if (mCallback == nullptr) { - return fromStatus(Status::OK); - } - for (const auto& pair : mCameraStatusMap) { mCallback->cameraDeviceStatusChange(pair.first, pair.second); } -- GitLab From 49ba82ce11a0d4d7c18ae7ef6c5196710ae82c0b Mon Sep 17 00:00:00 2001 From: Michael Stokes Date: Mon, 2 Oct 2023 09:56:59 +0000 Subject: [PATCH 163/376] Revert "Convert from HIDL mapper to libui GraphicBufferMapper" Revert submission 24747509-camera_fail2 Reason for revert: DroidMonitor-triggered revert due to breakage b/302990858. This may cause CtsAppOpsTestCases b/300115646 to fail again, unfortunately (b/300115646). Bug: 302990858 Reverted changes: /q/submissionid:24747509-camera_fail2 Change-Id: I0191b3ee88846f5b2c6e37ebd6be6d1369d9dba9 --- camera/common/default/Android.bp | 5 +- camera/common/default/HandleImporter.cpp | 399 +++++++++++++++--- .../common/default/include/HandleImporter.h | 26 +- camera/device/1.0/default/Android.bp | 1 - camera/device/3.2/default/Android.bp | 1 - camera/device/3.4/default/Android.bp | 1 - .../default/ExternalCameraDeviceSession.cpp | 25 +- camera/device/3.5/default/Android.bp | 2 - camera/device/3.6/default/Android.bp | 1 - .../default/ExternalCameraOfflineSession.cpp | 25 +- camera/device/default/Android.bp | 3 +- .../default/ExternalCameraDeviceSession.cpp | 20 +- .../default/ExternalCameraDeviceSession.h | 4 - .../default/ExternalCameraOfflineSession.cpp | 22 +- camera/device/default/ExternalCameraUtils.h | 6 - 15 files changed, 384 insertions(+), 157 deletions(-) diff --git a/camera/common/default/Android.bp b/camera/common/default/Android.bp index b5d3095cff..e8c8f9dba0 100644 --- a/camera/common/default/Android.bp +++ b/camera/common/default/Android.bp @@ -30,12 +30,13 @@ cc_library_static { "libgralloctypes", "libhardware", "libcamera_metadata", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", "libexif", - "libui", ], include_dirs: ["system/media/private/camera/include"], export_include_dirs: ["include"], - export_shared_lib_headers: ["libui"], } // NOTE: Deprecated module kept for compatibility reasons. diff --git a/camera/common/default/HandleImporter.cpp b/camera/common/default/HandleImporter.cpp index 9c579e59a1..1145baa5f1 100644 --- a/camera/common/default/HandleImporter.cpp +++ b/camera/common/default/HandleImporter.cpp @@ -17,10 +17,9 @@ #define LOG_TAG "HandleImporter" #include "HandleImporter.h" -#include #include #include -#include +#include "aidl/android/hardware/graphics/common/Smpte2086.h" namespace android { namespace hardware { @@ -32,6 +31,12 @@ using aidl::android::hardware::graphics::common::PlaneLayout; using aidl::android::hardware::graphics::common::PlaneLayoutComponent; using aidl::android::hardware::graphics::common::PlaneLayoutComponentType; using aidl::android::hardware::graphics::common::Smpte2086; +using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType; +using MapperErrorV2 = android::hardware::graphics::mapper::V2_0::Error; +using MapperErrorV3 = android::hardware::graphics::mapper::V3_0::Error; +using MapperErrorV4 = android::hardware::graphics::mapper::V4_0::Error; +using IMapperV3 = android::hardware::graphics::mapper::V3_0::IMapper; +using IMapperV4 = android::hardware::graphics::mapper::V4_0::IMapper; HandleImporter::HandleImporter() : mInitialized(false) {} @@ -40,20 +45,51 @@ void HandleImporter::initializeLocked() { return; } - GraphicBufferMapper::preloadHal(); + mMapperV4 = IMapperV4::getService(); + if (mMapperV4 != nullptr) { + mInitialized = true; + return; + } + + mMapperV3 = IMapperV3::getService(); + if (mMapperV3 != nullptr) { + mInitialized = true; + return; + } + + mMapperV2 = IMapper::getService(); + if (mMapperV2 == nullptr) { + ALOGE("%s: cannnot acccess graphics mapper HAL!", __FUNCTION__); + return; + } + mInitialized = true; return; } void HandleImporter::cleanup() { + mMapperV4.clear(); + mMapperV3.clear(); + mMapperV2.clear(); mInitialized = false; } -bool HandleImporter::importBufferInternal(buffer_handle_t& handle) { +template +bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& handle) { + E error; buffer_handle_t importedHandle; - auto status = GraphicBufferMapper::get().importBufferNoValidate(handle, &importedHandle); - if (status != OK) { - ALOGE("%s: mapper importBuffer failed: %d", __FUNCTION__, status); + auto ret = mapper->importBuffer( + hidl_handle(handle), [&](const auto& tmpError, const auto& tmpBufferHandle) { + error = tmpError; + importedHandle = static_cast(tmpBufferHandle); + }); + + if (!ret.isOk()) { + ALOGE("%s: mapper importBuffer failed: %s", __FUNCTION__, ret.description().c_str()); + return false; + } + + if (error != E::NONE) { return false; } @@ -61,32 +97,170 @@ bool HandleImporter::importBufferInternal(buffer_handle_t& handle) { return true; } -android_ycbcr HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const android::Rect& accessRegion) { - Mutex::Autolock lock(mLock); +template +YCbCrLayout HandleImporter::lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, + uint64_t cpuUsage, + const IMapper::Rect& accessRegion) { + hidl_handle acquireFenceHandle; + auto buffer = const_cast(buf); + YCbCrLayout layout = {}; + + typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, accessRegion.width, + accessRegion.height}; + mapper->lockYCbCr(buffer, cpuUsage, accessRegionCopy, acquireFenceHandle, + [&](const auto& tmpError, const auto& tmpLayout) { + if (tmpError == E::NONE) { + // Member by member copy from different versions of YCbCrLayout. + layout.y = tmpLayout.y; + layout.cb = tmpLayout.cb; + layout.cr = tmpLayout.cr; + layout.yStride = tmpLayout.yStride; + layout.cStride = tmpLayout.cStride; + layout.chromaStep = tmpLayout.chromaStep; + } else { + ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError); + } + }); + return layout; +} - if (!mInitialized) { - initializeLocked(); +bool isMetadataPesent(const sp mapper, const buffer_handle_t& buf, + MetadataType metadataType) { + auto buffer = const_cast(buf); + bool ret = false; + hidl_vec vec; + mapper->get(buffer, metadataType, [&](const auto& tmpError, const auto& tmpMetadata) { + if (tmpError == MapperErrorV4::NONE) { + vec = tmpMetadata; + } else { + ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); + } + }); + + if (vec.size() > 0) { + if (metadataType == gralloc4::MetadataType_Smpte2086) { + std::optional realSmpte2086; + gralloc4::decodeSmpte2086(vec, &realSmpte2086); + ret = realSmpte2086.has_value(); + } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) { + std::optional> realSmpte2094_10; + gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10); + ret = realSmpte2094_10.has_value(); + } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) { + std::optional> realSmpte2094_40; + gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40); + ret = realSmpte2094_40.has_value(); + } else { + ALOGE("%s: Unknown metadata type!", __FUNCTION__); + } } - android_ycbcr layout; - status_t status = GraphicBufferMapper::get().lockYCbCr(buf, cpuUsage, accessRegion, &layout); + return ret; +} - if (status != OK) { - ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, status); - } +std::vector getPlaneLayouts(const sp mapper, buffer_handle_t& buf) { + auto buffer = const_cast(buf); + std::vector planeLayouts; + hidl_vec encodedPlaneLayouts; + mapper->get(buffer, gralloc4::MetadataType_PlaneLayouts, + [&](const auto& tmpError, const auto& tmpEncodedPlaneLayouts) { + if (tmpError == MapperErrorV4::NONE) { + encodedPlaneLayouts = tmpEncodedPlaneLayouts; + } else { + ALOGE("%s: failed to get plane layouts %d!", __FUNCTION__, tmpError); + } + }); + + gralloc4::decodePlaneLayouts(encodedPlaneLayouts, &planeLayouts); - return layout; + return planeLayouts; } -std::vector getPlaneLayouts(buffer_handle_t& buf) { - std::vector planeLayouts; - status_t status = GraphicBufferMapper::get().getPlaneLayouts(buf, &planeLayouts); - if (status != OK) { - ALOGE("%s: failed to get PlaneLayouts! Status %d", __FUNCTION__, status); +template <> +YCbCrLayout HandleImporter::lockYCbCrInternal( + const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion) { + hidl_handle acquireFenceHandle; + auto buffer = const_cast(buf); + YCbCrLayout layout = {}; + void* mapped = nullptr; + + typename IMapperV4::Rect accessRegionV4 = {accessRegion.left, accessRegion.top, + accessRegion.width, accessRegion.height}; + mapper->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, + [&](const auto& tmpError, const auto& tmpPtr) { + if (tmpError == MapperErrorV4::NONE) { + mapped = tmpPtr; + } else { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); + } + }); + + if (mapped == nullptr) { + return layout; } - return planeLayouts; + std::vector planeLayouts = getPlaneLayouts(mapper, buf); + for (const auto& planeLayout : planeLayouts) { + for (const auto& planeLayoutComponent : planeLayout.components) { + const auto& type = planeLayoutComponent.type; + + if (!gralloc4::isStandardPlaneLayoutComponentType(type)) { + continue; + } + + uint8_t* data = reinterpret_cast(mapped); + data += planeLayout.offsetInBytes; + data += planeLayoutComponent.offsetInBits / 8; + + switch (static_cast(type.value)) { + case PlaneLayoutComponentType::Y: + layout.y = data; + layout.yStride = planeLayout.strideInBytes; + break; + case PlaneLayoutComponentType::CB: + layout.cb = data; + layout.cStride = planeLayout.strideInBytes; + layout.chromaStep = planeLayout.sampleIncrementInBits / 8; + break; + case PlaneLayoutComponentType::CR: + layout.cr = data; + layout.cStride = planeLayout.strideInBytes; + layout.chromaStep = planeLayout.sampleIncrementInBits / 8; + break; + default: + break; + } + } + } + + return layout; +} + +template +int HandleImporter::unlockInternal(const sp mapper, buffer_handle_t& buf) { + int releaseFence = -1; + auto buffer = const_cast(buf); + + mapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) { + if (tmpError == E::NONE) { + auto fenceHandle = tmpReleaseFence.getNativeHandle(); + if (fenceHandle) { + if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) { + ALOGE("%s: bad release fence numInts %d numFds %d", __FUNCTION__, + fenceHandle->numInts, fenceHandle->numFds); + return; + } + releaseFence = dup(fenceHandle->data[0]); + if (releaseFence < 0) { + ALOGE("%s: bad release fence FD %d", __FUNCTION__, releaseFence); + } + } + } else { + ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError); + } + }); + return releaseFence; } // In IComposer, any buffer_handle_t is owned by the caller and we need to @@ -103,7 +277,20 @@ bool HandleImporter::importBuffer(buffer_handle_t& handle) { initializeLocked(); } - return importBufferInternal(handle); + if (mMapperV4 != nullptr) { + return importBufferInternal(mMapperV4, handle); + } + + if (mMapperV3 != nullptr) { + return importBufferInternal(mMapperV3, handle); + } + + if (mMapperV2 != nullptr) { + return importBufferInternal(mMapperV2, handle); + } + + ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); + return false; } void HandleImporter::freeBuffer(buffer_handle_t handle) { @@ -116,9 +303,21 @@ void HandleImporter::freeBuffer(buffer_handle_t handle) { initializeLocked(); } - status_t status = GraphicBufferMapper::get().freeBuffer(handle); - if (status != OK) { - ALOGE("%s: mapper freeBuffer failed. Status %d", __FUNCTION__, status); + if (mMapperV4 != nullptr) { + auto ret = mMapperV4->freeBuffer(const_cast(handle)); + if (!ret.isOk()) { + ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); + } + } else if (mMapperV3 != nullptr) { + auto ret = mMapperV3->freeBuffer(const_cast(handle)); + if (!ret.isOk()) { + ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); + } + } else { + auto ret = mMapperV2->freeBuffer(const_cast(handle)); + if (!ret.isOk()) { + ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); + } } } @@ -146,12 +345,12 @@ void HandleImporter::closeFence(int fd) const { } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size) { - android::Rect accessRegion{0, 0, static_cast(size), 1}; + IMapper::Rect accessRegion{0, 0, static_cast(size), 1}; return lock(buf, cpuUsage, accessRegion); } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, - const android::Rect& accessRegion) { + const IMapper::Rect& accessRegion) { Mutex::Autolock lock(mLock); if (!mInitialized) { @@ -159,18 +358,81 @@ void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, } void* ret = nullptr; - status_t status = GraphicBufferMapper::get().lock(buf, cpuUsage, accessRegion, &ret); - if (status != OK) { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, status); + + if (mMapperV4 == nullptr && mMapperV3 == nullptr && mMapperV2 == nullptr) { + ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); + return ret; + } + + hidl_handle acquireFenceHandle; + auto buffer = const_cast(buf); + if (mMapperV4 != nullptr) { + IMapperV4::Rect accessRegionV4{accessRegion.left, accessRegion.top, accessRegion.width, + accessRegion.height}; + + mMapperV4->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, + [&](const auto& tmpError, const auto& tmpPtr) { + if (tmpError == MapperErrorV4::NONE) { + ret = tmpPtr; + } else { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); + } + }); + } else if (mMapperV3 != nullptr) { + IMapperV3::Rect accessRegionV3{accessRegion.left, accessRegion.top, accessRegion.width, + accessRegion.height}; + + mMapperV3->lock(buffer, cpuUsage, accessRegionV3, acquireFenceHandle, + [&](const auto& tmpError, const auto& tmpPtr, const auto& /*bytesPerPixel*/, + const auto& /*bytesPerStride*/) { + if (tmpError == MapperErrorV3::NONE) { + ret = tmpPtr; + } else { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); + } + }); + } else { + mMapperV2->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle, + [&](const auto& tmpError, const auto& tmpPtr) { + if (tmpError == MapperErrorV2::NONE) { + ret = tmpPtr; + } else { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); + } + }); } ALOGV("%s: ptr %p accessRegion.top: %d accessRegion.left: %d accessRegion.width: %d " "accessRegion.height: %d", - __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width(), - accessRegion.height()); + __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width, + accessRegion.height); return ret; } +YCbCrLayout HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion) { + Mutex::Autolock lock(mLock); + + if (!mInitialized) { + initializeLocked(); + } + + if (mMapperV4 != nullptr) { + return lockYCbCrInternal(mMapperV4, buf, cpuUsage, accessRegion); + } + + if (mMapperV3 != nullptr) { + return lockYCbCrInternal(mMapperV3, buf, cpuUsage, accessRegion); + } + + if (mMapperV2 != nullptr) { + return lockYCbCrInternal(mMapperV2, buf, cpuUsage, accessRegion); + } + + ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); + return {}; +} + status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/) { if (stride == nullptr) { return BAD_VALUE; @@ -182,26 +444,35 @@ status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t initializeLocked(); } - std::vector planeLayouts = getPlaneLayouts(buf); - if (planeLayouts.size() != 1) { - ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); - return BAD_VALUE; - } + if (mMapperV4 != nullptr) { + std::vector planeLayouts = getPlaneLayouts(mMapperV4, buf); + if (planeLayouts.size() != 1) { + ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); + return BAD_VALUE; + } - *stride = planeLayouts[0].strideInBytes; + *stride = planeLayouts[0].strideInBytes; + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + return NO_INIT; + } return OK; } int HandleImporter::unlock(buffer_handle_t& buf) { - int releaseFence = -1; - - status_t status = GraphicBufferMapper::get().unlockAsync(buf, &releaseFence); - if (status != OK) { - ALOGE("%s: failed to unlock error %d!", __FUNCTION__, status); + if (mMapperV4 != nullptr) { + return unlockInternal(mMapperV4, buf); + } + if (mMapperV3 != nullptr) { + return unlockInternal(mMapperV3, buf); + } + if (mMapperV2 != nullptr) { + return unlockInternal(mMapperV2, buf); } - return releaseFence; + ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); + return -1; } bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { @@ -210,14 +481,14 @@ bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { if (!mInitialized) { initializeLocked(); } - std::optional metadata; - status_t status = GraphicBufferMapper::get().getSmpte2086(buf, &metadata); - if (status != OK) { - ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); - return false; + + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2086); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); } - return metadata.has_value(); + return false; } bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { @@ -227,14 +498,13 @@ bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { initializeLocked(); } - std::optional> metadata; - status_t status = GraphicBufferMapper::get().getSmpte2094_10(buf, &metadata); - if (status != OK) { - ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); - return false; + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_10); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); } - return metadata.has_value(); + return false; } bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { @@ -244,14 +514,13 @@ bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { initializeLocked(); } - std::optional> metadata; - status_t status = GraphicBufferMapper::get().getSmpte2094_40(buf, &metadata); - if (status != OK) { - ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); - return false; + if (mMapperV4 != nullptr) { + return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_40); + } else { + ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); } - return metadata.has_value(); + return false; } } // namespace helper diff --git a/camera/common/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h index df01202224..5408ba92e6 100644 --- a/camera/common/default/include/HandleImporter.h +++ b/camera/common/default/include/HandleImporter.h @@ -17,11 +17,15 @@ #ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H #define CAMERA_COMMON_1_0_HANDLEIMPORTED_H +#include +#include +#include #include -#include -#include #include +using android::hardware::graphics::mapper::V2_0::IMapper; +using android::hardware::graphics::mapper::V2_0::YCbCrLayout; + namespace android { namespace hardware { namespace camera { @@ -45,11 +49,11 @@ class HandleImporter { void* lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size); // Locks 2-D buffer. Assumes caller has waited for acquire fences. - void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const android::Rect& accessRegion); + void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const IMapper::Rect& accessRegion); // Assumes caller has waited for acquire fences. - android_ycbcr lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const android::Rect& accessRegion); + YCbCrLayout lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion); // Query the stride of the first plane in bytes. status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/); @@ -65,11 +69,19 @@ class HandleImporter { void initializeLocked(); void cleanup(); - bool importBufferInternal(buffer_handle_t& handle); - int unlockInternal(buffer_handle_t& buf); + template + bool importBufferInternal(const sp mapper, buffer_handle_t& handle); + template + YCbCrLayout lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, + const IMapper::Rect& accessRegion); + template + int unlockInternal(const sp mapper, buffer_handle_t& buf); Mutex mLock; bool mInitialized; + sp mMapperV2; + sp mMapperV3; + sp mMapperV4; }; } // namespace helper diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp index 6992ff0294..9ff6480d4b 100644 --- a/camera/device/1.0/default/Android.bp +++ b/camera/device/1.0/default/Android.bp @@ -32,7 +32,6 @@ cc_library_shared { "libgralloctypes", "libhardware", "libcamera_metadata", - "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp index adf834ac53..a1962915ff 100644 --- a/camera/device/3.2/default/Android.bp +++ b/camera/device/3.2/default/Android.bp @@ -30,7 +30,6 @@ cc_library_shared { "libhardware", "libcamera_metadata", "libfmq", - "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/Android.bp b/camera/device/3.4/default/Android.bp index 100106e437..9f0c77739a 100644 --- a/camera/device/3.4/default/Android.bp +++ b/camera/device/3.4/default/Android.bp @@ -106,7 +106,6 @@ cc_library_shared { "libjpeg", "libexif", "libtinyxml2", - "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp index 01b3d41ff7..ca7186b18d 100644 --- a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp @@ -1574,23 +1574,14 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - android::Rect outRect{0, 0, static_cast(halBuf.width), - static_cast(halBuf.height)}; - android_ycbcr result = - sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, - result.y, result.cb, result.cr, result.ystride, result.cstride, - result.chroma_step); - if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || - result.chroma_step > UINT32_MAX) { - return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); - } - YCbCrLayout outLayout = {.y = result.y, - .cb = result.cb, - .cr = result.cr, - .yStride = static_cast(result.ystride), - .cStride = static_cast(result.cstride), - .chromaStep = static_cast(result.chroma_step)}; + IMapper::Rect outRect {0, 0, + static_cast(halBuf.width), + static_cast(halBuf.height)}; + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + *(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", + __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, + outLayout.yStride, outLayout.cStride, outLayout.chromaStep); // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/3.5/default/Android.bp b/camera/device/3.5/default/Android.bp index bc15629da0..9d27b321e0 100644 --- a/camera/device/3.5/default/Android.bp +++ b/camera/device/3.5/default/Android.bp @@ -46,7 +46,6 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", - "libui", "libutils", "libcutils", "camera.device@3.2-impl", @@ -82,7 +81,6 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", - "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/Android.bp b/camera/device/3.6/default/Android.bp index b4a486ff26..89ee145820 100644 --- a/camera/device/3.6/default/Android.bp +++ b/camera/device/3.6/default/Android.bp @@ -41,7 +41,6 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", - "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp index 1f1dfee146..e606fda832 100644 --- a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp @@ -222,23 +222,14 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - android::Rect outRect{0, 0, static_cast(halBuf.width), - static_cast(halBuf.height)}; - android_ycbcr result = - sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, - result.y, result.cb, result.cr, result.ystride, result.cstride, - result.chroma_step); - if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || - result.chroma_step > UINT32_MAX) { - return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); - } - YCbCrLayout outLayout = {.y = result.y, - .cb = result.cb, - .cr = result.cr, - .yStride = static_cast(result.ystride), - .cStride = static_cast(result.cstride), - .chromaStep = static_cast(result.chroma_step)}; + IMapper::Rect outRect {0, 0, + static_cast(halBuf.width), + static_cast(halBuf.height)}; + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + *(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", + __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, + outLayout.yStride, outLayout.cStride, outLayout.chromaStep); // Convert to output buffer size/format uint32_t outputFourcc = V3_4::implementation::getFourCcFromLayout(outLayout); diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp index 5fbcb5d89a..b9f10d6fd6 100644 --- a/camera/device/default/Android.bp +++ b/camera/device/default/Android.bp @@ -40,7 +40,7 @@ cc_library_shared { shared_libs: [ "android.hardware.camera.common-V1-ndk", "android.hardware.camera.device-V1-ndk", - "android.hardware.graphics.allocator-V2-ndk", + "android.hardware.graphics.allocator-V1-ndk", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@4.0", @@ -60,7 +60,6 @@ cc_library_shared { "libsync", "libtinyxml2", "libutils", - "libui", "libyuv", ], static_libs: [ diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp index 896e0daa0b..95a36f0615 100644 --- a/camera/device/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/default/ExternalCameraDeviceSession.cpp @@ -2882,23 +2882,13 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - android::Rect outRect{0, 0, static_cast(halBuf.width), + IMapper::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - android_ycbcr result = sHandleImporter.lockYCbCr( + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, - result.y, result.cb, result.cr, result.ystride, result.cstride, - result.chroma_step); - if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || - result.chroma_step > UINT32_MAX) { - return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); - } - YCbCrLayout outLayout = {.y = result.y, - .cb = result.cb, - .cr = result.cr, - .yStride = static_cast(result.ystride), - .cStride = static_cast(result.cstride), - .chromaStep = static_cast(result.chroma_step)}; + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, + outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, + outLayout.chromaStep); // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h index 736bfd1528..836266f3de 100644 --- a/camera/device/default/ExternalCameraDeviceSession.h +++ b/camera/device/default/ExternalCameraDeviceSession.h @@ -24,9 +24,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -58,7 +55,6 @@ using ::android::base::unique_fd; using ::android::hardware::camera::common::helper::SimpleThread; using ::android::hardware::camera::external::common::ExternalCameraConfig; using ::android::hardware::camera::external::common::SizeHasher; -using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; using ::ndk::ScopedAStatus; class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputThreadInterface { diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp index 53bd44f4fa..4c7f732f87 100644 --- a/camera/device/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/default/ExternalCameraOfflineSession.cpp @@ -486,23 +486,13 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - android::Rect outRect{0, 0, static_cast(halBuf.width), + IMapper::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - android_ycbcr result = sHandleImporter.lockYCbCr( + YCbCrLayout outLayout = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, - result.y, result.cb, result.cr, result.ystride, result.cstride, - result.chroma_step); - if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || - result.chroma_step > UINT32_MAX) { - return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); - } - YCbCrLayout outLayout = {.y = result.y, - .cb = result.cb, - .cr = result.cr, - .yStride = static_cast(result.ystride), - .cStride = static_cast(result.cstride), - .chromaStep = static_cast(result.chroma_step)}; + ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, + outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, + outLayout.chromaStep); // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); @@ -554,4 +544,4 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } // namespace device } // namespace camera } // namespace hardware -} // namespace android +} // namespace android \ No newline at end of file diff --git a/camera/device/default/ExternalCameraUtils.h b/camera/device/default/ExternalCameraUtils.h index d434905bd8..b37933ce7e 100644 --- a/camera/device/default/ExternalCameraUtils.h +++ b/camera/device/default/ExternalCameraUtils.h @@ -25,11 +25,7 @@ #include #include #include -#include -#include -#include #include -#include #include #include @@ -41,8 +37,6 @@ using ::aidl::android::hardware::graphics::common::BufferUsage; using ::aidl::android::hardware::graphics::common::PixelFormat; using ::android::hardware::camera::common::V1_0::helper::CameraMetadata; using ::android::hardware::camera::common::V1_0::helper::HandleImporter; -using ::android::hardware::graphics::mapper::V2_0::IMapper; -using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; namespace android { namespace hardware { -- GitLab From 523660cd87494ec5862e0c8cc6a1f37f2d6c70f5 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Mon, 2 Oct 2023 15:55:11 +0000 Subject: [PATCH 164/376] Revert "Revert "Convert from HIDL mapper to libui GraphicBufferM..." Revert submission 24913374-revert-24747509-camera_fail2-OVHUVTAXRP Reason for revert: 32-bit TV build is fixed with `%zu` instead of `%lu` for size_t argument. Reverted changes: /q/submissionid:24913374-revert-24747509-camera_fail2-OVHUVTAXRP Change-Id: I16287ce2dbea034db41450a3a5e9c3f729e76335 --- camera/common/default/Android.bp | 5 +- camera/common/default/HandleImporter.cpp | 399 +++--------------- .../common/default/include/HandleImporter.h | 26 +- camera/device/1.0/default/Android.bp | 1 + camera/device/3.2/default/Android.bp | 1 + camera/device/3.4/default/Android.bp | 1 + .../default/ExternalCameraDeviceSession.cpp | 25 +- camera/device/3.5/default/Android.bp | 2 + camera/device/3.6/default/Android.bp | 1 + .../default/ExternalCameraOfflineSession.cpp | 25 +- camera/device/default/Android.bp | 3 +- .../default/ExternalCameraDeviceSession.cpp | 20 +- .../default/ExternalCameraDeviceSession.h | 4 + .../default/ExternalCameraOfflineSession.cpp | 22 +- camera/device/default/ExternalCameraUtils.h | 6 + 15 files changed, 157 insertions(+), 384 deletions(-) diff --git a/camera/common/default/Android.bp b/camera/common/default/Android.bp index e8c8f9dba0..b5d3095cff 100644 --- a/camera/common/default/Android.bp +++ b/camera/common/default/Android.bp @@ -30,13 +30,12 @@ cc_library_static { "libgralloctypes", "libhardware", "libcamera_metadata", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", "libexif", + "libui", ], include_dirs: ["system/media/private/camera/include"], export_include_dirs: ["include"], + export_shared_lib_headers: ["libui"], } // NOTE: Deprecated module kept for compatibility reasons. diff --git a/camera/common/default/HandleImporter.cpp b/camera/common/default/HandleImporter.cpp index 1145baa5f1..9c579e59a1 100644 --- a/camera/common/default/HandleImporter.cpp +++ b/camera/common/default/HandleImporter.cpp @@ -17,9 +17,10 @@ #define LOG_TAG "HandleImporter" #include "HandleImporter.h" +#include #include #include -#include "aidl/android/hardware/graphics/common/Smpte2086.h" +#include namespace android { namespace hardware { @@ -31,12 +32,6 @@ using aidl::android::hardware::graphics::common::PlaneLayout; using aidl::android::hardware::graphics::common::PlaneLayoutComponent; using aidl::android::hardware::graphics::common::PlaneLayoutComponentType; using aidl::android::hardware::graphics::common::Smpte2086; -using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType; -using MapperErrorV2 = android::hardware::graphics::mapper::V2_0::Error; -using MapperErrorV3 = android::hardware::graphics::mapper::V3_0::Error; -using MapperErrorV4 = android::hardware::graphics::mapper::V4_0::Error; -using IMapperV3 = android::hardware::graphics::mapper::V3_0::IMapper; -using IMapperV4 = android::hardware::graphics::mapper::V4_0::IMapper; HandleImporter::HandleImporter() : mInitialized(false) {} @@ -45,51 +40,20 @@ void HandleImporter::initializeLocked() { return; } - mMapperV4 = IMapperV4::getService(); - if (mMapperV4 != nullptr) { - mInitialized = true; - return; - } - - mMapperV3 = IMapperV3::getService(); - if (mMapperV3 != nullptr) { - mInitialized = true; - return; - } - - mMapperV2 = IMapper::getService(); - if (mMapperV2 == nullptr) { - ALOGE("%s: cannnot acccess graphics mapper HAL!", __FUNCTION__); - return; - } - + GraphicBufferMapper::preloadHal(); mInitialized = true; return; } void HandleImporter::cleanup() { - mMapperV4.clear(); - mMapperV3.clear(); - mMapperV2.clear(); mInitialized = false; } -template -bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& handle) { - E error; +bool HandleImporter::importBufferInternal(buffer_handle_t& handle) { buffer_handle_t importedHandle; - auto ret = mapper->importBuffer( - hidl_handle(handle), [&](const auto& tmpError, const auto& tmpBufferHandle) { - error = tmpError; - importedHandle = static_cast(tmpBufferHandle); - }); - - if (!ret.isOk()) { - ALOGE("%s: mapper importBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - return false; - } - - if (error != E::NONE) { + auto status = GraphicBufferMapper::get().importBufferNoValidate(handle, &importedHandle); + if (status != OK) { + ALOGE("%s: mapper importBuffer failed: %d", __FUNCTION__, status); return false; } @@ -97,170 +61,32 @@ bool HandleImporter::importBufferInternal(const sp mapper, buffer_handle_t& h return true; } -template -YCbCrLayout HandleImporter::lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, - uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - YCbCrLayout layout = {}; - - typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - mapper->lockYCbCr(buffer, cpuUsage, accessRegionCopy, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpLayout) { - if (tmpError == E::NONE) { - // Member by member copy from different versions of YCbCrLayout. - layout.y = tmpLayout.y; - layout.cb = tmpLayout.cb; - layout.cr = tmpLayout.cr; - layout.yStride = tmpLayout.yStride; - layout.cStride = tmpLayout.cStride; - layout.chromaStep = tmpLayout.chromaStep; - } else { - ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError); - } - }); - return layout; -} +android_ycbcr HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const android::Rect& accessRegion) { + Mutex::Autolock lock(mLock); -bool isMetadataPesent(const sp mapper, const buffer_handle_t& buf, - MetadataType metadataType) { - auto buffer = const_cast(buf); - bool ret = false; - hidl_vec vec; - mapper->get(buffer, metadataType, [&](const auto& tmpError, const auto& tmpMetadata) { - if (tmpError == MapperErrorV4::NONE) { - vec = tmpMetadata; - } else { - ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError); - } - }); - - if (vec.size() > 0) { - if (metadataType == gralloc4::MetadataType_Smpte2086) { - std::optional realSmpte2086; - gralloc4::decodeSmpte2086(vec, &realSmpte2086); - ret = realSmpte2086.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) { - std::optional> realSmpte2094_10; - gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10); - ret = realSmpte2094_10.has_value(); - } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) { - std::optional> realSmpte2094_40; - gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40); - ret = realSmpte2094_40.has_value(); - } else { - ALOGE("%s: Unknown metadata type!", __FUNCTION__); - } + if (!mInitialized) { + initializeLocked(); } + android_ycbcr layout; - return ret; -} + status_t status = GraphicBufferMapper::get().lockYCbCr(buf, cpuUsage, accessRegion, &layout); -std::vector getPlaneLayouts(const sp mapper, buffer_handle_t& buf) { - auto buffer = const_cast(buf); - std::vector planeLayouts; - hidl_vec encodedPlaneLayouts; - mapper->get(buffer, gralloc4::MetadataType_PlaneLayouts, - [&](const auto& tmpError, const auto& tmpEncodedPlaneLayouts) { - if (tmpError == MapperErrorV4::NONE) { - encodedPlaneLayouts = tmpEncodedPlaneLayouts; - } else { - ALOGE("%s: failed to get plane layouts %d!", __FUNCTION__, tmpError); - } - }); - - gralloc4::decodePlaneLayouts(encodedPlaneLayouts, &planeLayouts); - - return planeLayouts; -} - -template <> -YCbCrLayout HandleImporter::lockYCbCrInternal( - const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - YCbCrLayout layout = {}; - void* mapped = nullptr; - - typename IMapperV4::Rect accessRegionV4 = {accessRegion.left, accessRegion.top, - accessRegion.width, accessRegion.height}; - mapper->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV4::NONE) { - mapped = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - - if (mapped == nullptr) { - return layout; - } - - std::vector planeLayouts = getPlaneLayouts(mapper, buf); - for (const auto& planeLayout : planeLayouts) { - for (const auto& planeLayoutComponent : planeLayout.components) { - const auto& type = planeLayoutComponent.type; - - if (!gralloc4::isStandardPlaneLayoutComponentType(type)) { - continue; - } - - uint8_t* data = reinterpret_cast(mapped); - data += planeLayout.offsetInBytes; - data += planeLayoutComponent.offsetInBits / 8; - - switch (static_cast(type.value)) { - case PlaneLayoutComponentType::Y: - layout.y = data; - layout.yStride = planeLayout.strideInBytes; - break; - case PlaneLayoutComponentType::CB: - layout.cb = data; - layout.cStride = planeLayout.strideInBytes; - layout.chromaStep = planeLayout.sampleIncrementInBits / 8; - break; - case PlaneLayoutComponentType::CR: - layout.cr = data; - layout.cStride = planeLayout.strideInBytes; - layout.chromaStep = planeLayout.sampleIncrementInBits / 8; - break; - default: - break; - } - } + if (status != OK) { + ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, status); } return layout; } -template -int HandleImporter::unlockInternal(const sp mapper, buffer_handle_t& buf) { - int releaseFence = -1; - auto buffer = const_cast(buf); - - mapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) { - if (tmpError == E::NONE) { - auto fenceHandle = tmpReleaseFence.getNativeHandle(); - if (fenceHandle) { - if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) { - ALOGE("%s: bad release fence numInts %d numFds %d", __FUNCTION__, - fenceHandle->numInts, fenceHandle->numFds); - return; - } - releaseFence = dup(fenceHandle->data[0]); - if (releaseFence < 0) { - ALOGE("%s: bad release fence FD %d", __FUNCTION__, releaseFence); - } - } - } else { - ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError); - } - }); - return releaseFence; +std::vector getPlaneLayouts(buffer_handle_t& buf) { + std::vector planeLayouts; + status_t status = GraphicBufferMapper::get().getPlaneLayouts(buf, &planeLayouts); + if (status != OK) { + ALOGE("%s: failed to get PlaneLayouts! Status %d", __FUNCTION__, status); + } + + return planeLayouts; } // In IComposer, any buffer_handle_t is owned by the caller and we need to @@ -277,20 +103,7 @@ bool HandleImporter::importBuffer(buffer_handle_t& handle) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return importBufferInternal(mMapperV4, handle); - } - - if (mMapperV3 != nullptr) { - return importBufferInternal(mMapperV3, handle); - } - - if (mMapperV2 != nullptr) { - return importBufferInternal(mMapperV2, handle); - } - - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return false; + return importBufferInternal(handle); } void HandleImporter::freeBuffer(buffer_handle_t handle) { @@ -303,21 +116,9 @@ void HandleImporter::freeBuffer(buffer_handle_t handle) { initializeLocked(); } - if (mMapperV4 != nullptr) { - auto ret = mMapperV4->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } - } else if (mMapperV3 != nullptr) { - auto ret = mMapperV3->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } - } else { - auto ret = mMapperV2->freeBuffer(const_cast(handle)); - if (!ret.isOk()) { - ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str()); - } + status_t status = GraphicBufferMapper::get().freeBuffer(handle); + if (status != OK) { + ALOGE("%s: mapper freeBuffer failed. Status %d", __FUNCTION__, status); } } @@ -345,12 +146,12 @@ void HandleImporter::closeFence(int fd) const { } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size) { - IMapper::Rect accessRegion{0, 0, static_cast(size), 1}; + android::Rect accessRegion{0, 0, static_cast(size), 1}; return lock(buf, cpuUsage, accessRegion); } void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { + const android::Rect& accessRegion) { Mutex::Autolock lock(mLock); if (!mInitialized) { @@ -358,81 +159,18 @@ void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, } void* ret = nullptr; - - if (mMapperV4 == nullptr && mMapperV3 == nullptr && mMapperV2 == nullptr) { - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return ret; - } - - hidl_handle acquireFenceHandle; - auto buffer = const_cast(buf); - if (mMapperV4 != nullptr) { - IMapperV4::Rect accessRegionV4{accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - - mMapperV4->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV4::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - } else if (mMapperV3 != nullptr) { - IMapperV3::Rect accessRegionV3{accessRegion.left, accessRegion.top, accessRegion.width, - accessRegion.height}; - - mMapperV3->lock(buffer, cpuUsage, accessRegionV3, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr, const auto& /*bytesPerPixel*/, - const auto& /*bytesPerStride*/) { - if (tmpError == MapperErrorV3::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); - } else { - mMapperV2->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpPtr) { - if (tmpError == MapperErrorV2::NONE) { - ret = tmpPtr; - } else { - ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError); - } - }); + status_t status = GraphicBufferMapper::get().lock(buf, cpuUsage, accessRegion, &ret); + if (status != OK) { + ALOGE("%s: failed to lock error %d!", __FUNCTION__, status); } ALOGV("%s: ptr %p accessRegion.top: %d accessRegion.left: %d accessRegion.width: %d " "accessRegion.height: %d", - __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width, - accessRegion.height); + __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width(), + accessRegion.height()); return ret; } -YCbCrLayout HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion) { - Mutex::Autolock lock(mLock); - - if (!mInitialized) { - initializeLocked(); - } - - if (mMapperV4 != nullptr) { - return lockYCbCrInternal(mMapperV4, buf, cpuUsage, accessRegion); - } - - if (mMapperV3 != nullptr) { - return lockYCbCrInternal(mMapperV3, buf, cpuUsage, accessRegion); - } - - if (mMapperV2 != nullptr) { - return lockYCbCrInternal(mMapperV2, buf, cpuUsage, accessRegion); - } - - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return {}; -} - status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/) { if (stride == nullptr) { return BAD_VALUE; @@ -444,35 +182,26 @@ status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t initializeLocked(); } - if (mMapperV4 != nullptr) { - std::vector planeLayouts = getPlaneLayouts(mMapperV4, buf); - if (planeLayouts.size() != 1) { - ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); - return BAD_VALUE; - } - - *stride = planeLayouts[0].strideInBytes; - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); - return NO_INIT; + std::vector planeLayouts = getPlaneLayouts(buf); + if (planeLayouts.size() != 1) { + ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size()); + return BAD_VALUE; } + *stride = planeLayouts[0].strideInBytes; + return OK; } int HandleImporter::unlock(buffer_handle_t& buf) { - if (mMapperV4 != nullptr) { - return unlockInternal(mMapperV4, buf); - } - if (mMapperV3 != nullptr) { - return unlockInternal(mMapperV3, buf); - } - if (mMapperV2 != nullptr) { - return unlockInternal(mMapperV2, buf); + int releaseFence = -1; + + status_t status = GraphicBufferMapper::get().unlockAsync(buf, &releaseFence); + if (status != OK) { + ALOGE("%s: failed to unlock error %d!", __FUNCTION__, status); } - ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__); - return -1; + return releaseFence; } bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { @@ -481,14 +210,14 @@ bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) { if (!mInitialized) { initializeLocked(); } - - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2086); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional metadata; + status_t status = GraphicBufferMapper::get().getSmpte2086(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { @@ -498,13 +227,14 @@ bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_10); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional> metadata; + status_t status = GraphicBufferMapper::get().getSmpte2094_10(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { @@ -514,13 +244,14 @@ bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) { initializeLocked(); } - if (mMapperV4 != nullptr) { - return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_40); - } else { - ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__); + std::optional> metadata; + status_t status = GraphicBufferMapper::get().getSmpte2094_40(buf, &metadata); + if (status != OK) { + ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status); + return false; } - return false; + return metadata.has_value(); } } // namespace helper diff --git a/camera/common/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h index 5408ba92e6..df01202224 100644 --- a/camera/common/default/include/HandleImporter.h +++ b/camera/common/default/include/HandleImporter.h @@ -17,15 +17,11 @@ #ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H #define CAMERA_COMMON_1_0_HANDLEIMPORTED_H -#include -#include -#include #include +#include +#include #include -using android::hardware::graphics::mapper::V2_0::IMapper; -using android::hardware::graphics::mapper::V2_0::YCbCrLayout; - namespace android { namespace hardware { namespace camera { @@ -49,11 +45,11 @@ class HandleImporter { void* lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size); // Locks 2-D buffer. Assumes caller has waited for acquire fences. - void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const IMapper::Rect& accessRegion); + void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const android::Rect& accessRegion); // Assumes caller has waited for acquire fences. - YCbCrLayout lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion); + android_ycbcr lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage, + const android::Rect& accessRegion); // Query the stride of the first plane in bytes. status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/); @@ -69,19 +65,11 @@ class HandleImporter { void initializeLocked(); void cleanup(); - template - bool importBufferInternal(const sp mapper, buffer_handle_t& handle); - template - YCbCrLayout lockYCbCrInternal(const sp mapper, buffer_handle_t& buf, uint64_t cpuUsage, - const IMapper::Rect& accessRegion); - template - int unlockInternal(const sp mapper, buffer_handle_t& buf); + bool importBufferInternal(buffer_handle_t& handle); + int unlockInternal(buffer_handle_t& buf); Mutex mLock; bool mInitialized; - sp mMapperV2; - sp mMapperV3; - sp mMapperV4; }; } // namespace helper diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp index 9ff6480d4b..6992ff0294 100644 --- a/camera/device/1.0/default/Android.bp +++ b/camera/device/1.0/default/Android.bp @@ -32,6 +32,7 @@ cc_library_shared { "libgralloctypes", "libhardware", "libcamera_metadata", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp index a1962915ff..adf834ac53 100644 --- a/camera/device/3.2/default/Android.bp +++ b/camera/device/3.2/default/Android.bp @@ -30,6 +30,7 @@ cc_library_shared { "libhardware", "libcamera_metadata", "libfmq", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/Android.bp b/camera/device/3.4/default/Android.bp index 9f0c77739a..100106e437 100644 --- a/camera/device/3.4/default/Android.bp +++ b/camera/device/3.4/default/Android.bp @@ -106,6 +106,7 @@ cc_library_shared { "libjpeg", "libexif", "libtinyxml2", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper", diff --git a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp index ca7186b18d..01b3d41ff7 100644 --- a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp @@ -1574,14 +1574,23 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect {0, 0, - static_cast(halBuf.width), - static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( - *(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", - __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, - outLayout.yStride, outLayout.cStride, outLayout.chromaStep); + android::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + android_ycbcr result = + sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/3.5/default/Android.bp b/camera/device/3.5/default/Android.bp index 9d27b321e0..bc15629da0 100644 --- a/camera/device/3.5/default/Android.bp +++ b/camera/device/3.5/default/Android.bp @@ -46,6 +46,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", @@ -81,6 +82,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/Android.bp b/camera/device/3.6/default/Android.bp index 89ee145820..b4a486ff26 100644 --- a/camera/device/3.6/default/Android.bp +++ b/camera/device/3.6/default/Android.bp @@ -41,6 +41,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl", diff --git a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp index e606fda832..1f1dfee146 100644 --- a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp @@ -222,14 +222,23 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect {0, 0, - static_cast(halBuf.width), - static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( - *(halBuf.bufPtr), halBuf.usage, outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", - __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr, - outLayout.yStride, outLayout.cStride, outLayout.chromaStep); + android::Rect outRect{0, 0, static_cast(halBuf.width), + static_cast(halBuf.height)}; + android_ycbcr result = + sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = V3_4::implementation::getFourCcFromLayout(outLayout); diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp index b9f10d6fd6..5fbcb5d89a 100644 --- a/camera/device/default/Android.bp +++ b/camera/device/default/Android.bp @@ -40,7 +40,7 @@ cc_library_shared { shared_libs: [ "android.hardware.camera.common-V1-ndk", "android.hardware.camera.device-V1-ndk", - "android.hardware.graphics.allocator-V1-ndk", + "android.hardware.graphics.allocator-V2-ndk", "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@4.0", @@ -60,6 +60,7 @@ cc_library_shared { "libsync", "libtinyxml2", "libutils", + "libui", "libyuv", ], static_libs: [ diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp index 95a36f0615..896e0daa0b 100644 --- a/camera/device/default/ExternalCameraDeviceSession.cpp +++ b/camera/device/default/ExternalCameraDeviceSession.cpp @@ -2882,13 +2882,23 @@ bool ExternalCameraDeviceSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + android::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + android_ycbcr result = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, - outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, - outLayout.chromaStep); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h index 836266f3de..736bfd1528 100644 --- a/camera/device/default/ExternalCameraDeviceSession.h +++ b/camera/device/default/ExternalCameraDeviceSession.h @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -55,6 +58,7 @@ using ::android::base::unique_fd; using ::android::hardware::camera::common::helper::SimpleThread; using ::android::hardware::camera::external::common::ExternalCameraConfig; using ::android::hardware::camera::external::common::SizeHasher; +using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; using ::ndk::ScopedAStatus; class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputThreadInterface { diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp index 4c7f732f87..53bd44f4fa 100644 --- a/camera/device/default/ExternalCameraOfflineSession.cpp +++ b/camera/device/default/ExternalCameraOfflineSession.cpp @@ -486,13 +486,23 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } break; case PixelFormat::YCBCR_420_888: case PixelFormat::YV12: { - IMapper::Rect outRect{0, 0, static_cast(halBuf.width), + android::Rect outRect{0, 0, static_cast(halBuf.width), static_cast(halBuf.height)}; - YCbCrLayout outLayout = sHandleImporter.lockYCbCr( + android_ycbcr result = sHandleImporter.lockYCbCr( *(halBuf.bufPtr), static_cast(halBuf.usage), outRect); - ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__, - outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride, - outLayout.chromaStep); + ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__, + result.y, result.cb, result.cr, result.ystride, result.cstride, + result.chroma_step); + if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX || + result.chroma_step > UINT32_MAX) { + return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__); + } + YCbCrLayout outLayout = {.y = result.y, + .cb = result.cb, + .cr = result.cr, + .yStride = static_cast(result.ystride), + .cStride = static_cast(result.cstride), + .chromaStep = static_cast(result.chroma_step)}; // Convert to output buffer size/format uint32_t outputFourcc = getFourCcFromLayout(outLayout); @@ -544,4 +554,4 @@ bool ExternalCameraOfflineSession::OutputThread::threadLoop() { } // namespace device } // namespace camera } // namespace hardware -} // namespace android \ No newline at end of file +} // namespace android diff --git a/camera/device/default/ExternalCameraUtils.h b/camera/device/default/ExternalCameraUtils.h index b37933ce7e..d434905bd8 100644 --- a/camera/device/default/ExternalCameraUtils.h +++ b/camera/device/default/ExternalCameraUtils.h @@ -25,7 +25,11 @@ #include #include #include +#include +#include +#include #include +#include #include #include @@ -37,6 +41,8 @@ using ::aidl::android::hardware::graphics::common::BufferUsage; using ::aidl::android::hardware::graphics::common::PixelFormat; using ::android::hardware::camera::common::V1_0::helper::CameraMetadata; using ::android::hardware::camera::common::V1_0::helper::HandleImporter; +using ::android::hardware::graphics::mapper::V2_0::IMapper; +using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout; namespace android { namespace hardware { -- GitLab From 7d7a24d5f6adb75b83ab2387ebc55d5a51de51a2 Mon Sep 17 00:00:00 2001 From: sergiuferentz Date: Wed, 27 Sep 2023 03:13:04 +0000 Subject: [PATCH 165/376] Bump android.hardware.graphics.common V4->V5 Test: Build Bug: 291142745 Change-Id: Ib0002feb982ffcc37fa7b69493c644b7a835cf4f --- automotive/evs/aidl/Android.bp | 6 +++--- camera/device/aidl/Android.bp | 6 +++--- graphics/Android.bp | 4 ++-- graphics/allocator/aidl/Android.bp | 4 ++-- graphics/common/aidl/Android.bp | 2 +- graphics/composer/aidl/Android.bp | 6 +++--- graphics/mapper/4.0/utils/vts/Android.bp | 2 +- neuralnetworks/aidl/Android.bp | 10 +++++----- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp index bafb4af30f..3bfe8f3069 100644 --- a/automotive/evs/aidl/Android.bp +++ b/automotive/evs/aidl/Android.bp @@ -30,7 +30,7 @@ aidl_interface { stability: "vintf", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], backend: { java: { @@ -53,14 +53,14 @@ aidl_interface { version: "1", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, { version: "2", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp index 43a3934e74..1a665fb153 100644 --- a/camera/device/aidl/Android.bp +++ b/camera/device/aidl/Android.bp @@ -18,7 +18,7 @@ aidl_interface { "android.hardware.common.fmq-V1", "android.hardware.camera.common-V1", "android.hardware.camera.metadata-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], backend: { cpp: { @@ -37,7 +37,7 @@ aidl_interface { "android.hardware.common.fmq-V1", "android.hardware.camera.common-V1", "android.hardware.camera.metadata-V1", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, { @@ -47,7 +47,7 @@ aidl_interface { "android.hardware.common.fmq-V1", "android.hardware.camera.common-V1", "android.hardware.camera.metadata-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, diff --git a/graphics/Android.bp b/graphics/Android.bp index 8a69f0950e..cae5292752 100644 --- a/graphics/Android.bp +++ b/graphics/Android.bp @@ -39,14 +39,14 @@ cc_defaults { cc_defaults { name: "android.hardware.graphics.common-ndk_static", static_libs: [ - "android.hardware.graphics.common-V4-ndk", + "android.hardware.graphics.common-V5-ndk", ], } cc_defaults { name: "android.hardware.graphics.common-ndk_shared", shared_libs: [ - "android.hardware.graphics.common-V4-ndk", + "android.hardware.graphics.common-V5-ndk", ], } diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp index a3a2c554ca..03628b058b 100644 --- a/graphics/allocator/aidl/Android.bp +++ b/graphics/allocator/aidl/Android.bp @@ -18,7 +18,7 @@ aidl_interface { srcs: ["android/hardware/graphics/allocator/*.aidl"], imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], stability: "vintf", backend: { @@ -49,7 +49,7 @@ aidl_interface { version: "2", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp index 142c7c17be..f177a41768 100644 --- a/graphics/common/aidl/Android.bp +++ b/graphics/common/aidl/Android.bp @@ -15,7 +15,7 @@ aidl_interface { enabled: true, support_system_process: true, }, - vndk_use_version: "4", + vndk_use_version: "5", srcs: [ "android/hardware/graphics/common/*.aidl", ], diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp index c105ad4b6e..5699895693 100644 --- a/graphics/composer/aidl/Android.bp +++ b/graphics/composer/aidl/Android.bp @@ -38,7 +38,7 @@ aidl_interface { ], stability: "vintf", imports: [ - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", "android.hardware.common-V2", ], backend: { @@ -62,14 +62,14 @@ aidl_interface { { version: "1", imports: [ - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", "android.hardware.common-V2", ], }, { version: "2", imports: [ - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", "android.hardware.common-V2", ], }, diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp index 51e871b2d6..7815d41b5b 100644 --- a/graphics/mapper/4.0/utils/vts/Android.bp +++ b/graphics/mapper/4.0/utils/vts/Android.bp @@ -47,7 +47,7 @@ cc_library_static { ], export_static_lib_headers: [ "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.common-V4-ndk", + "android.hardware.graphics.common-V5-ndk", "android.hardware.graphics.mapper@4.0", ], export_include_dirs: ["include"], diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp index be868797d1..145604cbd3 100644 --- a/neuralnetworks/aidl/Android.bp +++ b/neuralnetworks/aidl/Android.bp @@ -17,7 +17,7 @@ aidl_interface { stability: "vintf", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], backend: { java: { @@ -40,28 +40,28 @@ aidl_interface { version: "1", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, { version: "2", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, { version: "3", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, { version: "4", imports: [ "android.hardware.common-V2", - "android.hardware.graphics.common-V4", + "android.hardware.graphics.common-V5", ], }, -- GitLab From 14960cae33017f6202b37b8ba9d5aa38f955da4c Mon Sep 17 00:00:00 2001 From: sergiuferentz Date: Thu, 31 Aug 2023 13:33:34 +0000 Subject: [PATCH 166/376] Modifying Dataspace.aidl to add additional HAL_ Datapoints present in graphics/**/swapchain.cpp Bug: 291142745 Change-Id: I54a41f3170b6c21f1c1b12aec40a8ce928f9163f --- .../hardware/graphics/common/Dataspace.aidl | 2 ++ .../hardware/graphics/common/Dataspace.aidl | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl index d9ff5aabed..6ed5bb2183 100644 --- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl @@ -81,9 +81,11 @@ enum Dataspace { DISPLAY_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */, DISPLAY_P3 = (((10 << 16) | (2 << 22)) | (1 << 27)) /* 143261696 */, ADOBE_RGB = (((11 << 16) | (4 << 22)) | (1 << 27)) /* 151715840 */, + ADOBE_RGB_LINEAR = (((11 << 16) | (1 << 22)) | (1 << 27)) /* 139132928 */, BT2020_LINEAR = (((6 << 16) | (1 << 22)) | (1 << 27)) /* 138805248 */, BT2020 = (((6 << 16) | (3 << 22)) | (1 << 27)) /* 147193856 */, BT2020_PQ = (((6 << 16) | (7 << 22)) | (1 << 27)) /* 163971072 */, + BT2020_LINEAR_EXTENDED = (((6 << 16) | (1 << 22)) | (3 << 27)) /* 407240704 */, DEPTH = 0x1000, SENSOR = 0x1001, BT2020_ITU = (((6 << 16) | (3 << 22)) | (2 << 27)) /* 281411584 */, diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl index 4b6613e914..79737eb885 100644 --- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl +++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl @@ -558,6 +558,13 @@ enum Dataspace { */ ADOBE_RGB = 11 << 16 | 4 << 22 | 1 << 27, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL + /** + * Adobe RGB LINEAR + * + * Use full range, linear transfer and Adobe RGB primaries + */ + ADOBE_RGB_LINEAR = 11 << 16 | 1 << 22 | 1 << 27, // STANDARD_ADOBE_RGB | TRANSFER_LINEAR | RANGE_FULL + /** * ITU-R Recommendation 2020 (BT.2020) * @@ -585,6 +592,15 @@ enum Dataspace { */ BT2020_PQ = 6 << 16 | 7 << 22 | 1 << 27, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL + /** + * ITU-R Recommendation 2020 (BT.2020) + * + * Ultra High-definition television + * + * Use extended range, linear transfer and BT2020 standard + */ + BT2020_LINEAR_EXTENDED = 6 << 16 | 1 << 22 | 3 << 27, // STANDARD_BT2020 | TRANSFER_LINEAR | RANGE_EXTENDED + /** * Data spaces for non-color formats */ -- GitLab From fd98b872239c9c399d802b3727a5a165f2a4ddb4 Mon Sep 17 00:00:00 2001 From: yomna Date: Wed, 4 Oct 2023 22:26:57 +0000 Subject: [PATCH 167/376] setNullCipherAndIntegrityEnabled VTS to no longer return REQUEST_NOT_SUPPORTED Mark setNullCipherAndIntegrityEnabled are required-to-support. Bug: 303307414 Test: m & atest VtsHalRadioTargetTest Change-Id: I05a4a0791f4cad2f3044778657ae2a13795433a7 --- .../radio/network/IRadioNetworkResponse.aidl | 2 -- radio/aidl/vts/radio_network_test.cpp | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl index db37a0e649..0889832271 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl @@ -623,7 +623,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED */ void setNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info); @@ -635,7 +634,6 @@ oneway interface IRadioNetworkResponse { * RadioError:NONE * RadioError:RADIO_NOT_AVAILABLE * RadioError:MODEM_ERR - * RadioError:REQUEST_NOT_SUPPORTED */ void isNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info, in boolean isEnabled); diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index 6643c1e7ff..4e84116e7b 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -1931,9 +1931,9 @@ TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, - RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); } /** @@ -1958,7 +1958,7 @@ TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type); EXPECT_EQ(serial, radioRsp_network->rspInfo.serial); - ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, - {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, - RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED})); + ASSERT_TRUE(CheckAnyOfErrors( + radioRsp_network->rspInfo.error, + {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR})); } -- GitLab From ce33864049635d3700fcd751360d1739026780cf Mon Sep 17 00:00:00 2001 From: Vlad Popa Date: Thu, 21 Sep 2023 18:54:03 -0700 Subject: [PATCH 168/376] CSD: Add default AIDL HAL implementation This should enable the sound dose gts on cuttlefish devices. The sound dose HAL uses the internal MelProcessor to compute the MELs which are reported to the framework. Test: atest GtsAudioTestCases:SoundDoseTest Bug: 301527435 Change-Id: Ifc505a0171bc8b4d3f5cf65d950fa5c0f812087f --- audio/aidl/default/Android.bp | 15 ++++ audio/aidl/default/Module.cpp | 7 +- audio/aidl/default/SoundDose.cpp | 89 +++++++++++++++++++ audio/aidl/default/Stream.cpp | 12 +++ audio/aidl/default/include/core-impl/Module.h | 2 +- .../default/include/core-impl/SoundDose.h | 57 ++++++++++-- audio/aidl/default/include/core-impl/Stream.h | 10 +++ .../default/include/core-impl/StreamPrimary.h | 4 + audio/aidl/default/primary/StreamPrimary.cpp | 15 +++- 9 files changed, 202 insertions(+), 9 deletions(-) diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp index bb8d76f8fc..af12e75e8c 100644 --- a/audio/aidl/default/Android.bp +++ b/audio/aidl/default/Android.bp @@ -46,11 +46,20 @@ cc_library { "SoundDose.cpp", ], shared_libs: [ + "libaudio_aidl_conversion_common_ndk", + "libaudioutils", "libbase", "libbinder_ndk", "libcutils", "libutils", ], + cflags: [ + "-Wall", + "-Wextra", + "-Werror", + "-Wthread-safety", + "-DBACKEND_NDK", + ], visibility: [ "//hardware/interfaces/audio/aidl/sounddose/default", ], @@ -111,8 +120,12 @@ cc_library { shared_libs: [ "android.hardware.bluetooth.audio-V3-ndk", "libaudio_aidl_conversion_common_ndk", + "libaudioutils", + "libaudioutils_nonvndk", "libbluetooth_audio_session_aidl", + "liblog", "libmedia_helper", + "libmediautils_vendor", "libstagefright_foundation", ], export_shared_lib_headers: [ @@ -143,8 +156,10 @@ cc_binary { ], shared_libs: [ "android.hardware.bluetooth.audio-V3-ndk", + "libaudioutils_nonvndk", "libaudio_aidl_conversion_common_ndk", "libbluetooth_audio_session_aidl", + "liblog", "libmedia_helper", "libstagefright_foundation", ], diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp index 76132b38fe..c17e0becfb 100644 --- a/audio/aidl/default/Module.cpp +++ b/audio/aidl/default/Module.cpp @@ -189,6 +189,11 @@ ndk::ScopedAStatus Module::createStreamContext( StreamContext::DebugParameters params{mDebug.streamTransientStateDelayMs, mVendorDebug.forceTransientBurst, mVendorDebug.forceSynchronousDrain}; + std::shared_ptr soundDose; + if (!getSoundDose(&soundDose).isOk()) { + LOG(ERROR) << __func__ << ": could not create sound dose instance"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); + } StreamContext temp( std::make_unique(1, true /*configureEventFlagWord*/), std::make_unique(1, true /*configureEventFlagWord*/), @@ -196,7 +201,7 @@ ndk::ScopedAStatus Module::createStreamContext( portConfigIt->channelMask.value(), portConfigIt->sampleRate.value().value, flags, portConfigIt->ext.get().handle, std::make_unique(frameSize * in_bufferSizeFrames), - asyncCallback, outEventCallback, params); + asyncCallback, outEventCallback, mSoundDose.getInstance(), params); if (temp.isValid()) { *out_context = std::move(temp); } else { diff --git a/audio/aidl/default/SoundDose.cpp b/audio/aidl/default/SoundDose.cpp index f12ce5d806..1c9e081353 100644 --- a/audio/aidl/default/SoundDose.cpp +++ b/audio/aidl/default/SoundDose.cpp @@ -18,7 +18,15 @@ #include "core-impl/SoundDose.h" +#include #include +#include +#include + +using aidl::android::hardware::audio::core::sounddose::ISoundDose; +using aidl::android::media::audio::common::AudioDevice; +using aidl::android::media::audio::common::AudioDeviceDescription; +using aidl::android::media::audio::common::AudioFormatDescription; namespace aidl::android::hardware::audio::core::sounddose { @@ -28,11 +36,16 @@ ndk::ScopedAStatus SoundDose::setOutputRs2UpperBound(float in_rs2ValueDbA) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } + ::android::audio_utils::lock_guard l(mMutex); mRs2Value = in_rs2ValueDbA; + if (mMelProcessor != nullptr) { + mMelProcessor->setOutputRs2UpperBound(in_rs2ValueDbA); + } return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus SoundDose::getOutputRs2UpperBound(float* _aidl_return) { + ::android::audio_utils::lock_guard l(mMutex); *_aidl_return = mRs2Value; LOG(DEBUG) << __func__ << ": returning " << *_aidl_return; return ndk::ScopedAStatus::ok(); @@ -44,6 +57,8 @@ ndk::ScopedAStatus SoundDose::registerSoundDoseCallback( LOG(ERROR) << __func__ << ": Callback is nullptr"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } + + ::android::audio_utils::lock_guard l(mCbMutex); if (mCallback != nullptr) { LOG(ERROR) << __func__ << ": Sound dose callback was already registered"; return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE); @@ -51,7 +66,81 @@ ndk::ScopedAStatus SoundDose::registerSoundDoseCallback( mCallback = in_callback; LOG(DEBUG) << __func__ << ": Registered sound dose callback "; + return ndk::ScopedAStatus::ok(); } +void SoundDose::setAudioDevice(const AudioDevice& audioDevice) { + ::android::audio_utils::lock_guard l(mCbMutex); + mAudioDevice = audioDevice; +} + +void SoundDose::startDataProcessor(uint32_t sampleRate, uint32_t channelCount, + const AudioFormatDescription& aidlFormat) { + ::android::audio_utils::lock_guard l(mMutex); + const auto result = aidl2legacy_AudioFormatDescription_audio_format_t(aidlFormat); + const audio_format_t format = result.value_or(AUDIO_FORMAT_INVALID); + + if (mMelProcessor == nullptr) { + // we don't have the deviceId concept on the vendor side so just pass 0 + mMelProcessor = ::android::sp<::android::audio_utils::MelProcessor>::make( + sampleRate, channelCount, format, mMelCallback, /*deviceId=*/0, mRs2Value); + } else { + mMelProcessor->updateAudioFormat(sampleRate, channelCount, format); + } +} + +void SoundDose::process(const void* buffer, size_t bytes) { + ::android::audio_utils::lock_guard l(mMutex); + if (mMelProcessor != nullptr) { + mMelProcessor->process(buffer, bytes); + } +} + +void SoundDose::onNewMelValues(const std::vector& mels, size_t offset, size_t length, + audio_port_handle_t deviceId __attribute__((__unused__))) const { + ::android::audio_utils::lock_guard l(mCbMutex); + if (!mAudioDevice.has_value()) { + LOG(WARNING) << __func__ << ": New mel values without a registered device"; + return; + } + if (mCallback == nullptr) { + LOG(ERROR) << __func__ << ": New mel values without a registered callback"; + return; + } + + ISoundDose::IHalSoundDoseCallback::MelRecord melRecord; + melRecord.timestamp = nanoseconds_to_seconds(systemTime()); + melRecord.melValues = std::vector(mels.begin() + offset, mels.begin() + offset + length); + + mCallback->onNewMelValues(melRecord, mAudioDevice.value()); +} + +void SoundDose::MelCallback::onNewMelValues(const std::vector& mels, size_t offset, + size_t length, + audio_port_handle_t deviceId + __attribute__((__unused__))) const { + mSoundDose.onNewMelValues(mels, offset, length, deviceId); +} + +void SoundDose::onMomentaryExposure(float currentMel, audio_port_handle_t deviceId + __attribute__((__unused__))) const { + ::android::audio_utils::lock_guard l(mCbMutex); + if (!mAudioDevice.has_value()) { + LOG(WARNING) << __func__ << ": Momentary exposure without a registered device"; + return; + } + if (mCallback == nullptr) { + LOG(ERROR) << __func__ << ": Momentary exposure without a registered callback"; + return; + } + + mCallback->onMomentaryExposureWarning(currentMel, mAudioDevice.value()); +} + +void SoundDose::MelCallback::onMomentaryExposure(float currentMel, audio_port_handle_t deviceId + __attribute__((__unused__))) const { + mSoundDose.onMomentaryExposure(currentMel, deviceId); +} + } // namespace aidl::android::hardware::audio::core::sounddose diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp index f7298c0286..f00e35833a 100644 --- a/audio/aidl/default/Stream.cpp +++ b/audio/aidl/default/Stream.cpp @@ -90,6 +90,14 @@ bool StreamContext::isValid() const { return true; } +void StreamContext::startStreamDataProcessor() { + auto streamDataProcessor = mStreamDataProcessor.lock(); + if (streamDataProcessor != nullptr) { + streamDataProcessor->startDataProcessor(mSampleRate, getChannelCount(mChannelLayout), + mFormat); + } +} + void StreamContext::reset() { mCommandMQ.reset(); mReplyMQ.reset(); @@ -593,6 +601,10 @@ bool StreamOutWorkerLogic::write(size_t clientSize, StreamDescriptor::Reply* rep fatal = true; LOG(ERROR) << __func__ << ": write failed: " << status; } + auto streamDataProcessor = mContext->getStreamDataProcessor().lock(); + if (streamDataProcessor != nullptr) { + streamDataProcessor->process(mDataBuffer.get(), actualFrameCount * frameSize); + } } else { if (mContext->getAsyncCallback() == nullptr) { usleep(3000); // Simulate blocking transfer delay. diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h index bfdab51454..b5c92a230b 100644 --- a/audio/aidl/default/include/core-impl/Module.h +++ b/audio/aidl/default/include/core-impl/Module.h @@ -157,7 +157,7 @@ class Module : public BnModule { bool mMicMute = false; bool mMasterMute = false; float mMasterVolume = 1.0f; - ChildInterface mSoundDose; + ChildInterface mSoundDose; std::optional mIsMmapSupported; protected: diff --git a/audio/aidl/default/include/core-impl/SoundDose.h b/audio/aidl/default/include/core-impl/SoundDose.h index 2a069d9bac..82c1077f1b 100644 --- a/audio/aidl/default/include/core-impl/SoundDose.h +++ b/audio/aidl/default/include/core-impl/SoundDose.h @@ -20,23 +20,68 @@ #include #include - -using aidl::android::media::audio::common::AudioDevice; +#include +#include +#include namespace aidl::android::hardware::audio::core::sounddose { -class SoundDose : public BnSoundDose { +// Interface used for processing the data received by a stream. +class StreamDataProcessorInterface { + public: + virtual ~StreamDataProcessorInterface() = default; + + virtual void startDataProcessor( + uint32_t samplerate, uint32_t channelCount, + const ::aidl::android::media::audio::common::AudioFormatDescription& format) = 0; + virtual void setAudioDevice( + const ::aidl::android::media::audio::common::AudioDevice& audioDevice) = 0; + virtual void process(const void* buffer, size_t size) = 0; +}; + +class SoundDose final : public BnSoundDose, public StreamDataProcessorInterface { public: - SoundDose() : mRs2Value(DEFAULT_MAX_RS2){}; + SoundDose() : mMelCallback(::android::sp::make(this)){}; + // -------------------------------------- BnSoundDose ------------------------------------------ ndk::ScopedAStatus setOutputRs2UpperBound(float in_rs2ValueDbA) override; ndk::ScopedAStatus getOutputRs2UpperBound(float* _aidl_return) override; ndk::ScopedAStatus registerSoundDoseCallback( const std::shared_ptr& in_callback) override; + // ----------------------------- StreamDataProcessorInterface ---------------------------------- + void setAudioDevice( + const ::aidl::android::media::audio::common::AudioDevice& audioDevice) override; + void startDataProcessor( + uint32_t samplerate, uint32_t channelCount, + const ::aidl::android::media::audio::common::AudioFormatDescription& format) override; + void process(const void* buffer, size_t size) override; + private: - std::shared_ptr mCallback; - float mRs2Value; + class MelCallback : public ::android::audio_utils::MelProcessor::MelCallback { + public: + explicit MelCallback(SoundDose* soundDose) : mSoundDose(*soundDose) {} + + // ------------------------------------ MelCallback ---------------------------------------- + void onNewMelValues(const std::vector& mels, size_t offset, size_t length, + audio_port_handle_t deviceId) const override; + void onMomentaryExposure(float currentMel, audio_port_handle_t deviceId) const override; + + SoundDose& mSoundDose; // must outlive MelCallback, not owning + }; + + void onNewMelValues(const std::vector& mels, size_t offset, size_t length, + audio_port_handle_t deviceId) const; + void onMomentaryExposure(float currentMel, audio_port_handle_t deviceId) const; + + mutable ::android::audio_utils::mutex mCbMutex; + std::shared_ptr mCallback GUARDED_BY(mCbMutex); + std::optional<::aidl::android::media::audio::common::AudioDevice> mAudioDevice + GUARDED_BY(mCbMutex); + mutable ::android::audio_utils::mutex mMutex; + float mRs2Value GUARDED_BY(mMutex) = DEFAULT_MAX_RS2; + ::android::sp<::android::audio_utils::MelProcessor> mMelProcessor GUARDED_BY(mMutex); + ::android::sp mMelCallback GUARDED_BY(mMutex); }; } // namespace aidl::android::hardware::audio::core::sounddose diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h index 88fddec233..daa920d9b5 100644 --- a/audio/aidl/default/include/core-impl/Stream.h +++ b/audio/aidl/default/include/core-impl/Stream.h @@ -44,6 +44,7 @@ #include #include "core-impl/ChildInterface.h" +#include "core-impl/SoundDose.h" #include "core-impl/utils.h" namespace aidl::android::hardware::audio::core { @@ -87,6 +88,7 @@ class StreamContext { int32_t mixPortHandle, std::unique_ptr dataMQ, std::shared_ptr asyncCallback, std::shared_ptr outEventCallback, + std::weak_ptr streamDataProcessor, DebugParameters debugParameters) : mCommandMQ(std::move(commandMQ)), mInternalCommandCookie(std::rand()), @@ -100,6 +102,7 @@ class StreamContext { mDataMQ(std::move(dataMQ)), mAsyncCallback(asyncCallback), mOutEventCallback(outEventCallback), + mStreamDataProcessor(streamDataProcessor), mDebugParameters(debugParameters) {} StreamContext(StreamContext&& other) : mCommandMQ(std::move(other.mCommandMQ)), @@ -114,6 +117,7 @@ class StreamContext { mDataMQ(std::move(other.mDataMQ)), mAsyncCallback(std::move(other.mAsyncCallback)), mOutEventCallback(std::move(other.mOutEventCallback)), + mStreamDataProcessor(std::move(other.mStreamDataProcessor)), mDebugParameters(std::move(other.mDebugParameters)), mFrameCount(other.mFrameCount) {} StreamContext& operator=(StreamContext&& other) { @@ -129,6 +133,7 @@ class StreamContext { mDataMQ = std::move(other.mDataMQ); mAsyncCallback = std::move(other.mAsyncCallback); mOutEventCallback = std::move(other.mOutEventCallback); + mStreamDataProcessor = std::move(other.mStreamDataProcessor); mDebugParameters = std::move(other.mDebugParameters); mFrameCount = other.mFrameCount; return *this; @@ -154,6 +159,10 @@ class StreamContext { std::shared_ptr getOutEventCallback() const { return mOutEventCallback; } + std::weak_ptr getStreamDataProcessor() const { + return mStreamDataProcessor; + } + void startStreamDataProcessor(); int getPortId() const { return mPortId; } ReplyMQ* getReplyMQ() const { return mReplyMQ.get(); } int getTransientStateDelayMs() const { return mDebugParameters.transientStateDelayMs; } @@ -179,6 +188,7 @@ class StreamContext { std::unique_ptr mDataMQ; std::shared_ptr mAsyncCallback; std::shared_ptr mOutEventCallback; // Only used by output streams + std::weak_ptr mStreamDataProcessor; DebugParameters mDebugParameters; long mFrameCount = 0; }; diff --git a/audio/aidl/default/include/core-impl/StreamPrimary.h b/audio/aidl/default/include/core-impl/StreamPrimary.h index b3ddd0bd53..b64b749ec5 100644 --- a/audio/aidl/default/include/core-impl/StreamPrimary.h +++ b/audio/aidl/default/include/core-impl/StreamPrimary.h @@ -79,6 +79,10 @@ class StreamOutPrimary final : public StreamOut, ndk::ScopedAStatus getHwVolume(std::vector* _aidl_return) override; ndk::ScopedAStatus setHwVolume(const std::vector& in_channelVolumes) override; + + ndk::ScopedAStatus setConnectedDevices( + const std::vector<::aidl::android::media::audio::common::AudioDevice>& devices) + override; }; } // namespace aidl::android::hardware::audio::core diff --git a/audio/aidl/default/primary/StreamPrimary.cpp b/audio/aidl/default/primary/StreamPrimary.cpp index e01be8a3c6..17de2baf7a 100644 --- a/audio/aidl/default/primary/StreamPrimary.cpp +++ b/audio/aidl/default/primary/StreamPrimary.cpp @@ -37,7 +37,9 @@ using android::base::GetBoolProperty; namespace aidl::android::hardware::audio::core { StreamPrimary::StreamPrimary(StreamContext* context, const Metadata& metadata) - : StreamAlsa(context, metadata, 3 /*readWriteRetries*/), mIsInput(isInput(metadata)) {} + : StreamAlsa(context, metadata, 3 /*readWriteRetries*/), mIsInput(isInput(metadata)) { + context->startStreamDataProcessor(); +} std::vector StreamPrimary::getDeviceProfiles() { static const std::vector kBuiltInSource{ @@ -183,4 +185,15 @@ ndk::ScopedAStatus StreamOutPrimary::setHwVolume(const std::vector& in_ch return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus StreamOutPrimary::setConnectedDevices( + const std::vector<::aidl::android::media::audio::common::AudioDevice>& devices) { + if (!devices.empty()) { + auto streamDataProcessor = mContextInstance.getStreamDataProcessor().lock(); + if (streamDataProcessor != nullptr) { + streamDataProcessor->setAudioDevice(devices[0]); + } + } + return StreamSwitcher::setConnectedDevices(devices); +} + } // namespace aidl::android::hardware::audio::core -- GitLab From efc2c9ab567d7f21f06b4fea82bc6fa6ff80ff08 Mon Sep 17 00:00:00 2001 From: yomna Date: Thu, 5 Oct 2023 20:17:33 +0000 Subject: [PATCH 169/376] Clarify IRadioNetwork also applies to satellite-based cellular connections. Clarify the functionality specified in IRadioNetwork applies to both terrestrial (earth-based) and extraterrestrial (satellite-based) cellular networks. Bug: 301483855 Test: m Change-Id: Id8d1508c68cbca868fc3471f0840883eeca163c7 --- radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index e4c385670d..878ad23582 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -32,6 +32,7 @@ import android.hardware.radio.network.UsageSetting; /** * This interface is used by telephony and telecom to talk to cellular radio for network APIs. + * All functions apply to both terrestrial and extraterrestrial (satellite) based cellular networks. * All the functions have minimum one parameter: * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the * duration of a method call. If clients provide colliding serials (including passing the same -- GitLab From a1828f9ad32239b3d6fe470a894f58a43ef01cd1 Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Fri, 6 Oct 2023 02:39:13 +0000 Subject: [PATCH 170/376] Generated EnumForVehicleProperty.java from VehicleProeprty.aidl Test: None Bug: 290972334 Change-Id: I4aa34b4a04cd5a1ce5c7524d0d409aa372675fb5 --- .../cpp/AccessForVehicleProperty.h | 2 +- .../cpp/ChangeModeForVehicleProperty.h | 2 +- .../java/AccessForVehicleProperty.java | 2 +- .../java/ChangeModeForVehicleProperty.java | 2 +- .../java/EnumForVehicleProperty.java | 99 +++++++++++++++++++ .../tools/generate_annotation_enums.py | 37 ++++++- 6 files changed, 136 insertions(+), 8 deletions(-) create mode 100644 automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index d0c6e83ebe..7c07e49b3b 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 48532c93ca..fec2f062af 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 758670d588..91af12df1c 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 29069f8de4..32e71c09ce 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java new file mode 100644 index 0000000000..144d0e1d4a --- /dev/null +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * DO NOT EDIT MANUALLY!!! + * + * Generated by tools/generate_annotation_enums.py. + */ + +// clang-format off + +package android.hardware.automotive.vehicle; + +import java.util.List; +import java.util.Map; + +public final class EnumForVehicleProperty { + + public static final Map>> values = Map.ofEntries( + Map.entry(VehicleProperty.INFO_FUEL_TYPE, List.of(FuelType.class)), + Map.entry(VehicleProperty.INFO_EV_CONNECTOR_TYPE, List.of(EvConnectorType.class)), + Map.entry(VehicleProperty.INFO_FUEL_DOOR_LOCATION, List.of(PortLocationType.class)), + Map.entry(VehicleProperty.INFO_EV_PORT_LOCATION, List.of(PortLocationType.class)), + Map.entry(VehicleProperty.INFO_DRIVER_SEAT, List.of(VehicleAreaSeat.class)), + Map.entry(VehicleProperty.INFO_MULTI_EV_PORT_LOCATIONS, List.of(PortLocationType.class)), + Map.entry(VehicleProperty.ENGINE_OIL_LEVEL, List.of(VehicleOilLevel.class)), + Map.entry(VehicleProperty.GEAR_SELECTION, List.of(VehicleGear.class)), + Map.entry(VehicleProperty.CURRENT_GEAR, List.of(VehicleGear.class)), + Map.entry(VehicleProperty.TURN_SIGNAL_STATE, List.of(VehicleTurnSignal.class)), + Map.entry(VehicleProperty.IGNITION_STATE, List.of(VehicleIgnitionState.class)), + Map.entry(VehicleProperty.EV_STOPPING_MODE, List.of(EvStoppingMode.class)), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, List.of(VehicleHvacFanDirection.class)), + Map.entry(VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS, List.of(VehicleUnit.class)), + Map.entry(VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, List.of(VehicleHvacFanDirection.class)), + Map.entry(VehicleProperty.DISTANCE_DISPLAY_UNITS, List.of(VehicleUnit.class)), + Map.entry(VehicleProperty.FUEL_VOLUME_DISPLAY_UNITS, List.of(VehicleUnit.class)), + Map.entry(VehicleProperty.TIRE_PRESSURE_DISPLAY_UNITS, List.of(VehicleUnit.class)), + Map.entry(VehicleProperty.EV_BATTERY_DISPLAY_UNITS, List.of(VehicleUnit.class)), + Map.entry(VehicleProperty.HW_ROTARY_INPUT, List.of(RotaryInputType.class)), + Map.entry(VehicleProperty.HW_CUSTOM_INPUT, List.of(CustomInputType.class)), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.SEAT_OCCUPANCY, List.of(VehicleSeatOccupancyState.class)), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, List.of(WindshieldWipersState.class)), + Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, List.of(WindshieldWipersSwitch.class)), + Map.entry(VehicleProperty.HEADLIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.FOG_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.HAZARD_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.HEADLIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.HAZARD_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.CABIN_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.CABIN_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.READING_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.READING_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, List.of(ElectronicTollCollectionCardType.class)), + Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, List.of(ElectronicTollCollectionCardStatus.class)), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_STATE, List.of(VehicleLightState.class)), + Map.entry(VehicleProperty.REAR_FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.EV_CHARGE_STATE, List.of(EvChargeState.class)), + Map.entry(VehicleProperty.EV_REGENERATIVE_BRAKING_STATE, List.of(EvRegenerativeBrakingState.class)), + Map.entry(VehicleProperty.TRAILER_PRESENT, List.of(TrailerState.class)), + Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, List.of(GsrComplianceRequirementType.class)), + Map.entry(VehicleProperty.SHUTDOWN_REQUEST, List.of(VehicleApPowerStateShutdownParam.class)), + Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, List.of(AutomaticEmergencyBrakingState.class, ErrorState.class)), + Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, List.of(ForwardCollisionWarningState.class, ErrorState.class)), + Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, List.of(BlindSpotWarningState.class, ErrorState.class)), + Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, List.of(LaneDepartureWarningState.class, ErrorState.class)), + Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, List.of(LaneKeepAssistState.class, ErrorState.class)), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, List.of(LaneCenteringAssistCommand.class)), + Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, List.of(LaneCenteringAssistState.class, ErrorState.class)), + Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_STATE, List.of(EmergencyLaneKeepAssistState.class, ErrorState.class)), + Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, List.of(CruiseControlType.class, ErrorState.class)), + Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, List.of(CruiseControlState.class, ErrorState.class)), + Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, List.of(CruiseControlCommand.class)), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, List.of(HandsOnDetectionDriverState.class, ErrorState.class)), + Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, List.of(HandsOnDetectionWarning.class, ErrorState.class)) + ); + +} diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py index fddc55b5f4..05fc99a231 100755 --- a/automotive/vehicle/tools/generate_annotation_enums.py +++ b/automotive/vehicle/tools/generate_annotation_enums.py @@ -18,7 +18,7 @@ Need ANDROID_BUILD_TOP environmental variable to be set. This script will update ChangeModeForVehicleProperty.h and AccessForVehicleProperty.h under generated_lib/cpp and - ChangeModeForVehicleProperty.java and AccessForVehicleProperty.java under generated_lib/java. + ChangeModeForVehicleProperty.java, AccessForVehicleProperty.java, EnumForVehicleProperty.java under generated_lib/java. Usage: $ python generate_annotation_enums.py @@ -40,6 +40,8 @@ CHANGE_MODE_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/gener 'ChangeModeForVehicleProperty.java') ACCESS_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' + 'AccessForVehicleProperty.java') +ENUM_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' + + 'EnumForVehicleProperty.java') SCRIPT_PATH = 'hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py' TAB = ' ' @@ -54,7 +56,7 @@ RE_UNIT = re.compile('\s*\* @unit (\S+)\s+') RE_VALUE = re.compile('\s*(\w+)\s*=(.*)') LICENSE = """/* - * Copyright (C) 2022 The Android Open Source Project + * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -167,6 +169,22 @@ ACCESS_JAVA_FOOTER = """ } """ +ENUM_JAVA_HEADER = """package android.hardware.automotive.vehicle; + +import java.util.List; +import java.util.Map; + +public final class EnumForVehicleProperty { + + public static final Map>> values = Map.ofEntries( +""" + +ENUM_JAVA_FOOTER = """ + ); + +} +""" + class PropertyConfig: """Represents one VHAL property definition in VehicleProperty.aidl.""" @@ -272,6 +290,11 @@ class FileParser: annotation = "VehiclePropertyAccess::" + config.access_modes[0] else: annotation = "VehiclePropertyAccess." + config.access_modes[0] + elif field == 'enum_types': + if len(config.enum_types) < 1: + continue; + if not cpp: + annotation = "List.of(" + ', '.join([class_name + ".class" for class_name in config.enum_types]) + ")" else: raise Exception('Unknown field: ' + field) if counter != 0: @@ -348,7 +371,7 @@ def main(): else: android_top = os.environ['ANDROID_BUILD_TOP'] if not android_top: - print('ANDROID_BUILD_TOP is not in envorinmental variable, please run source and lunch ' + + print('ANDROID_BUILD_TOP is not in environmental variable, please run source and lunch ' + 'at the android root') aidl_file = os.path.join(android_top, PROP_AIDL_FILE_PATH) @@ -363,6 +386,7 @@ def main(): access_cpp_file = os.path.join(android_top, ACCESS_CPP_FILE_PATH); change_mode_java_file = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH); access_java_file = os.path.join(android_top, ACCESS_JAVA_FILE_PATH); + enum_java_file = os.path.join(android_top, ENUM_JAVA_FILE_PATH); temp_files = [] if not args.check_only: @@ -370,6 +394,7 @@ def main(): access_cpp_output = access_cpp_file change_mode_java_output = change_mode_java_file access_java_output = access_java_file + enum_java_output = enum_java_file else: change_mode_cpp_output = createTempFile() temp_files.append(change_mode_cpp_output) @@ -379,6 +404,8 @@ def main(): temp_files.append(change_mode_java_output) access_java_output = createTempFile() temp_files.append(access_java_output) + enum_java_output = createTempFile() + temp_files.append(enum_java_output) try: f.convert(change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, @@ -387,6 +414,7 @@ def main(): CHANGE_MODE_JAVA_FOOTER, False, 'change_mode') f.convert(access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True, 'access_mode') f.convert(access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False, 'access_mode') + f.convert(enum_java_output, ENUM_JAVA_HEADER, ENUM_JAVA_FOOTER, False, 'enum_types') if not args.check_only: return @@ -394,7 +422,8 @@ def main(): if ((not filecmp.cmp(change_mode_cpp_output, change_mode_cpp_file)) or (not filecmp.cmp(change_mode_java_output, change_mode_java_file)) or (not filecmp.cmp(access_cpp_output, access_cpp_file)) or - (not filecmp.cmp(access_java_output, access_java_file))): + (not filecmp.cmp(access_java_output, access_java_file)) or + (not filecmp.cmp(enum_java_output, enum_java_file))): print('The generated enum files for VehicleProperty.aidl requires update, ') print('Run \npython ' + android_top + '/' + SCRIPT_PATH) sys.exit(1) -- GitLab From 077e36dee61db38ad8d0e28a62542e571e2921ae Mon Sep 17 00:00:00 2001 From: Tyler Trephan Date: Fri, 6 Oct 2023 02:46:45 +0000 Subject: [PATCH 171/376] Fixed spelling mistake in LaneCenteringAssistCommand Test: None Bug: 290972334 Change-Id: Ic85ba803abe349ea9a7edd7dca5cbe7159df34ac --- .../hardware/automotive/vehicle/VehicleProperty.aidl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 7d88810911..e762f36011 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -4737,11 +4737,11 @@ enum VehicleProperty { * * Commands to activate and suspend LCA. * - * When the command ACTIVATE from LaneCenteringAssistCommmand is sent, + * When the command ACTIVATE from LaneCenteringAssistCommand is sent, * LANE_CENTERING_ASSIST_STATE must be set to LaneCenteringAssistState#ACTIVATION_REQUESTED. * When the ACTIVATE command succeeds, LANE_CENTERING_ASSIST_STATE must be set to * LaneCenteringAssistState#ACTIVATED. When the command DEACTIVATE from - * LaneCenteringAssistCommmand succeeds, LANE_CENTERING_ASSIST_STATE must be set to + * LaneCenteringAssistCommand succeeds, LANE_CENTERING_ASSIST_STATE must be set to * LaneCenteringAssistState#ENABLED. * * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless @@ -4757,7 +4757,7 @@ enum VehicleProperty { * * @change_mode VehiclePropertyChangeMode.ON_CHANGE * @access VehiclePropertyAccess.WRITE - * @data_enum LaneCenteringAssistCommmand + * @data_enum LaneCenteringAssistCommand */ LANE_CENTERING_ASSIST_COMMAND = 0x100B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, -- GitLab From 29df1e98a7f1f623c895f4e63bf461eeefcf4d88 Mon Sep 17 00:00:00 2001 From: Jeff Pu Date: Fri, 6 Oct 2023 14:12:44 +0000 Subject: [PATCH 172/376] Fix: Fingerprint detect should not depend on enrollment match Bug: 277600842 Test: atest FakeFingerprintEngineTest -c Test: atest VtsHalBiometricsFingerprintTargetTest Change-Id: I750e9c4684fd7513d5281dfa653acbd2985317d9 --- .../aidl/default/FakeFingerprintEngine.cpp | 16 +++++----------- .../aidl/default/FakeFingerprintEngineSide.cpp | 4 +--- .../default/tests/FakeFingerprintEngineTest.cpp | 6 +++--- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp index 574570e961..4e8005214e 100644 --- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp @@ -32,7 +32,9 @@ using ::android::base::ParseInt; namespace aidl::android::hardware::biometrics::fingerprint { FakeFingerprintEngine::FakeFingerprintEngine() - : mRandom(std::mt19937::default_seed), mWorkMode(WorkMode::kIdle) {} + : mRandom(std::mt19937::default_seed), + mWorkMode(WorkMode::kIdle), + isLockoutTimerSupported(true) {} void FakeFingerprintEngine::generateChallengeImpl(ISessionCallback* cb) { BEGIN_OP(0); @@ -305,15 +307,6 @@ bool FakeFingerprintEngine::onDetectInteractFingerDown(ISessionCallback* cb, SLEEP_MS(duration / N); } while (!Util::hasElapsed(now, duration)); - auto id = FingerprintHalProperties::enrollment_hit().value_or(0); - auto enrolls = FingerprintHalProperties::enrollments(); - auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end(); - if (id <= 0 || !isEnrolled) { - LOG(ERROR) << "Fail: not enrolled"; - cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */); - return true; - } - cb->onInteractionDetected(); return true; @@ -386,7 +379,7 @@ void FakeFingerprintEngine::resetLockoutImpl(ISessionCallback* cb, return; } clearLockout(cb); - isLockoutTimerAborted = true; + if (isLockoutTimerStarted) isLockoutTimerAborted = true; } void FakeFingerprintEngine::clearLockout(ISessionCallback* cb) { @@ -533,6 +526,7 @@ void FakeFingerprintEngine::startLockoutTimer(int64_t timeout, ISessionCallback* isLockoutTimerStarted = true; } void FakeFingerprintEngine::lockoutTimerExpired(ISessionCallback* cb) { + BEGIN_OP(0); if (!isLockoutTimerAborted) { clearLockout(cb); } diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp index a78cdcdbce..acb792de61 100644 --- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp +++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp @@ -27,9 +27,7 @@ using namespace ::android::fingerprint::virt; namespace aidl::android::hardware::biometrics::fingerprint { -FakeFingerprintEngineSide::FakeFingerprintEngineSide() : FakeFingerprintEngine() { - isLockoutTimerSupported = true; -} +FakeFingerprintEngineSide::FakeFingerprintEngineSide() : FakeFingerprintEngine() {} SensorLocation FakeFingerprintEngineSide::defaultSensorLocation() { return SensorLocation{.sensorLocationX = defaultSensorLocationX, diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp index 45b5be8d2e..eedcae1a35 100644 --- a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp +++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp @@ -357,7 +357,7 @@ TEST_F(FakeFingerprintEngineTest, InteractionDetectNotSet) { FingerprintHalProperties::enrollment_hit({}); mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); mEngine.fingerDownAction(); - ASSERT_EQ(0, mCallback->mInteractionDetectedCount); + ASSERT_EQ(1, mCallback->mInteractionDetectedCount); } TEST_F(FakeFingerprintEngineTest, InteractionDetectNotEnrolled) { @@ -365,7 +365,7 @@ TEST_F(FakeFingerprintEngineTest, InteractionDetectNotEnrolled) { FingerprintHalProperties::enrollment_hit(25); mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future()); mEngine.fingerDownAction(); - ASSERT_EQ(0, mCallback->mInteractionDetectedCount); + ASSERT_EQ(1, mCallback->mInteractionDetectedCount); } TEST_F(FakeFingerprintEngineTest, InteractionDetectError) { @@ -508,7 +508,7 @@ TEST_F(FakeFingerprintEngineTest, randomLatency) { TEST_F(FakeFingerprintEngineTest, lockoutTimer) { mEngine.startLockoutTimer(200, mCallback.get()); ASSERT_TRUE(mEngine.getLockoutTimerStarted()); - std::this_thread::sleep_for(std::chrono::milliseconds(230)); + std::this_thread::sleep_for(std::chrono::milliseconds(250)); ASSERT_FALSE(mEngine.getLockoutTimerStarted()); ASSERT_TRUE(mCallback->mLockoutCleared); } -- GitLab From f6c039a49ead173ba6ff34766c3803b7b60eb243 Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Fri, 6 Oct 2023 23:02:17 +0000 Subject: [PATCH 173/376] Start VTS for color management. Right now this only makes sure that extended sRGB buffers aren't corrupted by the time it hits the display. This is especially important for Ultra HDR, because display compensation is defined by the spec. Bug: 276331687 Bug: 259144781 Test: VtsHalGraphicsComposer3_ReadbackTest Change-Id: Ib6c39858289d5559ae76280ca1a0ef756f2daef0 --- graphics/composer/aidl/vts/ReadbackVts.cpp | 32 ++++- graphics/composer/aidl/vts/ReadbackVts.h | 13 +- .../composer/aidl/vts/RenderEngineVts.cpp | 28 ++++ graphics/composer/aidl/vts/RenderEngineVts.h | 1 + .../VtsHalGraphicsComposer3_ReadbackTest.cpp | 133 ++++++++++++++++-- 5 files changed, 188 insertions(+), 19 deletions(-) diff --git a/graphics/composer/aidl/vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp index abb58e25dd..8605628098 100644 --- a/graphics/composer/aidl/vts/ReadbackVts.cpp +++ b/graphics/composer/aidl/vts/ReadbackVts.cpp @@ -35,6 +35,7 @@ void TestLayer::write(ComposerClientWriter& writer) { writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha); writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode); writer.setLayerBrightness(mDisplay, mLayer, mBrightness); + writer.setLayerDataspace(mDisplay, mLayer, mDataspace); } std::string ReadbackHelper::getColorModeString(ColorMode mode) { @@ -99,6 +100,7 @@ LayerSettings TestLayer::toRenderEngineLayerSettings() { layerSettings.geometry.positionTransform = scale * translation; layerSettings.whitePointNits = mWhitePointNits; + layerSettings.sourceDataspace = static_cast<::android::ui::Dataspace>(mDataspace); return layerSettings; } @@ -189,6 +191,23 @@ void ReadbackHelper::compareColorBuffers(const std::vector& expectedColor } } +void ReadbackHelper::compareColorBuffers(void* expectedBuffer, void* actualBuffer, + const uint32_t stride, const uint32_t width, + const uint32_t height, common::PixelFormat pixelFormat) { + const int32_t bytesPerPixel = ReadbackHelper::GetBytesPerPixel(pixelFormat); + ASSERT_NE(-1, bytesPerPixel); + for (int row = 0; row < height; row++) { + for (int col = 0; col < width; col++) { + int offset = (row * static_cast(stride) + col) * bytesPerPixel; + uint8_t* expectedColor = (uint8_t*)expectedBuffer + offset; + uint8_t* actualColor = (uint8_t*)actualBuffer + offset; + ASSERT_EQ(expectedColor[0], actualColor[0]); + ASSERT_EQ(expectedColor[1], actualColor[1]); + ASSERT_EQ(expectedColor[2], actualColor[2]); + } + } +} + ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr& client, int32_t width, int32_t height, common::PixelFormat pixelFormat, common::Dataspace dataspace) @@ -248,6 +267,15 @@ void ReadbackBuffer::checkReadbackBuffer(const std::vector& expectedColor EXPECT_EQ(::android::OK, status); } +::android::sp<::android::GraphicBuffer> ReadbackBuffer::getBuffer() { + const auto& [fenceStatus, bufferFence] = mComposerClient->getReadbackBufferFence(mDisplay); + EXPECT_TRUE(fenceStatus.isOk()); + if (bufferFence.get() != -1) { + sync_wait(bufferFence.get(), -1); + } + return mGraphicBuffer; +} + void TestColorLayer::write(ComposerClientWriter& writer) { TestLayer::write(writer); writer.setLayerCompositionType(mDisplay, mLayer, Composition::SOLID_COLOR); @@ -344,10 +372,6 @@ void TestBufferLayer::setBuffer(std::vector colors) { "TestBufferLayer"); } -void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) { - writer.setLayerDataspace(mDisplay, mLayer, dataspace); -} - void TestBufferLayer::setToClientComposition(ComposerClientWriter& writer) { writer.setLayerCompositionType(mDisplay, mLayer, Composition::CLIENT); } diff --git a/graphics/composer/aidl/vts/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h index d5602c1716..ee205735f1 100644 --- a/graphics/composer/aidl/vts/ReadbackVts.h +++ b/graphics/composer/aidl/vts/ReadbackVts.h @@ -42,6 +42,9 @@ static const Color TRANSLUCENT_RED = {1.0f, 0.0f, 0.0f, 0.3f}; static const Color GREEN = {0.0f, 1.0f, 0.0f, 1.0f}; static const Color BLUE = {0.0f, 0.0f, 1.0f, 1.0f}; static const Color WHITE = {1.0f, 1.0f, 1.0f, 1.0f}; +static const Color LIGHT_RED = {0.5f, 0.0f, 0.0f, 1.0f}; +static const Color LIGHT_GREEN = {0.0f, 0.5f, 0.0f, 1.0f}; +static const Color LIGHT_BLUE = {0.0f, 0.0f, 0.5f, 1.0f}; class TestRenderEngine; @@ -71,6 +74,8 @@ class TestLayer { mSurfaceDamage = std::move(surfaceDamage); } + void setDataspace(Dataspace dataspace) { mDataspace = dataspace; } + void setTransform(Transform transform) { mTransform = transform; } void setAlpha(float alpha) { mAlpha = alpha; } void setBlendMode(BlendMode blendMode) { mBlendMode = blendMode; } @@ -98,6 +103,7 @@ class TestLayer { float mAlpha = 1.0; BlendMode mBlendMode = BlendMode::NONE; uint32_t mZOrder = 0; + Dataspace mDataspace = Dataspace::UNKNOWN; }; class TestColorLayer : public TestLayer { @@ -130,8 +136,6 @@ class TestBufferLayer : public TestLayer { void setBuffer(std::vector colors); - void setDataspace(Dataspace dataspace, ComposerClientWriter& writer); - void setToClientComposition(ComposerClientWriter& writer); uint32_t getWidth() const { return mWidth; } @@ -185,6 +189,9 @@ class ReadbackHelper { static void compareColorBuffers(const std::vector& expectedColors, void* bufferData, const uint32_t stride, const uint32_t width, const uint32_t height, PixelFormat pixelFormat); + static void compareColorBuffers(void* expectedBuffer, void* actualBuffer, const uint32_t stride, + const uint32_t width, const uint32_t height, + PixelFormat pixelFormat); }; class ReadbackBuffer { @@ -196,6 +203,8 @@ class ReadbackBuffer { void checkReadbackBuffer(const std::vector& expectedColors); + ::android::sp<::android::GraphicBuffer> getBuffer(); + protected: uint32_t mWidth; uint32_t mHeight; diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp index d1f89d06f7..4e7f7735ea 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.cpp +++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp @@ -89,4 +89,32 @@ void TestRenderEngine::checkColorBuffer(const std::vector& expectedColors ASSERT_EQ(::android::OK, mGraphicBuffer->unlock()); } +void TestRenderEngine::checkColorBuffer(const ::android::sp<::android::GraphicBuffer>& buffer) { + ASSERT_EQ(mGraphicBuffer->getWidth(), buffer->getWidth()); + ASSERT_EQ(mGraphicBuffer->getHeight(), buffer->getHeight()); + void* renderedBufferData; + int32_t bytesPerPixel = -1; + int32_t bytesPerStride = -1; + ASSERT_EQ(0, mGraphicBuffer->lock(static_cast(mGraphicBuffer->getUsage()), + &renderedBufferData, &bytesPerPixel, &bytesPerStride)); + const uint32_t renderedStride = (bytesPerPixel > 0 && bytesPerStride > 0) + ? static_cast(bytesPerStride / bytesPerPixel) + : mGraphicBuffer->getStride(); + + void* bufferData; + ASSERT_EQ(0, buffer->lock(static_cast(buffer->getUsage()), &bufferData, + &bytesPerPixel, &bytesPerStride)); + const uint32_t bufferStride = (bytesPerPixel > 0 && bytesPerStride > 0) + ? static_cast(bytesPerStride / bytesPerPixel) + : buffer->getStride(); + + ASSERT_EQ(renderedStride, bufferStride); + + ReadbackHelper::compareColorBuffers(renderedBufferData, bufferData, bufferStride, + mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(), + mFormat); + ASSERT_EQ(::android::OK, buffer->unlock()); + ASSERT_EQ(::android::OK, mGraphicBuffer->unlock()); +} + } // namespace aidl::android::hardware::graphics::composer3::vts diff --git a/graphics/composer/aidl/vts/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h index 612f0ea270..bbe508f620 100644 --- a/graphics/composer/aidl/vts/RenderEngineVts.h +++ b/graphics/composer/aidl/vts/RenderEngineVts.h @@ -45,6 +45,7 @@ class TestRenderEngine { }; void drawLayers(); void checkColorBuffer(const std::vector& expectedColors); + void checkColorBuffer(const ::android::sp<::android::GraphicBuffer>& buffer); ::android::renderengine::RenderEngine& getInternalRenderEngine() { return *mRenderEngine; } diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp index 4b0f336d29..466954f26d 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp @@ -70,9 +70,9 @@ class GraphicsCompositionTestBase : public ::testing::Test { ContextPriority::HIGH) .build()))); - ::android::renderengine::DisplaySettings clientCompositionDisplay; - clientCompositionDisplay.physicalDisplay = Rect(getDisplayWidth(), getDisplayHeight()); - clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay; + mClientCompositionDisplaySettings.physicalDisplay = + Rect(getDisplayWidth(), getDisplayHeight()); + mClientCompositionDisplaySettings.clip = mClientCompositionDisplaySettings.physicalDisplay; mTestRenderEngine->initGraphicBuffer( static_cast(getDisplayWidth()), static_cast(getDisplayHeight()), @@ -81,7 +81,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { static_cast(common::BufferUsage::CPU_READ_OFTEN) | static_cast(common::BufferUsage::CPU_WRITE_OFTEN) | static_cast(common::BufferUsage::GPU_RENDER_TARGET))); - mTestRenderEngine->setDisplaySettings(clientCompositionDisplay); + mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings); } void TearDown() override { @@ -163,6 +163,7 @@ class GraphicsCompositionTestBase : public ::testing::Test { std::unique_ptr mTestRenderEngine; common::PixelFormat mPixelFormat; common::Dataspace mDataspace; + ::android::renderengine::DisplaySettings mClientCompositionDisplaySettings; static constexpr uint32_t kClientTargetSlotCount = 64; @@ -271,7 +272,7 @@ TEST_P(GraphicsCompositionTest, SetLayerBuffer) { getDisplayHeight(), common::PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; @@ -455,7 +456,7 @@ TEST_P(GraphicsCompositionTest, ClientComposition) { getDisplayHeight(), PixelFormat::RGBA_FP16); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); std::vector> layers = {layer}; @@ -553,7 +554,7 @@ TEST_P(GraphicsCompositionTest, DeviceAndClientComposition) { deviceLayer->setDisplayFrame({0, 0, static_cast(deviceLayer->getWidth()), static_cast(deviceLayer->getHeight())}); deviceLayer->setZOrder(10); - deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors)); deviceLayer->write(*mWriter); @@ -640,7 +641,7 @@ TEST_P(GraphicsCompositionTest, SetLayerDamage) { getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors)); std::vector> layers = {layer}; @@ -768,7 +769,7 @@ TEST_P(GraphicsCompositionTest, SetLayerSourceCrop) { getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); layer->setSourceCrop({0, static_cast(getDisplayHeight() / 2), static_cast(getDisplayWidth()), static_cast(getDisplayHeight())}); @@ -987,7 +988,7 @@ class GraphicsBlendModeCompositionTest getDisplayHeight(), PixelFormat::RGBA_8888); layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); layer->setZOrder(10); - layer->setDataspace(Dataspace::UNKNOWN, *mWriter); + layer->setDataspace(Dataspace::UNKNOWN); ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors)); layer->setBlendMode(blendMode); @@ -1222,7 +1223,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_H) { getDisplayHeight(), mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_H); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1268,7 +1269,7 @@ TEST_P(GraphicsTransformCompositionTest, FLIP_V) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::FLIP_V); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1313,7 +1314,7 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); mLayer->setTransform(Transform::ROT_180); - mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter); + mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode)); std::vector expectedColors( static_cast(getDisplayWidth() * getDisplayHeight())); @@ -1342,6 +1343,100 @@ TEST_P(GraphicsTransformCompositionTest, ROT_180) { } } +class GraphicsColorManagementCompositionTest + : public GraphicsCompositionTestBase, + public testing::WithParamInterface> { + public: + void SetUp() override { + SetUpBase(std::get<0>(GetParam())); + // for some reason only sRGB reliably works + mTestColorModes.erase( + std::remove_if(mTestColorModes.begin(), mTestColorModes.end(), + [](ColorMode mode) { return mode != ColorMode::SRGB; }), + mTestColorModes.end()); + auto standard = std::get<1>(GetParam()); + auto transfer = std::get<2>(GetParam()); + auto range = std::get<3>(GetParam()); + + mLayerDataspace = static_cast(static_cast(standard) | + static_cast(transfer) | + static_cast(range)); + ALOGD("Invoking test for dataspace: {%s, %s, %s}", toString(standard).c_str(), + toString(transfer).c_str(), toString(range).c_str()); + } + + void makeLayer() { + mLayer = std::make_shared( + mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(), + getDisplayHeight(), common::PixelFormat::RGBA_8888); + mLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()}); + mLayer->setZOrder(10); + mLayer->setAlpha(1.f); + mLayer->setDataspace(mLayerDataspace); + } + + void fillColor(Color color) { + std::vector baseColors(static_cast(getDisplayWidth() * getDisplayHeight())); + ReadbackHelper::fillColorsArea(baseColors, getDisplayWidth(), + common::Rect{.left = 0, + .top = 0, + .right = getDisplayWidth(), + .bottom = getDisplayHeight()}, + color); + ASSERT_NO_FATAL_FAILURE(mLayer->setBuffer(baseColors)); + } + + Dataspace mLayerDataspace; + std::shared_ptr mLayer; +}; + +TEST_P(GraphicsColorManagementCompositionTest, ColorConversion) { + for (ColorMode mode : mTestColorModes) { + EXPECT_TRUE(mComposerClient + ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC) + .isOk()); + + bool isSupported; + ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer()); + if (!isSupported) { + GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; + return; + } + + mClientCompositionDisplaySettings.outputDataspace = + static_cast<::android::ui::Dataspace>(mDataspace); + mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings); + + makeLayer(); + for (auto color : {LIGHT_RED, LIGHT_GREEN, LIGHT_BLUE}) { + ALOGD("Testing color: %f, %f, %f, %f with color mode: %d", color.r, color.g, color.b, + color.a, mode); + ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(), + getDisplayHeight(), mPixelFormat, mDataspace); + ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); + fillColor(color); + writeLayers({mLayer}); + EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); + + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp); + execute(); + if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) { + continue; + } + ASSERT_TRUE(mReader.takeErrors().empty()); + mWriter->presentDisplay(getPrimaryDisplayId()); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + + mTestRenderEngine->setRenderLayers({mLayer}); + ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers()); + ASSERT_NO_FATAL_FAILURE( + mTestRenderEngine->checkColorBuffer(readbackBuffer.getBuffer())); + } + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsCompositionTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsCompositionTest, @@ -1360,5 +1455,17 @@ INSTANTIATE_TEST_SUITE_P( testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), ::android::PrintInstanceNameToString); +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsColorManagementCompositionTest); +INSTANTIATE_TEST_SUITE_P(PerInstance, GraphicsColorManagementCompositionTest, + testing::Combine(testing::ValuesIn(::android::getAidlHalInstanceNames( + IComposer::descriptor)), + // Only check sRGB, but verify that extended range + // doesn't trigger any gamma shifts + testing::Values(Dataspace::STANDARD_BT709), + testing::Values(Dataspace::TRANSFER_SRGB), + // Don't test limited range until we send YUV overlays + testing::Values(Dataspace::RANGE_FULL, + Dataspace::RANGE_EXTENDED))); + } // namespace } // namespace aidl::android::hardware::graphics::composer3::vts -- GitLab From 6c4672c6dabd60358fc75c28c0d182311912655f Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Mon, 9 Oct 2023 19:57:54 +0000 Subject: [PATCH 174/376] nfc(hal): Make it available for nfc apex Bug: 303286040 Test: Compiles (cherry picked from https://android-review.googlesource.com/q/commit:0219d892a4027690ca150809d389c224e6611468) Merged-In: I2d70f751867fe02ba2bc6958963e30f128630b00 Change-Id: I2d70f751867fe02ba2bc6958963e30f128630b00 --- nfc/1.0/Android.bp | 4 ++++ nfc/1.1/Android.bp | 4 ++++ nfc/1.2/Android.bp | 4 ++++ nfc/aidl/Android.bp | 7 +++++++ 4 files changed, 19 insertions(+) diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp index 55c8639dfd..ef12c7c7c2 100644 --- a/nfc/1.0/Android.bp +++ b/nfc/1.0/Android.bp @@ -22,4 +22,8 @@ hidl_interface { ], gen_java: true, gen_java_constants: true, + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], } diff --git a/nfc/1.1/Android.bp b/nfc/1.1/Android.bp index a8463cf0fe..65da2a03b0 100644 --- a/nfc/1.1/Android.bp +++ b/nfc/1.1/Android.bp @@ -22,4 +22,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], } diff --git a/nfc/1.2/Android.bp b/nfc/1.2/Android.bp index 4831ab9133..8ad93f9247 100644 --- a/nfc/1.2/Android.bp +++ b/nfc/1.2/Android.bp @@ -22,4 +22,8 @@ hidl_interface { "android.hidl.base@1.0", ], gen_java: true, + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], } diff --git a/nfc/aidl/Android.bp b/nfc/aidl/Android.bp index 08ec5fe392..dae9f29a11 100644 --- a/nfc/aidl/Android.bp +++ b/nfc/aidl/Android.bp @@ -34,6 +34,13 @@ aidl_interface { sdk_version: "module_current", enabled: false, }, + ndk: { + enabled: true, + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], + }, rust: { enabled: true, }, -- GitLab From 0cd816cf20a68493e5a5ef28bbcb3d60c882d7d5 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 10 Oct 2023 15:28:38 +0900 Subject: [PATCH 175/376] Cleanup: use shared apex_key Bug: 296524155 Test: m Change-Id: Ib04e5b2f1f2719b040656237f3759502d14e3d3e --- biometrics/face/aidl/default/apex/Android.bp | 16 +----- ...hardware.biometrics.face.virtual.avbpubkey | Bin 1032 -> 0 bytes ...droid.hardware.biometrics.face.virtual.pem | 52 ------------------ ...droid.hardware.biometrics.face.virtual.pk8 | Bin 2374 -> 0 bytes ....hardware.biometrics.face.virtual.x509.pem | 34 ------------ 5 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.avbpubkey delete mode 100644 biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem delete mode 100644 biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pk8 delete mode 100644 biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem diff --git a/biometrics/face/aidl/default/apex/Android.bp b/biometrics/face/aidl/default/apex/Android.bp index 9c031a35d7..86c4e12435 100644 --- a/biometrics/face/aidl/default/apex/Android.bp +++ b/biometrics/face/aidl/default/apex/Android.bp @@ -16,26 +16,14 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } -apex_key { - name: "com.android.hardware.biometrics.face.virtual.key", - public_key: "com.android.hardware.biometrics.face.virtual.avbpubkey", - private_key: "com.android.hardware.biometrics.face.virtual.pem", -} - -android_app_certificate { - name: "com.android.hardware.biometrics.face.virtual.certificate", - certificate: "com.android.hardware.biometrics.face.virtual", -} - apex { name: "com.android.hardware.biometrics.face.virtual", manifest: "manifest.json", file_contexts: "file_contexts", - key: "com.android.hardware.biometrics.face.virtual.key", - certificate: ":com.android.hardware.biometrics.face.virtual.certificate", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", updatable: false, vendor: true, - use_vndk_as_stable: true, binaries: [ // hal diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.avbpubkey b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.avbpubkey deleted file mode 100644 index 9f358fff6684c1727689973ee10647df4a1b1bcc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1032 zcmV+j1o!&@01yDOImVf&XKxBsd_nd}7tHu#@|9AWBNWpYAyb3opzFoXYW=sC`>YLf zn=^}!Lsl}pZPjp;5%Zu=b9vJ~Q{&DZq((un0teqyYDnt;PsxVm`q=_QV9{!yfnR_d z&1MSVKAdhE)5qovz9$nkV2ZRaT9xxeBS@d(#K-6c;EjqK!3J13g`YL>NK!`PezdLf z&@^}~dOQEqpk_QN(t@2jE*gnU?WiQ6iB$|=J4DYlM|~9~QeD-q9l^xf3@9AW`wRVa z1>AgHaExpO5o?Ecnt}PD8=;3^IMn+{LrOEl`^RdKlbO>Sj%XXgmD%Ia-@KW2a(wx7 zk-rH;we%?q4cuRT!Qtb`%TqD+ofsThZGr-Hh_lJYjVCfVpnigXH`YhIY63=WQS8(z ze>m36W#kBiLiCZ>t0P<0qUYWP{rvoocdnfJJ$iXIB=9FN>li&)A;^3~yS+pi=pmk!Xc>)rLn7H_JCcO5pb>F#F455Gyq6RhCD>?;$j)cybBC_? z3){YTYbD9`H3h7Dw(&H-1Uq%9XHn!);A(3qNNerH=7StKCbIjes}?xaF;`cTiw%gb z(9DgaW?nn!NiN|bVeKMQY!WR4)yM4MIMphq6(b>AN`u>Q2e)){=m-&W6W#WgyEKG( z0)u^?sVX;{d;$ER>dU%(p#2}Np9divP()zAQ9x3)XI}j3Nc_u6JZ&;+eiJ>jiBm;( zCj_~cnSEmAwU#@VYQ9&^)*ykDgTO^b^&*36d>$|4Qwq^PBEZ|DFrN}&ps-{GGI>n`iDzfC0((v~*F=`@E;?>{T~^bQ|4Iuc0{=M3!y3U4}Owx5wSi$?|Qf zrdA@GRJJorJA(j#j3}^XRH!?On+4U=;BZ=8VPT1iv;H2!~-uC{9=w44j CZUtWe diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem deleted file mode 100644 index ad8f57d544..0000000000 --- a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pem +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCoZ28KVXxB9kkX -zPhi8pVSmiMU0xchU4PkoOvFzmr9t5b7rA1zmzOLjkNWMrxt1XCUEfOgT3N50z5T -484dpEZBrwIH31NqSOr/T8mG5frZAkNg0WqfgV+AG81mCuA+nG4a08fmDL4nEzVg -irQvWpXzRCNIn+LEx+gG4I2KG8EGWDiFnzXwSFJG4n60rfLQNHgsejv/06BmPCnS -gp06LhqJTO2oJKCJVQxfO0TPNUd9FSVSXdWuHcHE2gwoHM/7C/10Bdx8XXCMbAQR -a4d3moH5oRuhh1841PtIQ0ozw/vHapCTmdMbjmgbwpXZ49DfvJl2cnz5c5G/CUO1 -9CkLDdxffsHh48jLUzH1nRgcWW2CAnSIs8nGjScyOKB+gn831ke8agJGbVHs1Cp/ -ONbMZeQIhEL0kderI1vVoufeBf38/I93rpz6PXp5NiTwOnVdEik595/W7oldr/rM -taKvWwfnjml+Z1uzJWWDKPnS+onxBVcoBGFhiewIejPz3UjncMiHW5QAx/BzfGgh -UmFO0vsh8qrEfAqT4AqL4uCuyVm0JmugdWKoeQISh5i4+HMmvPaudd+8yF0plr10 -+pyNGkLZm4NBJxOD7V0AMjfTIpKRbmV8xnCAnWQ+xx/qWxHAZ0wfbZXXF0m6L6po -dVwJJI7EnuQbAkbXnzMtCTQToZTSVwIDAQABAoICAAGjGJNY15kYKO3xzXWMyfXT -gl7L9Im1TNVwP3Dpu+S7U0NSd1w12Iju35znzlwhx7/j8skOrKubaZvM9ztJ79Yb -1CDs3PWhP6OVJeGvvHU9zkp59RexQ5Ma8hXskIroE2WJ97bQgRkfi/r9x8wKc39T -aYv/SrTC0SPr+YRFSjMvfV35kvLC759slgwkmsH6ZWatSeyhPooJfX1kTRBi08A2 -i4lOBD+Bhtn2jG/+1eYtFyYXVaHx/E9XfU6QhSPgIhBULdujPucmj6pc4yRYnKxA -32QxGc35u0QHEqJ9/iWAoporIMAmU/Qp7phl9g+OvxrFkloMc3cp3GSMh8k2bJUY -nRvk0IPG1bF7jwezHbQGTwTlguJlWPl3+v+qeKJQI4pov3Cz6aNrBmBfEbjwcJrf -RvPNCQ2X1GciZcGoJxcHRgFNKarzb+m92qNRftr6YDBZM8PlvJgGhnTRkOuFmIZB -WPRergEwaClp1DbQsXwKlWpGfSMLznj57oKT3MJ31R4pusfMDBS39p9jUFH7uO+p -e/Wdy+RaKei4AYBZIc+ks8LJzeIG+YWD9kN0lPVvzoza6nJYGGNVe/bxErjpESsR -fZDs5EMNPGsCQ56Tgt+vtHEGF3x7ufGMF1XqisCMlaxH03aT2N3Wi5um8jO2pfFC -4NEBq4ixvlyefb0TER+5AoIBAQC6nSDDzeeseLOJ8QSb1kHHkvQOGb8kdYY/KJ51 -+uiwoEWOYAxKubqumo2rYaqcM0lbZKWb/9cgVK4LAzdqY4z3BINA7YRzXSUXdb8T -rbqtg33Yj7f1KBiBqns2FMktfIZ+6JUDALb+CD7rHGpi62RDd8JaKL8wugqMBmwM -YHBfzECVSjDosjGpbILbDJPTfiEQLyPEoJxJ48Z3Xg6l+0BSZrrH9FqGVgsvEQ7f -zhZ6rpJIefb1cFjwIRFORS4tMqS1keu+dugyUBs83AOp5kaq6O31n5hDAOyZVFsw -HSBu8pbWAceWJrF7R1Am23063hIztjPbU9yeN2mvhVQSgO4PAoIBAQDnBQHt3prI -AajCYbHmk0v1WT2kDD5yEX/fZzifTU5k/+0Jvixpa0KOR2qaUXyx4ocIT6F1hR89 -VXGby2UG6SlvuwXMzwmoVf5sueQ6wshu3fCaS8BYNpJnOAfgLTnUpKIWITDm/2Hj -4NCFYL77EfBXXhFH7lLPhiPcTWQlPDuFCXU/BJuVhJbpd+GtF1+loiNQArg9nmKb -9Ac7ccR9UBO/XSQN1th4+yaxyGQKaiYsBqsy8SPp2ynTdGXT72LePqSUrkNsjgE7 -PkzgX0pBZw8upBXk+8ByfIaaQONRbCuMQEXj6B66szaWeR2hDfaoDOk3/w6JN93r -yPKfk4TFNB85AoIBAGoiHVVfUOjViP7l9cIPvD+eQ3GVkRFSSfS3zE+7UQXLUWPl -GniRYywUuIgFNvw5avowpsOvYRGBN68JuEWosq52gZO2wkK+ce8Cx5aQkwBGLZey -PWSP1khAxmx+q+BT10ZsTvtzN6AI3ofnFFaIG/EHNqECVaKH3KHAsUjkvGSvjPeb -R2/AkOAT1+RvJc/+Bx3mQYh99AVOJz0SYHBkEjQLOyWnwqhuXVP6dqQw2LYTfRz9 -SMhUijCgDfCfBeEs0WJ2yEX96Jdc2fDmDKtfTUe8zEGK8BUDfIzD3kzh8+VF0SWL -w5CRFxXO/DXtVS7ayC1i7eFKs8nEKDZsNOGFNF8CggEAKXRMlFKNk7Y4gijls2pb -Bvusg/NugSmCuKPdFTjaCGWkM0tczM3ic4V9K5PTvFfZwzQG1P++S1M5v6sPxd2x -AcudjtLX+Mz1iq0QtzqcnMhWlFljenDQdJUpVKDI789bBn2OOOU6u5lr0YM6wfLG -HedTUoUBdxuq860vez8DryuzTkuVX48bRWmtpVG8aAxgKctTJDt3lmSDp7cSeyoT -YRNllNYoogzvNJew2+2QS/YmYk3DFAOvzbHlU9Jw+1BiWAutLZ2NuwPC58AxourL -XqMzCpPiRKjzvlpGcCXo6pHd+Ld+TCI8eWPiXTQUPrOSZenuwdC0kcrNPrVJ7dkc -gQKCAQEAmE6BTX7nn0HT859PtBlsy3rM8psihR4UYuYkTdE0+KF4hBRIP6uhMAVh -vV6UMnt3QubKIekG14seGkwkBnEhv5reYWn/1+t3qP7qqvgndGgI2yPbzJx/cPMK -+KKhRbBAIgkjiY6hlo+DhrNS5nuBjZS2q/NnkO4NK7qBHvpIYAnRZK9qNsT4KZm6 -EO9YlCCnoZ3EB7brNgBZkxoekZG4jTlpD0E7nTxPTF1iVWedKRfmLFxAiDaSz0eo -9tbTaRQ6ybU6jl1hMg4aINjp4xl/ScKk51veKg5ptjpPtspIh7keJRIUz3qwhuvk -ZJpVwCxgxAOagrQtvwdedbmvChAfGA== ------END PRIVATE KEY----- diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pk8 b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.pk8 deleted file mode 100644 index af0ff4e75a5afc404d4cb5a7e1fd86660f8a5349..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2374 zcmV-M3Ay$#f(b$b0RS)!1_>&LNQUwEHHuzC;|Zh0)heo0QQ}nBTo|Y zjUNyKX5GU2(KfCIx`CZ(#rx&JYBf=hasw9-jJ>u=Z+AEjk=@t1y7UxmczbWyIRUd+ zaT)PA$gWVWmq=xX4#zRLYEV=vVc>0RTqCV*IkVN4_}cUf2qXs|EOR5aMD>oouRJ)X zcrflU>FYl=H#B^Qy!w*K5O{+Am2o=j7b7=qoetbijj2u&{^G>xztf3$ z``6y9=fK<=@?a^v+irXR4ME0zp%SfCm@ZB6p?%l!Qg1)F$TQXGWER_iQs4moLljHj zZ0k!~E zjJWc%vn`4;C+edhcqxQ-;6ODnB>TS#t{&>?`66qW*JKq{+k|CQe8QjNbXniF{W2(? z(mS*}5`7DN*yiMU1j*_WI;#G#m!$}Kqg=jiW}G<%Y0@MXBzN-gsUwCIH9g%`dWB^6 zU4yU!R-3D*z{|!S_>pq_;05TzIadVJ9x)C-lfVnMUvIG57Su_PR_a-#Ux~&ZR?E+A zb!>n|tBsG$11Uy!DvZ2lmxXCNg(rt3Y3zz=v)^p*_>2_k`vL<2009Dm0st87ne3^b zxf;;FR zvBwa9q$LOy2u@2^Q(~w18uG`sk>~w(A&nT{{Ih|)+WNq%Jb5st^_&>+>4|ft-x#;W zR9uMRL@FN!Ikrv;b{^EySnlAR4)sz}^0j)5k|)0BW`9t-XeR2K z9s6Qgv7-M4i5OBDBHRcI42Iov;hh}PuWyK9ad~al_K`6>*7Ks-oZOXYpxrxg{qys7 zuO+Z~y}R2uwC}dlb7gQpuKWFLT?|=&tHvuEj^+Y#RY{&mfVe`QsAxr_FDG*+?iC$i zM4G40OSmqyl6e)xksTc5C^SVVGhXDVY`%BIa~*lFWvB>qo0zB1aK?3I{t`E8lXk__ zQy0YeqkAwqUeWJ+X0dk3q1rGY_ccR4-M}}M>$O#HRGeHwzVQNr0RaI0VAL1?y4voY zk%oY!^$5XI)I$6-S0yv(j$*b(vhmA!0_>ccKhjO!DNNOq{zMHwjOZ6Cok;Me5{tK0 zPhId9d(%N1b>}hidwx^`PZ17M{01f-(W;q?A>h1PjnkRu;v8LUWL&pz12@paAXhOO zZZpTbWF5dfPm@{0+C5{8({w>pk{1_0#xCu__#d$l2TJNajCq*YQQxyD{*tmUlrmV# zm%8D_?e*xF>y=v4eh>p$gO(>XWv?heP7`&%DGCCjg!S%gecZJPbSt<==M#mk*&fZ| zWF#qt>UPm{<-&cRc8%ewG2a>eBd`ysm-B3Wfzfe^n$>U7(^b&|f&l>l`6}K!&`PBS z{iO@zQ96W1iO@~;s{^n@TJ*VsHYF9viD&2Hx9ql$_a&fyL7$L4#E^t&z?gDr!Pet0zGTOnE-sDEnt+jAtga#~Zhaj79n>Ly3FHOaQ)@qUo{R960fL^r z%bD$^C(d~_VghVqhs$}xu#yvsmcDUN{W~Fuqq~#uABg?q5I@3Xrlq*~>r!`XMjqlG z%R7pE$;_xV;K%{;Qm2B03A${zf>EzAo03iVmpS(&5#?nA zS?w=(+D`H(xC!esC4qROy#GY=d?bW@Z(AZT7C%kjZ{%6J1JUr7S#PSj!DGO+LNj%3 z4kmF;$W#GZ^DN~_l4XLd+eJ~QQ0=BzqG!3WA0gQec+O$0CA8FJ05zIQcSH(OnlY)D zksE=Rzx5|*m2-fqAEN0@h}1OlVp*P|8}h?0Vu z%IB0}YHffrpqz8KBh~7PsYUeB+%vnLB@CH5*;ib|EyFNr@J+$H^8$ha03i(``iG~x z6H@b$&Ia0?(Y)()pJFxT3ifYIMgndIQU~8P()h)?*)L+}Xj^C?AiHC5rKE#)Pli}4 zP*IEIHR|Y1gWkyP*6nNUu{0KUwCqt6?qanFMLId>BMT5;%|9Q1x3u$H3zSOZ*bjqE+-^K sSHK+nCtE~bK?baGWRaJHu6^VmVck2%Uཟ)!D0a|4l_2u6o%TBkLqyPW_ diff --git a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem b/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem deleted file mode 100644 index 3dc37ffd42..0000000000 --- a/biometrics/face/aidl/default/apex/com.android.hardware.biometrics.face.virtual.x509.pem +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF7TCCA9UCFCmJBOOYRVUgdy8vKm8OQd0ii2pPMA0GCSqGSIb3DQEBCwUAMIGx -MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 -bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwHQW5kcm9pZDEi -MCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTEtMCsGA1UEAwwkY29t -LmFuZHJvaWQuaGFyZHdhcmUuYmlvbWV0cmljcy5mYWNlMCAXDTIzMDUyNTA2NDIw -MFoYDzQ3NjEwNDIwMDY0MjAwWjCBsTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh -bGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxEDAOBgNVBAoMB0FuZHJv -aWQxEDAOBgNVBAsMB0FuZHJvaWQxIjAgBgkqhkiG9w0BCQEWE2FuZHJvaWRAYW5k -cm9pZC5jb20xLTArBgNVBAMMJGNvbS5hbmRyb2lkLmhhcmR3YXJlLmJpb21ldHJp -Y3MuZmFjZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAPadnCNPEvKN -HxACZt3C+tE2rga6gZ1pxfvlwGo1UY9yAxcQjL22SW93OA6R3de5uvQUbHh7b9g5 -AbNYcRnxOMiuUK2XSGWGDscxuGpQVCph4G1rXCOtbTmz1Zb42vQLCCQHHyxzI7ZE -9Y6+rzw4p3jtEyBSiiErk13GFZTzwcDzqsQs12vDn9ovSTTn5Nyy6Csz7+O2t4SN -qU4S/uLE6b/TiXj7196r58DcGvJgKbzbbnv/DUHGfaESrVWYLk3xoX3X8VJvP7jI -M9XoZBbbgFLgAP5DFEvf5QWS9tR092z0YXOGr+mLHtkJM7Or9nKOohm6aFfHbuvu -pSWyR4FWnaFANQ8wLH+fH485fiO6juJdTuRWeQpZddv0/IgguZ2Plu7z6NHCf5+L -KYFjQ5y716wOufIqHhRLqYnpsAG2AFaMuPKzsy2KMifqoyB4KYR24EA1MCT7vwqu -Hurp+SJrmNdkFVXbhGVUfMKf4nRZ37b9Miie0ju0OxJ9C3zY5uR5BMnqEjqq/rCX -pQh5o1y+bWacOQVp0iQWJHfy8KkjhhQ1Pd1VeoVk9l2DsAJWm6unwMvGHviRcvzg -BejDOVcE0x4xDj+TwAu2X2+w2hbUSY9W6lmkX4nGHlbLz211bIBFq42PzAMpRnYq -jLxml4VpO4UnhyRp7Ipps99s7/iMFOn7AgMBAAEwDQYJKoZIhvcNAQELBQADggIB -AG/5t56hKYKORne0bwJpMSCWZNT6JcYjf6fEmNrvG3/gz9BCuj4osZjJHD2OSUJl -F5yI52RgPrXK8bNqJOvX6MIc4Y2JoSI2Uz4J2vZ3QhRkPC9oqwk/Enz4GIVJ4Dnm -/kgpBbN2SN0TjnmEooptly5tWb3IPTjqLZpaPIW1ntQeCAbgrYVHiMsvNe1BuBrn -RNi1xqw3QGp2ZV/RfJ3MH6d49TswEL1gwiUeg3hw5eG7IDfLB/2IJBrff7kmPTQ6 -n+il4uXuXMmX70xSvJXwP/NinomJsORZ4Npbmp7xV/QJp9cNoxNAo3DJ4OHRAnA+ -L7E1KZ3+nSRxGcVlqBekmG6wH9U39NN+dh758aGdJOWqA+B+1PAGxkvFCNqLgTpm -xNl62YiRRo4FiIAkntvs+JneMEphv/T5i824t2xFZD2lBuW8r54nWj5cpx8AU9W2 -rulR0jx7BnVdj6czn1/pPCIah8Os9pZM8q1CbF8vXD+QLAF0/NjPNomTEGd/M+V+ -sfn1OhLGF/E1kWyNeOmkvX26txQdY8k6jUdsAc5vmQqgwxdorjI38ynpYQnFwq2g -eO4l62sx8icsSh2TRklWy8BwZpaCyO/WVv/FcjIUexYhmZ0EHpmQk/RAlD1f9wFy -CciNa/Dm94AwJgZk9LcXye3BSvb1sKF6C7eYrW0eI95V ------END CERTIFICATE----- -- GitLab From 56b7c056ba8750d39d0bb858f1ec45897c413ad5 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Tue, 10 Oct 2023 21:33:04 +0000 Subject: [PATCH 176/376] Revert^2 "Remove HIDL graphics.mapper service from V+" 1491721640ef25f54ff18cc973a8372bb3c39755 This topic fixes the dependencies that caused the inital revert (b/300115646): https://googleplex-android-review.git.corp.google.com/q/topic:%22camera_fail2%22 Test: CtsCameraTestCases CtsAppOpsTestCases Bug: 285605852 Change-Id: I9553e2918a619c1a2409046e7e4fe48219679a6e --- compatibility_matrices/compatibility_matrix.9.xml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 9a9af1c109..59fd2b0a1e 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -238,15 +238,6 @@ default - - - android.hardware.graphics.mapper - 4.0 - - IMapper - default - - android.hardware.health 1-2 @@ -686,7 +677,7 @@ default - + mapper 5.0 -- GitLab From ec5d5b0bfc7fa46246cb183639f0068c5b72d418 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 9 Oct 2023 14:43:36 -0700 Subject: [PATCH 177/376] Allow CDD required properties to be absent in VTS. Allow CDD required properties not to be supported in VHAL VTS since this is already covered in CTS. We also need to consider special cases where one VHAL instance does not support all required properties. Test: atest VtsHalAutomotiveVehicle_TargetTest Bug: 301577794 (Cherry-picked from commit b84f6f3c68fcd7f613146146821130eb354865c1) Change-Id: I93020e7e024760601bc5a8edf9997cc356a568c6 --- .../VtsHalAutomotiveVehicle_TargetTest.cpp | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 6e6d05cd61..bc9a527c40 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -115,6 +115,9 @@ class VtsVehicleCallback final : public ISubscriptionCallback { }; class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam { + protected: + void checkIsSupported(int32_t propertyId); + public: void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access, VehiclePropertyChangeMode changeMode, VehiclePropertyGroup group, @@ -155,7 +158,7 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, useHidlBackend) { } } -// Test getAllPropConfig() returns at least 4 property configs. +// Test getAllPropConfigs() returns at least 1 property configs. TEST_P(VtsHalAutomotiveVehicleTargetTest, getAllPropConfigs) { ALOGD("VtsHalAutomotiveVehicleTargetTest::getAllPropConfigs"); @@ -163,25 +166,29 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, getAllPropConfigs) { ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " << result.error().message(); - ASSERT_GE(result.value().size(), 4u) << StringPrintf( - "Expect to get at least 4 property configs, got %zu", result.value().size()); + ASSERT_GE(result.value().size(), 1u) << StringPrintf( + "Expect to get at least 1 property config, got %zu", result.value().size()); } -// Test getPropConfigs() can query all properties listed in CDD. -TEST_P(VtsHalAutomotiveVehicleTargetTest, getRequiredPropConfigs) { +// Test getPropConfigs() can query properties returned by getAllPropConfigs. +TEST_P(VtsHalAutomotiveVehicleTargetTest, getPropConfigsWithValidProps) { ALOGD("VtsHalAutomotiveVehicleTargetTest::getRequiredPropConfigs"); - // Check the properties listed in CDD - std::vector properties = { - toInt(VehicleProperty::GEAR_SELECTION), toInt(VehicleProperty::NIGHT_MODE), - toInt(VehicleProperty::PARKING_BRAKE_ON), toInt(VehicleProperty::PERF_VEHICLE_SPEED)}; + std::vector properties; + auto result = mVhalClient->getAllPropConfigs(); + + ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: " + << result.error().message(); + for (const auto& cfgPtr : result.value()) { + properties.push_back(cfgPtr->getPropId()); + } - auto result = mVhalClient->getPropConfigs(properties); + result = mVhalClient->getPropConfigs(properties); ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " << result.error().message(); - ASSERT_EQ(result.value().size(), 4u) - << StringPrintf("Expect to get exactly 4 configs, got %zu", result.value().size()); + ASSERT_EQ(result.value().size(), properties.size()) << StringPrintf( + "Expect to get exactly %zu configs, got %zu", properties.size(), result.value().size()); } // Test getPropConfig() with an invalid propertyId returns an error code. @@ -200,6 +207,7 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, get) { ALOGD("VtsHalAutomotiveVehicleTargetTest::get"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + checkIsSupported(propId); auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 @@ -285,6 +293,8 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { ALOGD("VtsHalAutomotiveVehicleTargetTest::setNotWritableProp"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + checkIsSupported(propId); + auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); ASSERT_TRUE(getValueResult.ok()) << StringPrintf("Failed to get value for property: %" PRId32 ", error: %s", propId, @@ -325,6 +335,7 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeAndUnsubscribe) { ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeAndUnsubscribe"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + checkIsSupported(propId); auto propConfigsResult = mVhalClient->getPropConfigs({propId}); @@ -414,6 +425,7 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetValuesTimestampAIDL) { } int32_t propId = toInt(VehicleProperty::PARKING_BRAKE_ON); + checkIsSupported(propId); auto prop = mVhalClient->createHalPropValue(propId); auto result = mVhalClient->getValueSync(*prop); @@ -871,6 +883,15 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) { VehicleArea::GLOBAL, VehiclePropertyType::MIXED); } +void VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { + auto result = mVhalClient->getPropConfigs({propertyId}); + ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " + << result.error().message(); + if (result.value().size() == 0) { + GTEST_SKIP() << "Property: " << propertyId << " is not supported, skip the test"; + } +} + std::vector getDescriptors() { std::vector descriptors; for (std::string name : getAidlHalInstanceNames(IVehicle::descriptor)) { -- GitLab From 0ebd87691400996b86f0f67c7207dc80ceab2d21 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 11 Oct 2023 11:31:04 -0700 Subject: [PATCH 178/376] Handle prop not supported correctly. getPropConfigs() will return error when the property is not supported instead of returning an empty array. Also make sure GTEST_SKIP is called directly in the test function, not the helper function since it will only abort the current function. Test: atest VtsHalAutomotiveVehicle_TargetTest Bug: 301577794 Change-Id: I99e2cb8bd00430fe9668e8a911a60bbfe97bc4e0 --- .../VtsHalAutomotiveVehicle_TargetTest.cpp | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index bc9a527c40..3dca0aef72 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -116,7 +116,7 @@ class VtsVehicleCallback final : public ISubscriptionCallback { class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam { protected: - void checkIsSupported(int32_t propertyId); + bool checkIsSupported(int32_t propertyId); public: void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access, @@ -207,7 +207,9 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, get) { ALOGD("VtsHalAutomotiveVehicleTargetTest::get"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); - checkIsSupported(propId); + if (!checkIsSupported(propId)) { + GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; + } auto result = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); ASSERT_TRUE(result.ok()) << StringPrintf("Failed to get value for property: %" PRId32 @@ -293,7 +295,9 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, setNotWritableProp) { ALOGD("VtsHalAutomotiveVehicleTargetTest::setNotWritableProp"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); - checkIsSupported(propId); + if (!checkIsSupported(propId)) { + GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; + } auto getValueResult = mVhalClient->getValueSync(*mVhalClient->createHalPropValue(propId)); ASSERT_TRUE(getValueResult.ok()) @@ -335,7 +339,9 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, subscribeAndUnsubscribe) { ALOGD("VtsHalAutomotiveVehicleTargetTest::subscribeAndUnsubscribe"); int32_t propId = toInt(VehicleProperty::PERF_VEHICLE_SPEED); - checkIsSupported(propId); + if (!checkIsSupported(propId)) { + GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; + } auto propConfigsResult = mVhalClient->getPropConfigs({propId}); @@ -425,7 +431,9 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, testGetValuesTimestampAIDL) { } int32_t propId = toInt(VehicleProperty::PARKING_BRAKE_ON); - checkIsSupported(propId); + if (!checkIsSupported(propId)) { + GTEST_SKIP() << "Property: " << propId << " is not supported, skip the test"; + } auto prop = mVhalClient->createHalPropValue(propId); auto result = mVhalClient->getValueSync(*prop); @@ -883,13 +891,9 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) { VehicleArea::GLOBAL, VehiclePropertyType::MIXED); } -void VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { +bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); - ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: " - << result.error().message(); - if (result.value().size() == 0) { - GTEST_SKIP() << "Property: " << propertyId << " is not supported, skip the test"; - } + return result.ok(); } std::vector getDescriptors() { -- GitLab From 2226b540cd2b5d46cd1a76e7df92ea3d59c299ab Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 12 Oct 2023 00:10:09 +0000 Subject: [PATCH 179/376] Revert^3 "Remove HIDL graphics.mapper service from V+" 56b7c056ba8750d39d0bb858f1ec45897c413ad5 Change-Id: I1872654da10501ee3fe05b813d87ba4cfcb2e040 --- compatibility_matrices/compatibility_matrix.9.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 59fd2b0a1e..9a9af1c109 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -238,6 +238,15 @@ default + + + android.hardware.graphics.mapper + 4.0 + + IMapper + default + + android.hardware.health 1-2 @@ -677,7 +686,7 @@ default - + mapper 5.0 -- GitLab From 79d7ae82076a3ff340dfc49ac7907071aa7b2fa2 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Wed, 11 Oct 2023 16:03:52 -0400 Subject: [PATCH 180/376] Remove deprecated warnings for SKIP_VALIDATE We deliberately use a deprecated API to test that it is not used. Ignore warnings from using it in this test. In PresentDisplayNoLayerStateChanges, remove the check for SKIP_VALIDATE, removing the other warning. As written, the test would be skipped without SKIP_VALIDATE support. But devices should *not* claim Capability::SKIP_VALIDATE, meaning the test would always be skipped. The docs state that the behavior previously indicated by SKIP_VALIDATE is now the default, so we should always be running the test. Bug: NA Test: atest VtsHalGraphicsComposer3_TargetTest (no warnings) Change-Id: Icc89a82b4850428c2f0940be0f78f5ebff1881b3 --- .../aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 1e6f34b534..09882f5911 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -1860,10 +1860,6 @@ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) { * surface damage have been set */ TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) { - if (!hasCapability(Capability::SKIP_VALIDATE)) { - GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; - return; - } EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk()); const auto& [renderIntentsStatus, renderIntents] = @@ -2571,8 +2567,11 @@ class GraphicsComposerAidlCommandV2Test : public GraphicsComposerAidlCommandTest * Capability::SKIP_VALIDATE has been deprecated and should not be enabled. */ TEST_P(GraphicsComposerAidlCommandV2Test, SkipValidateDeprecatedTest) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE)) << "Found Capability::SKIP_VALIDATE capability."; +#pragma clang diagnostic pop } TEST_P(GraphicsComposerAidlCommandV2Test, SetLayerBufferSlotsToClear) { -- GitLab From 1419f35690a86eb2b0d9cfcae54842d31c1f60d3 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Fri, 13 Oct 2023 14:58:41 +0900 Subject: [PATCH 181/376] Make face.virtual HAL smaller by static-linking dependencies. This makes the Face virtual hal much smaller. /vendor/apex/com.android.hardware.biometrics.face.virtual.apex is now 585728 bytes, which is slightly bigger than the size before regression (536576). Bug: 304679972 Test: m Change-Id: I4ed0cd432aeb9932c09c00592dd1fe0a1a38af0a --- biometrics/face/aidl/default/Android.bp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index 7bc219855c..b005746968 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -23,13 +23,10 @@ cc_binary { init_rc: [":face-example.rc"], vintf_fragments: [":face-example.xml"], vendor: true, + shared_libs: [ - "libbase", "libbinder_ndk", - "android.hardware.biometrics.face-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", - "android.hardware.biometrics.common.thread", - "android.hardware.biometrics.common.util", + "liblog", ], srcs: [ "main.cpp", @@ -37,7 +34,17 @@ cc_binary { "FakeFaceEngine.cpp", "Session.cpp", ], - static_libs: ["libandroid.hardware.biometrics.face.VirtualProps"], + stl: "c++_static", + static_libs: [ + "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common.thread", + "android.hardware.biometrics.common.util", + "android.hardware.biometrics.face-V3-ndk", + "android.hardware.common-V2-ndk", + "android.hardware.keymaster-V4-ndk", + "libandroid.hardware.biometrics.face.VirtualProps", + "libbase", + ], } sysprop_library { -- GitLab From 9d67c77d35a86fc2b38e563400d1161c30145027 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 12 Oct 2023 20:47:34 +0000 Subject: [PATCH 182/376] Migrate sensors VTS to use libui There is a new graphics.mapper HAL and instead of adding yet another combination of mapper/allocator, use libui that handles all of that for us. Test: VtsAidlHalSensorsTargetTest Bug: 304843606 Change-Id: Icf4a218de6afe0ae77a4520a6f78a4f7da9bedd4 --- .../aidl/vts/SensorsAidlTestSharedMemory.h | 82 +++- .../vts/2_X/VtsHalSensorsV2_XTargetTest.h | 29 +- sensors/common/vts/utils/Android.bp | 14 +- sensors/common/vts/utils/GrallocWrapper.cpp | 355 ------------------ .../sensors-vts-utils/GrallocWrapper.h | 58 --- .../SensorsTestSharedMemory.h | 81 +++- 6 files changed, 142 insertions(+), 477 deletions(-) delete mode 100644 sensors/common/vts/utils/GrallocWrapper.cpp delete mode 100644 sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h diff --git a/sensors/aidl/vts/SensorsAidlTestSharedMemory.h b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h index 4b5916a0d7..200f26f8f9 100644 --- a/sensors/aidl/vts/SensorsAidlTestSharedMemory.h +++ b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h @@ -17,7 +17,11 @@ #ifndef ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H #define ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H -#include "sensors-vts-utils/GrallocWrapper.h" +#include +#include +#include +#include +#include #include #include @@ -28,6 +32,8 @@ #include +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::aidl::android::hardware::graphics::common::PixelFormat; using ::aidl::android::hardware::sensors::BnSensors; using ::aidl::android::hardware::sensors::Event; using ::aidl::android::hardware::sensors::ISensors; @@ -53,12 +59,22 @@ class SensorsAidlTestSharedMemory { } ISensors::SharedMemInfo getSharedMemInfo() const { - ISensors::SharedMemInfo mem = { - .type = mType, - .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT, - .size = static_cast(mSize), - .memoryHandle = android::dupToAidl(mNativeHandle)}; - return mem; + if (mType == ISensors::SharedMemInfo::SharedMemType::GRALLOC) { + ISensors::SharedMemInfo mem = { + .type = mType, + .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT, + .size = static_cast(mSize), + .memoryHandle = android::dupToAidl(mBufferHandle)}; + return mem; + + } else { + ISensors::SharedMemInfo mem = { + .type = mType, + .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT, + .size = static_cast(mSize), + .memoryHandle = android::dupToAidl(mNativeHandle)}; + return mem; + } } char* getBuffer() const { return mBuffer; } size_t getSize() const { return mSize; } @@ -141,17 +157,26 @@ class SensorsAidlTestSharedMemory { } case ISensors::SharedMemInfo::SharedMemType::GRALLOC: { if (mSize != 0) { - mGrallocWrapper->freeBuffer(mNativeHandle); - mNativeHandle = nullptr; + android::status_t status = + android::GraphicBufferAllocator::get().free(mBufferHandle); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory Gralloc failed to free buffer. Status: " + "%s", + android::statusToString(status).c_str()); + } + mBufferHandle = nullptr; + mBuffer = nullptr; mSize = 0; } break; } default: { - if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) { + if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr || + mBufferHandle != nullptr) { ALOGE("SensorsAidlTestSharedMemory %p not properly destructed: " - "type %d, native handle %p, size %zu, buffer %p", - this, static_cast(mType), mNativeHandle, mSize, mBuffer); + "type %d, native handle %p, size %zu, buffer %p, buffer handle %p", + this, static_cast(mType), mNativeHandle, mSize, mBuffer, + mBufferHandle); } break; } @@ -185,14 +210,33 @@ class SensorsAidlTestSharedMemory { break; } case ISensors::SharedMemInfo::SharedMemType::GRALLOC: { - mGrallocWrapper = std::make_unique<::android::GrallocWrapper>(); - if (!mGrallocWrapper->isInitialized()) { + static constexpr uint64_t kBufferUsage = + static_cast(BufferUsage::SENSOR_DIRECT_DATA) | + static_cast(BufferUsage::CPU_READ_OFTEN) | + static_cast(BufferUsage::CPU_WRITE_RARELY); + + uint32_t stride = 0; + buffer_handle_t bufferHandle; + android::status_t status = android::GraphicBufferAllocator::get().allocate( + size, 1, static_cast(PixelFormat::BLOB), 1, kBufferUsage, + &bufferHandle, &stride, "SensorVts"); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory failed to allocate memory. Status: %s", + android::statusToString(status).c_str()); break; } - - std::pair buf = mGrallocWrapper->allocate(size); - handle = buf.first; - buffer = static_cast(buf.second); + // Per the HAL, all-zeros Rect means the entire buffer + android::Rect rect = {0, 0, 0, 0}; + void* ret; + status = android::GraphicBufferMapper::get().lock(bufferHandle, kBufferUsage, rect, + &ret); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory failed to import buffer: Status: %s", + android::statusToString(status).c_str()); + } else { + buffer = static_cast(ret); + mBufferHandle = bufferHandle; + } break; } default: @@ -208,9 +252,9 @@ class SensorsAidlTestSharedMemory { ISensors::SharedMemInfo::SharedMemType mType; native_handle_t* mNativeHandle; + buffer_handle_t mBufferHandle; size_t mSize; char* mBuffer; - std::unique_ptr<::android::GrallocWrapper> mGrallocWrapper; DISALLOW_COPY_AND_ASSIGN(SensorsAidlTestSharedMemory); }; diff --git a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h index b3815807b7..becc93ce3e 100644 --- a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h +++ b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h @@ -52,8 +52,6 @@ using ::android::hardware::sensors::V1_0::SharedMemType; using ::android::hardware::sensors::V1_0::Vec3; using ::android::hardware::sensors::V2_1::implementation::convertToOldSensorInfos; using std::chrono::duration_cast; -using std::chrono::microseconds; -using std::chrono::milliseconds; using std::chrono::nanoseconds; using EventV1_0 = ::android::hardware::sensors::V1_0::Event; @@ -91,7 +89,7 @@ class EventCallback : public IEventCallback { } void waitForFlushEvents(const std::vector& sensorsToWaitFor, - int32_t numCallsToFlush, milliseconds timeout) { + int32_t numCallsToFlush, std::chrono::milliseconds timeout) { std::unique_lock lock(mFlushMutex); mFlushCV.wait_for(lock, timeout, [&] { return flushesReceived(sensorsToWaitFor, numCallsToFlush); }); @@ -102,7 +100,8 @@ class EventCallback : public IEventCallback { return mEventMap[sensorHandle]; } - void waitForEvents(const std::vector& sensorsToWaitFor, milliseconds timeout) { + void waitForEvents(const std::vector& sensorsToWaitFor, + std::chrono::milliseconds timeout) { std::unique_lock lock(mEventMutex); mEventCV.wait_for(lock, timeout, [&] { return eventsReceived(sensorsToWaitFor); }); } @@ -472,7 +471,7 @@ TEST_P(SensorsHidlTest, InjectSensorEventData) { } // Wait for events to be written back to the Event FMQ - callback.waitForEvents(sensors, milliseconds(1000) /* timeout */); + callback.waitForEvents(sensors, std::chrono::milliseconds(1000) /* timeout */); getEnvironment()->unregisterCallback(); for (const auto& s : sensors) { @@ -623,7 +622,7 @@ void SensorsHidlTest::runFlushTest(const std::vector& sensors, b } // Wait up to one second for the flush events - callback.waitForFlushEvents(sensors, flushCalls, milliseconds(1000) /* timeout */); + callback.waitForFlushEvents(sensors, flushCalls, std::chrono::milliseconds(1000) /* timeout */); // Deactivate all sensors after waiting for flush events so pending flush events are not // abandoned by the HAL. @@ -748,8 +747,8 @@ TEST_P(SensorsHidlTest, Activate) { } TEST_P(SensorsHidlTest, NoStaleEvents) { - constexpr milliseconds kFiveHundredMs(500); - constexpr milliseconds kOneSecond(1000); + constexpr std::chrono::milliseconds kFiveHundredMs(500); + constexpr std::chrono::milliseconds kOneSecond(1000); // Register the callback to receive sensor events EventCallback callback; @@ -757,10 +756,11 @@ TEST_P(SensorsHidlTest, NoStaleEvents) { // This test is not valid for one-shot, on-change or special-report-mode sensors const std::vector sensors = getNonOneShotAndNonOnChangeAndNonSpecialSensors(); - milliseconds maxMinDelay(0); + std::chrono::milliseconds maxMinDelay(0); for (const SensorInfoType& sensor : sensors) { - milliseconds minDelay = duration_cast(microseconds(sensor.minDelay)); - maxMinDelay = milliseconds(std::max(maxMinDelay.count(), minDelay.count())); + std::chrono::milliseconds minDelay = duration_cast( + std::chrono::microseconds(sensor.minDelay)); + maxMinDelay = std::chrono::milliseconds(std::max(maxMinDelay.count(), minDelay.count())); } // Activate the sensors so that they start generating events @@ -787,7 +787,7 @@ TEST_P(SensorsHidlTest, NoStaleEvents) { } // Allow some time to pass, reset the callback, then reactivate the sensors - usleep(duration_cast(kOneSecond + (5 * maxMinDelay)).count()); + usleep(duration_cast(kOneSecond + (5 * maxMinDelay)).count()); callback.reset(); activateAllSensors(true); callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay)); @@ -815,9 +815,10 @@ TEST_P(SensorsHidlTest, NoStaleEvents) { // Ensure that the first event received is not stale by ensuring that its timestamp is // sufficiently different from the previous event const EventType newEvent = events.front(); - milliseconds delta = duration_cast( + std::chrono::milliseconds delta = duration_cast( nanoseconds(newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle])); - milliseconds sensorMinDelay = duration_cast(microseconds(sensor.minDelay)); + std::chrono::milliseconds sensorMinDelay = duration_cast( + std::chrono::microseconds(sensor.minDelay)); ASSERT_GE(delta, kFiveHundredMs + (3 * sensorMinDelay)); } } diff --git a/sensors/common/vts/utils/Android.bp b/sensors/common/vts/utils/Android.bp index b35280a541..ab3984ca74 100644 --- a/sensors/common/vts/utils/Android.bp +++ b/sensors/common/vts/utils/Android.bp @@ -35,6 +35,7 @@ cc_defaults { "libbinder_ndk", "libutils", "libvndksupport", + "libui", ], static_libs: [ "libaidlcommonsupport", @@ -50,9 +51,6 @@ cc_library_static { "android.hardware.graphics.common-ndk_shared", ], cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""], - srcs: [ - "GrallocWrapper.cpp", - ], export_include_dirs: [ "include", ], @@ -64,6 +62,7 @@ cc_library_static { "libbinder_ndk", "libutils", "libvndksupport", + "libui", ], static_libs: [ "android.hardware.sensors@1.0", @@ -71,13 +70,4 @@ cc_library_static { "android.hardware.sensors@2.1", "libaidlcommonsupport", ], - whole_static_libs: [ - "android.hardware.graphics.allocator@2.0", - "android.hardware.graphics.allocator@3.0", - "android.hardware.graphics.allocator@4.0", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@2.1", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", - ], } diff --git a/sensors/common/vts/utils/GrallocWrapper.cpp b/sensors/common/vts/utils/GrallocWrapper.cpp deleted file mode 100644 index a15e7fee8c..0000000000 --- a/sensors/common/vts/utils/GrallocWrapper.cpp +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "GrallocWrapper.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -using IAllocatorAidl = ::aidl::android::hardware::graphics::allocator::IAllocator; -using IAllocator2 = ::android::hardware::graphics::allocator::V2_0::IAllocator; -using IAllocator3 = ::android::hardware::graphics::allocator::V3_0::IAllocator; -using IAllocator4 = ::android::hardware::graphics::allocator::V4_0::IAllocator; -using IMapper2 = ::android::hardware::graphics::mapper::V2_0::IMapper; -using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper; -using IMapper3 = ::android::hardware::graphics::mapper::V3_0::IMapper; -using IMapper4 = ::android::hardware::graphics::mapper::V4_0::IMapper; - -using Error2 = ::android::hardware::graphics::mapper::V2_0::Error; -using Error3 = ::android::hardware::graphics::mapper::V3_0::Error; -using Error4 = ::android::hardware::graphics::mapper::V4_0::Error; - -using ::aidl::android::hardware::common::NativeHandle; -using ::aidl::android::hardware::graphics::allocator::AllocationResult; - -using ::android::hardware::graphics::common::V1_0::BufferUsage; -using ::android::hardware::graphics::common::V1_0::PixelFormat; - -using ::android::hardware::hidl_handle; -using ::android::hardware::hidl_string; -using ::android::hardware::hidl_vec; - -namespace android { - -// Since we use the same APIs across allocator/mapper HALs but they have major -// version differences (meaning they are not related through inheritance), we -// create a common interface abstraction for the IAllocator + IMapper combination -// (major versions need to match in the current HALs, e.g. IAllocator 3.0 needs to -// be paired with IMapper 3.0, so these are tied together) -class IGrallocHalWrapper { - public: - virtual ~IGrallocHalWrapper() = default; - - // IAllocator - virtual native_handle_t* allocate(uint32_t size) = 0; - virtual void freeBuffer(native_handle_t* bufferHandle) = 0; - - // IMapper - virtual void* lock(native_handle_t* bufferHandle) = 0; - virtual void unlock(native_handle_t* bufferHandle) = 0; -}; - -namespace { - -bool failed(Error2 error) { - return (error != Error2::NONE); -} -bool failed(Error3 error) { - return (error != Error3::NONE); -} -bool failed(Error4 error) { - return (error != Error4::NONE); -} - -template -struct FirstArg; - -// Template specialization for pointer to a non-static member function, which exposes -// the type of the first argument given to said function -template -struct FirstArg { - using type = Arg1; -}; - -// Alias to FirstArg which also removes any reference type and const associated -template -using BaseTypeOfFirstArg = typename std::remove_const< - typename std::remove_reference::type>::type>::type; - -// Since all the type and function names are the same for the things we use across the major HAL -// versions, we use template magic to avoid repeating ourselves. -template typename AllocatorWrapperT = sp> -class GrallocHalWrapper : public IGrallocHalWrapper { - public: - GrallocHalWrapper(const AllocatorWrapperT& allocator, const sp& mapper) - : mAllocator(allocator), mMapper(mapper) { - if (mapper->isRemote()) { - ALOGE("Mapper is in passthrough mode"); - } - } - - virtual native_handle_t* allocate(uint32_t size) override; - virtual void freeBuffer(native_handle_t* bufferHandle) override; - - virtual void* lock(native_handle_t* bufferHandle) override; - virtual void unlock(native_handle_t* bufferHandle) override; - - private: - static constexpr uint64_t kBufferUsage = - static_cast(BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::CPU_READ_OFTEN | - BufferUsage::CPU_WRITE_RARELY); - AllocatorWrapperT mAllocator; - sp mMapper; - - // v2.0 and v3.0 use vec for BufferDescriptor, but v4.0 uses vec, so use - // some template magic to deduce the right type based off of the first argument to allocate(), - // which is always the version-specific BufferDescriptor type - typedef BaseTypeOfFirstArg BufferDescriptorT; - - BufferDescriptorT getDescriptor(uint32_t size); - native_handle_t* importBuffer(const hidl_handle& rawHandle); -}; - -template <> -native_handle_t* GrallocHalWrapper::allocate( - uint32_t size) { - constexpr uint32_t kBufferCount = 1; - BufferDescriptorT descriptor = getDescriptor(size); - native_handle_t* bufferHandle = nullptr; - - AllocationResult result; - auto status = mAllocator->allocate(descriptor, kBufferCount, &result); - if (!status.isOk()) { - status_t error = status.getExceptionCode(); - ALOGE("Failed to allocate buffer: %" PRId32, static_cast(error)); - } else if (result.buffers.size() != kBufferCount) { - ALOGE("Invalid buffer array size (got %zu, expected %" PRIu32 ")", result.buffers.size(), - kBufferCount); - } else { - // Convert from AIDL NativeHandle to native_handle_t to hidl_handle - hidl_handle hidlHandle; - hidlHandle.setTo(dupFromAidl(result.buffers[0]), /*shouldOwn*/ true); - bufferHandle = importBuffer(hidlHandle); - } - - return bufferHandle; -} - -template typename AllocatorWrapperT> -native_handle_t* GrallocHalWrapper::allocate( - uint32_t size) { - constexpr uint32_t kBufferCount = 1; - BufferDescriptorT descriptor = getDescriptor(size); - native_handle_t* bufferHandle = nullptr; - - auto callback = [&](auto error, uint32_t /*stride*/, const hidl_vec& buffers) { - if (failed(error)) { - ALOGE("Failed to allocate buffer: %" PRId32, static_cast(error)); - } else if (buffers.size() != kBufferCount) { - ALOGE("Invalid buffer array size (got %zu, expected %" PRIu32 ")", buffers.size(), - kBufferCount); - } else { - bufferHandle = importBuffer(buffers[0]); - } - }; - - mAllocator->allocate(descriptor, kBufferCount, callback); - return bufferHandle; -} - -template typename AllocatorWrapperT> -void GrallocHalWrapper::freeBuffer( - native_handle_t* bufferHandle) { - auto error = mMapper->freeBuffer(bufferHandle); - if (!error.isOk() || failed(error)) { - ALOGE("Failed to free buffer %p", bufferHandle); - } -} - -template typename AllocatorWrapperT> -typename GrallocHalWrapper::BufferDescriptorT -GrallocHalWrapper::getDescriptor(uint32_t size) { - typename MapperT::BufferDescriptorInfo descriptorInfo = { - .width = size, - .height = 1, - .layerCount = 1, - .format = static_cast(PixelFormat::BLOB), - .usage = kBufferUsage, - }; - - BufferDescriptorT descriptor; - auto callback = [&](auto error, const BufferDescriptorT& tmpDescriptor) { - if (failed(error)) { - ALOGE("Failed to create descriptor: %" PRId32, static_cast(error)); - } else { - descriptor = tmpDescriptor; - } - }; - - mMapper->createDescriptor(descriptorInfo, callback); - return descriptor; -} - -template typename AllocatorWrapperT> -native_handle_t* GrallocHalWrapper::importBuffer( - const hidl_handle& rawHandle) { - native_handle_t* bufferHandle = nullptr; - - mMapper->importBuffer(rawHandle, [&](auto error, void* tmpBuffer) { - if (failed(error)) { - ALOGE("Failed to import buffer %p: %" PRId32, rawHandle.getNativeHandle(), - static_cast(error)); - } else { - bufferHandle = static_cast(tmpBuffer); - } - }); - - return bufferHandle; -} - -template typename AllocatorWrapperT> -void* GrallocHalWrapper::lock( - native_handle_t* bufferHandle) { - // Per the HAL, all-zeros Rect means the entire buffer - typename MapperT::Rect accessRegion = {}; - hidl_handle acquireFenceHandle; // No fence needed, already safe to lock - - void* data = nullptr; - mMapper->lock(bufferHandle, kBufferUsage, accessRegion, acquireFenceHandle, - [&](auto error, void* tmpData, ...) { // V3/4 pass extra args we don't use - if (failed(error)) { - ALOGE("Failed to lock buffer %p: %" PRId32, bufferHandle, - static_cast(error)); - } else { - data = tmpData; - } - }); - - return data; -} - -template typename AllocatorWrapperT> -void GrallocHalWrapper::unlock( - native_handle_t* bufferHandle) { - mMapper->unlock(bufferHandle, [&](auto error, const hidl_handle& /*releaseFence*/) { - if (failed(error)) { - ALOGE("Failed to unlock buffer %p: %" PRId32, bufferHandle, - static_cast(error)); - } - }); -} - -} // anonymous namespace - -GrallocWrapper::GrallocWrapper() { - sp allocator4 = IAllocator4::getService(); - sp mapper4 = IMapper4::getService(); - - const auto kAllocatorSvc = std::string(IAllocatorAidl::descriptor) + "/default"; - std::shared_ptr allocatorAidl; - if (AServiceManager_isDeclared(kAllocatorSvc.c_str())) { - allocatorAidl = IAllocatorAidl::fromBinder( - ndk::SpAIBinder(AServiceManager_checkService(kAllocatorSvc.c_str()))); - } - - // As of T, AIDL Allocator is supported only with HIDL Mapper4 - // (ref: VtsHalGraphicsAllocatorAidl_TargetTest.cpp) - if (allocatorAidl != nullptr && mapper4 != nullptr) { - ALOGD("Using AIDL IAllocator + HIDL IMapper v4.0"); - mGrallocHal = std::unique_ptr( - new GrallocHalWrapper(allocatorAidl, - mapper4)); - } else if (allocator4 != nullptr && mapper4 != nullptr) { - ALOGD("AIDL IAllocator not found, using HIDL IAllocator/IMapper v4.0"); - mGrallocHal = std::unique_ptr( - new GrallocHalWrapper(allocator4, mapper4)); - } else { - ALOGD("Graphics HALs 4.0 not found (allocator %d mapper %d), falling back to 3.0", - (allocator4 != nullptr), (mapper4 != nullptr)); - - sp allocator3 = IAllocator3::getService(); - sp mapper3 = IMapper3::getService(); - - if (allocator3 != nullptr && mapper3 != nullptr) { - mGrallocHal = std::unique_ptr( - new GrallocHalWrapper(allocator3, mapper3)); - } else { - ALOGD("Graphics HALs 3.0 not found (allocator %d mapper %d), falling back to 2.x", - (allocator3 != nullptr), (mapper3 != nullptr)); - - sp allocator2 = IAllocator2::getService(); - sp mapper2 = IMapper2_1::getService(); - if (mapper2 == nullptr) { - mapper2 = IMapper2::getService(); - } - - if (allocator2 != nullptr && mapper2 != nullptr) { - mGrallocHal = std::unique_ptr( - new GrallocHalWrapper(allocator2, mapper2)); - } else { - ALOGE("Couldn't open graphics HALs (2.x allocator %d mapper %d)", - (allocator2 != nullptr), (mapper2 != nullptr)); - } - } - } -} - -GrallocWrapper::~GrallocWrapper() { - for (auto bufferHandle : mAllocatedBuffers) { - mGrallocHal->unlock(bufferHandle); - mGrallocHal->freeBuffer(bufferHandle); - } - mAllocatedBuffers.clear(); -} - -std::pair GrallocWrapper::allocate(uint32_t size) { - native_handle_t* bufferHandle = mGrallocHal->allocate(size); - void* buffer = nullptr; - if (bufferHandle) { - buffer = mGrallocHal->lock(bufferHandle); - if (buffer) { - mAllocatedBuffers.insert(bufferHandle); - } else { - mGrallocHal->freeBuffer(bufferHandle); - bufferHandle = nullptr; - } - } - return std::make_pair<>(bufferHandle, buffer); -} - -void GrallocWrapper::freeBuffer(native_handle_t* bufferHandle) { - if (mAllocatedBuffers.erase(bufferHandle)) { - mGrallocHal->unlock(bufferHandle); - mGrallocHal->freeBuffer(bufferHandle); - } -} - -} // namespace android diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h b/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h deleted file mode 100644 index ebbcb2c06f..0000000000 --- a/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include -#include -#include -#include - -namespace android { - -class IGrallocHalWrapper; - -// Reference: hardware/interfaces/graphics/mapper/2.0/vts/functional/ -class GrallocWrapper { - public: - GrallocWrapper(); - ~GrallocWrapper(); - - // After constructing this object, this function must be called to check the result. If it - // returns false, other methods are not safe to call. - bool isInitialized() const { return (mGrallocHal != nullptr); }; - - // Allocates a gralloc buffer suitable for direct channel sensors usage with the given size. - // The buffer should be freed using freeBuffer when it's not needed anymore; otherwise it'll - // be freed when this object is destroyed. - // Returns a handle to the buffer, and a CPU-accessible pointer for reading. On failure, both - // will be set to nullptr. - std::pair allocate(uint32_t size); - - // Releases a gralloc buffer previously returned by allocate() - void freeBuffer(native_handle_t* bufferHandle); - - private: - std::unique_ptr mGrallocHal; - - // Keep track of all cloned and imported handles. When a test fails with - // ASSERT_*, the destructor will free the handles for the test. - std::unordered_set mAllocatedBuffers; -}; - -} // namespace android diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h index 39084a45e6..b96adb3df5 100644 --- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h +++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h @@ -17,7 +17,11 @@ #ifndef ANDROID_SENSORS_TEST_SHARED_MEMORY_H #define ANDROID_SENSORS_TEST_SHARED_MEMORY_H -#include "GrallocWrapper.h" +#include +#include +#include +#include +#include #include #include @@ -28,6 +32,8 @@ #include using namespace ::android::hardware::sensors::V1_0; +using ::aidl::android::hardware::graphics::common::BufferUsage; +using ::aidl::android::hardware::graphics::common::PixelFormat; template class SensorsTestSharedMemory { @@ -48,11 +54,20 @@ class SensorsTestSharedMemory { } SharedMemInfo getSharedMemInfo() const { - SharedMemInfo mem = {.type = mType, - .format = SharedMemFormat::SENSORS_EVENT, - .size = static_cast(mSize), - .memoryHandle = mNativeHandle}; - return mem; + if (mType == SharedMemType::GRALLOC) { + SharedMemInfo mem = {.type = mType, + .format = SharedMemFormat::SENSORS_EVENT, + .size = static_cast(mSize), + .memoryHandle = mBufferHandle}; + return mem; + + } else { + SharedMemInfo mem = {.type = mType, + .format = SharedMemFormat::SENSORS_EVENT, + .size = static_cast(mSize), + .memoryHandle = mNativeHandle}; + return mem; + } } char* getBuffer() const { return mBuffer; } size_t getSize() const { return mSize; } @@ -128,17 +143,26 @@ class SensorsTestSharedMemory { } case SharedMemType::GRALLOC: { if (mSize != 0) { - mGrallocWrapper->freeBuffer(mNativeHandle); - mNativeHandle = nullptr; + android::status_t status = + android::GraphicBufferAllocator::get().free(mBufferHandle); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory Gralloc failed to free buffer. Status: " + "%s", + android::statusToString(status).c_str()); + } + mBufferHandle = nullptr; + mBuffer = nullptr; mSize = 0; } break; } default: { - if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) { - ALOGE("SensorsTestSharedMemory %p not properly destructed: " - "type %d, native handle %p, size %zu, buffer %p", - this, static_cast(mType), mNativeHandle, mSize, mBuffer); + if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr || + mBufferHandle != nullptr) { + ALOGE("SensorsAidlTestSharedMemory %p not properly destructed: " + "type %d, native handle %p, size %zu, buffer %p, buffer handle %p", + this, static_cast(mType), mNativeHandle, mSize, mBuffer, + mBufferHandle); } break; } @@ -171,14 +195,33 @@ class SensorsTestSharedMemory { break; } case SharedMemType::GRALLOC: { - mGrallocWrapper = std::make_unique<::android::GrallocWrapper>(); - if (!mGrallocWrapper->isInitialized()) { + static constexpr uint64_t kBufferUsage = + static_cast(BufferUsage::SENSOR_DIRECT_DATA) | + static_cast(BufferUsage::CPU_READ_OFTEN) | + static_cast(BufferUsage::CPU_WRITE_RARELY); + + uint32_t stride = 0; + buffer_handle_t bufferHandle; + android::status_t status = android::GraphicBufferAllocator::get().allocate( + size, 1, static_cast(PixelFormat::BLOB), 1, kBufferUsage, + &bufferHandle, &stride, "SensorVts"); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory failed to allocate memory. Status: %s", + android::statusToString(status).c_str()); break; } - - std::pair buf = mGrallocWrapper->allocate(size); - handle = buf.first; - buffer = static_cast(buf.second); + // Per the HAL, all-zeros Rect means the entire buffer + android::Rect rect = {0, 0, 0, 0}; + void* ret; + status = android::GraphicBufferMapper::get().lock(bufferHandle, kBufferUsage, rect, + &ret); + if (status != android::OK) { + ALOGE("SensorsAidlTestSharedMemory failed to import buffer: Status: %s", + android::statusToString(status).c_str()); + } else { + buffer = static_cast(ret); + mBufferHandle = bufferHandle; + } break; } default: @@ -194,9 +237,9 @@ class SensorsTestSharedMemory { SharedMemType mType; native_handle_t* mNativeHandle; + buffer_handle_t mBufferHandle; size_t mSize; char* mBuffer; - std::unique_ptr<::android::GrallocWrapper> mGrallocWrapper; DISALLOW_COPY_AND_ASSIGN(SensorsTestSharedMemory); }; -- GitLab From 3254bd793d52b16945e131b1f219f727351329a1 Mon Sep 17 00:00:00 2001 From: Thomas Nguyen Date: Fri, 13 Oct 2023 00:00:52 +0000 Subject: [PATCH 183/376] Revert "Add Satellite HAL APIs" Revert submission 20583557-Satellite APIs Reason for revert: Radio HAL for satellite APIs are not needed. Reverted changes: /q/submissionid:20583557-Satellite+APIs Bug: 304622222 Test: SMS, MMS, call with live network. SatelliteManagerTestOnMockService SatelliteManagerTest SatelliteControllerTest DatagramDispatcherTest DatagramReceiverTest SatelliteSOSMessageRecommenderTest NtnCapabilityResolverTest ServiceStateTrackerTest VtsHalRadioTargetTest Change-Id: If75532dea8ffb3c4827871a6c1719d5f8d54c4df --- .../compatibility_matrix.9.xml | 10 - radio/aidl/Android.bp | 16 - .../radio/satellite/IRadioSatellite.aidl | 54 -- .../satellite/IRadioSatelliteIndication.aidl | 45 -- .../satellite/IRadioSatelliteResponse.aidl | 53 -- .../radio/satellite/IndicationFilter.aidl | 40 -- .../radio/satellite/NTRadioTechnology.aidl | 42 -- .../radio/satellite/PointingInfo.aidl | 43 -- .../satellite/SatelliteCapabilities.aidl | 43 -- .../radio/satellite/SatelliteFeature.aidl | 42 -- .../radio/satellite/SatelliteMode.aidl | 43 -- .../android/hardware/radio/RadioError.aidl | 11 - .../android/hardware/radio/RadioError.aidl | 47 -- .../radio/satellite/IRadioSatellite.aidl | 169 ------ .../satellite/IRadioSatelliteIndication.aidl | 91 --- .../satellite/IRadioSatelliteResponse.aidl | 462 ---------------- .../radio/satellite/IndicationFilter.aidl | 26 - .../radio/satellite/NTRadioTechnology.aidl | 32 -- .../radio/satellite/PointingInfo.aidl | 43 -- .../satellite/SatelliteCapabilities.aidl | 51 -- .../radio/satellite/SatelliteFeature.aidl | 32 -- .../radio/satellite/SatelliteMode.aidl | 34 -- radio/aidl/compat/libradiocompat/Android.bp | 4 - .../include/libradiocompat/RadioIndication.h | 10 - .../include/libradiocompat/RadioResponse.h | 9 - .../include/libradiocompat/RadioSatellite.h | 65 --- .../satellite/RadioIndication-satellite.cpp | 39 -- .../satellite/RadioResponse-satellite.cpp | 39 -- .../satellite/RadioSatellite.cpp | 128 ----- radio/aidl/compat/service/Android.bp | 1 - radio/aidl/vts/Android.bp | 4 - radio/aidl/vts/VtsHalRadioTargetTest.cpp | 7 - radio/aidl/vts/radio_aidl_hal_utils.h | 2 - radio/aidl/vts/radio_satellite_indication.cpp | 56 -- radio/aidl/vts/radio_satellite_response.cpp | 120 ---- radio/aidl/vts/radio_satellite_test.cpp | 519 ------------------ radio/aidl/vts/radio_satellite_utils.h | 126 ----- 37 files changed, 2558 deletions(-) delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl delete mode 100644 radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl delete mode 100644 radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl delete mode 100644 radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h delete mode 100644 radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp delete mode 100644 radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp delete mode 100644 radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp delete mode 100644 radio/aidl/vts/radio_satellite_indication.cpp delete mode 100644 radio/aidl/vts/radio_satellite_response.cpp delete mode 100644 radio/aidl/vts/radio_satellite_test.cpp delete mode 100644 radio/aidl/vts/radio_satellite_utils.h diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 00139232e9..a69def8384 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -485,16 +485,6 @@ slot3 - - android.hardware.radio.satellite - 1 - - IRadioSatellite - slot1 - slot2 - slot3 - - android.hardware.radio.ims.media 2 diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp index 72aaa0ffc5..1971832465 100644 --- a/radio/aidl/Android.bp +++ b/radio/aidl/Android.bp @@ -318,19 +318,3 @@ aidl_interface { }, ], } - -aidl_interface { - name: "android.hardware.radio.satellite", - vendor_available: true, - srcs: ["android/hardware/radio/satellite/*.aidl"], - stability: "vintf", - imports: ["android.hardware.radio-V3"], - backend: { - cpp: { - enabled: false, - }, - java: { - sdk_version: "module_current", - }, - }, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl deleted file mode 100644 index 0c7408ad81..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatellite.aidl +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@VintfStability -interface IRadioSatellite { - oneway void addAllowedSatelliteContacts(in int serial, in String[] contacts); - oneway void getCapabilities(in int serial); - oneway void getMaxCharactersPerTextMessage(in int serial); - oneway void getPendingMessages(in int serial); - oneway void getPowerState(in int serial); - oneway void getSatelliteMode(in int serial); - oneway void getTimeForNextSatelliteVisibility(in int serial); - oneway void provisionService(in int serial, in String imei, in String msisdn, in String imsi, in android.hardware.radio.satellite.SatelliteFeature[] features); - oneway void removeAllowedSatelliteContacts(in int serial, in String[] contacts); - oneway void responseAcknowledgement(); - oneway void sendMessages(in int serial, in String[] messages, in String destination, in double latitude, in double longitude); - oneway void setIndicationFilter(in int serial, in int filterBitmask); - oneway void setPower(in int serial, in boolean on); - oneway void setResponseFunctions(in android.hardware.radio.satellite.IRadioSatelliteResponse satelliteResponse, in android.hardware.radio.satellite.IRadioSatelliteIndication satelliteIndication); - oneway void startSendingSatellitePointingInfo(in int serial); - oneway void stopSendingSatellitePointingInfo(in int serial); -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl deleted file mode 100644 index 36ec5f37ec..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@VintfStability -interface IRadioSatelliteIndication { - oneway void onMessagesTransferComplete(in android.hardware.radio.RadioIndicationType type, in boolean complete); - oneway void onNewMessages(in android.hardware.radio.RadioIndicationType type, in String[] messages); - oneway void onPendingMessageCount(in android.hardware.radio.RadioIndicationType type, in int count); - oneway void onProvisionStateChanged(in android.hardware.radio.RadioIndicationType type, boolean provisioned, in android.hardware.radio.satellite.SatelliteFeature[] features); - oneway void onSatelliteModeChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.SatelliteMode mode); - oneway void onSatellitePointingInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.PointingInfo pointingInfo); - oneway void onSatelliteRadioTechnologyChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.satellite.NTRadioTechnology technology); -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl deleted file mode 100644 index bf9b9e6a9b..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@VintfStability -interface IRadioSatelliteResponse { - oneway void acknowledgeRequest(in int serial); - oneway void addAllowedSatelliteContactsResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void getCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.satellite.SatelliteCapabilities capabilities); - oneway void getMaxCharactersPerTextMessageResponse(in android.hardware.radio.RadioResponseInfo info, in int charLimit); - oneway void getPendingMessagesResponse(in android.hardware.radio.RadioResponseInfo info, in String[] messages); - oneway void getPowerStateResponse(in android.hardware.radio.RadioResponseInfo info, in boolean on); - oneway void getSatelliteModeResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.satellite.SatelliteMode mode, in android.hardware.radio.satellite.NTRadioTechnology technology); - oneway void getTimeForNextSatelliteVisibilityResponse(in android.hardware.radio.RadioResponseInfo info, in int timeInSeconds); - oneway void provisionServiceResponse(in android.hardware.radio.RadioResponseInfo info, in boolean provisioned); - oneway void removeAllowedSatelliteContactsResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void sendMessagesResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void setIndicationFilterResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void setPowerResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void startSendingSatellitePointingInfoResponse(in android.hardware.radio.RadioResponseInfo info); - oneway void stopSendingSatellitePointingInfoResponse(in android.hardware.radio.RadioResponseInfo info); -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl deleted file mode 100644 index b9df1f513b..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/IndicationFilter.aidl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@Backing(type="int") @JavaDerive(toString=true) @VintfStability -enum IndicationFilter { - NONE = 0, - SATELLITE_MODE = 1, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl deleted file mode 100644 index f05baaa8a6..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/NTRadioTechnology.aidl +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@Backing(type="int") @JavaDerive(toString=true) @VintfStability -enum NTRadioTechnology { - NB_IOT_NTN = 0, - NR_NTN = 1, - EMTC_NTN = 2, - PROPRIETARY = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl deleted file mode 100644 index 1ada88a035..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/PointingInfo.aidl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@JavaDerive(toString=true) @VintfStability -parcelable PointingInfo { - float satelliteAzimuthDegrees; - float satelliteElevationDegrees; - float antennaAzimuthDegrees; - float antennaPitchDegrees; - float antennaRollDegrees; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl deleted file mode 100644 index e0af71ac6c..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteCapabilities.aidl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@JavaDerive(toString=true) @VintfStability -parcelable SatelliteCapabilities { - android.hardware.radio.satellite.NTRadioTechnology[] supportedRadioTechnologies; - boolean isAlwaysOn; - boolean needsPointingToSatellite; - android.hardware.radio.satellite.SatelliteFeature[] supportedFeatures; - boolean needsSeparateSimProfile; -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl deleted file mode 100644 index e79e572b3c..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteFeature.aidl +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@Backing(type="int") @JavaDerive(toString=true) @VintfStability -enum SatelliteFeature { - SOS_SMS = 0, - EMERGENCY_SMS = 1, - SMS = 2, - LOCATION_SHARING = 3, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl deleted file mode 100644 index a1ce566507..0000000000 --- a/radio/aidl/aidl_api/android.hardware.radio.satellite/current/android/hardware/radio/satellite/SatelliteMode.aidl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.radio.satellite; -/* @hide */ -@Backing(type="int") @JavaDerive(toString=true) @VintfStability -enum SatelliteMode { - POWERED_OFF = 0, - OUT_OF_SERVICE_NOT_SEARCHING = 1, - OUT_OF_SERVICE_SEARCHING = 2, - ACQUIRED = 3, - MESSAGE_TRANSFERRING = 4, -} diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl index 781c9f61ef..02c537055c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl @@ -124,15 +124,4 @@ enum RadioError { BLOCKED_DUE_TO_CALL = 69, RF_HARDWARE_ISSUE = 70, NO_RF_CALIBRATION_INFO = 71, - ENCODING_NOT_SUPPORTED = 72, - FEATURE_NOT_SUPPORTED = 73, - INVALID_CONTACT = 74, - MODEM_INCOMPATIBLE = 75, - NETWORK_TIMEOUT = 76, - NO_SATELLITE_SIGNAL = 77, - NOT_SUFFICIENT_ACCOUNT_BALANCE = 78, - RADIO_TECHNOLOGY_NOT_SUPPORTED = 79, - SUBSCRIBER_NOT_AUTHORIZED = 80, - SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL = 81, - UNIDENTIFIED_SUBSCRIBER = 82, } diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl index e95d72508b..9c39bc4420 100644 --- a/radio/aidl/android/hardware/radio/RadioError.aidl +++ b/radio/aidl/android/hardware/radio/RadioError.aidl @@ -302,51 +302,4 @@ enum RadioError { * Unlike RF_HARDWARE_ISSUE, this is a SW problem and no HW repair is needed. */ NO_RF_CALIBRATION_INFO = 71, - /** - * The encoding scheme is not supported by either the network or the MS. - */ - ENCODING_NOT_SUPPORTED = 72, - /** - * The requesting feature is not supported by the service provider/operator. - */ - FEATURE_NOT_SUPPORTED = 73, - /** - * The contact to be added is either not existing or not valid. - */ - INVALID_CONTACT = 74, - /** - * The modem of the MS is not compatible with the service provider/operator. This generic error - * should be used only when there are some mimatches in the capabilities between the MS and - * the operator and the error cannot be mapped properly to other specific network errors. - */ - MODEM_INCOMPATIBLE = 75, - /** - * Modem timeout to receive ACK or response from network after sending a request to the network. - */ - NETWORK_TIMEOUT = 76, - /** - * Modem fails to communicate with the satellite network since there is no satellite signal. - */ - NO_SATELLITE_SIGNAL = 77, - /** - * The request cannot be performed since the subscriber's account balance is not sufficient. - */ - NOT_SUFFICIENT_ACCOUNT_BALANCE = 78, - /** - * The radio technology is not supported by the service provider/operator. - */ - RADIO_TECHNOLOGY_NOT_SUPPORTED = 79, - /** - * The subscription is not authorized to register with the service provider/operator. - */ - SUBSCRIBER_NOT_AUTHORIZED = 80, - /** - * While processing a request from the Framework, the satellite modem detects terrestrial - * signal, aborts the request, and switches to the terrestrial network. - */ - SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL = 81, - /** - * The subscriber is not registered in the service provider. - */ - UNIDENTIFIED_SUBSCRIBER = 82 } diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl deleted file mode 100644 index 749f49f07c..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatellite.aidl +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -import android.hardware.radio.satellite.IRadioSatelliteIndication; -import android.hardware.radio.satellite.IRadioSatelliteResponse; -import android.hardware.radio.satellite.IndicationFilter; -import android.hardware.radio.satellite.SatelliteFeature; - -/** - * This interface is used by telephony to send commands to and query info from satellite modem. - * All the functions have minimum one parameter: - * serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the - * duration of a method call. If clients provide colliding serials (including passing the same - * serial to different methods), multiple responses (one for each method call) must still be served. - * @hide - */ -@VintfStability -oneway interface IRadioSatellite { - /** - * Add contacts that are allowed to be used for satellite communication. This is applicable for - * incoming messages as well. - * - * @param serial Serial number of request. - * @param contacts List of allowed contacts to be added. - */ - void addAllowedSatelliteContacts(in int serial, in String[] contacts); - - /** - * Get feature capabilities supported by satellite. - * - * @param serial Serial number of request. - */ - void getCapabilities(in int serial); - - /** - * Get max number of characters per text message. - * - * @param serial Serial number of request. - */ - void getMaxCharactersPerTextMessage(in int serial); - - /** - * Get pending messages. - * - * @param serial Serial number of request. - */ - void getPendingMessages(in int serial); - - /** - * Get satellite modem state. - * - * @param serial Serial number of request. - */ - void getPowerState(in int serial); - - /** - * Get current satellite registration mode, which is defined in {@link #SatelliteMode}. - * - * @param serial Serial number of request. - */ - void getSatelliteMode(in int serial); - - /** - * Get time for next visibility of satellite. - * - * @param serial Serial number of request. - */ - void getTimeForNextSatelliteVisibility(in int serial); - - /** - * Provision the subscription with a satellite provider. This is needed to register the - * subscription if the provider allows dynamic registration. - * - * @param serial Serial number of request. - * @param imei IMEI of the SIM associated with the satellite modem. - * @param msisdn MSISDN of the SIM associated with the satellite modem. - * @param imsi IMSI of the SIM associated with the satellite modem. - * @param features List of features to be provisioned. - */ - void provisionService(in int serial, in String imei, in String msisdn, in String imsi, - in SatelliteFeature[] features); - - /** - * Remove contacts that are allowed to be used for satellite communication. This is applicable - * for incoming messages as well. - * - * @param serial Serial number of request. - * @param contacts List of allowed contacts to be removed. - */ - void removeAllowedSatelliteContacts(in int serial, in String[] contacts); - - /** - * When response type received from a radio indication or radio response is - * RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively, - * acknowledge the receipt of those messages by sending responseAcknowledgement(). - */ - void responseAcknowledgement(); - - /** - * Send text messages. - * - * @param serial Serial number of request. - * @param messages List of messages in text format to be sent. - * @param destination The recipient of the message. - * @param latitude The current latitude of the device. - * @param longitude The current longitude of the device. The location (i.e., latitude and - * longitude) of the device will be filled for emergency messages. - */ - void sendMessages(in int serial, in String[] messages, in String destination, - in double latitude, in double longitude); - - /** - * Set the filter for what type of indication framework want to receive from modem. - * - * @param serial Serial number of request. - * @param filterBitmask The filter bitmask identifying what type of indication Telephony - * framework wants to receive from modem. This bitmask is the 'or' - * combination of the enum values defined in {@link #IndicationFilter}. - */ - void setIndicationFilter(in int serial, in int filterBitmask); - - /** - * Turn satellite modem on/off. - * - * @param serial Serial number of request. - * @param on True for turning on. - * False for turning off. - */ - void setPower(in int serial, in boolean on); - - /** - * Set response functions for Satellite requests and indications. - * - * @param satelliteResponse Object containing response functions - * @param satelliteIndication Object containing radio indications - */ - void setResponseFunctions(in IRadioSatelliteResponse satelliteResponse, - in IRadioSatelliteIndication satelliteIndication); - - /** - * User started pointing to the satellite. Modem should continue to update the pointing input - * as user device/satellite moves. - * - * @param serial Serial number of request. - */ - void startSendingSatellitePointingInfo(in int serial); - - /** - * Stop sending satellite pointing info to the framework. - * - * @param serial Serial number of request. - */ - void stopSendingSatellitePointingInfo(in int serial); -} diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl deleted file mode 100644 index 2a2fb95221..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteIndication.aidl +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -import android.hardware.radio.RadioIndicationType; -import android.hardware.radio.satellite.NTRadioTechnology; -import android.hardware.radio.satellite.PointingInfo; -import android.hardware.radio.satellite.SatelliteFeature; -import android.hardware.radio.satellite.SatelliteMode; - -/** - * Interface declaring unsolicited radio indications for satellite APIs. - * @hide - */ -@VintfStability -oneway interface IRadioSatelliteIndication { - /** - * Confirms that ongoing message transfer is complete. - * - * @param type Type of radio indication - * @param complete True mean the transfer is complete. - * False means the transfer is not complete. - */ - void onMessagesTransferComplete(in RadioIndicationType type, in boolean complete); - - /** - * Indicates new message received on device. - * - * @param type Type of radio indication - * @param messages List of new messages received. - */ - void onNewMessages(in RadioIndicationType type, in String[] messages); - - /** - * Indicates that satellite has pending messages for the device to be pulled. - * - * @param type Type of radio indication - * @param count Number of pending messages. - */ - void onPendingMessageCount(in RadioIndicationType type, in int count); - - /** - * Indicate that satellite provision state has changed. - * - * @param type Type of radio indication - * @param provisioned True means the service is provisioned. - * False means the service is not provisioned. - * @param features List of Feature whose provision state has changed. - */ - void onProvisionStateChanged( - in RadioIndicationType type, boolean provisioned, in SatelliteFeature[] features); - - /** - * Indicate that satellite mode has changed. - * - * @param type Type of radio indication - * @param mode The current mode of the satellite modem. - */ - void onSatelliteModeChanged(in RadioIndicationType type, in SatelliteMode mode); - - /** - * Indicate that satellite Pointing input has changed. - * - * @param type Type of radio indication - * @param pointingInfo The current pointing info. - */ - void onSatellitePointingInfoChanged(in RadioIndicationType type, in PointingInfo pointingInfo); - - /** - * Indicate that satellite radio technology has changed. - * - * @param type Type of radio indication - * @param technology The current technology of the satellite modem. - */ - void onSatelliteRadioTechnologyChanged( - in RadioIndicationType type, in NTRadioTechnology technology); -} diff --git a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl b/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl deleted file mode 100644 index 2bef3d2d8d..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/IRadioSatelliteResponse.aidl +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -import android.hardware.radio.RadioResponseInfo; -import android.hardware.radio.satellite.NTRadioTechnology; -import android.hardware.radio.satellite.SatelliteCapabilities; -import android.hardware.radio.satellite.SatelliteMode; - -/** - * Interface declaring response functions to solicited radio requests for satellite APIs. - * @hide - */ -@VintfStability -oneway interface IRadioSatelliteResponse { - /** - * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for - * radio request which take long time to respond. For more details, refer - * https://source.android.com/devices/tech/connect/ril.html - * - * @param serial Serial no. of the request whose acknowledgement is sent. - */ - void acknowledgeRequest(in int serial); - - /** - * Response of the request addAllowedSatelliteContacts. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:ABORTED - * RadioError:ACCESS_BARRED - * RadioError:CANCELLED - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_CONTACT - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NETWORK_ERR - * RadioError:NETWORK_NOT_READY - * RadioError:NETWORK_REJECT - * RadioError:NETWORK_TIMEOUT - * RadioError:NO_MEMORY - * RadioError:NO_NETWORK_FOUND - * RadioError:NO_RESOURCES - * RadioError:NO_SATELLITE_SIGNAL - * RadioError:NO_SUBSCRIPTION - * RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SIM_ABSENT - * RadioError:SIM_BUSY - * RadioError:SIM_ERR - * RadioError:SIM_FULL - * RadioError:SYSTEM_ERR - * RadioError:UNIDENTIFIED_SUBSCRIBER - */ - void addAllowedSatelliteContactsResponse(in RadioResponseInfo info); - - /** - * Response of the request getCapabilities. - * - * @param info Response info struct containing serial no. and error - * @param capabilities List of capabilities that the satellite modem supports. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void getCapabilitiesResponse(in RadioResponseInfo info, in SatelliteCapabilities capabilities); - - /** - * Response of the request getMaxCharactersPerTextMessage. - * - * @param info Response info struct containing serial no. and error - * @param charLimit Maximum number of characters in a text message that can be sent. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void getMaxCharactersPerTextMessageResponse(in RadioResponseInfo info, in int charLimit); - - /** - * Response of the request getPendingMessages. - * - * @param info Response info struct containing serial no. and error - * @param messages List of pending messages received. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:ABORTED - * RadioError:ACCESS_BARRED - * RadioError:BLOCKED_DUE_TO_CALL - * RadioError:CANCELLED - * RadioError:ENCODING_ERR - * RadioError:ENCODING_NOT_SUPPORTED - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_SMS_FORMAT - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NETWORK_ERR - * RadioError:NETWORK_NOT_READY - * RadioError:NETWORK_REJECT - * RadioError:NETWORK_TIMEOUT - * RadioError:NO_MEMORY - * RadioError:NO_NETWORK_FOUND - * RadioError:NO_RESOURCES - * RadioError:NO_SMS_TO_ACK - * RadioError:NO_SATELLITE_SIGNAL - * RadioError:NO_SUBSCRIPTION - * RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SIM_ABSENT - * RadioError:SIM_BUSY - * RadioError:SIM_ERR - * RadioError:SIM_FULL - * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED - * RadioError:SYSTEM_ERR - * RadioError:SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL - */ - void getPendingMessagesResponse(in RadioResponseInfo info, in String[] messages); - - /** - * Response of the request getPowerSate. - * - * @param info Response info struct containing serial no. and error - * @param on True means the modem is ON. - * False means the modem is OFF. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void getPowerStateResponse(in RadioResponseInfo info, in boolean on); - - /** - * Response of the request getSatelliteMode. - * - * @param info Response info struct containing serial no. and error - * @param mode Current Mode of the satellite modem. - * @param technology The current technology of the satellite modem. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void getSatelliteModeResponse( - in RadioResponseInfo info, in SatelliteMode mode, in NTRadioTechnology technology); - - /** - * Response of the request getTimeForNextSatelliteVisibility. - * - * @param info Response info struct containing serial no. and error - * @param timeInSeconds The duration in seconds after which the satellite will be visible. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void getTimeForNextSatelliteVisibilityResponse(in RadioResponseInfo info, in int timeInSeconds); - - /** - * Response of the request provisionService. - * - * @param info Response info struct containing serial no. and error - * @param provisioned True means the service is provisioned. - * False means the service is not provisioned. - * - * Valid errors returned: - * RadioError:NONE - * RadioError:ABORTED - * RadioError:ACCESS_BARRED - * RadioError:CANCELLED - * RadioError:FEATURE_NOT_SUPPORTED - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:MODEM_INCOMPATIBLE - * RadioError:NETWORK_ERR - * RadioError:NETWORK_NOT_READY - * RadioError:NETWORK_REJECT - * RadioError:NETWORK_TIMEOUT - * RadioError:NO_MEMORY - * RadioError:NO_NETWORK_FOUND - * RadioError:NO_RESOURCES - * RadioError:NO_SATELLITE_SIGNAL - * RadioError:NO_SUBSCRIPTION - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:RADIO_TECHNOLOGY_NOT_SUPPORTED - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SIM_ABSENT - * RadioError:SIM_BUSY - * RadioError:SIM_ERR - * RadioError:SIM_FULL - * RadioError:SUBSCRIBER_NOT_AUTHORIZED - * RadioError:SYSTEM_ERR - */ - void provisionServiceResponse(in RadioResponseInfo info, in boolean provisioned); - - /** - * Response of the request removeAllowedSatelliteContacts. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:ABORTED - * RadioError:ACCESS_BARRED - * RadioError:CANCELLED - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_CONTACT - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NETWORK_ERR - * RadioError:NETWORK_NOT_READY - * RadioError:NETWORK_REJECT - * RadioError:NETWORK_TIMEOUT - * RadioError:NO_MEMORY - * RadioError:NO_NETWORK_FOUND - * RadioError:NO_RESOURCES - * RadioError:NO_SATELLITE_SIGNAL - * RadioError:NO_SUBSCRIPTION - * RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SIM_ABSENT - * RadioError:SIM_BUSY - * RadioError:SIM_ERR - * RadioError:SIM_FULL - * RadioError:SYSTEM_ERR - * RadioError:UNIDENTIFIED_SUBSCRIBER - */ - void removeAllowedSatelliteContactsResponse(in RadioResponseInfo info); - - /** - * Response of the request sendMessages. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:ABORTED - * RadioError:ACCESS_BARRED - * RadioError:BLOCKED_DUE_TO_CALL - * RadioError:CANCELLED - * RadioError:ENCODING_ERR - * RadioError:ENCODING_NOT_SUPPORTED - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_SMS_FORMAT - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NETWORK_ERR - * RadioError:NETWORK_NOT_READY - * RadioError:NETWORK_REJECT - * RadioError:NETWORK_TIMEOUT - * RadioError:NO_MEMORY - * RadioError:NO_NETWORK_FOUND - * RadioError:NO_RESOURCES - * RadioError:NO_SMS_TO_ACK - * RadioError:NO_SATELLITE_SIGNAL - * RadioError:NO_SUBSCRIPTION - * RadioError:NOT_SUFFICIENT_ACCOUNT_BALANCE - * RadioError:OPERATION_NOT_ALLOWED - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SIM_ABSENT - * RadioError:SIM_BUSY - * RadioError:SIM_ERR - * RadioError:SIM_FULL - * RadioError:SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED - * RadioError:SMS_SEND_FAIL_RETRY - * RadioError:SYSTEM_ERR - * RadioError:SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL - * RadioError:UNIDENTIFIED_SUBSCRIBER - */ - void sendMessagesResponse(in RadioResponseInfo info); - - /** - * Response of the request setIndicationFilter. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void setIndicationFilterResponse(in RadioResponseInfo info); - - /** - * Response of the request setPower. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:NO_RF_CALIBRATION_INFO - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:RF_HARDWARE_ISSUE - * RadioError:SYSTEM_ERR - */ - void setPowerResponse(in RadioResponseInfo info); - - /** - * Response of the request startSendingSatellitePointingInfo. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void startSendingSatellitePointingInfoResponse(in RadioResponseInfo info); - - /** - * Response of the request stopSendingSatellitePointingInfo. - * - * @param info Response info struct containing serial no. and error - * - * Valid errors returned: - * RadioError:NONE - * RadioError:INTERNAL_ERR - * RadioError:INVALID_ARGUMENTS - * RadioError:INVALID_MODEM_STATE - * RadioError:INVALID_SIM_STATE - * RadioError:INVALID_STATE - * RadioError:MODEM_ERR - * RadioError:NO_MEMORY - * RadioError:NO_RESOURCES - * RadioError:RADIO_NOT_AVAILABLE - * RadioError:REQUEST_NOT_SUPPORTED - * RadioError:REQUEST_RATE_LIMITED - * RadioError:SYSTEM_ERR - */ - void stopSendingSatellitePointingInfoResponse(in RadioResponseInfo info); -} diff --git a/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl deleted file mode 100644 index 16bd10dfef..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/IndicationFilter.aidl +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -/** @hide */ -@VintfStability -@Backing(type="int") -@JavaDerive(toString=true) -enum IndicationFilter { - NONE = 0, - SATELLITE_MODE = 1 -} diff --git a/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl b/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl deleted file mode 100644 index f1618957b4..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/NTRadioTechnology.aidl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -/** @hide */ -@VintfStability -@Backing(type="int") -@JavaDerive(toString=true) -enum NTRadioTechnology { - /* 3GPP NB-IoT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology */ - NB_IOT_NTN = 0, - /* 3GPP 5G NR over Non-Terrestrial-Networks technology */ - NR_NTN = 1, - /* 3GPP eMTC (enhanced Machine-Type Communication) over Non-Terrestrial-Networks technology */ - EMTC_NTN = 2, - /* Proprietary technology like Iridium or Bullitt */ - PROPRIETARY = 3 -} diff --git a/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl b/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl deleted file mode 100644 index 9f12d7aa12..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/PointingInfo.aidl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -/** @hide */ -@VintfStability -@JavaDerive(toString=true) -parcelable PointingInfo { - /* Satellite azimuth in degrees */ - float satelliteAzimuthDegrees; - - /* Satellite elevation in degrees */ - float satelliteElevationDegrees; - - /* Antenna azimuth in degrees */ - float antennaAzimuthDegrees; - - /** - * Angle of rotation about the x axis. This value represents the angle between a plane - * parallel to the device's screen and a plane parallel to the ground. - */ - float antennaPitchDegrees; - - /** - * Angle of rotation about the y axis. This value represents the angle between a plane - * perpendicular to the device's screen and a plane parallel to the ground. - */ - float antennaRollDegrees; -} diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl deleted file mode 100644 index 29eb63546f..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteCapabilities.aidl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -import android.hardware.radio.satellite.NTRadioTechnology; -import android.hardware.radio.satellite.SatelliteFeature; - -/** @hide */ -@VintfStability -@JavaDerive(toString=true) -parcelable SatelliteCapabilities { - /** - * List of technologies supported by the satellite modem. - */ - NTRadioTechnology[] supportedRadioTechnologies; - - /** - * Whether satellite mode is always on (this indicates the power impact of keeping it on is - * very minimal). - */ - boolean isAlwaysOn; - - /** - * Whether UE needs to point to a satellite to send and receive data. - */ - boolean needsPointingToSatellite; - - /** - * List of features supported by the satellite modem. - */ - SatelliteFeature[] supportedFeatures; - - /** - * Whether UE needs a separate SIM profile to communicate with satellite network. - */ - boolean needsSeparateSimProfile; -} diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl deleted file mode 100644 index 6284ec89a8..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteFeature.aidl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -/** @hide */ -@VintfStability -@Backing(type="int") -@JavaDerive(toString=true) -enum SatelliteFeature { - /* Able to send and receive SMS messages to/from SOS numbers like call/service centers */ - SOS_SMS = 0, - /* Able to send and receive SMS messages to/from emergency numbers like 911 */ - EMERGENCY_SMS = 1, - /* Able to send and receive SMS messages to/from any allowed contacts */ - SMS = 2, - /* Able to send device location to allowed contacts */ - LOCATION_SHARING = 3 -} diff --git a/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl b/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl deleted file mode 100644 index b764d0efdd..0000000000 --- a/radio/aidl/android/hardware/radio/satellite/SatelliteMode.aidl +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.hardware.radio.satellite; - -/** @hide */ -@VintfStability -@Backing(type="int") -@JavaDerive(toString=true) -enum SatelliteMode { - /* Satellite modem is powered off */ - POWERED_OFF = 0, - /* Satellite modem is in out of service state and not searching for satellite signal */ - OUT_OF_SERVICE_NOT_SEARCHING = 1, - /* Satellite modem is in out of service state and searching for satellite signal */ - OUT_OF_SERVICE_SEARCHING = 2, - /* Satellite modem has found satellite signal and gets connected to the satellite network */ - ACQUIRED = 3, - /* Satellite modem is sending and/or receiving messages */ - MESSAGE_TRANSFERRING = 4 -} diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp index f5000b91d0..66970dbf98 100644 --- a/radio/aidl/compat/libradiocompat/Android.bp +++ b/radio/aidl/compat/libradiocompat/Android.bp @@ -43,7 +43,6 @@ cc_library { "android.hardware.radio.modem-V3-ndk", "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.satellite-V1-ndk", "android.hardware.radio.sim-V3-ndk", "android.hardware.radio.voice-V3-ndk", "android.hardware.radio@1.0", @@ -94,9 +93,6 @@ cc_library { "sap/Sap.cpp", "sap/SapCallback.cpp", "sap/structs.cpp", - "satellite/RadioIndication-satellite.cpp", - "satellite/RadioResponse-satellite.cpp", - "satellite/RadioSatellite.cpp", "sim/RadioIndication-sim.cpp", "sim/RadioResponse-sim.cpp", "sim/RadioSim.cpp", diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h index ad9127e461..f042456409 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -61,10 +60,6 @@ class RadioIndication : public V1_6::IRadioIndication { ::aidl::android::hardware::radio::ims::IRadioImsIndication, ::aidl::android::hardware::radio::ims::IRadioImsIndicationDefault, true> mImsCb; - GuaranteedCallback< // - ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication, - ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndicationDefault, true> - mSatelliteCb; // IRadioIndication @ 1.0 Return radioStateChanged(V1_0::RadioIndicationType type, @@ -232,9 +227,6 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voicCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb); - void setResponseFunction( - std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication> - satelliteCb); std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataIndication> dataCb(); std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingIndication> @@ -244,8 +236,6 @@ class RadioIndication : public V1_6::IRadioIndication { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimIndication> simCb(); std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceIndication> voiceCb(); std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsIndication> imsCb(); - std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication> - satelliteCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h index b976435064..e20eed985f 100644 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h +++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioResponse.h @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -55,9 +54,6 @@ class RadioResponse : public V1_6::IRadioResponse { GuaranteedCallback<::aidl::android::hardware::radio::ims::IRadioImsResponse, ::aidl::android::hardware::radio::ims::IRadioImsResponseDefault> mImsCb; - GuaranteedCallback<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse, - ::aidl::android::hardware::radio::satellite::IRadioSatelliteResponseDefault> - mSatelliteCb; // IRadioResponse @ 1.0 Return getIccCardStatusResponse(const V1_0::RadioResponseInfo& info, @@ -451,9 +447,6 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb); void setResponseFunction( std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb); - void setResponseFunction( - std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse> - satelliteCb); std::shared_ptr<::aidl::android::hardware::radio::data::IRadioDataResponse> dataCb(); std::shared_ptr<::aidl::android::hardware::radio::messaging::IRadioMessagingResponse> @@ -463,8 +456,6 @@ class RadioResponse : public V1_6::IRadioResponse { std::shared_ptr<::aidl::android::hardware::radio::sim::IRadioSimResponse> simCb(); std::shared_ptr<::aidl::android::hardware::radio::voice::IRadioVoiceResponse> voiceCb(); std::shared_ptr<::aidl::android::hardware::radio::ims::IRadioImsResponse> imsCb(); - std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse> - satelliteCb(); }; } // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h deleted file mode 100644 index 3ee6db2721..0000000000 --- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioSatellite.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include "RadioCompatBase.h" - -#include - -namespace android::hardware::radio::compat { - -class RadioSatellite : public RadioCompatBase, - public aidl::android::hardware::radio::satellite::BnRadioSatellite { - ::ndk::ScopedAStatus responseAcknowledgement() override; - ::ndk::ScopedAStatus getCapabilities(int32_t serial) override; - ::ndk::ScopedAStatus setPower(int32_t serial, bool on) override; - ::ndk::ScopedAStatus getPowerState(int32_t serial) override; - ::ndk::ScopedAStatus provisionService( - int32_t serial, const std::string& imei, const std::string& msisdn, - const std::string& imsi, - const std::vector<::aidl::android::hardware::radio::satellite::SatelliteFeature>& - features) override; - ::ndk::ScopedAStatus addAllowedSatelliteContacts( - int32_t serial, const std::vector& contacts) override; - ::ndk::ScopedAStatus removeAllowedSatelliteContacts( - int32_t serial, const std::vector& contacts) override; - ::ndk::ScopedAStatus sendMessages(int32_t serial, const std::vector& messages, - const std::string& destination, double latitude, - double longitude) override; - ::ndk::ScopedAStatus getPendingMessages(int32_t serial) override; - ::ndk::ScopedAStatus getSatelliteMode(int32_t serial) override; - ::ndk::ScopedAStatus setIndicationFilter(int32_t serial, int32_t filterBitmask) override; - ::ndk::ScopedAStatus startSendingSatellitePointingInfo(int32_t serial) override; - ::ndk::ScopedAStatus stopSendingSatellitePointingInfo(int32_t serial) override; - ::ndk::ScopedAStatus getMaxCharactersPerTextMessage(int32_t serial) override; - ::ndk::ScopedAStatus getTimeForNextSatelliteVisibility(int32_t serial) override; - - ::ndk::ScopedAStatus setResponseFunctions( - const std::shared_ptr< - ::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse>& - radioSatelliteResponse, - const std::shared_ptr< - ::aidl::android::hardware::radio::satellite::IRadioSatelliteIndication>& - radioSatelliteIndication) override; - - protected: - std::shared_ptr<::aidl::android::hardware::radio::satellite::IRadioSatelliteResponse> respond(); - - public: - using RadioCompatBase::RadioCompatBase; -}; - -} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp deleted file mode 100644 index 39da43d832..0000000000 --- a/radio/aidl/compat/libradiocompat/satellite/RadioIndication-satellite.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "commonStructs.h" -#include "debug.h" - -#include "collections.h" - -#define RADIO_MODULE "RadioSatelliteIndication" - -namespace android::hardware::radio::compat { - -namespace aidl = ::aidl::android::hardware::radio::satellite; - -void RadioIndication::setResponseFunction( - std::shared_ptr satelliteCb) { - mSatelliteCb = satelliteCb; -} - -std::shared_ptr RadioIndication::satelliteCb() { - return mSatelliteCb.get(); -} - -} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp deleted file mode 100644 index 2209c93c2e..0000000000 --- a/radio/aidl/compat/libradiocompat/satellite/RadioResponse-satellite.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "commonStructs.h" -#include "debug.h" - -#include "collections.h" - -#define RADIO_MODULE "RadioSatelliteResponse" - -namespace android::hardware::radio::compat { - -namespace aidl = ::aidl::android::hardware::radio::satellite; - -void RadioResponse::setResponseFunction( - std::shared_ptr satelliteCb) { - mSatelliteCb = satelliteCb; -} - -std::shared_ptr RadioResponse::satelliteCb() { - return mSatelliteCb.get(); -} - -} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp b/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp deleted file mode 100644 index 16a3167bf5..0000000000 --- a/radio/aidl/compat/libradiocompat/satellite/RadioSatellite.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "commonStructs.h" -#include "debug.h" - -#include "collections.h" - -#define RADIO_MODULE "RadioSatellite" - -namespace android::hardware::radio::compat { - -using ::ndk::ScopedAStatus; -namespace aidl = ::aidl::android::hardware::radio::satellite; -constexpr auto ok = &ScopedAStatus::ok; - -std::shared_ptr RadioSatellite::respond() { - return mCallbackManager->response().satelliteCb(); -} - -ScopedAStatus RadioSatellite::responseAcknowledgement() { - LOG(ERROR) << " responseAcknowledgement is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getCapabilities(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getCapabilities is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::setPower(int32_t serial, bool /*on*/) { - LOG_CALL << serial; - LOG(ERROR) << " setPower is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getPowerState(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getPowerSate is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::provisionService( - int32_t serial, const std::string& /*imei*/, const std::string& /*msisdn*/, - const std::string& /*imsi*/, - const std::vector< - ::aidl::android::hardware::radio::satellite::SatelliteFeature>& /*features*/) { - LOG_CALL << serial; - LOG(ERROR) << " provisionService is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::addAllowedSatelliteContacts( - int32_t serial, const std::vector& /*contacts*/) { - LOG_CALL << serial; - LOG(ERROR) << " addAllowedSatelliteContacts is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::removeAllowedSatelliteContacts( - int32_t serial, const std::vector& /*contacts*/) { - LOG_CALL << serial; - LOG(ERROR) << " removeAllowedSatelliteContacts is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::sendMessages(int32_t serial, - const std::vector& /*messages*/, - const std::string& /*destination*/, double /*latitude*/, - double /*longitude*/) { - LOG_CALL << serial; - LOG(ERROR) << " sendMessage is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getPendingMessages(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getPendingMessages is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getSatelliteMode(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getSatelliteMode is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::setIndicationFilter(int32_t serial, int32_t /*filterBitmask*/) { - LOG_CALL << serial; - LOG(ERROR) << " setIndicationFilter is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::startSendingSatellitePointingInfo(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " startSendingSatellitePointingInfo is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::stopSendingSatellitePointingInfo(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " stopSendingSatellitePointingInfo is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getMaxCharactersPerTextMessage(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getMaxCharactersPerTextMessage is unsupported by HIDL HALs"; - return ok(); -} -ScopedAStatus RadioSatellite::getTimeForNextSatelliteVisibility(int32_t serial) { - LOG_CALL << serial; - LOG(ERROR) << " getTimeForNextSatelliteVisibility is unsupported by HIDL HALs"; - return ok(); -} - -ScopedAStatus RadioSatellite::setResponseFunctions( - const std::shared_ptr& response, - const std::shared_ptr& indication) { - LOG_CALL << response << ' ' << indication; - mCallbackManager->setResponseFunctions(response, indication); - return ok(); -} - -} // namespace android::hardware::radio::compat diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp index 1a6ea48df9..62c99febab 100644 --- a/radio/aidl/compat/service/Android.bp +++ b/radio/aidl/compat/service/Android.bp @@ -46,7 +46,6 @@ cc_binary { "android.hardware.radio.modem-V3-ndk", "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.satellite-V1-ndk", "android.hardware.radio.sim-V3-ndk", "android.hardware.radio.voice-V3-ndk", "android.hardware.radio@1.0", diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp index 8301f103bc..ddb1b335dd 100644 --- a/radio/aidl/vts/Android.bp +++ b/radio/aidl/vts/Android.bp @@ -58,9 +58,6 @@ cc_test { "radio_network_test.cpp", "radio_sap_callback.cpp", "radio_sap_test.cpp", - "radio_satellite_indication.cpp", - "radio_satellite_response.cpp", - "radio_satellite_test.cpp", "radio_sim_indication.cpp", "radio_sim_response.cpp", "radio_sim_test.cpp", @@ -83,7 +80,6 @@ cc_test { "android.hardware.radio.modem-V3-ndk", "android.hardware.radio.network-V3-ndk", "android.hardware.radio.sap-V1-ndk", - "android.hardware.radio.satellite-V1-ndk", "android.hardware.radio.sim-V3-ndk", "android.hardware.radio.voice-V3-ndk", ], diff --git a/radio/aidl/vts/VtsHalRadioTargetTest.cpp b/radio/aidl/vts/VtsHalRadioTargetTest.cpp index 86c109948a..c04173b762 100644 --- a/radio/aidl/vts/VtsHalRadioTargetTest.cpp +++ b/radio/aidl/vts/VtsHalRadioTargetTest.cpp @@ -24,7 +24,6 @@ #include "radio_modem_utils.h" #include "radio_network_utils.h" #include "radio_sap_utils.h" -#include "radio_satellite_utils.h" #include "radio_sim_utils.h" #include "radio_voice_utils.h" @@ -80,12 +79,6 @@ INSTANTIATE_TEST_SUITE_P( testing::ValuesIn(android::getAidlHalInstanceNames(IRadioIms::descriptor)), android::PrintInstanceNameToString); -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioSatelliteTest); -INSTANTIATE_TEST_SUITE_P( - PerInstance, RadioSatelliteTest, - testing::ValuesIn(android::getAidlHalInstanceNames(IRadioSatellite::descriptor)), - android::PrintInstanceNameToString); - GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(RadioImsMediaTest); INSTANTIATE_TEST_SUITE_P(PerInstance, RadioImsMediaTest, testing::ValuesIn(android::getAidlHalInstanceNames(IImsMedia::descriptor)), diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h index 1690e8912a..d8aa02431e 100644 --- a/radio/aidl/vts/radio_aidl_hal_utils.h +++ b/radio/aidl/vts/radio_aidl_hal_utils.h @@ -68,8 +68,6 @@ static constexpr const char* FEATURE_TELEPHONY_CDMA = "android.hardware.telephon static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims"; -static constexpr const char* FEATURE_TELEPHONY_SATELLITE = "android.hardware.telephony.satellite"; - #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 #define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2 diff --git a/radio/aidl/vts/radio_satellite_indication.cpp b/radio/aidl/vts/radio_satellite_indication.cpp deleted file mode 100644 index 13e4453403..0000000000 --- a/radio/aidl/vts/radio_satellite_indication.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "radio_satellite_utils.h" - -RadioSatelliteIndication::RadioSatelliteIndication(RadioServiceTest& parent) - : parent_satellite(parent) {} - -ndk::ScopedAStatus RadioSatelliteIndication::onPendingMessageCount(RadioIndicationType /*type*/, - int32_t /*count*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onNewMessages( - RadioIndicationType /*type*/, const std::vector& /*messages*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onMessagesTransferComplete( - RadioIndicationType /*type*/, bool /*complete*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onSatellitePointingInfoChanged( - RadioIndicationType /*type*/, const PointingInfo& /*pointingInfo*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onSatelliteModeChanged(RadioIndicationType /*type*/, - SatelliteMode /*mode*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onSatelliteRadioTechnologyChanged( - RadioIndicationType /*type*/, NTRadioTechnology /*technology*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteIndication::onProvisionStateChanged( - RadioIndicationType /*type*/, bool /*provisioned*/, - const std::vector& /*features*/) { - return ndk::ScopedAStatus::ok(); -} diff --git a/radio/aidl/vts/radio_satellite_response.cpp b/radio/aidl/vts/radio_satellite_response.cpp deleted file mode 100644 index 84d57b2d58..0000000000 --- a/radio/aidl/vts/radio_satellite_response.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "radio_satellite_utils.h" - -RadioSatelliteResponse::RadioSatelliteResponse(RadioServiceTest& parent) - : parent_satellite(parent) {} - -ndk::ScopedAStatus RadioSatelliteResponse::acknowledgeRequest(int32_t /*serial*/) { - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getCapabilitiesResponse( - const RadioResponseInfo& info, const SatelliteCapabilities& /*capabilities*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::setPowerResponse(const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getPowerStateResponse(const RadioResponseInfo& info, - bool /*on*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::provisionServiceResponse(const RadioResponseInfo& info, - bool /*provisioned*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::addAllowedSatelliteContactsResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::removeAllowedSatelliteContactsResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::sendMessagesResponse(const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getPendingMessagesResponse( - const RadioResponseInfo& info, const std::vector& /*messages*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getSatelliteModeResponse( - const RadioResponseInfo& info, SatelliteMode /*mode*/, NTRadioTechnology /*technology*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::setIndicationFilterResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::startSendingSatellitePointingInfoResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::stopSendingSatellitePointingInfoResponse( - const RadioResponseInfo& info) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getMaxCharactersPerTextMessageResponse( - const RadioResponseInfo& info, int32_t /*charLimit*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} - -ndk::ScopedAStatus RadioSatelliteResponse::getTimeForNextSatelliteVisibilityResponse( - const RadioResponseInfo& info, int32_t /*timeInSeconds*/) { - rspInfo = info; - parent_satellite.notify(info.serial); - return ndk::ScopedAStatus::ok(); -} \ No newline at end of file diff --git a/radio/aidl/vts/radio_satellite_test.cpp b/radio/aidl/vts/radio_satellite_test.cpp deleted file mode 100644 index b646ef615a..0000000000 --- a/radio/aidl/vts/radio_satellite_test.cpp +++ /dev/null @@ -1,519 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#include "radio_satellite_utils.h" - -#define ASSERT_OK(ret) ASSERT_TRUE(((ret).isOk())) - -void RadioSatelliteTest::SetUp() { - RadioServiceTest::SetUp(); - std::string serviceName = GetParam(); - - if (!isServiceValidForDeviceConfiguration(serviceName)) { - ALOGI("Skipped the radio satellite tests due to device configuration."); - GTEST_SKIP(); - } - - if (!deviceSupportsFeature(FEATURE_TELEPHONY_SATELLITE)) { - ALOGI("Skipping test because satellite is not supported in device."); - GTEST_SKIP(); - } - - satellite = IRadioSatellite::fromBinder( - ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str()))); - ASSERT_NE(nullptr, satellite.get()); - - rsp_satellite = ndk::SharedRefBase::make(*this); - ASSERT_NE(nullptr, rsp_satellite.get()); - - ind_satellite = ndk::SharedRefBase::make(*this); - ASSERT_NE(nullptr, ind_satellite.get()); - - satellite->setResponseFunctions(rsp_satellite, ind_satellite); - - // Assert IRadioConfig exists before testing - radio_config = config::IRadioConfig::fromBinder(ndk::SpAIBinder( - AServiceManager_waitForService("android.hardware.radio.config.IRadioConfig/default"))); - ASSERT_NE(nullptr, radio_config.get()); -} - -/* - * Test IRadioSatellite.getCapabilities() for the response returned. - */ -TEST_P(RadioSatelliteTest, getCapabilities) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getCapabilities(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getCapabilities, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.setPower() for the response returned. - */ -TEST_P(RadioSatelliteTest, setPower) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->setPower(serial, true); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("setPower, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.getPowerSate() for the response returned. - */ -TEST_P(RadioSatelliteTest, getPowerSate) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getPowerState(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getPowerState, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.provisionService() for the response returned. - */ -TEST_P(RadioSatelliteTest, provisionService) { - serial = GetRandomSerialNumber(); - std::string imei = "imei"; - std::string msisdn = "msisdn"; - std::string imsi = "imsi"; - const std::vector features{ - SatelliteFeature::SOS_SMS, SatelliteFeature::EMERGENCY_SMS, SatelliteFeature::SMS}; - ndk::ScopedAStatus res = satellite->provisionService(serial, imei, msisdn, imsi, features); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("provisionService, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error, - {RadioError::NONE, - RadioError::ABORTED, - RadioError::ACCESS_BARRED, - RadioError::CANCELLED, - RadioError::FEATURE_NOT_SUPPORTED, - RadioError::INTERNAL_ERR, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, - RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, - RadioError::MODEM_ERR, - RadioError::MODEM_INCOMPATIBLE, - RadioError::NETWORK_ERR, - RadioError::NETWORK_NOT_READY, - RadioError::NETWORK_REJECT, - RadioError::NETWORK_TIMEOUT, - RadioError::NO_MEMORY, - RadioError::NO_NETWORK_FOUND, - RadioError::NO_RESOURCES, - RadioError::NO_SATELLITE_SIGNAL, - RadioError::NO_SUBSCRIPTION, - RadioError::OPERATION_NOT_ALLOWED, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::RADIO_TECHNOLOGY_NOT_SUPPORTED, - RadioError::REQUEST_NOT_SUPPORTED, - RadioError::REQUEST_RATE_LIMITED, - RadioError::SIM_ABSENT, - RadioError::SIM_BUSY, - RadioError::SIM_ERR, - RadioError::SIM_FULL, - RadioError::SUBSCRIBER_NOT_AUTHORIZED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.addAllowedSatelliteContacts() for the response returned. - */ -TEST_P(RadioSatelliteTest, addAllowedSatelliteContacts) { - serial = GetRandomSerialNumber(); - const std::vector contacts = {"contact 1", "contact 2"}; - ndk::ScopedAStatus res = satellite->addAllowedSatelliteContacts(serial, contacts); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("addAllowedSatelliteContacts, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error, - {RadioError::NONE, - RadioError::ABORTED, - RadioError::ACCESS_BARRED, - RadioError::CANCELLED, - RadioError::INTERNAL_ERR, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_CONTACT, - RadioError::INVALID_MODEM_STATE, - RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, - RadioError::MODEM_ERR, - RadioError::NETWORK_ERR, - RadioError::NETWORK_NOT_READY, - RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE, - RadioError::OPERATION_NOT_ALLOWED, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, - RadioError::REQUEST_RATE_LIMITED, - RadioError::SIM_ABSENT, - RadioError::SIM_BUSY, - RadioError::SIM_ERR, - RadioError::SIM_FULL, - RadioError::SYSTEM_ERR, - RadioError::UNIDENTIFIED_SUBSCRIBER})); -} - -/* - * Test IRadioSatellite.removeAllowedSatelliteContacts() for the response returned. - */ -TEST_P(RadioSatelliteTest, removeAllowedSatelliteContacts) { - serial = GetRandomSerialNumber(); - const std::vector contacts = {"contact 1", "contact 2"}; - ndk::ScopedAStatus res = satellite->removeAllowedSatelliteContacts(serial, contacts); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("removeAllowedSatelliteContacts, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error, - {RadioError::NONE, - RadioError::ABORTED, - RadioError::ACCESS_BARRED, - RadioError::CANCELLED, - RadioError::INTERNAL_ERR, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_CONTACT, - RadioError::INVALID_MODEM_STATE, - RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, - RadioError::MODEM_ERR, - RadioError::NETWORK_ERR, - RadioError::NETWORK_NOT_READY, - RadioError::NETWORK_REJECT, - RadioError::NETWORK_TIMEOUT, - RadioError::NO_MEMORY, - RadioError::NO_NETWORK_FOUND, - RadioError::NO_RESOURCES, - RadioError::NO_SATELLITE_SIGNAL, - RadioError::NO_SUBSCRIPTION, - RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE, - RadioError::OPERATION_NOT_ALLOWED, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, - RadioError::REQUEST_RATE_LIMITED, - RadioError::SIM_ABSENT, - RadioError::SIM_BUSY, - RadioError::SIM_ERR, - RadioError::SIM_FULL, - RadioError::SYSTEM_ERR, - RadioError::UNIDENTIFIED_SUBSCRIBER})); -} - -/* - * Test IRadioSatellite.sendMessages() for the response returned. - */ -TEST_P(RadioSatelliteTest, sendMessages) { - serial = GetRandomSerialNumber(); - const std::vector messages = {"message 1", "message 2"}; - std::string destination = "0123456789"; - ndk::ScopedAStatus res = satellite->sendMessages(serial, messages, destination, 1.0, 2.0); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("sendMessages, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error, - {RadioError::NONE, - RadioError::ABORTED, - RadioError::ACCESS_BARRED, - RadioError::BLOCKED_DUE_TO_CALL, - RadioError::CANCELLED, - RadioError::ENCODING_ERR, - RadioError::ENCODING_NOT_SUPPORTED, - RadioError::INTERNAL_ERR, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, - RadioError::INVALID_SIM_STATE, - RadioError::INVALID_SMS_FORMAT, - RadioError::INVALID_STATE, - RadioError::MODEM_ERR, - RadioError::NETWORK_ERR, - RadioError::NETWORK_NOT_READY, - RadioError::NETWORK_REJECT, - RadioError::NETWORK_TIMEOUT, - RadioError::NO_MEMORY, - RadioError::NO_NETWORK_FOUND, - RadioError::NO_RESOURCES, - RadioError::NO_SMS_TO_ACK, - RadioError::NO_SATELLITE_SIGNAL, - RadioError::NO_SUBSCRIPTION, - RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE, - RadioError::OPERATION_NOT_ALLOWED, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, - RadioError::REQUEST_RATE_LIMITED, - RadioError::SIM_ABSENT, - RadioError::SIM_BUSY, - RadioError::SIM_ERR, - RadioError::SIM_FULL, - RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED, - RadioError::SMS_SEND_FAIL_RETRY, - RadioError::SYSTEM_ERR, - RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL, - RadioError::UNIDENTIFIED_SUBSCRIBER})); -} - -/* - * Test IRadioSatellite.getPendingMessages() for the response returned. - */ -TEST_P(RadioSatelliteTest, getPendingMessages) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getPendingMessages(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getPendingMessages, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors(rsp_satellite->rspInfo.error, - {RadioError::NONE, - RadioError::ABORTED, - RadioError::ACCESS_BARRED, - RadioError::BLOCKED_DUE_TO_CALL, - RadioError::CANCELLED, - RadioError::ENCODING_ERR, - RadioError::ENCODING_NOT_SUPPORTED, - RadioError::INTERNAL_ERR, - RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, - RadioError::INVALID_SIM_STATE, - RadioError::INVALID_SMS_FORMAT, - RadioError::INVALID_STATE, - RadioError::MODEM_ERR, - RadioError::NETWORK_ERR, - RadioError::NETWORK_NOT_READY, - RadioError::NETWORK_REJECT, - RadioError::NETWORK_TIMEOUT, - RadioError::NO_MEMORY, - RadioError::NO_NETWORK_FOUND, - RadioError::NO_RESOURCES, - RadioError::NO_SMS_TO_ACK, - RadioError::NO_SATELLITE_SIGNAL, - RadioError::NO_SUBSCRIPTION, - RadioError::NOT_SUFFICIENT_ACCOUNT_BALANCE, - RadioError::OPERATION_NOT_ALLOWED, - RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, - RadioError::REQUEST_RATE_LIMITED, - RadioError::SIM_ABSENT, - RadioError::SIM_BUSY, - RadioError::SIM_ERR, - RadioError::SIM_FULL, - RadioError::SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED, - RadioError::SYSTEM_ERR, - RadioError::SWITCHED_FROM_SATELLITE_TO_TERRESTRIAL})); -} - -/* - * Test IRadioSatellite.getSatelliteMode() for the response returned. - */ -TEST_P(RadioSatelliteTest, getSatelliteMode) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getSatelliteMode(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getSatelliteMode, rspInfo.error = %s\n", toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.setIndicationFilter() for the response returned. - */ -TEST_P(RadioSatelliteTest, setIndicationFilter) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->setIndicationFilter(serial, 0); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("setIndicationFilter, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.startSendingSatellitePointingInfo() for the response returned. - */ -TEST_P(RadioSatelliteTest, startSendingSatellitePointingInfo) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->startSendingSatellitePointingInfo(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("startSendingSatellitePointingInfo, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.stopSatelliteLocationUpdate() for the response returned. - */ -TEST_P(RadioSatelliteTest, stopSatelliteLocationUpdate) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->stopSendingSatellitePointingInfo(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("stopSendingSatellitePointingInfo, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.getMaxCharactersPerTextMessage() for the response returned. - */ -TEST_P(RadioSatelliteTest, getMaxCharactersPerTextMessage) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getMaxCharactersPerTextMessage(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getMaxCharactersPerTextMessage, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} - -/* - * Test IRadioSatellite.getTimeForNextSatelliteVisibility() for the response returned. - */ -TEST_P(RadioSatelliteTest, getTimeForNextSatelliteVisibility) { - serial = GetRandomSerialNumber(); - ndk::ScopedAStatus res = satellite->getTimeForNextSatelliteVisibility(serial); - ASSERT_OK(res); - EXPECT_EQ(std::cv_status::no_timeout, wait()); - EXPECT_EQ(RadioResponseType::SOLICITED, rsp_satellite->rspInfo.type); - EXPECT_EQ(serial, rsp_satellite->rspInfo.serial); - - ALOGI("getTimeForNextSatelliteVisibility, rspInfo.error = %s\n", - toString(rsp_satellite->rspInfo.error).c_str()); - - ASSERT_TRUE(CheckAnyOfErrors( - rsp_satellite->rspInfo.error, - {RadioError::NONE, RadioError::INTERNAL_ERR, RadioError::INVALID_ARGUMENTS, - RadioError::INVALID_MODEM_STATE, RadioError::INVALID_SIM_STATE, - RadioError::INVALID_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, - RadioError::NO_RESOURCES, RadioError::RADIO_NOT_AVAILABLE, - RadioError::REQUEST_NOT_SUPPORTED, RadioError::REQUEST_RATE_LIMITED, - RadioError::SYSTEM_ERR})); -} diff --git a/radio/aidl/vts/radio_satellite_utils.h b/radio/aidl/vts/radio_satellite_utils.h deleted file mode 100644 index a0fdc7e599..0000000000 --- a/radio/aidl/vts/radio_satellite_utils.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -#include "radio_aidl_hal_utils.h" - -using namespace aidl::android::hardware::radio::satellite; - -class RadioSatelliteTest; - -/* Callback class for Satellite response */ -class RadioSatelliteResponse : public BnRadioSatelliteResponse { - protected: - RadioServiceTest& parent_satellite; - - public: - RadioSatelliteResponse(RadioServiceTest& parent_satellite); - virtual ~RadioSatelliteResponse() = default; - - RadioResponseInfo rspInfo; - - virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override; - - virtual ndk::ScopedAStatus getCapabilitiesResponse( - const RadioResponseInfo& info, const SatelliteCapabilities& capabilities) override; - - virtual ndk::ScopedAStatus setPowerResponse(const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus getPowerStateResponse(const RadioResponseInfo& info, - bool on) override; - - virtual ndk::ScopedAStatus provisionServiceResponse(const RadioResponseInfo& info, - bool provisioned) override; - - virtual ndk::ScopedAStatus addAllowedSatelliteContactsResponse( - const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus removeAllowedSatelliteContactsResponse( - const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus sendMessagesResponse(const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus getPendingMessagesResponse( - const RadioResponseInfo& info, const std::vector& /*messages*/) override; - - virtual ndk::ScopedAStatus getSatelliteModeResponse( - const RadioResponseInfo& info, SatelliteMode mode, - satellite::NTRadioTechnology technology) override; - - virtual ndk::ScopedAStatus setIndicationFilterResponse(const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus startSendingSatellitePointingInfoResponse( - const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus stopSendingSatellitePointingInfoResponse( - const RadioResponseInfo& info) override; - - virtual ndk::ScopedAStatus getMaxCharactersPerTextMessageResponse(const RadioResponseInfo& info, - int32_t charLimit) override; - - virtual ndk::ScopedAStatus getTimeForNextSatelliteVisibilityResponse( - const RadioResponseInfo& info, int32_t timeInSeconds) override; -}; - -/* Callback class for Satellite indication */ -class RadioSatelliteIndication : public BnRadioSatelliteIndication { - protected: - RadioServiceTest& parent_satellite; - - public: - RadioSatelliteIndication(RadioServiceTest& parent_satellite); - virtual ~RadioSatelliteIndication() = default; - - virtual ndk::ScopedAStatus onPendingMessageCount(RadioIndicationType type, - int32_t count) override; - - virtual ndk::ScopedAStatus onNewMessages(RadioIndicationType type, - const std::vector& messages) override; - - virtual ndk::ScopedAStatus onMessagesTransferComplete(RadioIndicationType type, - bool complete) override; - - virtual ndk::ScopedAStatus onSatellitePointingInfoChanged( - RadioIndicationType type, const PointingInfo& pointingInfo) override; - - virtual ndk::ScopedAStatus onSatelliteModeChanged(RadioIndicationType type, - SatelliteMode mode) override; - - virtual ndk::ScopedAStatus onSatelliteRadioTechnologyChanged( - RadioIndicationType type, satellite::NTRadioTechnology technology) override; - - virtual ndk::ScopedAStatus onProvisionStateChanged( - RadioIndicationType type, bool provisioned, - const std::vector& features) override; -}; - -// The main test class for AIDL Satellite. -class RadioSatelliteTest : public RadioServiceTest { - public: - void SetUp() override; - - /* Radio Satellite service handle */ - std::shared_ptr satellite; - /* Radio Satellite response handle */ - std::shared_ptr rsp_satellite; - /* Radio Satellite indication handle */ - std::shared_ptr ind_satellite; -}; -- GitLab From 87800e609a5f8068144830e1b6bf975ab551144c Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Mon, 16 Oct 2023 18:13:00 +0000 Subject: [PATCH 184/376] Add NavIC L1 support in GnssNavigationMessage (hardware/interfaces) Bug: 302199306 Test: atest GnssNavigationMessageTest Change-Id: I0c7fec9e537e7348d05cb5a9468abc9eefda73b8 --- .../gnss/IGnssNavigationMessageCallback.aidl | 5 ++++ .../gnss/IGnssNavigationMessageCallback.aidl | 28 +++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl index 57d0e68d44..f6a8fef7ac 100644 --- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl +++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -63,7 +63,12 @@ interface IGnssNavigationMessageCallback { BDS_CNAV2 = 0x0504, GAL_I = 0x0601, GAL_F = 0x0602, + /** + * @deprecated Use IRN_L5 instead. + */ IRN_L5CA = 0x0701, + IRN_L5 = 0x0702, + IRN_L1 = 0x0703, } } } diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl index 6990e19ff6..b224b0ba09 100644 --- a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl +++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl @@ -100,8 +100,17 @@ interface IGnssNavigationMessageCallback { /** Galileo F/NAV message contained in the structure. */ GAL_F = 0x0602, - /** IRNSS L5 C/A message contained in the structure. */ + /** + * NavIC L5 C/A message contained in the structure. + * @deprecated Use IRN_L5 instead. + */ IRN_L5CA = 0x0701, + + /** NavIC L5 message contained in the structure. */ + IRN_L5 = 0x0702, + + /** NavIC L1 message contained in the structure. */ + IRN_L1 = 0x0703, } /** @@ -156,9 +165,12 @@ interface IGnssNavigationMessageCallback { * * - For Beidou CNAV1 this refers to the page type number in the range of 1-63. * - * - For IRNSS L5 C/A subframe 3 and 4, this value corresponds to the Message Id of the + * - For NavIC L5 subframe 3 and 4, this value corresponds to the Message Id of the * navigation message, in the range of 1-63. (Subframe 1 and 2 does not contain a message * type id and this value can be set to -1.) + * - For NavIC L1 subframe 3, this value corresponds to the Message Id of the navigation + * message, in the range of 1-63. (Subframe 1 and 2 does not contain a message type id and + * this value can be set to -1.) */ int messageId; @@ -187,8 +199,10 @@ interface IGnssNavigationMessageCallback { * * - For Beidou CNAV2, the submessage id corresponds to the message type, in the range 1-63. * - * - For IRNSS L5 C/A, the submessage id corresponds to the subframe number of the - * navigation message, in the range of 1-4. + * - For NavIC L5, the submessage id corresponds to the subframe number of the navigation + * message, in the range of 1-4. + * - For NavIC L1, the submessage id corresponds to the subframe number of the navigation + * message, in the range of 1-3. */ int submessageId; @@ -196,7 +210,7 @@ interface IGnssNavigationMessageCallback { * The data of the reported GNSS message. The bytes (or words) are specified * using big endian format (MSB first). * - * - For GNSS L1 C/A, Beidou D1 & Beidou D2, each subframe contains 10 30-bit + * - For GNSS L1 C/A, NavIC L5, Beidou D1 & Beidou D2, each subframe contains 10 30-bit * words. Each word (30 bits) must fit into the last 30 bits in a * 4-byte word (skip B31 and B32), with MSB first, for a total of 40 * bytes, covering a time period of 6, 6, and 0.6 seconds, respectively. @@ -228,6 +242,10 @@ interface IGnssNavigationMessageCallback { * - For Beidou CNAV2, each subframe consists of 288 data bits, that should be fit into 36 * bytes. * + * - For NavIC L1, subframe #1 consists of 9 data bits that should be fit into 2 bytes (skip + * B10-B16). subframe #2 consists of 600 bits that should be fit into 75 bytes. subframe + * #3 consists of 274 data bits that should be fit into 35 bytes (skip B275-B280). + * * The data reported here must be the raw data as demodulated by the GNSS receiver, not data * received from an external source (i.e. not from a server download.) */ -- GitLab From 690919a58b59a179fb9f70b536367385f976ad6c Mon Sep 17 00:00:00 2001 From: Keith Mok Date: Wed, 12 Apr 2023 15:44:32 +0000 Subject: [PATCH 185/376] Define MACsec HAL and ref impl Add MACsec HAL interface and reference implementation. This allow OEM to store MACsec PSK key in secure storage and provide functions to use that key, Bug: 254108688 Test: atest VtsHalMacsecPSKPluginV1_0Test Change-Id: Iecfe4828839a1dab81989bf9b178ae41c6f46b82 --- .../compatibility_matrix.9.xml | 8 + macsec/OWNERS | 1 + macsec/aidl/Android.bp | 40 +++ .../hardware/macsec/IMacsecPskPlugin.aidl | 80 +++++ .../hardware/macsec/IMacsecPskPlugin.aidl | 91 ++++++ macsec/aidl/default/Android.bp | 64 ++++ macsec/aidl/default/MacsecPskPlugin.cpp | 308 ++++++++++++++++++ macsec/aidl/default/MacsecPskPlugin.h | 57 ++++ .../aidl/default/android.hardware.macsec.rc | 3 + .../aidl/default/android.hardware.macsec.xml | 26 ++ macsec/aidl/default/fuzzer/fuzzer.cpp | 27 ++ macsec/aidl/default/service.cpp | 43 +++ macsec/aidl/vts/functional/Android.bp | 48 +++ macsec/aidl/vts/functional/MacsecAidlTest.cpp | 142 ++++++++ macsec/aidl/vts/functional/OWNERS | 2 + 15 files changed, 940 insertions(+) create mode 100644 macsec/OWNERS create mode 100644 macsec/aidl/Android.bp create mode 100644 macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl create mode 100644 macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl create mode 100644 macsec/aidl/default/Android.bp create mode 100644 macsec/aidl/default/MacsecPskPlugin.cpp create mode 100644 macsec/aidl/default/MacsecPskPlugin.h create mode 100644 macsec/aidl/default/android.hardware.macsec.rc create mode 100644 macsec/aidl/default/android.hardware.macsec.xml create mode 100644 macsec/aidl/default/fuzzer/fuzzer.cpp create mode 100644 macsec/aidl/default/service.cpp create mode 100644 macsec/aidl/vts/functional/Android.bp create mode 100644 macsec/aidl/vts/functional/MacsecAidlTest.cpp create mode 100644 macsec/aidl/vts/functional/OWNERS diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 00139232e9..b0390e6874 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -84,6 +84,14 @@ [a-z]+/[0-9]+ + + android.hardware.macsec + 1 + + IMacsecPskPlugin + default + + android.hardware.automotive.occupant_awareness 1 diff --git a/macsec/OWNERS b/macsec/OWNERS new file mode 100644 index 0000000000..6934f86203 --- /dev/null +++ b/macsec/OWNERS @@ -0,0 +1 @@ +keithmok@google.com diff --git a/macsec/aidl/Android.bp b/macsec/aidl/Android.bp new file mode 100644 index 0000000000..5e47999bce --- /dev/null +++ b/macsec/aidl/Android.bp @@ -0,0 +1,40 @@ +// +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +aidl_interface { + name: "android.hardware.macsec", + vendor_available: true, + srcs: ["android/hardware/macsec/*.aidl"], + stability: "vintf", + host_supported: true, + backend: { + java: { + enabled: false, + }, + rust: { + enabled: false, + }, + }, +} diff --git a/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl new file mode 100644 index 0000000000..6a93919e6e --- /dev/null +++ b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.macsec; + +/** + * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant + * + * The goal of this service is to provide function for using the MACSEC CAK + * + */ +@VintfStability +interface IMacsecPskPlugin { + /** + * For xTS test only inject a key to verify implementation correctness, not called in production + * + * @param keyId is key id to add + * @param Connectivity Association Keys (CAK) to set + * @param Connectivity Association Key Name (CKN) to set + * + */ + void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN); + + /** + * Use ICV key do AES CMAC + * same as ieee802_1x_icv_aes_cmac in wpa_supplicant + * + * @param keyId is key id to be used for AES CMAC + * @param data, a data pointer to the buffer for calculate the ICV + * + * @return Integrity check value (ICV). + */ + byte[] calcIcv(in byte[] keyId, in byte[] data); + + /** + * KDF with CAK key to generate Secure Association Key (SAK) + * same as ieee802_1x_sak_aes_cmac in wpa_supplicant + * + * @param keyId is key id to be used for KDF + * @param data is key seed (random number) + * @param sakLength generated SAK length (16 or 32) + * + * @return Secure Association Key (SAK). + */ + byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength); + + /** + * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant + * which used to wrap a SAK key + * + * @param keyId is key id to be used for encryption + * @param sak is the SAK key (16 or 32 bytes) to be wrapped. + * + * @return wrapped data using Key Encrypting Key (KEK). + */ + byte[] wrapSak(in byte[] keyId, in byte[] sak); + + /** + * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant + * which used to unwrap a SAK key + * + * @param keyId is key id to be used for decryption + * @param sak is wrapped SAK key. + * + * @return unwrapped data using KEK key. + */ + byte[] unwrapSak(in byte[] keyId, in byte[] sak); +} diff --git a/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl new file mode 100644 index 0000000000..a98cfa6bd6 --- /dev/null +++ b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.macsec; + +/** + * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant + * + * The goal of this service is to provide function for using the MACSEC CAK + * + */ +@VintfStability +interface IMacsecPskPlugin { + /** + * For xTS test only inject a key to verify implementation correctness, not called in production + * + * @param keyId is key id to add + * @param Connectivity Association Keys (CAK) to set + * @param Connectivity Association Key Name (CKN) to set + * @throws EX_ILLEGAL_ARGUMENT If CAK size is not 16 or 32 or keyID size not equals to CAK size + */ + void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN); + + /** + * Use ICV key do AES CMAC + * same as ieee802_1x_icv_aes_cmac in wpa_supplicant + * + * @param keyId is key id to be used for AES CMAC + * @param data, a data pointer to the buffer for calculate the ICV + * + * @return Integrity check value (ICV). + * @throws EX_ILLEGAL_ARGUMENT If keyId does not exist + */ + byte[] calcIcv(in byte[] keyId, in byte[] data); + + /** + * KDF with CAK key to generate Secure Association Key (SAK) + * same as ieee802_1x_sak_aes_cmac in wpa_supplicant + * + * @param keyId is key id to be used for KDF + * @param data is key seed (random number) + * @param sakLength generated SAK length (16 or 32) + * + * @return Secure Association Key (SAK). + * @throws EX_ILLEGAL_ARGUMENT In the following cases: + * - If keyId does not exist + * - sakLength != 16 or 32 + * - data length < sakLength + */ + byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength); + + /** + * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant + * which used to wrap a SAK key + * + * @param keyId is key id to be used for encryption + * @param sak is the SAK key (16 or 32 bytes) to be wrapped. + * + * @return wrapped data using Key Encrypting Key (KEK). + * @throws EX_ILLEGAL_ARGUMENT In the following cases: + * - If keyId does not exist + * - sak size eqauls to 0 or not multiples of 8 + */ + byte[] wrapSak(in byte[] keyId, in byte[] sak); + + /** + * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant + * which used to unwrap a SAK key + * + * @param keyId is key id to be used for decryption + * @param sak is wrapped SAK key. + * + * @return unwrapped data using KEK key. + * @throws EX_ILLEGAL_ARGUMENT In the following cases: + * - If keyId does not exist + * - sak size <= 8 or not multiples of 8 + */ + byte[] unwrapSak(in byte[] keyId, in byte[] sak); +} diff --git a/macsec/aidl/default/Android.bp b/macsec/aidl/default/Android.bp new file mode 100644 index 0000000000..7c7346fb81 --- /dev/null +++ b/macsec/aidl/default/Android.bp @@ -0,0 +1,64 @@ +// +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_binary { + name: "android.hardware.macsec-service", + init_rc: ["android.hardware.macsec.rc"], + vendor: true, + relative_install_path: "hw", + srcs: [ + "MacsecPskPlugin.cpp", + "service.cpp", + ], + shared_libs: [ + "android.hardware.macsec-V1-ndk", + "libcrypto", + "libbase", + "libbinder_ndk", + ], + vintf_fragments: ["android.hardware.macsec.xml"], +} + +cc_fuzz { + name: "android.hardware.macsec@V1-default-service.aidl_fuzzer", + vendor: true, + srcs: [ + "MacsecPskPlugin.cpp", + "fuzzer/fuzzer.cpp", + ], + shared_libs: [ + "android.hardware.macsec-V1-ndk", + "libcrypto", + "liblog", + ], + defaults: [ + "service_fuzzer_defaults", + ], + fuzz_config: { + cc: [ + "keithmok@google.com", + ], + }, +} diff --git a/macsec/aidl/default/MacsecPskPlugin.cpp b/macsec/aidl/default/MacsecPskPlugin.cpp new file mode 100644 index 0000000000..82d2545800 --- /dev/null +++ b/macsec/aidl/default/MacsecPskPlugin.cpp @@ -0,0 +1,308 @@ +/* + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MacsecPskPlugin.h" +#include +#include + +#include +#include + +namespace aidl::android::hardware::macsec { + +constexpr auto ok = &ndk::ScopedAStatus::ok; + +// vendor should hide the key in TEE/TA +// CAK key can be either 16 / 32 bytes +const std::vector CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; +const std::vector CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; +std::vector CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes + +const std::vector CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}; +const std::vector CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; +std::vector CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes + +static ndk::ScopedAStatus resultToStatus(binder_exception_t res, const std::string& msg = "") { + if (msg.empty()) { + return ndk::ScopedAStatus::fromExceptionCode(res); + } + return ndk::ScopedAStatus::fromExceptionCodeWithMessage(res, msg.c_str()); +} + +static int omac1_aes(CMAC_CTX* ctx, const uint8_t* data, size_t data_len, + uint8_t* mac /* 16 bytes */) { + size_t outlen; + + // Just reuse same key in ctx + if (!CMAC_Reset(ctx)) { + return -1; + } + + if (!CMAC_Update(ctx, data, data_len)) { + return -1; + } + + if (!CMAC_Final(ctx, mac, &outlen) || outlen != 16) { + return -1; + } + return 0; +} + +static void put_be16(uint8_t* addr, uint16_t value) { + *addr++ = value >> 8; + *addr = value & 0xff; +} + +/* IEEE Std 802.1X-2010, 6.2.1 KDF */ +static int aes_kdf(CMAC_CTX* ctx, const char* label, const uint8_t* context, int ctx_bits, + int ret_bits, uint8_t* ret) { + const int h = 128; + const int r = 8; + int i, n; + int lab_len, ctx_len, ret_len, buf_len; + uint8_t* buf; + + lab_len = strlen(label); + ctx_len = (ctx_bits + 7) / 8; + ret_len = ((ret_bits & 0xffff) + 7) / 8; + buf_len = lab_len + ctx_len + 4; + + memset(ret, 0, ret_len); + + n = (ret_bits + h - 1) / h; + if (n > ((0x1 << r) - 1)) return -1; + + buf = (uint8_t*)calloc(1, buf_len); + if (buf == NULL) return -1; + + memcpy(buf + 1, label, lab_len); + memcpy(buf + lab_len + 2, context, ctx_len); + put_be16(&buf[buf_len - 2], ret_bits); + + for (i = 0; i < n; i++) { + int res; + + buf[0] = (uint8_t)(i + 1); + res = omac1_aes(ctx, buf, buf_len, ret); + if (res) { + free(buf); + return -1; + } + ret = ret + h / 8; + } + free(buf); + return 0; +} + +MacsecPskPlugin::MacsecPskPlugin() { + // always make sure ckn is 16 bytes, zero padded + CKN_1.resize(16); + CKN_2.resize(16); + + addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1); + addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2); +} + +MacsecPskPlugin::~MacsecPskPlugin() { + for (auto s : mKeys) { + OPENSSL_cleanse(&s.kekEncCtx, sizeof(AES_KEY)); + OPENSSL_cleanse(&s.kekDecCtx, sizeof(AES_KEY)); + CMAC_CTX_free(s.ickCtx); + CMAC_CTX_free(s.cakCtx); + } +} + +ndk::ScopedAStatus MacsecPskPlugin::addTestKey(const std::vector& keyId, + const std::vector& CAK, + const std::vector& CKN) { + if (CAK.size() != 16 && CAK.size() != 32) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "CAK length must be 16 or 32 bytes"); + } + + if (keyId.size() != CAK.size()) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key ID must be same as CAK length"); + } + + std::vector ckn; + ckn = CKN; + ckn.resize(16); // make sure it is always zero padded with maximum length of + // 16 bytes + + AES_KEY kekEncCtx; + AES_KEY kekDecCtx; + CMAC_CTX* ickCtx; + CMAC_CTX* cakCtx; + + // Create the CAK openssl context + cakCtx = CMAC_CTX_new(); + + CMAC_Init(cakCtx, CAK.data(), CAK.size(), + CAK.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL); + + // derive KEK from CAK (ieee802_1x_kek_aes_cmac) + std::vector kek; + kek.resize(CAK.size()); + + aes_kdf(cakCtx, "IEEE8021 KEK", (const uint8_t*)ckn.data(), ckn.size() * 8, 8 * kek.size(), + kek.data()); + + AES_set_encrypt_key(kek.data(), kek.size() << 3, &kekEncCtx); + AES_set_decrypt_key(kek.data(), kek.size() << 3, &kekDecCtx); + + // derive ICK from CAK (ieee802_1x_ick_aes_cmac) + std::vector ick; + ick.resize(CAK.size()); + + aes_kdf(cakCtx, "IEEE8021 ICK", (const uint8_t*)CKN.data(), CKN.size() * 8, 8 * ick.size(), + ick.data()); + + ickCtx = CMAC_CTX_new(); + + CMAC_Init(ickCtx, ick.data(), ick.size(), + ick.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL); + + mKeys.push_back({keyId, kekEncCtx, kekDecCtx, ickCtx, cakCtx}); + + return ok(); +} + +ndk::ScopedAStatus MacsecPskPlugin::calcIcv(const std::vector& keyId, + const std::vector& data, + std::vector* out) { + CMAC_CTX* ctx = NULL; + + for (auto s : mKeys) { + if (s.keyId == keyId) { + ctx = s.ickCtx; + break; + } + } + + if (ctx == NULL) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist"); + } + + out->resize(16); + if (omac1_aes(ctx, data.data(), data.size(), out->data()) != 0) { + return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error"); + } + + return ok(); +} + +ndk::ScopedAStatus MacsecPskPlugin::generateSak(const std::vector& keyId, + const std::vector& data, + const int sakLength, std::vector* out) { + CMAC_CTX* ctx = NULL; + + if ((sakLength != 16) && (sakLength != 32)) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid SAK length"); + } + + if (data.size() < sakLength) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid data length"); + } + + for (auto s : mKeys) { + if (s.keyId == keyId) { + ctx = s.cakCtx; + break; + } + } + + if (ctx == NULL) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist"); + } + + out->resize(sakLength); + + if (aes_kdf(ctx, "IEEE8021 SAK", data.data(), data.size() * 8, out->size() * 8, out->data()) != + 0) { + return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error"); + } + + return ok(); +} + +ndk::ScopedAStatus MacsecPskPlugin::wrapSak(const std::vector& keyId, + const std::vector& sak, + std::vector* out) { + if (sak.size() == 0 || sak.size() % 8 != 0) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, + "SAK length not multiple of 8 or greater than 0"); + } + + AES_KEY* ctx = NULL; + + for (auto s : mKeys) { + if (s.keyId == keyId) { + ctx = &s.kekEncCtx; + break; + } + } + + if (ctx == NULL) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist"); + } + + out->resize(sak.size() + 8); + + if (AES_wrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) { + return ok(); + } + + return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error"); +} + +ndk::ScopedAStatus MacsecPskPlugin::unwrapSak(const std::vector& keyId, + const std::vector& sak, + std::vector* out) { + if (sak.size() <= 8 || sak.size() % 8 != 0) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, + "SAK length not multiple of 8 or greater than 0"); + } + + AES_KEY* ctx = NULL; + + for (auto s : mKeys) { + if (s.keyId == keyId) { + ctx = &s.kekDecCtx; + break; + } + } + + if (ctx == NULL) { + return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist"); + } + + out->resize(sak.size() - 8); + + if (AES_unwrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) { + return ok(); + } + + return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error"); +} + +} // namespace aidl::android::hardware::macsec diff --git a/macsec/aidl/default/MacsecPskPlugin.h b/macsec/aidl/default/MacsecPskPlugin.h new file mode 100644 index 0000000000..0b056e3ede --- /dev/null +++ b/macsec/aidl/default/MacsecPskPlugin.h @@ -0,0 +1,57 @@ +/* + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace aidl::android::hardware::macsec { + +struct keys { + std::vector keyId; + AES_KEY kekEncCtx; + AES_KEY kekDecCtx; + CMAC_CTX* ickCtx; + CMAC_CTX* cakCtx; +}; + +class MacsecPskPlugin : public BnMacsecPskPlugin { + public: + MacsecPskPlugin(); + ~MacsecPskPlugin(); + ndk::ScopedAStatus addTestKey(const std::vector& keyId, + const std::vector& CAK, + const std::vector& CKN) override; + ndk::ScopedAStatus calcIcv(const std::vector& keyId, const std::vector& data, + std::vector* out) override; + + ndk::ScopedAStatus generateSak(const std::vector& keyId, + const std::vector& data, const int sakLength, + std::vector* out); + + ndk::ScopedAStatus wrapSak(const std::vector& keyId, const std::vector& sak, + std::vector* out) override; + + ndk::ScopedAStatus unwrapSak(const std::vector& keyId, const std::vector& sak, + std::vector* out) override; + + private: + std::vector mKeys; +}; +} // namespace aidl::android::hardware::macsec diff --git a/macsec/aidl/default/android.hardware.macsec.rc b/macsec/aidl/default/android.hardware.macsec.rc new file mode 100644 index 0000000000..0ff0e53619 --- /dev/null +++ b/macsec/aidl/default/android.hardware.macsec.rc @@ -0,0 +1,3 @@ +service android.hardware.macsec /vendor/bin/hw/android.hardware.macsec-service + class early_hal + user nobody diff --git a/macsec/aidl/default/android.hardware.macsec.xml b/macsec/aidl/default/android.hardware.macsec.xml new file mode 100644 index 0000000000..9cf9e5aa7d --- /dev/null +++ b/macsec/aidl/default/android.hardware.macsec.xml @@ -0,0 +1,26 @@ + + + + + + android.hardware.macsec + 1 + + IMacsecPskPlugin + default + + + diff --git a/macsec/aidl/default/fuzzer/fuzzer.cpp b/macsec/aidl/default/fuzzer/fuzzer.cpp new file mode 100644 index 0000000000..d912a67f2e --- /dev/null +++ b/macsec/aidl/default/fuzzer/fuzzer.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include "MacsecPskPlugin.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + std::shared_ptr service = + ndk::SharedRefBase::make(); + android::fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size)); + + return 0; +} diff --git a/macsec/aidl/default/service.cpp b/macsec/aidl/default/service.cpp new file mode 100644 index 0000000000..faf3a09ed1 --- /dev/null +++ b/macsec/aidl/default/service.cpp @@ -0,0 +1,43 @@ +/* + * Copyright 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MacsecPskPlugin.h" + +#include +#include +#include + +namespace android::hardware::macsec { + +using namespace std::string_literals; +using ::aidl::android::hardware::macsec::MacsecPskPlugin; + +extern "C" int main() { + base::SetDefaultTag("MacsecPskPlugin"); + base::SetMinimumLogSeverity(base::VERBOSE); + + LOG(VERBOSE) << "Starting up..."; + auto service = ndk::SharedRefBase::make(); + const auto instance = MacsecPskPlugin::descriptor + "/default"s; + const auto status = AServiceManager_addService(service->asBinder().get(), instance.c_str()); + CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance; + LOG(VERBOSE) << "Started successfully!"; + + ABinderProcess_joinThreadPool(); + LOG(FATAL) << "MacsecPskPlugin exited unexpectedly!"; + return EXIT_FAILURE; +} +} // namespace android::hardware::macsec diff --git a/macsec/aidl/vts/functional/Android.bp b/macsec/aidl/vts/functional/Android.bp new file mode 100644 index 0000000000..0c8f43dcba --- /dev/null +++ b/macsec/aidl/vts/functional/Android.bp @@ -0,0 +1,48 @@ +// +// Copyright (C) 2023 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +cc_test { + name: "VtsHalMacsecPskPluginV1Test", + defaults: [ + "VtsHalTargetTestDefaults", + "use_libaidlvintf_gtest_helper_static", + ], + cpp_std: "experimental", + srcs: [ + "MacsecAidlTest.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + ], + static_libs: [ + "android.hardware.macsec-V1-ndk", + "libgmock", + ], + test_suites: [ + "general-tests", + "vts", + ], +} diff --git a/macsec/aidl/vts/functional/MacsecAidlTest.cpp b/macsec/aidl/vts/functional/MacsecAidlTest.cpp new file mode 100644 index 0000000000..e94c0498d4 --- /dev/null +++ b/macsec/aidl/vts/functional/MacsecAidlTest.cpp @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +using aidl::android::hardware::macsec::IMacsecPskPlugin; +using namespace std::chrono_literals; +using namespace std::string_literals; + +const std::vector CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01}; +const std::vector CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; +const std::vector CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes +const std::vector SAK_DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14, + 0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14}; +const std::vector SAK_1 = {0x13, 0xD9, 0xEE, 0x5B, 0x26, 0x8B, 0x44, 0xFB, + 0x37, 0x63, 0x3D, 0x41, 0xC8, 0xE7, 0x0D, 0x93}; +const std::vector WRAPPED_SAK_1 = {0x3B, 0x39, 0xAB, 0x4C, 0xD8, 0xDA, 0x2E, 0xC5, + 0xD1, 0x38, 0x6A, 0x13, 0x9D, 0xE3, 0x78, 0xD9, + 0x93, 0xD2, 0xA0, 0x70, 0x88, 0xCB, 0xF5, 0xEC}; +const std::vector DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x34, 0x29, + 0x51, 0x52, 0x53, 0x54, 0x51, 0x35, 0x54, 0x59}; +const std::vector ICV_1 = {0xDF, 0x54, 0xFF, 0xCD, 0xE0, 0xA9, 0x78, 0x10, + 0x6B, 0x7B, 0xD2, 0xBF, 0xEF, 0xD9, 0x0C, 0x81}; + +const std::vector CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02}; +const std::vector CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, + 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; +const std::vector CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes +const std::vector SAK_DATA_2 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34, + 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34, + 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34, + 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34}; +const std::vector SAK_2 = {0x39, 0x09, 0x36, 0x60, 0x18, 0x07, 0x2B, 0x5D, + 0xF0, 0x81, 0x81, 0x45, 0xCD, 0x71, 0xC6, 0xBA, + 0x1D, 0x2B, 0x87, 0xC4, 0xEF, 0x79, 0x68, 0x82, + 0x28, 0xD0, 0x25, 0x86, 0xD3, 0x63, 0xFF, 0x89}; +const std::vector WRAPPED_SAK_2 = { + 0x2f, 0x6a, 0x22, 0x29, 0x68, 0x0e, 0x6e, 0x35, 0x91, 0x64, 0x05, 0x4a, 0x31, 0x8d, + 0x35, 0xea, 0x95, 0x85, 0x40, 0xc6, 0xea, 0x55, 0xe5, 0xc5, 0x68, 0x40, 0xae, 0x4d, + 0x6f, 0xeb, 0x73, 0xcd, 0x4e, 0x2a, 0x43, 0xb1, 0xda, 0x49, 0x4f, 0x0a}; +const std::vector DATA_2 = {0x71, 0x82, 0x13, 0x24, 0x31, 0x82, 0xA4, 0x2F, + 0x51, 0x52, 0x53, 0x44, 0x21, 0x35, 0x54, 0x59}; +const std::vector ICV_2 = {0x8D, 0xF1, 0x1D, 0x6E, 0xAC, 0x62, 0xC1, 0x2A, + 0xE8, 0xF8, 0x4E, 0xB1, 0x00, 0x45, 0x9A, 0xAD}; + +class MacsecAidlTest : public ::testing::TestWithParam { + public: + virtual void SetUp() override { + android::base::SetDefaultTag("MACSEC_HAL_VTS"); + android::base::SetMinimumLogSeverity(android::base::VERBOSE); + const auto instance = IMacsecPskPlugin::descriptor + "/default"s; + mMacsecPskPluginService = IMacsecPskPlugin::fromBinder( + ndk::SpAIBinder(AServiceManager_waitForService(instance.c_str()))); + + ASSERT_NE(mMacsecPskPluginService, nullptr); + auto aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1); + ASSERT_TRUE(aidlStatus.isOk()); + aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2); + ASSERT_TRUE(aidlStatus.isOk()); + } + virtual void TearDown() override {} + + std::shared_ptr mMacsecPskPluginService; +}; + +TEST_P(MacsecAidlTest, calcIcv) { + std::vector out; + auto aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_1, DATA_1, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 1 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, ICV_1); + + aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_2, DATA_2, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 2 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, ICV_2); +} + +TEST_P(MacsecAidlTest, generateSak) { + std::vector out; + auto aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_1, SAK_DATA_1, 16, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 1 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, SAK_1); + + aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_2, SAK_DATA_2, 32, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 2 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, SAK_2); +} + +TEST_P(MacsecAidlTest, wrapSak) { + std::vector out; + auto aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_1, SAK_1, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 1 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, WRAPPED_SAK_1); + + aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_2, SAK_2, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 2 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, WRAPPED_SAK_2); +} + +TEST_P(MacsecAidlTest, unwrapSak) { + std::vector out; + auto aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_1, WRAPPED_SAK_1, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 1 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, SAK_1); + + aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_2, WRAPPED_SAK_2, &out); + ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 2 failed: " << aidlStatus.getMessage(); + EXPECT_EQ(out, SAK_2); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MacsecAidlTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, MacsecAidlTest, + testing::ValuesIn(android::getAidlHalInstanceNames(IMacsecPskPlugin::descriptor)), + android::PrintInstanceNameToString); diff --git a/macsec/aidl/vts/functional/OWNERS b/macsec/aidl/vts/functional/OWNERS new file mode 100644 index 0000000000..5009a88231 --- /dev/null +++ b/macsec/aidl/vts/functional/OWNERS @@ -0,0 +1,2 @@ +# Bug component: 533426 +keithmok@google.com -- GitLab From e0a962c8e30c0c775c7365eb97bce1755575cc48 Mon Sep 17 00:00:00 2001 From: Joen Chen Date: Mon, 28 Aug 2023 09:49:11 +0000 Subject: [PATCH 186/376] Reland "Add a DisplayCapability for multi-threaded present" Originally landed as I5dbb01fc23abd5e0108c565f96d25e62c77fc16d and previously reverted in I6265f8de3db31f07506906cee82a91fe3baac0bc due to timeline constraints. Add a test presenting from multiple threads. Split up execute() so that it can be called for a single display. Update MultiThreadedPresent (test) to offload presentDisplay to a separate thread, similar to how Ib9d074671e32c95875ef7e0791dd95d6e595e47a does it, as described in go/multi-threaded-present. Bug: 259132483 Bug: 284156408 Fixes: 251842321 Fixes: 295841597 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: If975ee9bb0b9c6f64ef50401e2aee32f934e3f08 --- .../graphics/composer3/DisplayCapability.aidl | 1 + .../graphics/composer3/DisplayCapability.aidl | 16 ++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 142 ++++++++++++++++-- 3 files changed, 147 insertions(+), 12 deletions(-) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl index 6eba887aef..0e2d72bae0 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -42,4 +42,5 @@ enum DisplayCapability { AUTO_LOW_LATENCY_MODE = 5, SUSPEND = 6, DISPLAY_IDLE_TIMER = 7, + MULTI_THREADED_PRESENT = 8, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl index f4b29843b8..7154d74499 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl @@ -80,4 +80,20 @@ enum DisplayCapability { * IComposerCallback.onVsyncIdle. */ DISPLAY_IDLE_TIMER = 7, + /** + * Indicates that both the composer HAL implementation and the given display + * support calling executeCommands concurrently from separate threads. + * executeCommands for a particular display will never run concurrently to + * any other executeCommands for the same display. In addition, the + * CommandResultPayload must only reference displays included in the + * DisplayCommands passed to executeCommands. Displays referenced from + * separate threads must have minimal interference with one another. If a + * HWC-managed display has this capability, SurfaceFlinger can run + * executeCommands for this display concurrently with other displays with the + * same capability. + * @see IComposerClient.executeCommands + * @see DisplayCommand.presentDisplay + * @see DisplayCommand.validateDisplay + */ + MULTI_THREADED_PRESENT = 8, } diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index 1e6f34b534..67c7b5a9be 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -1381,21 +1382,17 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { void execute() { std::vector payloads; for (auto& [_, writer] : mWriters) { - auto commands = writer.takePendingCommands(); - if (commands.empty()) { - continue; - } - - auto [status, results] = mComposerClient->executeCommands(commands); - ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); - - payloads.reserve(payloads.size() + results.size()); - payloads.insert(payloads.end(), std::make_move_iterator(results.begin()), - std::make_move_iterator(results.end())); + executeInternal(writer, payloads); } mReader.parse(std::move(payloads)); } + void execute(ComposerClientWriter& writer, ComposerClientReader& reader) { + std::vector payloads; + executeInternal(writer, payloads); + reader.parse(std::move(payloads)); + } + static inline auto toTimePoint(nsecs_t time) { return std::chrono::time_point(std::chrono::nanoseconds(time)); } @@ -1720,6 +1717,7 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { // clang-format on ComposerClientWriter& getWriter(int64_t display) { + std::lock_guard guard{mWritersMutex}; auto [it, _] = mWriters.try_emplace(display, display); return it->second; } @@ -1727,7 +1725,27 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { ComposerClientReader mReader; private: - std::unordered_map mWriters; + void executeInternal(ComposerClientWriter& writer, + std::vector& payloads) { + auto commands = writer.takePendingCommands(); + if (commands.empty()) { + return; + } + + auto [status, results] = mComposerClient->executeCommands(commands); + ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription(); + + payloads.reserve(payloads.size() + results.size()); + payloads.insert(payloads.end(), std::make_move_iterator(results.begin()), + std::make_move_iterator(results.end())); + } + + // Guards access to the map itself. Callers must ensure not to attempt to + // - modify the same writer from multiple threads + // - insert a new writer into the map during concurrent access, which would invalidate + // references from other threads + std::mutex mWritersMutex; + std::unordered_map mWriters GUARDED_BY(mWritersMutex); }; TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) { @@ -2785,6 +2803,106 @@ TEST_P(GraphicsComposerAidlCommandV2Test, } } +TEST_P(GraphicsComposerAidlCommandTest, MultiThreadedPresent) { + std::vector displays; + for (auto& display : mDisplays) { + if (hasDisplayCapability(display.getDisplayId(), + DisplayCapability::MULTI_THREADED_PRESENT)) { + displays.push_back(&display); + } + } + + const size_t numDisplays = displays.size(); + if (numDisplays <= 1u) { + GTEST_SKIP(); + } + + // When multi-threaded, use a reader per display. As with mWriters, this mutex + // guards access to the map. + std::mutex readersMutex; + std::unordered_map readers; + std::vector threads; + threads.reserve(numDisplays); + + // Each display will have a layer to present. This maps from the display to + // the layer, so we can properly destroy each layer at the end. + std::unordered_map layers; + + for (auto* const display : displays) { + const int64_t displayId = display->getDisplayId(); + + // Ensure that all writers and readers have been added to their respective + // maps initially, so that the following loop never modifies the maps. The + // maps are accessed from different threads, and if the maps were modified, + // this would invalidate their iterators, and therefore references to the + // writers and readers. + auto& writer = getWriter(displayId); + { + std::lock_guard guard{readersMutex}; + readers.try_emplace(displayId, displayId); + } + + EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); + + const auto& [status, layer] = mComposerClient->createLayer(displayId, kBufferSlotCount); + const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888); + ASSERT_NE(nullptr, buffer); + ASSERT_EQ(::android::OK, buffer->initCheck()); + ASSERT_NE(nullptr, buffer->handle); + + configureLayer(*display, layer, Composition::DEVICE, display->getFrameRect(), + display->getCrop()); + writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle, + /*acquireFence*/ -1); + writer.setLayerDataspace(displayId, layer, common::Dataspace::UNKNOWN); + layers.try_emplace(displayId, layer); + } + + for (auto* const display : displays) { + const int64_t displayId = display->getDisplayId(); + auto& writer = getWriter(displayId); + std::unique_lock lock{readersMutex}; + auto& reader = readers.at(displayId); + lock.unlock(); + + writer.validateDisplay(displayId, ComposerClientWriter::kNoTimestamp); + execute(writer, reader); + + threads.emplace_back([this, displayId, &readers, &readersMutex]() { + auto& writer = getWriter(displayId); + std::unique_lock lock{readersMutex}; + ComposerClientReader& reader = readers.at(displayId); + lock.unlock(); + + writer.presentDisplay(displayId); + execute(writer, reader); + ASSERT_TRUE(reader.takeErrors().empty()); + + auto presentFence = reader.takePresentFence(displayId); + // take ownership + const int fenceOwner = presentFence.get(); + *presentFence.getR() = -1; + EXPECT_NE(-1, fenceOwner); + const auto presentFence2 = sp<::android::Fence>::make(fenceOwner); + presentFence2->waitForever(LOG_TAG); + }); + } + + for (auto& thread : threads) { + thread.join(); + } + + for (auto& [displayId, layer] : layers) { + EXPECT_TRUE(mComposerClient->destroyLayer(displayId, layer).isOk()); + } + + std::lock_guard guard{readersMutex}; + for (auto& [displayId, reader] : readers) { + ASSERT_TRUE(reader.takeErrors().empty()); + ASSERT_TRUE(reader.takeChangedCompositionTypes(displayId).empty()); + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, -- GitLab From 6cb451d29af3ba94f6541ef65696e6a4936884a7 Mon Sep 17 00:00:00 2001 From: Cong Lin Date: Mon, 16 Oct 2023 14:51:37 -0700 Subject: [PATCH 187/376] Remove unused OWNERS file Empty OWNERS files are removed. The one from the parent directory hardware/interfaces/drm/OWNERS is used instead. Test: config only, lint verification Bug: 304183921 Change-Id: I44fa88f219e05f0f750bd6c931dd7a8ab3a29058 --- drm/aidl/OWNERS | 0 drm/aidl/vts/OWNERS | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 drm/aidl/OWNERS delete mode 100644 drm/aidl/vts/OWNERS diff --git a/drm/aidl/OWNERS b/drm/aidl/OWNERS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/drm/aidl/vts/OWNERS b/drm/aidl/vts/OWNERS deleted file mode 100644 index e69de29bb2..0000000000 -- GitLab From 03036457f2412af9c5fd7ce33eee50b4a3b5bf75 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Mon, 9 Oct 2023 13:47:06 -0700 Subject: [PATCH 188/376] Update TvMessageEvent to include a deviceId field Test: mmm Bug: 302208143 Change-Id: I45f8ba6d45dc7f4afbdbcf8d29e452944adea2ba --- compatibility_matrices/compatibility_matrix.9.xml | 2 +- tv/input/aidl/Android.bp | 3 +-- .../android/hardware/tv/input/TvMessageEvent.aidl | 1 + .../android/hardware/tv/input/ITvInputCallback.aidl | 13 ++++++++----- .../android/hardware/tv/input/TvMessageEvent.aidl | 1 + tv/input/aidl/vts/functional/Android.bp | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 00139232e9..e5e469ef6f 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -611,7 +611,7 @@ android.hardware.tv.input - 1 + 1-2 ITvInput default diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp index 35f510a162..cd69130f8b 100644 --- a/tv/input/aidl/Android.bp +++ b/tv/input/aidl/Android.bp @@ -35,6 +35,5 @@ aidl_interface { ], }, ], - frozen: true, - + frozen: false, } diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl index 94fe665d1d..3c1cb74860 100644 --- a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl +++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl @@ -37,4 +37,5 @@ parcelable TvMessageEvent { android.hardware.tv.input.TvMessageEventType type; int streamId; android.hardware.tv.input.TvMessage[] messages; + int deviceId; } diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl index a3afd41fd5..4121fc7516 100644 --- a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl +++ b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl @@ -32,17 +32,20 @@ interface ITvInputCallback { * Notifies the client that an TV message event has occurred. For possible event types, * check {@link android.hardware.tv.input.TvMessageEventType}. * - * The first message in a list of messages contained in a + *

    For implementations of version 1, The first message in a list of messages contained in a * {@link android.hardware.tv.input.TvMessageEvent} should always have a * {@link android.hardware.tv.input.TvMessage#subType} of "device_id", * otherwise the event is discarded. When the subType of a message is "device_id", the ID of * the device that sent the message should be contained in - * {@link android.hardware.tv.input.TvMessage#groupId} + * {@link android.hardware.tv.input.TvMessage#groupId}. * - * Invoking this callback for the first time immediately triggers + *

    For version 2 and beyond, the device ID should be contained in + * {@link android.hardware.tv.input.TvMessageEvent#deviceId}. + * + *

    Invoking this callback for the first time immediately triggers * {@link android.hardware.tv.input.ITvInput#getTvMessageQueueDesc}. It is - * expected for the queue to be ready with - * the relevant messages for the event before this callback is called. + * expected for the queue to be ready with the relevant messages for the event before this + * callback is called. * * @param event Event passed to the client. */ diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl index 74a078a45e..e04a725e47 100644 --- a/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl +++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl @@ -25,4 +25,5 @@ parcelable TvMessageEvent { int streamId; TvMessage[] messages; + int deviceId; } diff --git a/tv/input/aidl/vts/functional/Android.bp b/tv/input/aidl/vts/functional/Android.bp index 22487eafb1..930c5a808f 100644 --- a/tv/input/aidl/vts/functional/Android.bp +++ b/tv/input/aidl/vts/functional/Android.bp @@ -32,7 +32,7 @@ cc_test { "libvndksupport", "libfmq", "android.hardware.common.fmq-V1-ndk", - "android.hardware.tv.input-V1-ndk", + "android.hardware.tv.input-V2-ndk", ], require_root: true, } -- GitLab From 0dc2bc658f5707b9482a10b19adb2c0e77fb3a81 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 17 Oct 2023 11:56:52 -0700 Subject: [PATCH 189/376] Update TVInput impl and vts to create and validate queue Test: m vts && vts-tradefed run vts --module VtsHalTvInputTargetTest Bug: 305993654 Change-Id: I9e7a87b200c08a9807d99d66bd881226c4cc47aa --- tv/input/aidl/default/TvInput.cpp | 15 +++++++++++++-- tv/input/aidl/default/TvInput.h | 1 + .../vts/functional/VtsHalTvInputTargetTest.cpp | 8 ++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tv/input/aidl/default/TvInput.cpp b/tv/input/aidl/default/TvInput.cpp index 2ee8bcfec8..f6a64c4b40 100644 --- a/tv/input/aidl/default/TvInput.cpp +++ b/tv/input/aidl/default/TvInput.cpp @@ -43,6 +43,9 @@ void TvInput::init() { new TvStreamConfigWrapper(11, 360, 480, false))}}; mStreamConfigs[3] = {{5, shared_ptr( new TvStreamConfigWrapper(5, 1080, 1920, false))}}; + + mQueue = shared_ptr>( + new (std::nothrow) AidlMessageQueue(8)); } ::ndk::ScopedAStatus TvInput::setCallback(const shared_ptr& in_callback) { @@ -74,7 +77,9 @@ void TvInput::init() { return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); } + // When calling notifyTvMessage, make sure to verify against this map. mTvMessageEventEnabled[deviceId][streamId][in_type] = enabled; + return ::ndk::ScopedAStatus::ok(); } @@ -82,11 +87,17 @@ void TvInput::init() { MQDescriptor* out_queue, int32_t in_deviceId, int32_t in_streamId) { ALOGV("%s", __FUNCTION__); + ::ndk::ScopedAStatus status = ::ndk::ScopedAStatus::ok(); if (mStreamConfigs.count(in_deviceId) == 0) { ALOGW("Device with id %d isn't available", in_deviceId); - return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + status = ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS); + } else if (!mQueue->isValid()) { + ALOGE("Tv Message Queue was not properly initialized"); + status = ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE); + } else { + *out_queue = mQueue->dupeDesc(); } - return ::ndk::ScopedAStatus::ok(); + return status; } ::ndk::ScopedAStatus TvInput::getStreamConfigurations(int32_t in_deviceId, diff --git a/tv/input/aidl/default/TvInput.h b/tv/input/aidl/default/TvInput.h index 57769618e3..595f017fff 100644 --- a/tv/input/aidl/default/TvInput.h +++ b/tv/input/aidl/default/TvInput.h @@ -66,6 +66,7 @@ class TvInput : public BnTvInput { map> mDeviceInfos; map>> mStreamConfigs; TvMessageEnabledMap mTvMessageEventEnabled; + shared_ptr> mQueue; }; } // namespace input diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp index 8d3395b8d2..746ae1e1af 100644 --- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp +++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp @@ -355,8 +355,12 @@ TEST_P(TvInputAidlTest, GetTvMessageQueueTest) { } int32_t stream_id = streamConfigs[0].streamId; ALOGD("GetTvMessageQueueTest: device_id=%d, stream_id=%d", device_id, stream_id); - MQDescriptor queue; - tv_input_->getTvMessageQueueDesc(&queue, device_id, stream_id); + MQDescriptor queueDescriptor; + AidlMessageQueue* queue; + tv_input_->getTvMessageQueueDesc(&queueDescriptor, device_id, stream_id); + queue = new (std::nothrow) AidlMessageQueue(queueDescriptor); + ASSERT_TRUE(queue->isValid()); + delete queue; } INSTANTIATE_TEST_SUITE_P(PerInstance, TvInputAidlTest, -- GitLab From 0d523099ac011cd48790ae7959885de8666a4555 Mon Sep 17 00:00:00 2001 From: Shunkai Yao Date: Tue, 10 Oct 2023 19:26:07 +0000 Subject: [PATCH 190/376] Add defaults for audio AIDL interfaces - with defaults user don't have to change their Android.bp when there is a update - update AIDL audio interfaces with android.media.audio.common.types - update Spatialization and HeadTracking AIDL usage Bug: 273373363 Bug: 293370815 Test: m Change-Id: Ic9d8afc1d4e19e4243c66065b0a5d29156632851 --- audio/aidl/Android.bp | 71 +++++++++++++------ audio/aidl/common/Android.bp | 8 ++- audio/aidl/default/Android.bp | 6 +- ...oid.hardware.audio.effect.service-aidl.xml | 2 +- .../android.hardware.audio.service-aidl.xml | 8 +-- audio/aidl/sounddose/Android.bp | 4 +- audio/aidl/vts/Android.bp | 2 +- automotive/audiocontrol/aidl/Android.bp | 39 ++++++++-- .../aidl/default/audiocontrol-default.xml | 2 +- automotive/audiocontrol/aidl/vts/Android.bp | 4 +- bluetooth/audio/aidl/Android.bp | 23 +++++- bluetooth/audio/aidl/default/Android.bp | 4 +- .../audio/aidl/default/bluetooth_audio.xml | 2 +- bluetooth/audio/aidl/vts/Android.bp | 6 +- bluetooth/audio/utils/Android.bp | 4 +- common/aidl/Android.bp | 2 +- .../compatibility_matrix.9.xml | 12 ++-- .../exclude/fcm_exclude.cpp | 1 + soundtrigger/aidl/Android.bp | 14 +++- 19 files changed, 155 insertions(+), 59 deletions(-) diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 5a009fe674..0ab990a670 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -34,6 +34,7 @@ aidl_interface { name: "android.hardware.audio.common", defaults: [ "android.hardware.audio_defaults", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/common/AudioOffloadMetadata.aidl", @@ -42,10 +43,7 @@ aidl_interface { "android/hardware/audio/common/SinkMetadata.aidl", "android/hardware/audio/common/SourceMetadata.aidl", ], - frozen: true, - imports: [ - "android.media.audio.common.types-V2", - ], + frozen: false, backend: { cpp: { enabled: true, @@ -83,7 +81,7 @@ aidl_interface { } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_common = "android.hardware.audio.common-V2" +latest_android_hardware_audio_common = "android.hardware.audio.common-V3" // Modules that depend on android.hardware.audio.common directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -109,10 +107,21 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_common_import_interface", + imports: [ + latest_android_hardware_audio_common, + ], +} + aidl_interface { name: "android.hardware.audio.core", defaults: [ "android.hardware.audio_defaults", + "latest_android_hardware_audio_common_import_interface", + "latest_android_hardware_audio_core_sounddose_import_interface", + "latest_android_hardware_audio_effect_import_interface", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/core/AudioPatch.aidl", @@ -137,10 +146,6 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V2", - "android.hardware.audio.core.sounddose-V1", - "android.hardware.audio.effect-V1", - "android.media.audio.common.types-V2", ], backend: { // The C++ backend is disabled transitively due to use of FMQ. @@ -167,11 +172,11 @@ aidl_interface { // IMPORTANT: Update latest_android_hardware_audio_core every time you // add the latest frozen version to versions_with_info ], - frozen: true, + frozen: false, } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_core = "android.hardware.audio.core-V1" +latest_android_hardware_audio_core = "android.hardware.audio.core-V2" // Modules that depend on android.hardware.audio.core directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -190,18 +195,23 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_core_import_interface", + imports: [ + latest_android_hardware_audio_core, + ], +} + // Used for the standalone sounddose HAL aidl_interface { name: "android.hardware.audio.core.sounddose", defaults: [ "android.hardware.audio_defaults", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/core/sounddose/ISoundDose.aidl", ], - imports: [ - "android.media.audio.common.types-V2", - ], backend: { // The C++ backend is disabled transitively due to use of FMQ by the core HAL. cpp: { @@ -220,11 +230,11 @@ aidl_interface { // IMPORTANT: Update latest_android_hardware_audio_core_sounddose every time you // add the latest frozen version to versions_with_info ], - frozen: true, + frozen: false, } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_core_sounddose = "android.hardware.audio.core.sounddose-V1" +latest_android_hardware_audio_core_sounddose = "android.hardware.audio.core.sounddose-V2" // Modules that depend on android.hardware.audio.core.sounddose directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -236,6 +246,13 @@ cc_defaults { ], } +cc_defaults { + name: "latest_android_hardware_audio_core_sounddose_ndk_export_shared_lib_header", + export_shared_lib_headers: [ + latest_android_hardware_audio_core_sounddose + "-ndk", + ], +} + cc_defaults { name: "latest_android_hardware_audio_core_sounddose_ndk_static", static_libs: [ @@ -243,10 +260,19 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_core_sounddose_import_interface", + imports: [ + latest_android_hardware_audio_core_sounddose, + ], +} + aidl_interface { name: "android.hardware.audio.effect", defaults: [ "android.hardware.audio_defaults", + "latest_android_hardware_audio_common_import_interface", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/effect/AcousticEchoCanceler.aidl", @@ -280,8 +306,6 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V2", - "android.media.audio.common.types-V2", ], backend: { // The C++ backend is disabled transitively due to use of FMQ. @@ -303,11 +327,11 @@ aidl_interface { ], }, ], - frozen: true, + frozen: false, } -latest_android_hardware_audio_effect = "android.hardware.audio.effect-V1" +latest_android_hardware_audio_effect = "android.hardware.audio.effect-V2" cc_defaults { name: "latest_android_hardware_audio_effect_ndk_shared", @@ -322,3 +346,10 @@ cc_defaults { latest_android_hardware_audio_effect + "-ndk", ], } + +aidl_interface_defaults { + name: "latest_android_hardware_audio_effect_import_interface", + imports: [ + latest_android_hardware_audio_effect, + ], +} diff --git a/audio/aidl/common/Android.bp b/audio/aidl/common/Android.bp index 4c6a74e563..85ece3b026 100644 --- a/audio/aidl/common/Android.bp +++ b/audio/aidl/common/Android.bp @@ -45,8 +45,8 @@ cc_library { name: "libaudioaidlranges", host_supported: true, vendor_available: true, - static_libs: [ - "android.hardware.audio.effect-V1-ndk", + defaults: [ + "latest_android_hardware_audio_effect_ndk_shared", ], export_include_dirs: ["include"], header_libs: ["libaudioaidl_headers"], @@ -59,8 +59,10 @@ cc_test { name: "libaudioaidlcommon_test", host_supported: true, vendor_available: true, + defaults: [ + "latest_android_media_audio_common_types_ndk_static", + ], static_libs: [ - "android.media.audio.common.types-V1-ndk", "libaudioaidlcommon", ], shared_libs: [ diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp index 112d3e28fc..de247f1da5 100644 --- a/audio/aidl/default/Android.bp +++ b/audio/aidl/default/Android.bp @@ -78,6 +78,7 @@ cc_library { "latest_android_media_audio_common_types_ndk_shared", "latest_android_hardware_audio_core_ndk_shared", "latest_android_hardware_audio_core_sounddose_ndk_shared", + "latest_android_hardware_bluetooth_audio_ndk_shared", ], export_include_dirs: ["include"], srcs: [ @@ -125,7 +126,6 @@ cc_library { "audio_policy_engine_configuration_aidl_default", ], shared_libs: [ - "android.hardware.bluetooth.audio-V3-ndk", "libaudio_aidl_conversion_common_ndk", "libaudioutils", "libaudioutils_nonvndk", @@ -154,15 +154,15 @@ cc_binary { vintf_fragments: ["android.hardware.audio.service-aidl.xml"], defaults: [ "aidlaudioservice_defaults", - "latest_android_media_audio_common_types_ndk_shared", "latest_android_hardware_audio_core_sounddose_ndk_shared", "latest_android_hardware_audio_core_ndk_shared", + "latest_android_hardware_bluetooth_audio_ndk_shared", + "latest_android_media_audio_common_types_ndk_shared", ], static_libs: [ "libaudioserviceexampleimpl", ], shared_libs: [ - "android.hardware.bluetooth.audio-V3-ndk", "libaudioutils_nonvndk", "libaudio_aidl_conversion_common_ndk", "libbluetooth_audio_session_aidl", diff --git a/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml b/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml index fdc53a339c..05a825db1b 100644 --- a/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml +++ b/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml @@ -1,7 +1,7 @@ android.hardware.audio.effect - 1 + 2 IFactory/default diff --git a/audio/aidl/default/android.hardware.audio.service-aidl.xml b/audio/aidl/default/android.hardware.audio.service-aidl.xml index 57f61c9b2c..2a518763f1 100644 --- a/audio/aidl/default/android.hardware.audio.service-aidl.xml +++ b/audio/aidl/default/android.hardware.audio.service-aidl.xml @@ -1,22 +1,22 @@ android.hardware.audio.core - 1 + 2 IModule/default android.hardware.audio.core - 1 + 2 IModule/r_submix android.hardware.audio.core - 1 + 2 IModule/bluetooth android.hardware.audio.core - 1 + 2 IConfig/default - - android.hardware.graphics.mapper - 4.0 - - IMapper - default - - android.hardware.health 1-2 @@ -686,7 +677,7 @@ default - + mapper 5.0 -- GitLab From d5fa689e433e2141ea71305fe1ce522c0fc49350 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Fri, 20 Oct 2023 17:28:37 -0700 Subject: [PATCH 204/376] Add VUR to VHAL interface. Add enableVariableUpdateRate to subscribe options and supportVariableUpdateRate to VehicleAreaConfig. If variable update rate is enabled, VHAL will only send property change events for continuous property if the property's value changes. This is for improving performance and not send duplicate events. Test: m Bug: 306754638 Change-Id: Ic0d1ec2ebbf8ed6c26da3f3b820ac85e9c345b2c --- .../automotive/vehicle/SubscribeOptions.aidl | 1 + .../automotive/vehicle/VehicleAreaConfig.aidl | 1 + .../automotive/vehicle/SubscribeOptions.aidl | 15 +++++++++++ .../automotive/vehicle/VehicleAreaConfig.aidl | 27 +++++++++++++++++++ .../vehicle/VehicleAreaConfig.proto | 1 + 5 files changed, 45 insertions(+) diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl index 23fc8a92b4..1b1696b240 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl @@ -38,4 +38,5 @@ parcelable SubscribeOptions { int[] areaIds; float sampleRate; float resolution = 0.0f; + boolean enableVariableUpdateRate; } diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index 3322769071..08d4ee46e8 100644 --- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -43,4 +43,5 @@ parcelable VehicleAreaConfig { float maxFloatValue; @nullable long[] supportedEnumValues; android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE; + boolean supportVariableUpdateRate; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl index 1f2fb2754e..69f6190363 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl @@ -49,4 +49,19 @@ parcelable SubscribeOptions { * 10, VHAL should return a StatusCode::INVALID_ARG. */ float resolution = 0.0f; + + /** + * Whether to enable variable update rate. + * + * This only applies for continuous property. If variable update rate is + * enabled, for each given areaId, if VHAL supports variable update rate for + * the [propId, areaId], VHAL must ignore duplicate property value events + * and only sends changed value events (a.k.a treat continuous as an + * on-change property). + * + * If VHAL does not support variable update rate for the [propId, areaId], + * indicated by 'supportVariableUpdateRate' in 'VehicleAreaConfig', or if + * this property is not a continuous property, this option must be ignored. + */ + boolean enableVariableUpdateRate; } diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl index 9fd9bda3f8..08863b2576 100644 --- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl +++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl @@ -70,4 +70,31 @@ parcelable VehicleAreaConfig { * well. */ VehiclePropertyAccess access = VehiclePropertyAccess.NONE; + + /** + * Whether variable update rate is supported. + * + * This applies for continuous property only. + * + * It is HIGHLY RECOMMENDED to support variable update rate for all non-heartbeat continuous + * properties for better performance. + * + * If variable update rate is supported and 'enableVariableUpdateRate' is true in subscribe + * options, VHAL must only sends property update event when the property's value changes + * (a.k.a treat continuous as an on-change property). + * + * E.g. if the client is subscribing at 5hz at time 0. If the property's value is 0 initially + * and becomes 1 after 1 second. + + * If variable update rate is not enabled, VHAL clients will receive 5 property change events + * with value 0 and 5 events with value 1 after 2 seconds. + * + * If variable update rate is enabled, VHAL clients will receive 1 property change event + * with value 1 at time 1s. VHAL may/may not send a property event for the initial value (e.g. + * a property change event with value 0 at time 0s). VHAL client must not rely on the first + * property event, and must use getValues to fetch the initial value. In fact, car service is + * using getValues to fetch the initial value, convert it to a property event and deliver to + * car service clients. + */ + boolean supportVariableUpdateRate; } diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto index 04b7dd4d82..8093658477 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto @@ -44,4 +44,5 @@ message VehicleAreaConfig { */ repeated int64 supported_enum_values = 8; int32 access = 9; + bool support_variable_update_rate = 10; }; -- GitLab From 54da6d77130f7cfbadb925e68f0470790d0fc10c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 11 Sep 2023 14:55:19 -0700 Subject: [PATCH 205/376] Define a new BACKPORTED vehicle property group. This vehicle property group is used for reserving some property IDs that vendor can optionally implement as a custom property in older Android released so that we can backport VHAL property features. Test: m android.hardware.automotive.vehicle.property-update-api Bug: 300700901 Change-Id: Ic1f4865466acfcabbecf8a70f3cbcfb6440c9fe6 --- .../vehicle/VehiclePropertyGroup.aidl | 1 + .../vehicle/VehiclePropertyGroup.aidl | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl index 714d514cf4..b4f6850bbf 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -36,5 +36,6 @@ package android.hardware.automotive.vehicle; enum VehiclePropertyGroup { SYSTEM = 0x10000000, VENDOR = 0x20000000, + BACKPORTED = 0x30000000, MASK = 0xf0000000, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl index a2cbdec5e8..a417388929 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl @@ -29,5 +29,34 @@ enum VehiclePropertyGroup { */ VENDOR = 0x20000000, + /** + * Group reserved for backporting system properties introduced in a newer Android + * release to an older Android release. + * + * It is recommended to map the system property ID to a backported property ID by replacing the + * VehiclePropertyGroup, e.g. backported PERF_VEHICLE_SPEED(0x11600207) would be 0x31600207. + * + * When updated to a newer Android release where the property is defined as system properties, + * the backported properties must be migrated to system properties. + * + * In Android system, the backported property is treated the same as a vendor defined property + * with the same vendor permission model, a.k.a. Default required permission is + * `android.car.Car.PERMISSION_VENDOR_EXTENSION`, or customized by + * `SUPPORT_CUSTOMIZE_VENDOR_PERMISSION` VHAL property. + * + * Only applications with vendor permissions may access these backported properties. + * + * Vendors must also make sure this property's behavior is consistent with what is expected for + * the backported system property, e.g. the access mode, the change mode and the config array + * must be correct. + * + * When vendors define custom properties, they must use {@code VENDOR} flag, instead of + * {@code BACKPORTED} + */ + BACKPORTED = 0x30000000, + + /** + * The bit mask for {@code VehiclePropertyGroup}. This is not a group by itself. + */ MASK = 0xf0000000, } -- GitLab From 95f187b588681febee7d1a921d04a52a336a04ef Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 6 Sep 2023 10:36:24 -0700 Subject: [PATCH 206/376] Improved HD radio support in broadcast radio HAL Added identifier types, program info flags and metadata needed for HD radio in AIDL broadcast radio HAL. Depracated SXM identifier types since SXM is not supported. Bug: 280300929 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I822b43e6452c308db1259b99b961378c14c8b294 --- broadcastradio/aidl/Android.bp | 2 +- .../broadcastradio/AmFmRegionConfig.aidl | 8 +-- .../hardware/broadcastradio/ConfigFlag.aidl | 5 ++ .../hardware/broadcastradio/HdSubChannel.aidl | 45 +++++++++++++ .../broadcastradio/IdentifierType.aidl | 9 ++- .../hardware/broadcastradio/Metadata.aidl | 8 +++ .../hardware/broadcastradio/ProgramInfo.aidl | 15 +++-- .../hardware/broadcastradio/Result.aidl | 2 +- .../hardware/broadcastradio/ConfigFlag.aidl | 28 +++++++- .../hardware/broadcastradio/HdSubChannel.aidl | 62 +++++++++++++++++ .../broadcastradio/IdentifierType.aidl | 31 +++++++++ .../hardware/broadcastradio/Metadata.aidl | 66 +++++++++++++++++++ .../hardware/broadcastradio/ProgramInfo.aidl | 20 +++++- .../aidl/default/broadcastradio-default.xml | 1 + .../compatibility_matrix.9.xml | 1 + 15 files changed, 287 insertions(+), 16 deletions(-) create mode 100644 broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl create mode 100644 broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl diff --git a/broadcastradio/aidl/Android.bp b/broadcastradio/aidl/Android.bp index 3f89029232..e8bc5eb6d8 100644 --- a/broadcastradio/aidl/Android.bp +++ b/broadcastradio/aidl/Android.bp @@ -43,6 +43,6 @@ aidl_interface { imports: [], }, ], - frozen: true, + frozen: false, } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl index fe8489c69d..b96def32f8 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl @@ -37,8 +37,8 @@ parcelable AmFmRegionConfig { android.hardware.broadcastradio.AmFmBandRange[] ranges; int fmDeemphasis; int fmRds; - const int DEEMPHASIS_D50 = (1 << 0); - const int DEEMPHASIS_D75 = (1 << 1); - const int RDS = (1 << 0); - const int RBDS = (1 << 1); + const int DEEMPHASIS_D50 = (1 << 0) /* 1 */; + const int DEEMPHASIS_D75 = (1 << 1) /* 2 */; + const int RDS = (1 << 0) /* 1 */; + const int RBDS = (1 << 1) /* 2 */; } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl index 98af437266..d6d33bca50 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl @@ -35,6 +35,9 @@ package android.hardware.broadcastradio; @Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability enum ConfigFlag { FORCE_MONO = 1, + /** + * @deprecated Use {link #FORCE_ANALOG_FM} instead + */ FORCE_ANALOG, FORCE_DIGITAL, RDS_AF, @@ -43,4 +46,6 @@ enum ConfigFlag { DAB_FM_LINKING, DAB_DAB_SOFT_LINKING, DAB_FM_SOFT_LINKING, + FORCE_ANALOG_FM, + FORCE_ANALOG_AM, } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl new file mode 100644 index 0000000000..dd0613459c --- /dev/null +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.broadcastradio; +@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability +enum HdSubChannel { + HD1 = 0, + HD2 = 1, + HD3 = 2, + HD4 = 3, + HD5 = 4, + HD6 = 5, + HD7 = 6, + HD8 = 7, +} diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl index 4df272c3c3..ed41af00bc 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl @@ -47,6 +47,13 @@ enum IdentifierType { DAB_FREQUENCY_KHZ, DRMO_SERVICE_ID, DRMO_FREQUENCY_KHZ, - SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2), + /** + * @deprecated SiriusXM Satellite Radio is not supported. + */ + SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2) /* 12 */, + /** + * @deprecated SiriusXM Satellite Radio is not supported. + */ SXM_CHANNEL, + HD_STATION_LOCATION, } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl index e02b6b1bd0..b4a1efa488 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl @@ -50,4 +50,12 @@ union Metadata { String dabServiceNameShort; String dabComponentName; String dabComponentNameShort; + String genre; + String commentShortDescription; + String commentActualText; + String commercial; + String[] ufids; + String hdStationNameShort; + String hdStationNameLong; + int hdSubChannelsAvailable; } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl index b14023a3c0..997cdd7dd0 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl @@ -42,10 +42,13 @@ parcelable ProgramInfo { int signalQuality; android.hardware.broadcastradio.Metadata[] metadata; android.hardware.broadcastradio.VendorKeyValue[] vendorInfo; - const int FLAG_LIVE = (1 << 0); - const int FLAG_MUTED = (1 << 1); - const int FLAG_TRAFFIC_PROGRAM = (1 << 2); - const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3); - const int FLAG_TUNABLE = (1 << 4); - const int FLAG_STEREO = (1 << 5); + const int FLAG_LIVE = (1 << 0) /* 1 */; + const int FLAG_MUTED = (1 << 1) /* 2 */; + const int FLAG_TRAFFIC_PROGRAM = (1 << 2) /* 4 */; + const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3) /* 8 */; + const int FLAG_TUNABLE = (1 << 4) /* 16 */; + const int FLAG_STEREO = (1 << 5) /* 32 */; + const int FLAG_SIGNAL_ACQUISITION = (1 << 6) /* 64 */; + const int FLAG_HD_SIS_ACQUISITION = (1 << 7) /* 128 */; + const int FLAG_HD_AUDIO_ACQUISITION = (1 << 8) /* 256 */; } diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl index 8af74c74fb..b0fc018cb7 100644 --- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl +++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl @@ -34,7 +34,7 @@ package android.hardware.broadcastradio; @Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability enum Result { - OK, + OK = 0, INTERNAL_ERROR, INVALID_ARGUMENTS, INVALID_STATE, diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl index 11da39c02b..ddf60e0a88 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl @@ -36,10 +36,12 @@ enum ConfigFlag { * Forces the analog playback for the supporting radio technology. * * User may disable digital playback for FM HD Radio or hybrid FM/DAB with - * this option. This is purely user choice, ie. does not reflect digital- + * this option. This is purely user choice, i.e. does not reflect digital- * analog handover state managed from the HAL implementation side. * - * Some radio technologies may not support this, ie. DAB. + * Some radio technologies may not support this, i.e. DAB. + * + * @deprecated Use {link #FORCE_ANALOG_FM} instead */ FORCE_ANALOG, @@ -89,4 +91,26 @@ enum ConfigFlag { * Enables DAB-FM soft-linking (related content). */ DAB_FM_SOFT_LINKING, + + /** + * Forces the FM analog playback for the supporting radio technology. + * + * User may disable FM digital playback for FM HD Radio or hybrid FM/DAB + * with this option. This is purely user choice, i.e. does not reflect + * digital-analog handover state managed from the HAL implementation side. + * + * Some radio technologies may not support this, i.e. DAB. + */ + FORCE_ANALOG_FM, + + /** + * Forces the AM analog playback for the supporting radio technology. + * + * User may disable AM digital playback for AM HD Radio or hybrid AM/DAB + * with this option. This is purely user choice, i.e. does not reflect + * digital-analog handover state managed from the HAL implementation side. + * + * Some radio technologies may not support this, i.e. DAB. + */ + FORCE_ANALOG_AM, } diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl new file mode 100644 index 0000000000..46a3e0cf9e --- /dev/null +++ b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.broadcastradio; + +/** + * Index of HD radio subchannel. + */ +@VintfStability +@Backing(type="int") +@JavaDerive(equals=true, toString=true) +enum HdSubChannel { + /** + * Index of HD radio subchannel 1. + * + *

    There are at most 8 HD radio subchannels of 1-based om HD radio standard. It is + * converted to 0-based index. 0 is the index of main program service (MPS). 1 to 7 + * are indexes of additional supplemental program services (SPS). + */ + HD1 = 0, + /** + * {@see HD1} + */ + HD2 = 1, + /** + * {@see HD1} + */ + HD3 = 2, + /** + * {@see HD1} + */ + HD4 = 3, + /** + * {@see HD1} + */ + HD5 = 4, + /** + * {@see HD1} + */ + HD6 = 5, + /** + * {@see HD1} + */ + HD7 = 6, + /** + * {@see HD1} + */ + HD8 = 7, +} diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl index 646c502660..4a95a41c94 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl @@ -154,11 +154,42 @@ enum IdentifierType { /** * 32bit primary identifier for SiriusXM Satellite Radio. + * + * @deprecated SiriusXM Satellite Radio is not supported. */ SXM_SERVICE_ID = DRMO_FREQUENCY_KHZ + 2, /** * 0-999 range + * + * @deprecated SiriusXM Satellite Radio is not supported. */ SXM_CHANNEL, + + /** + * 64bit additional identifier for HD Radio representing station location. + * + * Consists of (from the LSB): + * - 4 bit: Bits 0:3 of altitude + * - 13 bit: Fractional bits of longitude + * - 8 bit: Integer bits of longitude + * - 1 bit: 0 for east and 1 for west for longitude + * - 1 bit: 0, representing latitude + * - 5 bit: pad of zeros separating longitude and latitude + * - 4 bit: Bits 4:7 of altitude + * - 13 bit: Fractional bits of latitude + * - 8 bit: Integer bits of latitude + * - 1 bit: 0 for north and 1 for south for latitude + * - 1 bit: 1, representing latitude + * - 5 bit: pad of zeros + * + * This format is defined in NRSC-5-C document: SY_IDD_1020s. + * + * Due to Station ID abuse, some HD_STATION_ID_EXT identifiers may be not + * globally unique. To provide a best-effort solution, the station’s + * broadcast antenna containing the latitude and longitude may be carried + * as additional identifier and may be used by the tuner hardware to + * double-check tuning. + */ + HD_STATION_LOCATION, } diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl index 7769b8c373..0ce967f009 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl @@ -116,4 +116,70 @@ union Metadata { *

    Note: The string must be up to 8 characters long. */ String dabComponentNameShort; + + /** + * Genre of the current audio piece (string) + * + *

    (see NRSC-G200-A and id3v2.3.0 for more info) + */ + String genre; + + /** + * Short context description of comment (string) + * + *

    Comment could relate to the current audio program content, or it might + * be unrelated information that the station chooses to send. It is + * composed of short content description and actual text (see NRSC-G200-A + * and id3v2.3.0 for more info). + */ + String commentShortDescription; + + /** + * Actual text of comment (string) + * + * @see #commentShortDescription + */ + String commentActualText; + + /** + * Commercial (string) + * + *

    Commercial is application specific and generally used to facilitate the + * sale of products and services (see NRSC-G200-A and id3v2.3.0 for more info). + */ + String commercial; + + /** + * HD Unique File Identifiers (Array of strings) + * + *

    Unique File Identifier (UFID) can be used to transmit an alphanumeric + * identifier of the current content, or of an advertised product or service + * (see NRSC-G200-A and id3v2.3.0 for more info). + */ + String[] ufids; + + /** + * HD short station name or HD universal short station name + * + *

    It can be up to 12 characters (see SY_IDD_1020s for more info). + */ + String hdStationNameShort; + + /** + * HD long station name, HD station slogan or HD station message + * + *

    (see SY_IDD_1020s for more info) + */ + String hdStationNameLong; + + /** + * Bit mask of all HD Radio subchannels available (uint8_t) + * + *

    Bit {@link HdSubChannel#HD1} from LSB represents the availability + * of HD-1 subchannel (main program service, MPS). Bits + * {@link HdSubChannel#HD2} to {@link HdSubChannel#HD8} from LSB represent + * HD-2 to HD-8 subchannel (supplemental program services, SPS) + * respectively. + */ + int hdSubChannelsAvailable; } diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl index 7632c81e1d..d4ccd01bc3 100644 --- a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl +++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl @@ -70,6 +70,23 @@ parcelable ProgramInfo { */ const int FLAG_STEREO = 1 << 5; + /** + * A signal has been acquired if this bit is set. + */ + + const int FLAG_SIGNAL_ACQUISITION = 1 << 6; + /** + * An HD Station Information Service (SIS) information is available if this + * bit is set. + */ + + const int FLAG_HD_SIS_ACQUISITION = 1 << 7; + + /** + * An HD digital audio is available if this bit is set. + */ + const int FLAG_HD_AUDIO_ACQUISITION = 1 << 8; + /** * An identifier used to point at the program (primarily to tune to it). * @@ -153,7 +170,8 @@ parcelable ProgramInfo { * * It can be a combination of {@link #FLAG_LIVE}, {@link #FLAG_MUTED}, * {@link #FLAG_TRAFFIC_PROGRAM}, {@link #FLAG_TRAFFIC_ANNOUNCEMENT}, - * {@link #FLAG_TUNABLE}, and {@link #FLAG_STEREO}. + * {@link #FLAG_TUNABLE}, {@link #FLAG_STEREO}, {@link #FLAG_SIGNAL_ACQUISITION}, + * {@link #FLAG_HD_SIS_ACQUISITION}, and {@link #FLAG_HD_AUDIO_ACQUISITION}. */ int infoFlags; diff --git a/broadcastradio/aidl/default/broadcastradio-default.xml b/broadcastradio/aidl/default/broadcastradio-default.xml index 1555822e07..acf35f98a5 100644 --- a/broadcastradio/aidl/default/broadcastradio-default.xml +++ b/broadcastradio/aidl/default/broadcastradio-default.xml @@ -1,6 +1,7 @@ android.hardware.broadcastradio + 1 IBroadcastRadio/amfm IBroadcastRadio/dab diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 75915e3342..77733a8bf7 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -157,6 +157,7 @@ android.hardware.broadcastradio + 1-2 IBroadcastRadio .* -- GitLab From 052608fe336faf04b3bc243fd98f62f26697ec24 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Wed, 18 Oct 2023 16:53:36 -0700 Subject: [PATCH 207/376] Add subscribe/unsubscribe to IVehicleHardware. These two functions replaces updateSampleRate. Previously updateSampleRate will be called when a continuous property is subscribed/unsubscribed. However, IVehicleHardware layer does not know when an on-change property is subscribed/unsubscribed. This CL introduces two new functions to notify IVehicleHardware when any properties are subscribed/unsubscribed. Test: atest DefaultVehicleHalTest Bug: 306262618 Change-Id: I8d32d1eb919036015b5082f74e259bcd4b1bd29e --- .../impl/hardware/include/IVehicleHardware.h | 108 +++++++--- .../impl/utils/common/include/VehicleUtils.h | 5 + .../impl/vhal/include/SubscriptionManager.h | 15 +- .../impl/vhal/src/SubscriptionManager.cpp | 196 ++++++++++++------ .../impl/vhal/test/MockVehicleHardware.cpp | 63 +++++- .../aidl/impl/vhal/test/MockVehicleHardware.h | 13 +- .../vhal/test/SubscriptionManagerTest.cpp | 37 +++- 7 files changed, 329 insertions(+), 108 deletions(-) diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index 3fecbd92f0..b813b1189e 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -82,35 +82,6 @@ class IVehicleHardware { const std::vector& requests) const = 0; - // Update the sampling rate for the specified property and the specified areaId (0 for global - // property) if server supports it. The property must be a continuous property. - // {@code sampleRate} means that for this specific property, the server must generate at least - // this many OnPropertyChange events per seconds. - // A sampleRate of 0 means the property is no longer subscribed and server does not need to - // generate any onPropertyEvent for this property. - // This would be called if sample rate is updated for a subscriber, a new subscriber is added - // or an existing subscriber is removed. For example: - // 1. We have no subscriber for speed. - // 2. A new subscriber is subscribing speed for 10 times/s, updsateSampleRate would be called - // with sampleRate as 10. The impl is now polling vehicle speed from bus 10 times/s. - // 3. A new subscriber is subscribing speed for 5 times/s, because it is less than 10 - // times/sec, updateSampleRate would not be called. - // 4. The initial subscriber is removed, updateSampleRate would be called with sampleRate as - // 5, because now it only needs to report event 5times/sec. The impl can now poll vehicle - // speed 5 times/s. If the impl is still polling at 10 times/s, that is okay as long as - // the polling rate is larger than 5times/s. DefaultVehicleHal would ignore the additional - // events. - // 5. The second subscriber is removed, updateSampleRate would be called with sampleRate as 0. - // The impl can optionally disable the polling for vehicle speed. - // - // If the impl is always polling at {@code maxSampleRate} as specified in config, then this - // function can be a no-op. - virtual aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( - [[maybe_unused]] int32_t propId, [[maybe_unused]] int32_t areaId, - [[maybe_unused]] float sampleRate) { - return aidl::android::hardware::automotive::vehicle::StatusCode::OK; - } - // Dump debug information in the server. virtual DumpResult dump(const std::vector& options) = 0; @@ -145,6 +116,85 @@ class IVehicleHardware { // By default batching is disabled. return std::chrono::nanoseconds(0); } + + // A [propId, areaId] is newly subscribed or the update rate is changed. + // + // The 'options' contains the property ID, area ID and sample rate in Hz. + // + // For continuous property, the sample rate is never 0 and indicates the new sample rate (or + // the initial sample rate if this property was not subscribed before). + // + // For on-change property, the sample rate is always 0 and must be ignored. + // + // A subscription from VHAL client might not necessarily trigger this function. + // DefaultVehicleHal will aggregate all the subscriptions from all the clients and notify + // IVehicleHardware if new subscriptions are required or sample rate is updated. + // + // For example: + // 1. VHAL initially have no subscriber for speed. + // 2. A new subscriber is subscribing speed for 10 times/s, 'subscribe' is called + // with sampleRate as 10. The impl is now polling vehicle speed from bus 10 times/s. + // 3. A new subscriber is subscribing speed for 5 times/s, because it is less than 10 + // times/sec, 'subscribe' is not called. + // 4. The initial subscriber is removed, 'subscribe' is called with sampleRate as + // 5, because now it only needs to report event 5times/sec. The impl can now poll vehicle + // speed 5 times/s. If the impl is still polling at 10 times/s, that is okay as long as + // the polling rate is larger than 5times/s. DefaultVehicleHal would ignore the additional + // events. + // 5. The second subscriber is removed, 'unsubscribe' is called. + // The impl can optionally disable the polling for vehicle speed. + // + // It is recommended to only deliver the subscribed property events to DefaultVehicleHal to + // improve performance. However, even if unsubscribed property events are delivered, they + // will be filtered out by DefaultVehicleHal. + // + // For continuous property, if the impl is always polling at {@code maxSampleRate} as specified + // in config, then this function can be a no-op. + // + // For on-change property, if the impl is always subscribing to all on-change properties, then + // this function can be no-op. + virtual aidl::android::hardware::automotive::vehicle::StatusCode subscribe( + [[maybe_unused]] aidl::android::hardware::automotive::vehicle::SubscribeOptions + options) { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + + // A [propId, areaId] is unsubscribed. This applies for both continuous or on-change property. + virtual aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe( + [[maybe_unused]] int32_t propId, [[maybe_unused]] int32_t areaId) { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } + + // This function is deprecated, subscribe/unsubscribe should be used instead. + // + // Update the sampling rate for the specified property and the specified areaId (0 for global + // property) if server supports it. The property must be a continuous property. + // {@code sampleRate} means that for this specific property, the server must generate at least + // this many OnPropertyChange events per seconds. + // A sampleRate of 0 means the property is no longer subscribed and server does not need to + // generate any onPropertyEvent for this property. + // This would be called if sample rate is updated for a subscriber, a new subscriber is added + // or an existing subscriber is removed. For example: + // 1. We have no subscriber for speed. + // 2. A new subscriber is subscribing speed for 10 times/s, updateSampleRate would be called + // with sampleRate as 10. The impl is now polling vehicle speed from bus 10 times/s. + // 3. A new subscriber is subscribing speed for 5 times/s, because it is less than 10 + // times/sec, updateSampleRate would not be called. + // 4. The initial subscriber is removed, updateSampleRate would be called with sampleRate as + // 5, because now it only needs to report event 5times/sec. The impl can now poll vehicle + // speed 5 times/s. If the impl is still polling at 10 times/s, that is okay as long as + // the polling rate is larger than 5times/s. DefaultVehicleHal would ignore the additional + // events. + // 5. The second subscriber is removed, updateSampleRate would be called with sampleRate as 0. + // The impl can optionally disable the polling for vehicle speed. + // + // If the impl is always polling at {@code maxSampleRate} as specified in config, then this + // function can be a no-op. + virtual aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( + [[maybe_unused]] int32_t propId, [[maybe_unused]] int32_t areaId, + [[maybe_unused]] float sampleRate) { + return aidl::android::hardware::automotive::vehicle::StatusCode::OK; + } }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h index c94bad6ca6..546421e109 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h @@ -329,6 +329,11 @@ struct PropIdAreaIdHash { } }; +inline std::string propIdToString(int32_t propId) { + return toString( + static_cast(propId)); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index b91895ed3c..057da35f24 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -119,7 +119,7 @@ class SubscriptionManager final { mutable std::mutex mLock; std::unordered_map, PropIdAreaIdHash> - mClientsByPropIdArea GUARDED_BY(mLock); + mClientsByPropIdAreaId GUARDED_BY(mLock); std::unordered_map> mSubscribedPropsByClient GUARDED_BY(mLock); std::unordered_map mContSubConfigsByPropIdArea @@ -128,12 +128,21 @@ class SubscriptionManager final { VhalResult addContinuousSubscriberLocked(const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz) REQUIRES(mLock); + VhalResult addOnChangeSubscriberLocked(const PropIdAreaId& propIdAreaId) REQUIRES(mLock); + // Removes the subscription client for the continuous [propId, areaId]. VhalResult removeContinuousSubscriberLocked(const ClientIdType& clientId, const PropIdAreaId& propIdAreaId) REQUIRES(mLock); + // Removes one subscription client for the on-change [propId, areaId]. + VhalResult removeOnChangeSubscriberLocked(const PropIdAreaId& propIdAreaId) + REQUIRES(mLock); + + VhalResult updateContSubConfigsLocked(const PropIdAreaId& PropIdAreaId, + const ContSubConfigs& newConfig) REQUIRES(mLock); - VhalResult updateContSubConfigs(const PropIdAreaId& PropIdAreaId, - const ContSubConfigs& newConfig) REQUIRES(mLock); + VhalResult unsubscribePropIdAreaIdLocked(SubscriptionManager::ClientIdType clientId, + const PropIdAreaId& propIdAreaId) + REQUIRES(mLock); // Checks whether the manager is empty. For testing purpose. bool isEmpty(); diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index b3c2693472..a7c797b9e4 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -16,6 +16,7 @@ #include "SubscriptionManager.h" +#include #include #include #include @@ -29,10 +30,6 @@ namespace vehicle { namespace { -constexpr float ONE_SECOND_IN_NANO = 1'000'000'000.; - -} // namespace - using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::StatusCode; using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; @@ -43,13 +40,26 @@ using ::android::base::Result; using ::android::base::StringPrintf; using ::ndk::ScopedAStatus; +constexpr float ONE_SECOND_IN_NANOS = 1'000'000'000.; + +SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId, float sampleRateHz) { + SubscribeOptions subscribedOptions; + subscribedOptions.propId = propId; + subscribedOptions.areaIds = {areaId}; + subscribedOptions.sampleRate = sampleRateHz; + + return subscribedOptions; +} + +} // namespace + SubscriptionManager::SubscriptionManager(IVehicleHardware* vehicleHardware) : mVehicleHardware(vehicleHardware) {} SubscriptionManager::~SubscriptionManager() { std::scoped_lock lockGuard(mLock); - mClientsByPropIdArea.clear(); + mClientsByPropIdAreaId.clear(); mSubscribedPropsByClient.clear(); } @@ -62,10 +72,10 @@ Result SubscriptionManager::getIntervalNanos(float sampleRateHz) { if (sampleRateHz <= 0) { return Error() << "invalid sample rate, must be a positive number"; } - if (sampleRateHz <= (ONE_SECOND_IN_NANO / static_cast(INT64_MAX))) { + if (sampleRateHz <= (ONE_SECOND_IN_NANOS / static_cast(INT64_MAX))) { return Error() << "invalid sample rate: " << sampleRateHz << ", too small"; } - intervalNanos = static_cast(ONE_SECOND_IN_NANO / sampleRateHz); + intervalNanos = static_cast(ONE_SECOND_IN_NANOS / sampleRateHz); return intervalNanos; } @@ -95,12 +105,31 @@ float ContSubConfigs::getMaxSampleRateHz() const { return mMaxSampleRateHz; } +VhalResult SubscriptionManager::addOnChangeSubscriberLocked( + const PropIdAreaId& propIdAreaId) { + if (mClientsByPropIdAreaId.find(propIdAreaId) != mClientsByPropIdAreaId.end()) { + // This propId, areaId is already subscribed, ignore the request. + return {}; + } + + int32_t propId = propIdAreaId.propId; + int32_t areaId = propIdAreaId.areaId; + if (auto status = mVehicleHardware->subscribe( + newSubscribeOptions(propId, areaId, /*updateRateHz=*/0)); + status != StatusCode::OK) { + return StatusError(status) + << StringPrintf("failed subscribe for prop: %s, areaId: %" PRId32, + propIdToString(propId).c_str(), areaId); + } + return {}; +} + VhalResult SubscriptionManager::addContinuousSubscriberLocked( const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz) { // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId]; newConfig.addClient(clientId, sampleRateHz); - return updateContSubConfigs(propIdAreaId, newConfig); + return updateContSubConfigsLocked(propIdAreaId, newConfig); } VhalResult SubscriptionManager::removeContinuousSubscriberLocked( @@ -108,11 +137,28 @@ VhalResult SubscriptionManager::removeContinuousSubscriberLocked( // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId]; newConfig.removeClient(clientId); - return updateContSubConfigs(propIdAreaId, newConfig); + return updateContSubConfigsLocked(propIdAreaId, newConfig); +} + +VhalResult SubscriptionManager::removeOnChangeSubscriberLocked( + const PropIdAreaId& propIdAreaId) { + if (mClientsByPropIdAreaId[propIdAreaId].size() > 1) { + // After unsubscribing this client, there is still client subscribed, so do nothing. + return {}; + } + + int32_t propId = propIdAreaId.propId; + int32_t areaId = propIdAreaId.areaId; + if (auto status = mVehicleHardware->unsubscribe(propId, areaId); status != StatusCode::OK) { + return StatusError(status) + << StringPrintf("failed unsubscribe for prop: %s, areaId: %" PRId32, + propIdToString(propId).c_str(), areaId); + } + return {}; } -VhalResult SubscriptionManager::updateContSubConfigs(const PropIdAreaId& propIdAreaId, - const ContSubConfigs& newConfig) { +VhalResult SubscriptionManager::updateContSubConfigsLocked(const PropIdAreaId& propIdAreaId, + const ContSubConfigs& newConfig) { if (newConfig.getMaxSampleRateHz() == mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRateHz()) { mContSubConfigsByPropIdArea[propIdAreaId] = newConfig; @@ -123,10 +169,27 @@ VhalResult SubscriptionManager::updateContSubConfigs(const PropIdAreaId& p int32_t areaId = propIdAreaId.areaId; if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz); status != StatusCode::OK) { - return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32 - ", area" - ": %" PRId32 ", sample rate: %f HZ", - propId, areaId, newRateHz); + return StatusError(status) + << StringPrintf("failed to update sample rate for prop: %s, areaId: %" PRId32 + ", sample rate: %f HZ", + propIdToString(propId).c_str(), areaId, newRateHz); + } + if (newRateHz != 0) { + if (auto status = + mVehicleHardware->subscribe(newSubscribeOptions(propId, areaId, newRateHz)); + status != StatusCode::OK) { + return StatusError(status) << StringPrintf( + "failed subscribe for prop: %s, areaId" + ": %" PRId32 ", sample rate: %f HZ", + propIdToString(propId).c_str(), areaId, newRateHz); + } + } else { + if (auto status = mVehicleHardware->unsubscribe(propId, areaId); status != StatusCode::OK) { + return StatusError(status) << StringPrintf( + "failed unsubscribe for prop: %s, areaId" + ": %" PRId32, + propIdToString(propId).c_str(), areaId); + } } mContSubConfigsByPropIdArea[propIdAreaId] = newConfig; return {}; @@ -163,21 +226,53 @@ VhalResult SubscriptionManager::subscribe(const std::shared_ptr result; if (isContinuousProperty) { - if (auto result = addContinuousSubscriberLocked(clientId, propIdAreaId, - option.sampleRate); - !result.ok()) { - return result; - } + result = addContinuousSubscriberLocked(clientId, propIdAreaId, option.sampleRate); + } else { + result = addOnChangeSubscriberLocked(propIdAreaId); + } + + if (!result.ok()) { + return result; } mSubscribedPropsByClient[clientId].insert(propIdAreaId); - mClientsByPropIdArea[propIdAreaId][clientId] = callback; + mClientsByPropIdAreaId[propIdAreaId][clientId] = callback; } } return {}; } +VhalResult SubscriptionManager::unsubscribePropIdAreaIdLocked( + SubscriptionManager::ClientIdType clientId, const PropIdAreaId& propIdAreaId) { + if (mContSubConfigsByPropIdArea.find(propIdAreaId) != mContSubConfigsByPropIdArea.end()) { + // This is a subscribed continuous property. + if (auto result = removeContinuousSubscriberLocked(clientId, propIdAreaId); !result.ok()) { + return result; + } + } else { + if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) { + ALOGW("Unsubscribe: The property: %s, areaId: %" PRId32 + " was not previously subscribed, do nothing", + propIdToString(propIdAreaId.propId).c_str(), propIdAreaId.areaId); + return {}; + } + // This is an on-change property. + if (auto result = removeOnChangeSubscriberLocked(propIdAreaId); !result.ok()) { + return result; + } + } + + auto& clients = mClientsByPropIdAreaId[propIdAreaId]; + clients.erase(clientId); + if (clients.empty()) { + mClientsByPropIdAreaId.erase(propIdAreaId); + mContSubConfigsByPropIdArea.erase(propIdAreaId); + } + return {}; +} + VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId, const std::vector& propIds) { std::scoped_lock lockGuard(mLock); @@ -186,39 +281,27 @@ VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdT return StatusError(StatusCode::INVALID_ARG) << "No property was subscribed for the callback"; } - std::unordered_set subscribedPropIds; - for (auto const& propIdAreaId : mSubscribedPropsByClient[clientId]) { - subscribedPropIds.insert(propIdAreaId.propId); - } + std::vector propIdAreaIdsToUnsubscribe; + std::unordered_set propIdSet; for (int32_t propId : propIds) { - if (subscribedPropIds.find(propId) == subscribedPropIds.end()) { - return StatusError(StatusCode::INVALID_ARG) - << "property ID: " << propId << " is not subscribed"; + propIdSet.insert(propId); + } + auto& subscribedPropIdsAreaIds = mSubscribedPropsByClient[clientId]; + for (const auto& propIdAreaId : subscribedPropIdsAreaIds) { + if (propIdSet.find(propIdAreaId.propId) != propIdSet.end()) { + propIdAreaIdsToUnsubscribe.push_back(propIdAreaId); } } - auto& propIdAreaIds = mSubscribedPropsByClient[clientId]; - auto it = propIdAreaIds.begin(); - while (it != propIdAreaIds.end()) { - int32_t propId = it->propId; - if (std::find(propIds.begin(), propIds.end(), propId) != propIds.end()) { - if (auto result = removeContinuousSubscriberLocked(clientId, *it); !result.ok()) { - return result; - } - - auto& clients = mClientsByPropIdArea[*it]; - clients.erase(clientId); - if (clients.empty()) { - mClientsByPropIdArea.erase(*it); - mContSubConfigsByPropIdArea.erase(*it); - } - it = propIdAreaIds.erase(it); - } else { - it++; + for (const auto& propIdAreaId : propIdAreaIdsToUnsubscribe) { + if (auto result = unsubscribePropIdAreaIdLocked(clientId, propIdAreaId); !result.ok()) { + return result; } + subscribedPropIdsAreaIds.erase(propIdAreaId); } - if (propIdAreaIds.empty()) { + + if (subscribedPropIdsAreaIds.empty()) { mSubscribedPropsByClient.erase(clientId); } return {}; @@ -233,16 +316,9 @@ VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdT auto& subscriptions = mSubscribedPropsByClient[clientId]; for (auto const& propIdAreaId : subscriptions) { - if (auto result = removeContinuousSubscriberLocked(clientId, propIdAreaId); !result.ok()) { + if (auto result = unsubscribePropIdAreaIdLocked(clientId, propIdAreaId); !result.ok()) { return result; } - - auto& clients = mClientsByPropIdArea[propIdAreaId]; - clients.erase(clientId); - if (clients.empty()) { - mClientsByPropIdArea.erase(propIdAreaId); - mContSubConfigsByPropIdArea.erase(propIdAreaId); - } } mSubscribedPropsByClient.erase(clientId); return {}; @@ -258,11 +334,11 @@ SubscriptionManager::getSubscribedClients(std::vector&& update .propId = value.prop, .areaId = value.areaId, }; - if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { + if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) { continue; } - for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) { + for (const auto& [_, client] : mClientsByPropIdAreaId[propIdAreaId]) { clients[client].push_back(value); } } @@ -280,11 +356,11 @@ SubscriptionManager::getSubscribedClientsForErrorEvents( .propId = errorEvent.propId, .areaId = errorEvent.areaId, }; - if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) { + if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) { continue; } - for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) { + for (const auto& [_, client] : mClientsByPropIdAreaId[propIdAreaId]) { clients[client].push_back({ .propId = errorEvent.propId, .areaId = errorEvent.areaId, @@ -297,7 +373,7 @@ SubscriptionManager::getSubscribedClientsForErrorEvents( bool SubscriptionManager::isEmpty() { std::scoped_lock lockGuard(mLock); - return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty(); + return mSubscribedPropsByClient.empty() && mClientsByPropIdAreaId.empty(); } size_t SubscriptionManager::countClients() { diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index 3fae59655c..b64c0d7102 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -29,6 +29,7 @@ using ::aidl::android::hardware::automotive::vehicle::GetValueResult; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; @@ -88,7 +89,26 @@ StatusCode MockVehicleHardware::checkHealth() { return StatusCode::OK; } -StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, float sampleRate) { +StatusCode MockVehicleHardware::subscribe(SubscribeOptions options) { + for (int32_t areaId : options.areaIds) { + if (auto status = subscribePropIdAreaId(options.propId, areaId, options.sampleRate); + status != StatusCode::OK) { + return status; + } + } + return StatusCode::OK; +} + +StatusCode MockVehicleHardware::subscribePropIdAreaId(int32_t propId, int32_t areaId, + float sampleRateHz) { + if (sampleRateHz == 0) { + // on-change property. + std::scoped_lock lockGuard(mLock); + mSubOnChangePropIdAreaIds.insert(std::pair(propId, areaId)); + return StatusCode::OK; + } + + // continuous property. std::shared_ptr> action; { @@ -97,9 +117,6 @@ StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, // Remove the previous action register for this [propId, areaId]. mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propId][areaId]); } - if (sampleRate == 0) { - return StatusCode::OK; - } // We are sure 'propertyChangeCallback' would be alive because we would unregister timer // before destroying 'this' which owns mPropertyChangeCallback. @@ -107,8 +124,8 @@ StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, action = std::make_shared>([propertyChangeCallback, propId, areaId] { std::vector values = { { - .prop = propId, .areaId = areaId, + .prop = propId, }, }; (*propertyChangeCallback)(values); @@ -119,11 +136,45 @@ StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, // In mock implementation, we generate a new property change event for this property at sample // rate. - int64_t interval = static_cast(1'000'000'000. / sampleRate); + int64_t interval = static_cast(1'000'000'000. / sampleRateHz); mRecurrentTimer->registerTimerCallback(interval, action); return StatusCode::OK; } +StatusCode MockVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) { + std::scoped_lock lockGuard(mLock); + // For on-change property. + mSubOnChangePropIdAreaIds.erase(std::make_pair(propId, areaId)); + // for continuous property. + if (mRecurrentActions[propId][areaId] != nullptr) { + // Remove the previous action register for this [propId, areaId]. + mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propId][areaId]); + mRecurrentActions[propId].erase(areaId); + if (mRecurrentActions[propId].empty()) { + mRecurrentActions.erase(propId); + } + } + return StatusCode::OK; +} + +std::set> MockVehicleHardware::getSubscribedOnChangePropIdAreaIds() { + std::scoped_lock lockGuard(mLock); + std::set> propIdAreaIds; + propIdAreaIds = mSubOnChangePropIdAreaIds; + return propIdAreaIds; +} + +std::set> MockVehicleHardware::getSubscribedContinuousPropIdAreaIds() { + std::scoped_lock lockGuard(mLock); + std::set> propIdAreaIds; + for (const auto& [propId, actionByAreaId] : mRecurrentActions) { + for (const auto& [areaId, _] : actionByAreaId) { + propIdAreaIds.insert(std::make_pair(propId, areaId)); + } + } + return propIdAreaIds; +} + void MockVehicleHardware::registerOnPropertyChangeEvent( std::unique_ptr callback) { std::scoped_lock lockGuard(mLock); diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index 3ce18c5f8d..e0d2d662f8 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -59,8 +60,10 @@ class MockVehicleHardware final : public IVehicleHardware { void registerOnPropertyChangeEvent( std::unique_ptr callback) override; void registerOnPropertySetErrorEvent(std::unique_ptr) override; - aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( - int32_t propId, int32_t areaId, float sampleRate) override; + aidl::android::hardware::automotive::vehicle::StatusCode subscribe( + aidl::android::hardware::automotive::vehicle::SubscribeOptions options) override; + aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(int32_t propId, + int32_t areaId) override; std::chrono::nanoseconds getPropertyOnChangeEventBatchingWindow() override; // Test functions. @@ -90,6 +93,9 @@ class MockVehicleHardware final : public IVehicleHardware { void sendOnPropertySetErrorEvent(const std::vector& errorEvents); void setPropertyOnChangeEventBatchingWindow(std::chrono::nanoseconds window); + std::set> getSubscribedOnChangePropIdAreaIds(); + std::set> getSubscribedContinuousPropIdAreaIds(); + private: mutable std::mutex mLock; mutable std::condition_variable mCv; @@ -114,6 +120,7 @@ class MockVehicleHardware final : public IVehicleHardware { const std::vector&)> mGetValueResponder GUARDED_BY(mLock); std::chrono::nanoseconds mEventBatchingWindow GUARDED_BY(mLock) = std::chrono::nanoseconds(0); + std::set> mSubOnChangePropIdAreaIds GUARDED_BY(mLock); template aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( @@ -126,6 +133,8 @@ class MockVehicleHardware final : public IVehicleHardware { const std::vector& requests, std::list>* storedRequests, std::list>* storedResponses) const REQUIRES(mLock); + aidl::android::hardware::automotive::vehicle::StatusCode subscribePropIdAreaId( + int32_t propId, int32_t areaId, float sampleRateHz); DumpResult mDumpResult; diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index 5464304468..049ca8b786 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -114,6 +114,8 @@ class SubscriptionManagerTest : public testing::Test { void clearEvents() { return getCallback()->clearEvents(); } + std::shared_ptr getHardware() { return mHardware; } + private: std::unique_ptr mManager; std::shared_ptr mCallback; @@ -132,6 +134,9 @@ TEST_F(SubscriptionManagerTest, testSubscribeGlobalContinuous) { auto result = getManager()->subscribe(getCallbackClient(), options, true); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + ASSERT_THAT(getHardware()->getSubscribedContinuousPropIdAreaIds(), + UnorderedElementsAre(std::pair(0, 0))); + std::this_thread::sleep_for(std::chrono::seconds(1)); // Theoretically trigger 10 times, but check for at least 9 times to be stable. @@ -240,6 +245,8 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeGlobalContinuous) { result = getManager()->unsubscribe(getCallbackClient()->asBinder().get()); ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message(); + ASSERT_EQ(getHardware()->getSubscribedContinuousPropIdAreaIds().size(), 0u); + // Wait for the last events to come. std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -316,7 +323,7 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeByCallback) { EXPECT_TRUE(getEvents().empty()); } -TEST_F(SubscriptionManagerTest, testUnsubscribeFailure) { +TEST_F(SubscriptionManagerTest, testUnsubscribeUnsubscribedPropId) { std::vector options = { { .propId = 0, @@ -334,14 +341,21 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeFailure) { // Property ID: 2 was not subscribed. result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), std::vector({0, 1, 2})); - ASSERT_FALSE(result.ok()) << "unsubscribe an unsubscribed property must fail"; + ASSERT_TRUE(result.ok()) << "unsubscribe an unsubscribed property must do nothing"; - // Since property 0 and property 1 was not unsubscribed successfully, we should be able to - // unsubscribe them again. - result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(), - std::vector({0, 1})); - ASSERT_TRUE(result.ok()) << "a failed unsubscription must not unsubscribe any properties" - << result.error().message(); + std::vector updatedValues = { + { + .prop = 0, + .areaId = 0, + }, + { + .prop = 1, + .areaId = 0, + }, + }; + auto clients = getManager()->getSubscribedClients(std::vector(updatedValues)); + + ASSERT_EQ(clients.size(), 0u) << "all subscribed properties must be unsubscribed"; } TEST_F(SubscriptionManagerTest, testSubscribeOnchange) { @@ -370,6 +384,11 @@ TEST_F(SubscriptionManagerTest, testSubscribeOnchange) { ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); result = getManager()->subscribe(client2, options2, false); ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + ASSERT_THAT(getHardware()->getSubscribedOnChangePropIdAreaIds(), + UnorderedElementsAre(std::pair(0, 0), + std::pair(0, 1), + std::pair(1, 0))); + ASSERT_EQ(getHardware()->getSubscribedContinuousPropIdAreaIds().size(), 0u); std::vector updatedValues = { { @@ -483,6 +502,8 @@ TEST_F(SubscriptionManagerTest, testUnsubscribeOnchange) { auto clients = getManager()->getSubscribedClients(std::vector(updatedValues)); ASSERT_THAT(clients[getCallbackClient()], ElementsAre(updatedValues[1])); + ASSERT_THAT(getHardware()->getSubscribedOnChangePropIdAreaIds(), + UnorderedElementsAre(std::pair(1, 0))); } TEST_F(SubscriptionManagerTest, testCheckSampleRateHzValid) { -- GitLab From f4647e03f41b467543610d1aefdeb2663b92df4c Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 19 Oct 2023 18:16:18 -0700 Subject: [PATCH 208/376] Avoid holding lock while calling callback. Avoid holding lock while calling property store OnValueChangeCallback. This might cause dead lock if VehiclePropertyStore is accessed within the callback. Test: atest VehiclePropertyStoreTest Bug: 306511577 Change-Id: I5e29e9715d4429ccde5145af385a363bac548af7 --- .../common/include/VehiclePropertyStore.h | 25 +++--- .../utils/common/src/VehiclePropertyStore.cpp | 81 +++++++++++-------- .../common/test/VehiclePropertyStoreTest.cpp | 18 +++++ 3 files changed, 78 insertions(+), 46 deletions(-) diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index 3d25cd3a41..b74dff56a8 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -92,7 +92,7 @@ class VehiclePropertyStore final { // used as the key. void registerProperty( const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config, - TokenFunction tokenFunc = nullptr); + TokenFunction tokenFunc = nullptr) EXCLUDES(mLock); // Stores provided value. Returns error if config wasn't registered. If 'updateStatus' is // true, the 'status' in 'propValue' would be stored. Otherwise, if this is a new value, @@ -102,44 +102,47 @@ class VehiclePropertyStore final { // 'EventMode' controls whether the 'OnValueChangeCallback' will be called for this operation. VhalResult writeValue(VehiclePropValuePool::RecyclableType propValue, bool updateStatus = false, - EventMode mode = EventMode::ON_VALUE_CHANGE); + EventMode mode = EventMode::ON_VALUE_CHANGE) EXCLUDES(mLock); // Remove a given property value from the property store. The 'propValue' would be used to // generate the key for the value to remove. void removeValue( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue) + EXCLUDES(mLock); // Remove all the values for the property. - void removeValuesForProperty(int32_t propId); + void removeValuesForProperty(int32_t propId) EXCLUDES(mLock); // Read all the stored values. - std::vector readAllValues() const; + std::vector readAllValues() const EXCLUDES(mLock); // Read all the values for the property. - ValuesResultType readValuesForProperty(int32_t propId) const; + ValuesResultType readValuesForProperty(int32_t propId) const EXCLUDES(mLock); // Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the // value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is // not configured. ValueResultType readValue( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const; + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const + EXCLUDES(mLock); // Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the // value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is // not configured. - ValueResultType readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const; + ValueResultType readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const + EXCLUDES(mLock); // Get all property configs. std::vector getAllConfigs() - const; + const EXCLUDES(mLock); // Get the property config for the requested property. android::base::Result - getConfig(int32_t propId) const; + getConfig(int32_t propId) const EXCLUDES(mLock); // Set a callback that would be called when a property value has been updated. - void setOnValueChangeCallback(const OnValueChangeCallback& callback); + void setOnValueChangeCallback(const OnValueChangeCallback& callback) EXCLUDES(mLock); inline std::shared_ptr getValuePool() { return mValuePool; } diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index 646dc0e618..3fd2aa87da 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -108,51 +108,62 @@ void VehiclePropertyStore::registerProperty(const VehiclePropConfig& config, VhalResult VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue, bool updateStatus, VehiclePropertyStore::EventMode eventMode) { - std::scoped_lock g(mLock); - - int32_t propId = propValue->prop; - - VehiclePropertyStore::Record* record = getRecordLocked(propId); - if (record == nullptr) { - return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; - } + bool valueUpdated = true; + VehiclePropValue updatedValue; + OnValueChangeCallback onValueChangeCallback = nullptr; + { + std::scoped_lock g(mLock); - if (!isGlobalProp(propId) && getAreaConfig(*propValue, record->propConfig) == nullptr) { - return StatusError(StatusCode::INVALID_ARG) - << "no config for property: " << propId << " area: " << propValue->areaId; - } + int32_t propId = propValue->prop; - VehiclePropertyStore::RecordId recId = getRecordIdLocked(*propValue, *record); - bool valueUpdated = true; - if (auto it = record->values.find(recId); it != record->values.end()) { - const VehiclePropValue* valueToUpdate = it->second.get(); - int64_t oldTimestamp = valueToUpdate->timestamp; - VehiclePropertyStatus oldStatus = valueToUpdate->status; - // propValue is outdated and drops it. - if (oldTimestamp > propValue->timestamp) { + VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { return StatusError(StatusCode::INVALID_ARG) - << "outdated timestamp: " << propValue->timestamp; + << "property: " << propId << " not registered"; } - if (!updateStatus) { - propValue->status = oldStatus; + + if (!isGlobalProp(propId) && getAreaConfig(*propValue, record->propConfig) == nullptr) { + return StatusError(StatusCode::INVALID_ARG) + << "no config for property: " << propId << " area ID: " << propValue->areaId; } - valueUpdated = (valueToUpdate->value != propValue->value || - valueToUpdate->status != propValue->status || - valueToUpdate->prop != propValue->prop || - valueToUpdate->areaId != propValue->areaId); - } else if (!updateStatus) { - propValue->status = VehiclePropertyStatus::AVAILABLE; - } + VehiclePropertyStore::RecordId recId = getRecordIdLocked(*propValue, *record); + if (auto it = record->values.find(recId); it != record->values.end()) { + const VehiclePropValue* valueToUpdate = it->second.get(); + int64_t oldTimestampNanos = valueToUpdate->timestamp; + VehiclePropertyStatus oldStatus = valueToUpdate->status; + // propValue is outdated and drops it. + if (oldTimestampNanos > propValue->timestamp) { + return StatusError(StatusCode::INVALID_ARG) + << "outdated timestampNanos: " << propValue->timestamp; + } + if (!updateStatus) { + propValue->status = oldStatus; + } + + valueUpdated = (valueToUpdate->value != propValue->value || + valueToUpdate->status != propValue->status || + valueToUpdate->prop != propValue->prop || + valueToUpdate->areaId != propValue->areaId); + } else if (!updateStatus) { + propValue->status = VehiclePropertyStatus::AVAILABLE; + } - record->values[recId] = std::move(propValue); + record->values[recId] = std::move(propValue); - if (eventMode == EventMode::NEVER) { - return {}; + if (eventMode == EventMode::NEVER) { + return {}; + } + updatedValue = *(record->values[recId]); + if (mOnValueChangeCallback == nullptr) { + return {}; + } + onValueChangeCallback = mOnValueChangeCallback; } - if ((eventMode == EventMode::ALWAYS || valueUpdated) && mOnValueChangeCallback != nullptr) { - mOnValueChangeCallback(*(record->values[recId])); + // Invoke the callback outside the lock to prevent dead-lock. + if (eventMode == EventMode::ALWAYS || valueUpdated) { + onValueChangeCallback(updatedValue); } return {}; } diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index fea5034db9..625652e41e 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -509,6 +509,24 @@ TEST_F(VehiclePropertyStoreTest, testPropertyChangeCallbackForceNoUpdate) { ASSERT_EQ(updatedValue.prop, INVALID_PROP_ID); } +TEST_F(VehiclePropertyStoreTest, testPropertyChangeCallbackUseVehiclePropertyStore_noDeadLock) { + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + }; + + std::vector configs; + + mStore->setOnValueChangeCallback( + [this, &configs]([[maybe_unused]] const VehiclePropValue& value) { + configs = mStore->getAllConfigs(); + }); + + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), /*updateStatus=*/true, + VehiclePropertyStore::EventMode::ALWAYS)); + ASSERT_EQ(configs.size(), static_cast(2)); +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From db4f577dc5e4c7427da7d50d6f13d544f9a2ff39 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 19 Oct 2023 18:24:05 -0700 Subject: [PATCH 209/376] Override subscribe/unsubscribe. Override subscribe/unsubscribe in FakeVehicleHardware, now it will only generate property change events for subscribed properties. Test: atest DefaultVehicleHalTest android.car.cts.CarPropertyManagerTest Bug: 306262618 Change-Id: Ice39f059820d4ec6039acb4daf9975514f2eb22b --- .../hardware/include/FakeVehicleHardware.h | 19 +- .../hardware/src/FakeVehicleHardware.cpp | 118 +++++-- .../hardware/test/FakeVehicleHardwareTest.cpp | 308 +++++++++++------- 3 files changed, 299 insertions(+), 146 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 844bea5a81..6115c4917f 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -91,9 +91,13 @@ class FakeVehicleHardware : public IVehicleHardware { void registerOnPropertySetErrorEvent( std::unique_ptr callback) override; - // Update the sample rate for the [propId, areaId] pair. - aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate( - int32_t propId, int32_t areaId, float sampleRate) override; + // Subscribe to a new [propId, areaId] or change the update rate. + aidl::android::hardware::automotive::vehicle::StatusCode subscribe( + aidl::android::hardware::automotive::vehicle::SubscribeOptions options) override; + + // Unsubscribe to a [propId, areaId]. + aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(int32_t propId, + int32_t areaId) override; protected: // mValuePool is also used in mServerSidePropStore. @@ -154,6 +158,7 @@ class FakeVehicleHardware : public IVehicleHardware { mRecurrentActions GUARDED_BY(mLock); std::unordered_map mSavedProps GUARDED_BY(mLock); + std::unordered_set mSubOnChangePropIdAreaIds GUARDED_BY(mLock); // PendingRequestHandler is thread-safe. mutable PendingRequestHandler @@ -176,7 +181,8 @@ class FakeVehicleHardware : public IVehicleHardware { void storePropInitialValue(const ConfigDeclaration& config); // The callback that would be called when a vehicle property value change happens. void onValueChangeCallback( - const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value); + const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) + EXCLUDES(mLock); // Load the config files in format '*.json' from the directory and parse the config files // into a map from property ID to ConfigDeclarations. void loadPropConfigsFromDir(const std::string& dirPath, @@ -262,6 +268,11 @@ class FakeVehicleHardware : public IVehicleHardware { void generateVendorConfigs( std::vector&) const; + aidl::android::hardware::automotive::vehicle::StatusCode subscribePropIdAreaIdLocked( + int32_t propId, int32_t areaId, float sampleRateHz, + aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode changeMode) + REQUIRES(mLock); + static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp( aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action, int32_t keyCode, int32_t targetDisplay); diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index ee24fbda9c..bc66f6d902 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -60,6 +60,8 @@ using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; +using ::aidl::android::hardware::automotive::vehicle::toString; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; using ::aidl::android::hardware::automotive::vehicle::VehicleArea; @@ -67,6 +69,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction; using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleProperty; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType; @@ -1926,43 +1929,85 @@ void FakeVehicleHardware::registerOnPropertySetErrorEvent( mOnPropertySetErrorCallback = std::move(callback); } -StatusCode FakeVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, float sampleRate) { - // DefaultVehicleHal makes sure that sampleRate must be within minSampleRate and maxSampleRate. - // For fake implementation, we would write the same value with a new timestamp into propStore - // at sample rate. +StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) { + int32_t propId = options.propId; + + auto configResult = mServerSidePropStore->getConfig(propId); + if (!configResult.ok()) { + ALOGE("subscribe: property: %" PRId32 " is not supported", propId); + return StatusCode::INVALID_ARG; + } + std::scoped_lock lockGuard(mLock); + for (int areaId : options.areaIds) { + if (StatusCode status = subscribePropIdAreaIdLocked(propId, areaId, options.sampleRate, + configResult.value()->changeMode); + status != StatusCode::OK) { + return status; + } + } + return StatusCode::OK; +} + +StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked(int32_t propId, int32_t areaId, + float sampleRateHz, + VehiclePropertyChangeMode changeMode) { + PropIdAreaId propIdAreaId{ + .propId = propId, + .areaId = areaId, + }; + switch (changeMode) { + case VehiclePropertyChangeMode::STATIC: + ALOGW("subscribe to a static property, do nothing."); + return StatusCode::OK; + case VehiclePropertyChangeMode::ON_CHANGE: + mSubOnChangePropIdAreaIds.insert(std::move(propIdAreaId)); + return StatusCode::OK; + case VehiclePropertyChangeMode::CONTINUOUS: + if (sampleRateHz == 0.f) { + ALOGE("Must not use sample rate 0 for a continuous property"); + return StatusCode::INTERNAL_ERROR; + } + if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) { + mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); + } + int64_t intervalInNanos = static_cast(1'000'000'000. / sampleRateHz); + auto action = std::make_shared([this, propId, areaId] { + // Refresh the property value. In real implementation, this should poll the latest + // value from vehicle bus. Here, we are just refreshing the existing value with a + // new timestamp. + auto result = getValue(VehiclePropValue{ + .areaId = areaId, + .prop = propId, + .value = {}, + }); + if (!result.ok()) { + // Failed to read current value, skip refreshing. + return; + } + result.value()->timestamp = elapsedRealtimeNano(); + // For continuous properties, we must generate a new onPropertyChange event + // periodically according to the sample rate. + mServerSidePropStore->writeValue(std::move(result.value()), /*updateStatus=*/true, + VehiclePropertyStore::EventMode::ALWAYS); + }); + mRecurrentTimer->registerTimerCallback(intervalInNanos, action); + mRecurrentActions[propIdAreaId] = action; + return StatusCode::OK; + } +} +StatusCode FakeVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) { + std::scoped_lock lockGuard(mLock); PropIdAreaId propIdAreaId{ .propId = propId, .areaId = areaId, }; if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) { mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); + mRecurrentActions.erase(propIdAreaId); } - if (sampleRate == 0) { - return StatusCode::OK; - } - int64_t interval = static_cast(1'000'000'000. / sampleRate); - auto action = std::make_shared([this, propId, areaId] { - // Refresh the property value. In real implementation, this should poll the latest value - // from vehicle bus. Here, we are just refreshing the existing value with a new timestamp. - auto result = getValue(VehiclePropValue{ - .areaId = areaId, - .prop = propId, - .value = {}, - }); - if (!result.ok()) { - // Failed to read current value, skip refreshing. - return; - } - result.value()->timestamp = elapsedRealtimeNano(); - // For continuous properties, we must generate a new onPropertyChange event periodically - // according to the sample rate. - mServerSidePropStore->writeValue(std::move(result.value()), /*updateStatus=*/true, - VehiclePropertyStore::EventMode::ALWAYS); - }); - mRecurrentTimer->registerTimerCallback(interval, action); - mRecurrentActions[propIdAreaId] = action; + mSubOnChangePropIdAreaIds.erase(propIdAreaId); return StatusCode::OK; } @@ -1971,6 +2016,23 @@ void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { return; } + PropIdAreaId propIdAreaId{ + .propId = value.prop, + .areaId = value.areaId, + }; + + { + std::scoped_lock lockGuard(mLock); + if (mRecurrentActions.find(propIdAreaId) == mRecurrentActions.end() && + mSubOnChangePropIdAreaIds.find(propIdAreaId) == mSubOnChangePropIdAreaIds.end()) { + if (FAKE_VEHICLEHARDWARE_DEBUG) { + ALOGD("The updated property value: %s is not subscribed, ignore", + value.toString().c_str()); + } + return; + } + } + std::vector updatedValues; updatedValues.push_back(value); (*mOnPropertyChangeCallback)(std::move(updatedValues)); diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index cf9beee0fb..85eefa4774 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -72,6 +72,7 @@ using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::SetValueRequest; using ::aidl::android::hardware::automotive::vehicle::SetValueResult; using ::aidl::android::hardware::automotive::vehicle::StatusCode; +using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateShutdownParam; @@ -149,6 +150,15 @@ class FakeVehicleHardwareTest : public ::testing::Test { mHardware = std::move(hardware); } + static SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId, + float sampleRateHz) { + SubscribeOptions options; + options.areaIds = {areaId}; + options.propId = propId; + options.sampleRate = sampleRateHz; + return options; + } + StatusCode setValues(const std::vector& requests) { { std::scoped_lock lockGuard(mLock); @@ -336,6 +346,13 @@ class FakeVehicleHardwareTest : public ::testing::Test { return mEventCount[propIdAreaId]; } + void subscribe(int32_t propId, int32_t areaId, float sampleRateHz) { + ASSERT_EQ(StatusCode::OK, + getHardware()->subscribe(newSubscribeOptions(propId, areaId, sampleRateHz))) + << "failed to subscribe to propId: " << propId << "areaId: " << areaId + << ", sampleRateHz: " << sampleRateHz; + } + static void addSetValueRequest(std::vector& requests, std::vector& expectedResults, int64_t requestId, const VehiclePropValue& value, StatusCode expectedStatus) { @@ -370,24 +387,24 @@ class FakeVehicleHardwareTest : public ::testing::Test { } std::vector getTestPropValues() { - VehiclePropValue fuelCapacity = { - .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), - .value = {.floatValues = {1.0}}, + VehiclePropValue oilLevel = { + .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL), + .value = {.int32Values = {1}}, }; - VehiclePropValue leftTirePressure = { - .prop = toInt(VehicleProperty::TIRE_PRESSURE), + VehiclePropValue leftHvacTemp = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT), .value = {.floatValues = {170.0}}, - .areaId = WHEEL_FRONT_LEFT, + .areaId = SEAT_1_LEFT, }; - VehiclePropValue rightTirePressure = { - .prop = toInt(VehicleProperty::TIRE_PRESSURE), + VehiclePropValue rightHvacTemp = { + .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT), .value = {.floatValues = {180.0}}, - .areaId = WHEEL_FRONT_RIGHT, + .areaId = SEAT_1_RIGHT, }; - return {fuelCapacity, leftTirePressure, rightTirePressure}; + return {oilLevel, leftHvacTemp, rightHvacTemp}; } struct PropValueCmp { @@ -559,17 +576,13 @@ TEST_F(FakeVehicleHardwareTest, testSetValuesError) { ASSERT_THAT(getSetValueResults(), ContainerEq(expectedResults)); } -TEST_F(FakeVehicleHardwareTest, testRegisterOnPropertyChangeEvent) { - // We have already registered this callback in Setup, here we are registering again. - auto callback = std::make_unique( - [this](const std::vector& values) { onPropertyChangeEvent(values); }); - getHardware()->registerOnPropertyChangeEvent(std::move(callback)); - +TEST_F(FakeVehicleHardwareTest, testSetValues_getUpdateEvents) { auto testValues = getTestPropValues(); std::vector requests; std::vector expectedResults; int64_t requestId = 1; for (auto& value : testValues) { + subscribe(value.prop, value.areaId, /*sampleRateHz=*/0); addSetValueRequest(requests, expectedResults, requestId++, value, StatusCode::OK); } int64_t timestamp = elapsedRealtimeNano(); @@ -1624,27 +1637,30 @@ INSTANTIATE_TEST_SUITE_P( return info.param.name; }); -TEST_F(FakeVehicleHardwareTest, testSetWaitForVhalAfterCarServiceCrash) { - int32_t propId = toInt(VehicleProperty::AP_POWER_STATE_REPORT); +TEST_F(FakeVehicleHardwareTest, testSetWaitForVhal_alwaysTriggerEvents) { + int32_t powerReq = toInt(VehicleProperty::AP_POWER_STATE_REQ); + subscribe(powerReq, /*areaId*/ 0, /*sampleRateHz*/ 0); + + int32_t powerReport = toInt(VehicleProperty::AP_POWER_STATE_REPORT); VehiclePropValue request = VehiclePropValue{ - .prop = propId, + .prop = powerReport, .value.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL)}, }; - ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << propId; + ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << powerReport; // Clear existing events. clearChangedProperties(); // Simulate a Car Service crash, Car Service would restart and send the message again. - ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << propId; + ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << powerReport; std::vector events = getChangedProperties(); // Even though the state is already ON, we should receive another ON event. - ASSERT_EQ(events.size(), 1u); + ASSERT_EQ(events.size(), 1u) << "failed to receive on-change events AP_POWER_STATE_REQ ON"; // Erase the timestamp for comparison. events[0].timestamp = 0; auto expectedValue = VehiclePropValue{ - .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .prop = powerReq, .status = VehiclePropertyStatus::AVAILABLE, .value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}, }; @@ -2015,6 +2031,22 @@ TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) { }, }, }; + + // First subscribe to all the properties that we will change. + for (auto& enabledToErrorStateProps : adasEnabledPropToAdasPropWithErrorState) { + std::unordered_set expectedChangedPropIds(enabledToErrorStateProps.second.begin(), + enabledToErrorStateProps.second.end()); + expectedChangedPropIds.insert(enabledToErrorStateProps.first); + + for (int32_t propId : expectedChangedPropIds) { + int32_t areaId = 0; + if (propId == toInt(VehicleProperty::BLIND_SPOT_WARNING_STATE)) { + areaId = toInt(VehicleAreaMirror::DRIVER_LEFT); + } + subscribe(propId, areaId, /*sampleRateHz*/ 0); + } + } + for (auto& enabledToErrorStateProps : adasEnabledPropToAdasPropWithErrorState) { int32_t adasEnabledPropertyId = enabledToErrorStateProps.first; StatusCode status = @@ -2095,9 +2127,16 @@ TEST_F(FakeVehicleHardwareTest, testGetUserIdAssoc) { } TEST_F(FakeVehicleHardwareTest, testSwitchUser) { + SubscribeOptions options; + int32_t propSwitchUser = toInt(VehicleProperty::SWITCH_USER); + options.propId = propSwitchUser; + options.areaIds = {0, 1}; + ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options)) + << "failed to subscribe to propId: " << propSwitchUser; + // This is the same example as used in User HAL Emulation doc. VehiclePropValue valueToSet = { - .prop = toInt(VehicleProperty::SWITCH_USER), + .prop = propSwitchUser, .areaId = 1, .value.int32Values = {666, 3, 2}, }; @@ -2108,7 +2147,7 @@ TEST_F(FakeVehicleHardwareTest, testSwitchUser) { // Simulate a request from Android side. VehiclePropValue switchUserRequest = { - .prop = toInt(VehicleProperty::SWITCH_USER), + .prop = propSwitchUser, .areaId = 0, .value.int32Values = {666, 3}, }; @@ -2138,7 +2177,7 @@ TEST_F(FakeVehicleHardwareTest, testSwitchUser) { events[0].timestamp = 0; auto expectedValue = VehiclePropValue{ .areaId = 0, - .prop = toInt(VehicleProperty::SWITCH_USER), + .prop = propSwitchUser, .value.int32Values = { // Request ID @@ -2153,6 +2192,13 @@ TEST_F(FakeVehicleHardwareTest, testSwitchUser) { } TEST_F(FakeVehicleHardwareTest, testCreateUser) { + SubscribeOptions options; + int32_t propCreateUser = toInt(VehicleProperty::CREATE_USER); + options.propId = propCreateUser; + options.areaIds = {0, 1}; + ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options)) + << "failed to subscribe to propId: " << propCreateUser; + // This is the same example as used in User HAL Emulation doc. VehiclePropValue valueToSet = { .prop = toInt(VehicleProperty::CREATE_USER), @@ -2166,7 +2212,7 @@ TEST_F(FakeVehicleHardwareTest, testCreateUser) { // Simulate a request from Android side. VehiclePropValue createUserRequest = { - .prop = toInt(VehicleProperty::CREATE_USER), + .prop = propCreateUser, .areaId = 0, .value.int32Values = {666}, }; @@ -2195,7 +2241,7 @@ TEST_F(FakeVehicleHardwareTest, testCreateUser) { events[0].timestamp = 0; auto expectedValue = VehiclePropValue{ .areaId = 0, - .prop = toInt(VehicleProperty::CREATE_USER), + .prop = propCreateUser, .value.int32Values = { // Request ID @@ -2208,9 +2254,16 @@ TEST_F(FakeVehicleHardwareTest, testCreateUser) { } TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { + SubscribeOptions options; + int32_t propInitialUserInfo = toInt(VehicleProperty::INITIAL_USER_INFO); + options.propId = propInitialUserInfo; + options.areaIds = {0, 1}; + ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options)) + << "failed to subscribe to propId: " << propInitialUserInfo; + // This is the same example as used in User HAL Emulation doc. VehiclePropValue valueToSet = { - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .prop = propInitialUserInfo, .areaId = 1, .value.int32Values = {666, 1, 11}, }; @@ -2221,7 +2274,7 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { // Simulate a request from Android side. VehiclePropValue initialUserInfoRequest = { - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .prop = propInitialUserInfo, .areaId = 0, .value.int32Values = {3}, }; @@ -2238,7 +2291,7 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { events[0].timestamp = 0; auto expectedValue = VehiclePropValue{ .areaId = 0, - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .prop = propInitialUserInfo, .value.int32Values = {3, 1, 11}, }; EXPECT_EQ(events[0], expectedValue); @@ -2253,7 +2306,7 @@ TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) { events[0].timestamp = 0; expectedValue = VehiclePropValue{ .areaId = 0, - .prop = toInt(VehicleProperty::INITIAL_USER_INFO), + .prop = propInitialUserInfo, .value.int32Values = { // Request ID @@ -2395,13 +2448,14 @@ TEST_F(FakeVehicleHardwareTest, testSaveRestoreProp) { } TEST_F(FakeVehicleHardwareTest, testDumpInjectEvent) { - int32_t prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + int32_t prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL); std::string propIdStr = std::to_string(prop); + subscribe(prop, /*areaId*/ 0, /*sampleRateHz*/ 0); + int64_t timestamp = elapsedRealtimeNano(); - // Inject an event with float value 123.4 and timestamp. DumpResult result = getHardware()->dump( - {"--inject-event", propIdStr, "-f", "123.4", "-t", std::to_string(timestamp)}); + {"--inject-event", propIdStr, "-i", "1234", "-t", std::to_string(timestamp)}); ASSERT_FALSE(result.callerShouldDumpState); ASSERT_THAT(result.buffer, @@ -2412,7 +2466,7 @@ TEST_F(FakeVehicleHardwareTest, testDumpInjectEvent) { ASSERT_EQ(events.size(), 1u); auto event = events[0]; ASSERT_EQ(event.timestamp, timestamp); - ASSERT_EQ(event.value.floatValues, std::vector({123.4})); + ASSERT_EQ(event.value.int32Values, std::vector({1234})); } TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) { @@ -2755,9 +2809,13 @@ INSTANTIATE_TEST_SUITE_P( }); TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataLinear) { - // Start a fake linear data generator for vehicle speed at 0.1s interval. + // Start a fake linear data generator for engine oil level at 0.1s interval. // range: 0 - 100, current value: 30, step: 20. - std::string propIdString = StringPrintf("%d", toInt(VehicleProperty::PERF_VEHICLE_SPEED)); + int32_t prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL); + + subscribe(prop, /*areaId*/ 0, /*sampleRateHz*/ 0); + + std::string propIdString = StringPrintf("%d", prop); std::vector options = {"--genfakedata", "--startlinear", propIdString, /*middleValue=*/"50", /*currentValue=*/"30", @@ -2770,15 +2828,14 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataLinear) { ASSERT_FALSE(result.callerShouldDumpState); ASSERT_THAT(result.buffer, HasSubstr("successfully")); - ASSERT_TRUE(waitForChangedProperties(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0, /*count=*/5, - milliseconds(1000))) + ASSERT_TRUE(waitForChangedProperties(prop, 0, /*count=*/5, milliseconds(1000))) << "not enough events generated for linear data generator"; int32_t value = 30; auto events = getChangedProperties(); for (size_t i = 0; i < 5; i++) { - ASSERT_EQ(1u, events[i].value.floatValues.size()); - EXPECT_EQ(static_cast(value), events[i].value.floatValues[0]); + ASSERT_EQ(1u, events[i].value.int32Values.size()); + EXPECT_EQ(value, events[i].value.int32Values[0]); value = (value + 20) % 100; } @@ -2794,7 +2851,7 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataLinear) { std::this_thread::sleep_for(std::chrono::milliseconds(200)); // There should be no new events generated. - EXPECT_EQ(0u, getEventCount(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0)); + EXPECT_EQ(0u, getEventCount(prop, 0)); } std::string getTestFilePath(const char* filename) { @@ -2803,6 +2860,8 @@ std::string getTestFilePath(const char* filename) { } TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJson) { + subscribe(toInt(VehicleProperty::GEAR_SELECTION), /*areaId*/ 0, /*sampleRateHz*/ 0); + std::vector options = {"--genfakedata", "--startjson", "--path", getTestFilePath("prop.json"), "2"}; @@ -2829,6 +2888,8 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJson) { } TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonByContent) { + subscribe(toInt(VehicleProperty::GEAR_SELECTION), /*areaId*/ 0, /*sampleRateHz*/ 0); + std::vector options = { "--genfakedata", "--startjson", "--content", "[{\"timestamp\":1000000,\"areaId\":0,\"value\":8,\"prop\":289408000}]", "1"}; @@ -2903,8 +2964,11 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonStopInvalidFile) { } TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyPress) { + int32_t propHwKeyInput = toInt(VehicleProperty::HW_KEY_INPUT); std::vector options = {"--genfakedata", "--keypress", "1", "2"}; + subscribe(propHwKeyInput, /*areaId*/ 0, /*sampleRateHz*/ 0); + DumpResult result = getHardware()->dump(options); ASSERT_FALSE(result.callerShouldDumpState); @@ -2912,8 +2976,8 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyPress) { auto events = getChangedProperties(); ASSERT_EQ(2u, events.size()); - EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[0].prop); - EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[1].prop); + EXPECT_EQ(propHwKeyInput, events[0].prop); + EXPECT_EQ(propHwKeyInput, events[1].prop); ASSERT_EQ(3u, events[0].value.int32Values.size()); ASSERT_EQ(3u, events[1].value.int32Values.size()); EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_DOWN), events[0].value.int32Values[0]); @@ -2925,8 +2989,11 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyPress) { } TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyInputV2) { + int32_t propHwKeyInputV2 = toInt(VehicleProperty::HW_KEY_INPUT_V2); std::vector options = {"--genfakedata", "--keyinputv2", "1", "2", "3", "4", "5"}; + subscribe(propHwKeyInputV2, /*areaId*/ 1, /*sampleRateHz*/ 0); + DumpResult result = getHardware()->dump(options); ASSERT_FALSE(result.callerShouldDumpState); @@ -2944,6 +3011,7 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyInputV2) { } TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) { + int32_t propHwMotionInput = toInt(VehicleProperty::HW_MOTION_INPUT); std::vector options = {"--genfakedata", "--motioninput", "1", @@ -2966,6 +3034,8 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) { "65.5", "76.6"}; + subscribe(propHwMotionInput, /*areaId*/ 1, /*sampleRateHz*/ 0); + DumpResult result = getHardware()->dump(options); ASSERT_FALSE(result.callerShouldDumpState); @@ -2973,7 +3043,7 @@ TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) { auto events = getChangedProperties(); ASSERT_EQ(1u, events.size()); - EXPECT_EQ(toInt(VehicleProperty::HW_MOTION_INPUT), events[0].prop); + EXPECT_EQ(propHwMotionInput, events[0].prop); ASSERT_EQ(9u, events[0].value.int32Values.size()); EXPECT_EQ(2, events[0].value.int32Values[0]); EXPECT_EQ(3, events[0].value.int32Values[1]); @@ -3014,23 +3084,27 @@ TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) { ASSERT_EQ(result.value().value.byteValues, std::vector({0x04, 0x03, 0x02, 0x01})); } -TEST_F(FakeVehicleHardwareTest, testUpdateSampleRate) { +TEST_F(FakeVehicleHardwareTest, testSubscribeUnsubscribe_continuous) { int32_t propSpeed = toInt(VehicleProperty::PERF_VEHICLE_SPEED); int32_t propSteering = toInt(VehicleProperty::PERF_STEERING_ANGLE); int32_t areaId = 0; - getHardware()->updateSampleRate(propSpeed, areaId, 5); + + auto status = getHardware()->subscribe(newSubscribeOptions(propSpeed, areaId, 5)); + ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe"; ASSERT_TRUE(waitForChangedProperties(propSpeed, areaId, /*count=*/5, milliseconds(1500))) << "not enough events generated for speed"; - getHardware()->updateSampleRate(propSteering, areaId, 10); + status = getHardware()->subscribe(newSubscribeOptions(propSteering, areaId, 10)); + ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe"; ASSERT_TRUE(waitForChangedProperties(propSteering, areaId, /*count=*/10, milliseconds(1500))) << "not enough events generated for steering"; int64_t timestamp = elapsedRealtimeNano(); // Disable refreshing for propSpeed. - getHardware()->updateSampleRate(propSpeed, areaId, 0); + status = getHardware()->unsubscribe(propSpeed, areaId); + ASSERT_EQ(status, StatusCode::OK) << "failed to unsubscribe"; clearChangedProperties(); ASSERT_TRUE(waitForChangedProperties(propSteering, areaId, /*count=*/5, milliseconds(1500))) @@ -3043,12 +3117,58 @@ TEST_F(FakeVehicleHardwareTest, testUpdateSampleRate) { } } +TEST_F(FakeVehicleHardwareTest, testSubscribeUnusubscribe_onChange) { + int32_t propHvac = toInt(VehicleProperty::HVAC_TEMPERATURE_SET); + int32_t areaId = SEAT_1_LEFT; + + auto status = getHardware()->subscribe(newSubscribeOptions(propHvac, areaId, 0)); + ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe"; + + status = setValue({ + .prop = propHvac, + .areaId = areaId, + .value.floatValues = {20.0f}, + }); + ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value"; + + ASSERT_TRUE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100))) + << "not enough on change events generated for hvac"; + clearChangedProperties(); + + status = setValue({ + .prop = propHvac, + .areaId = areaId, + .value.floatValues = {21.0f}, + }); + ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value"; + + ASSERT_TRUE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100))) + << "not enough on change events generated for hvac"; + clearChangedProperties(); + + status = getHardware()->unsubscribe(propHvac, areaId); + ASSERT_EQ(status, StatusCode::OK); + + status = setValue({ + .prop = propHvac, + .areaId = areaId, + .value.floatValues = {22.0f}, + }); + ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value"; + + ASSERT_FALSE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100))) + << "must not receive on change events if the propId, areaId is unsubscribed"; +} + TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { float CELSIUS = static_cast(toInt(VehicleUnit::CELSIUS)); float FAHRENHEIT = static_cast(toInt(VehicleUnit::FAHRENHEIT)); + int32_t propHvacTempValueSuggest = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION); + + subscribe(propHvacTempValueSuggest, HVAC_ALL, /*sampleRateHz*/ 0); VehiclePropValue floatArraySizeFour = { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {0, CELSIUS, 0, 0}, }; @@ -3056,14 +3176,14 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { EXPECT_EQ(status, StatusCode::OK); VehiclePropValue floatArraySizeZero = { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, }; status = setValue(floatArraySizeZero); EXPECT_EQ(status, StatusCode::INVALID_ARG); VehiclePropValue floatArraySizeFive = { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {0, CELSIUS, 0, 0, 0}, }; @@ -3071,7 +3191,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { EXPECT_EQ(status, StatusCode::INVALID_ARG); VehiclePropValue invalidUnit = { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {0, 0, 0, 0}, }; @@ -3102,9 +3222,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius, CELSIUS, 0, 0}, }, @@ -3112,9 +3230,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius, CELSIUS, minTempInCelsius, @@ -3127,9 +3243,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit, FAHRENHEIT, 0, 0}, @@ -3138,9 +3252,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit, FAHRENHEIT, minTempInCelsius, @@ -3153,9 +3265,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInCelsius, CELSIUS, 0, 0}, }, @@ -3163,9 +3273,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInCelsius, CELSIUS, maxTempInCelsius, @@ -3178,9 +3286,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInFahrenheit, FAHRENHEIT, 0, 0}, @@ -3189,9 +3295,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInFahrenheit, FAHRENHEIT, maxTempInCelsius, @@ -3204,9 +3308,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius - 1, CELSIUS, 0, 0}, @@ -3215,9 +3317,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius - 1, CELSIUS, minTempInCelsius, @@ -3230,9 +3330,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit - 1, FAHRENHEIT, 0, 0}, @@ -3241,9 +3339,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit - 1, FAHRENHEIT, minTempInCelsius, @@ -3256,9 +3352,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInCelsius + 1, CELSIUS, 0, 0}, @@ -3267,9 +3361,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInCelsius + 1, CELSIUS, maxTempInCelsius, @@ -3282,9 +3374,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInFahrenheit + 1, FAHRENHEIT, 0, 0}, @@ -3293,9 +3383,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {maxTempInFahrenheit + 1, FAHRENHEIT, maxTempInCelsius, @@ -3308,9 +3396,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius + incrementInCelsius * 2.5f, @@ -3320,9 +3406,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInCelsius + incrementInCelsius * 2.5f, @@ -3338,9 +3422,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .valuesToSet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit + incrementInFahrenheit * @@ -3351,9 +3433,7 @@ TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) { .expectedValuesToGet = { VehiclePropValue{ - .prop = toInt( - VehicleProperty:: - HVAC_TEMPERATURE_VALUE_SUGGESTION), + .prop = propHvacTempValueSuggest, .areaId = HVAC_ALL, .value.floatValues = {minTempInFahrenheit + -- GitLab From 605faf6854b154f23170d10fc99216ef244e7f37 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 23 Oct 2023 11:34:37 -0700 Subject: [PATCH 210/376] Support VUR in FakeVehicleHardware. Support VUR in reference VHAL FakeVehicleHardware layer. Unless specified in config, all continuous properties in reference VHAL supports VUR. Test: atest FakeVehicleHardwareTest Bug: 306748801 Change-Id: I5265172996418a5d405392570673355e7860b50c --- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 26 ++++++++ .../config/DefaultProperties.json | 14 +++- .../hardware/include/FakeVehicleHardware.h | 10 ++- .../hardware/src/FakeVehicleHardware.cpp | 42 +++++++++--- .../hardware/test/FakeVehicleHardwareTest.cpp | 65 +++++++++++++++++++ 5 files changed, 144 insertions(+), 13 deletions(-) diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 39ce10e64d..82dc8a6ae1 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -274,6 +274,16 @@ JsonValueParser::JsonValueParser() { #endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES } +template <> +Result JsonValueParser::convertValueToType(const std::string& fieldName, + const Json::Value& value) { + if (!value.isBool()) { + return Error() << "The value: " << value << " for field: " << fieldName + << " is not in correct type, expect bool"; + } + return value.asBool(); +} + template <> Result JsonValueParser::convertValueToType(const std::string& fieldName, const Json::Value& value) { @@ -531,6 +541,12 @@ void JsonConfigParser::parseAreas(const Json::Value& parentJsonNode, const std:: tryParseJsonValueToVariable(jsonAreaConfig, "maxFloatValue", /*optional=*/true, &areaConfig.maxFloatValue, errors); + // By default we support variable update rate for all properties except it is explicitly + // disabled. + areaConfig.supportVariableUpdateRate = true; + tryParseJsonValueToVariable(jsonAreaConfig, "supportVariableUpdateRate", /*optional=*/true, + &areaConfig.supportVariableUpdateRate, errors); + std::vector supportedEnumValues; tryParseJsonArrayToVariable(jsonAreaConfig, "supportedEnumValues", /*optional=*/true, &supportedEnumValues, errors); @@ -585,6 +601,16 @@ std::optional JsonConfigParser::parseEachProperty( if (errors->size() != initialErrorCount) { return std::nullopt; } + + // If there is no area config, by default we allow variable update rate, so we have to add + // a global area config. + if (configDecl.config.areaConfigs.size() == 0) { + VehicleAreaConfig areaConfig = { + .areaId = 0, + .supportVariableUpdateRate = true, + }; + configDecl.config.areaConfigs.push_back(std::move(areaConfig)); + } return configDecl; } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 6c8d59ca8c..d3bb60c7ae 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3579,7 +3579,13 @@ "property": "VehicleProperty::WATCHDOG_TERMINATED_PROCESS" }, { - "property": "VehicleProperty::VHAL_HEARTBEAT" + "property": "VehicleProperty::VHAL_HEARTBEAT", + "areas": [ + { + "areaId": 0, + "supportVariableUpdateRate": false + } + ] }, { "property": "VehicleProperty::CLUSTER_SWITCH_UI", @@ -3641,6 +3647,12 @@ 0, 16 ], + "areas": [ + { + "areaId": 0, + "supportVariableUpdateRate": false + } + ], "comment": "configArray specifies it consists of int64[2] and byte[16]." }, { diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 6115c4917f..718f68ef5b 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -269,9 +269,9 @@ class FakeVehicleHardware : public IVehicleHardware { std::vector&) const; aidl::android::hardware::automotive::vehicle::StatusCode subscribePropIdAreaIdLocked( - int32_t propId, int32_t areaId, float sampleRateHz, - aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode changeMode) - REQUIRES(mLock); + int32_t propId, int32_t areaId, float sampleRateHz, bool enableVariableUpdateRate, + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& + vehiclePropConfig) REQUIRES(mLock); static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp( aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action, @@ -286,6 +286,10 @@ class FakeVehicleHardware : public IVehicleHardware { static std::string genFakeDataHelp(); static std::string parseErrMsg(std::string fieldName, std::string value, std::string type); + static bool isVariableUpdateRateSupported( + const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& + vehiclePropConfig, + int32_t areaId); }; } // namespace fake diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index bc66f6d902..cb8e51f020 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -1941,7 +1941,8 @@ StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) { std::scoped_lock lockGuard(mLock); for (int areaId : options.areaIds) { if (StatusCode status = subscribePropIdAreaIdLocked(propId, areaId, options.sampleRate, - configResult.value()->changeMode); + options.enableVariableUpdateRate, + *configResult.value()); status != StatusCode::OK) { return status; } @@ -1949,14 +1950,29 @@ StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) { return StatusCode::OK; } -StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked(int32_t propId, int32_t areaId, - float sampleRateHz, - VehiclePropertyChangeMode changeMode) { +bool FakeVehicleHardware::isVariableUpdateRateSupported(const VehiclePropConfig& vehiclePropConfig, + int32_t areaId) { + for (size_t i = 0; i < vehiclePropConfig.areaConfigs.size(); i++) { + const auto& areaConfig = vehiclePropConfig.areaConfigs[i]; + if (areaConfig.areaId != areaId) { + continue; + } + if (areaConfig.supportVariableUpdateRate) { + return true; + } + break; + } + return false; +} + +StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked( + int32_t propId, int32_t areaId, float sampleRateHz, bool enableVariableUpdateRate, + const VehiclePropConfig& vehiclePropConfig) { PropIdAreaId propIdAreaId{ .propId = propId, .areaId = areaId, }; - switch (changeMode) { + switch (vehiclePropConfig.changeMode) { case VehiclePropertyChangeMode::STATIC: ALOGW("subscribe to a static property, do nothing."); return StatusCode::OK; @@ -1972,7 +1988,16 @@ StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked(int32_t propId, int3 mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); } int64_t intervalInNanos = static_cast(1'000'000'000. / sampleRateHz); - auto action = std::make_shared([this, propId, areaId] { + + // For continuous properties, we must generate a new onPropertyChange event + // periodically according to the sample rate. + auto eventMode = VehiclePropertyStore::EventMode::ALWAYS; + if (isVariableUpdateRateSupported(vehiclePropConfig, areaId) && + enableVariableUpdateRate) { + eventMode = VehiclePropertyStore::EventMode::ON_VALUE_CHANGE; + } + auto action = std::make_shared([this, propId, areaId, + eventMode] { // Refresh the property value. In real implementation, this should poll the latest // value from vehicle bus. Here, we are just refreshing the existing value with a // new timestamp. @@ -1986,10 +2011,9 @@ StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked(int32_t propId, int3 return; } result.value()->timestamp = elapsedRealtimeNano(); - // For continuous properties, we must generate a new onPropertyChange event - // periodically according to the sample rate. + mServerSidePropStore->writeValue(std::move(result.value()), /*updateStatus=*/true, - VehiclePropertyStore::EventMode::ALWAYS); + eventMode); }); mRecurrentTimer->registerTimerCallback(intervalInNanos, action); mRecurrentActions[propIdAreaId] = action; diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 85eefa4774..0432500c4b 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -95,6 +95,7 @@ using ::testing::ContainsRegex; using ::testing::Eq; using ::testing::HasSubstr; using ::testing::IsSubsetOf; +using ::testing::UnorderedElementsAre; using ::testing::WhenSortedBy; using std::chrono::milliseconds; @@ -454,6 +455,29 @@ TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs) { ASSERT_EQ(configs.size(), helper.loadConfigDeclarations().size()); } +TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs_defaultSupportVUR) { + std::vector configs = getHardware()->getAllPropertyConfigs(); + + for (const auto& config : configs) { + bool expectedSupportVUR = true; + if (config.prop == toInt(VehicleProperty::VHAL_HEARTBEAT) || + config.prop == toInt(VehicleProperty::CLUSTER_HEARTBEAT)) { + expectedSupportVUR = false; + } + EXPECT_GE(config.areaConfigs.size(), 1u) + << "expect at least one area config, including global area config, propId: " + << config.prop; + if (config.areaConfigs.size() == 0) { + continue; + } + for (const auto& areaConfig : config.areaConfigs) { + EXPECT_EQ(areaConfig.supportVariableUpdateRate, expectedSupportVUR) + << "unexpected supportVariableUpdateRate for propId: " << config.prop + << ", areaId: " << areaConfig.areaId; + } + } +} + TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) { std::vector getValueRequests; std::vector expectedGetValueResults; @@ -3117,6 +3141,47 @@ TEST_F(FakeVehicleHardwareTest, testSubscribeUnsubscribe_continuous) { } } +TEST_F(FakeVehicleHardwareTest, testSubscribe_enableVUR) { + int32_t propSpeed = toInt(VehicleProperty::PERF_VEHICLE_SPEED); + int32_t areaId = 0; + SubscribeOptions options; + options.propId = propSpeed; + options.areaIds = {areaId}; + options.enableVariableUpdateRate = true; + options.sampleRate = 5; + int64_t timestamp = elapsedRealtimeNano(); + + auto status = getHardware()->subscribe(options); + ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe"; + + status = setValue({ + .prop = propSpeed, + .areaId = 0, + .value.floatValues = {1.1f}, + }); + ASSERT_EQ(status, StatusCode::OK) << "failed to set speed"; + + status = setValue({ + .prop = propSpeed, + .areaId = 0, + .value.floatValues = {1.2f}, + }); + ASSERT_EQ(status, StatusCode::OK) << "failed to set speed"; + + ASSERT_TRUE(waitForChangedProperties(propSpeed, areaId, /*count=*/2, milliseconds(100))) + << "not enough events generated for speed"; + auto updatedValues = getChangedProperties(); + std::unordered_set gotValues; + for (auto& value : updatedValues) { + EXPECT_GE(value.timestamp, timestamp) << "timestamp must be updated"; + EXPECT_EQ(value.prop, propSpeed) << "propId must be correct"; + EXPECT_EQ(value.areaId, areaId) << "areaId must be correct"; + gotValues.insert(value.value.floatValues[0]); + } + EXPECT_THAT(gotValues, UnorderedElementsAre(1.1f, 1.2f)) + << "must only receive property event for changed value"; +} + TEST_F(FakeVehicleHardwareTest, testSubscribeUnusubscribe_onChange) { int32_t propHvac = toInt(VehicleProperty::HVAC_TEMPERATURE_SET); int32_t areaId = SEAT_1_LEFT; -- GitLab From cb9d6e8142751602f1a7a2239e4356386329aa30 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 23 Oct 2023 16:00:01 -0700 Subject: [PATCH 211/376] Implement VUR in SubscriptionManager. SubscriptionManager combines the enableVUR option for all the VHAL clients and sends the request to IVehicleHardware. If some of the clients enables VUR while others disable VUR, SubscriptionManager will apply filtering for the clients that enable it. Test: atest DefaultVehicleHalTest Bug: 306748801 Change-Id: I1a375ab2c00c7f37e432ed039818367dd0465b19 --- .../impl/hardware/include/IVehicleHardware.h | 56 ++-- .../impl/vhal/include/SubscriptionManager.h | 48 +++- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 2 + .../impl/vhal/src/SubscriptionManager.cpp | 117 ++++++-- .../impl/vhal/test/MockVehicleHardware.cpp | 14 + .../aidl/impl/vhal/test/MockVehicleHardware.h | 5 + .../vhal/test/SubscriptionManagerTest.cpp | 253 ++++++++++++++++++ 7 files changed, 444 insertions(+), 51 deletions(-) diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h index b813b1189e..f49d91b30c 100644 --- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h @@ -117,18 +117,53 @@ class IVehicleHardware { return std::chrono::nanoseconds(0); } - // A [propId, areaId] is newly subscribed or the update rate is changed. + // A [propId, areaId] is newly subscribed or the subscribe options are changed. // - // The 'options' contains the property ID, area ID and sample rate in Hz. + // The subscribe options contain sample rate in Hz or enable/disable variable update rate. // - // For continuous property, the sample rate is never 0 and indicates the new sample rate (or - // the initial sample rate if this property was not subscribed before). + // For continuous properties: // - // For on-change property, the sample rate is always 0 and must be ignored. + // The sample rate is never 0 and indicates the desired polling rate for this property. The + // sample rate is guaranteed to be within supported {@code minSampleRate} and + // {@code maxSampleRate} as specified in {@code VehiclePropConfig}. + // + // If the specified sample rate is not supported, e.g. vehicle bus only supports 5hz and 10hz + // polling rate but the sample rate is 8hz, impl must choose the higher polling rate (10hz). + // + // Whether variable update rate is enabled is specified by {@code enableVariableUpdateRate} in + // {@code SubscribeOptions}. If variable update rate is not supported for the + // [propId, areaId], impl must ignore this option and always treat it as disabled. + // + // If variable update rate is disabled/not supported, impl must report all the property events + // for this [propId, areaId] through {@code propertyChangeCallback} according to the sample + // rate. E.g. a sample rate of 10hz must generate at least 10 property change events per second. + // + // If variable update rate is enabled AND supported, impl must only report property events + // when the [propId, areaId]'s value or status changes (a.k.a same as on-change property). + // The sample rate still guides the polling rate, but duplicate property events must be dropped + // and not reported via {@code propertyChangeCallback}. + // + // Async property set error events are not affected by variable update rate and must always + // be reported. + // + // If the impl is always polling at {@code maxSampleRate} for all continuous [propId, areaId]s, + // and do not support variable update rate for any [propId, areaId], then this function can be a + // no-op. + // + // For on-change properties: + // + // The sample rate is always 0 and must be ignored. If the impl is always subscribing to all + // on-change properties, then this function can be no-op. + // + // For all properties: + // + // It is recommended to only deliver the subscribed property events to DefaultVehicleHal to + // improve performance. However, even if unsubscribed property events are delivered, they + // will be filtered out by DefaultVehicleHal. // // A subscription from VHAL client might not necessarily trigger this function. // DefaultVehicleHal will aggregate all the subscriptions from all the clients and notify - // IVehicleHardware if new subscriptions are required or sample rate is updated. + // IVehicleHardware if new subscriptions are required or subscribe options are updated. // // For example: // 1. VHAL initially have no subscriber for speed. @@ -144,15 +179,6 @@ class IVehicleHardware { // 5. The second subscriber is removed, 'unsubscribe' is called. // The impl can optionally disable the polling for vehicle speed. // - // It is recommended to only deliver the subscribed property events to DefaultVehicleHal to - // improve performance. However, even if unsubscribed property events are delivered, they - // will be filtered out by DefaultVehicleHal. - // - // For continuous property, if the impl is always polling at {@code maxSampleRate} as specified - // in config, then this function can be a no-op. - // - // For on-change property, if the impl is always subscribing to all on-change properties, then - // this function can be no-op. virtual aidl::android::hardware::automotive::vehicle::StatusCode subscribe( [[maybe_unused]] aidl::android::hardware::automotive::vehicle::SubscribeOptions options) { diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h index 057da35f24..5053c96efe 100644 --- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h +++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h @@ -36,20 +36,29 @@ namespace hardware { namespace automotive { namespace vehicle { +// A structure to represent subscription config for one subscription client. +struct SubConfig { + float sampleRateHz; + bool enableVur; +}; + // A class to represent all the subscription configs for a continuous [propId, areaId]. class ContSubConfigs final { public: using ClientIdType = const AIBinder*; - void addClient(const ClientIdType& clientId, float sampleRateHz); + void addClient(const ClientIdType& clientId, float sampleRateHz, bool enableVur); void removeClient(const ClientIdType& clientId); float getMaxSampleRateHz() const; + bool isVurEnabled() const; + bool isVurEnabledForClient(const ClientIdType& clientId); private: float mMaxSampleRateHz = 0.; - std::unordered_map mSampleRateHzByClient; + bool mEnableVur; + std::unordered_map mConfigByClient; - void refreshMaxSampleRateHz(); + void refreshCombinedConfig(); }; // A thread-safe subscription manager that manages all VHAL subscriptions. @@ -58,6 +67,7 @@ class SubscriptionManager final { using ClientIdType = const AIBinder*; using CallbackType = std::shared_ptr; + using VehiclePropValue = aidl::android::hardware::automotive::vehicle::VehiclePropValue; explicit SubscriptionManager(IVehicleHardware* vehicleHardware); ~SubscriptionManager(); @@ -92,11 +102,8 @@ class SubscriptionManager final { // For a list of updated properties, returns a map that maps clients subscribing to // the updated properties to a list of updated values. This would only return on-change property // clients that should be informed for the given updated values. - std::unordered_map> - getSubscribedClients( - std::vector&& - updatedValues); + std::unordered_map> getSubscribedClients( + std::vector&& updatedValues); // For a list of set property error events, returns a map that maps clients subscribing to the // properties to a list of errors for each client. @@ -116,6 +123,21 @@ class SubscriptionManager final { IVehicleHardware* mVehicleHardware; + struct VehiclePropValueHashPropIdAreaId { + inline size_t operator()(const VehiclePropValue& vehiclePropValue) const { + size_t res = 0; + hashCombine(res, vehiclePropValue.prop); + hashCombine(res, vehiclePropValue.areaId); + return res; + } + }; + + struct VehiclePropValueEqualPropIdAreaId { + inline bool operator()(const VehiclePropValue& left, const VehiclePropValue& right) const { + return left.prop == right.prop && left.areaId == right.areaId; + } + }; + mutable std::mutex mLock; std::unordered_map, PropIdAreaIdHash> @@ -124,10 +146,15 @@ class SubscriptionManager final { mSubscribedPropsByClient GUARDED_BY(mLock); std::unordered_map mContSubConfigsByPropIdArea GUARDED_BY(mLock); + std::unordered_map> + mContSubValuesByCallback GUARDED_BY(mLock); VhalResult addContinuousSubscriberLocked(const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, - float sampleRateHz) REQUIRES(mLock); + float sampleRateHz, bool enableVur) + REQUIRES(mLock); VhalResult addOnChangeSubscriberLocked(const PropIdAreaId& propIdAreaId) REQUIRES(mLock); // Removes the subscription client for the continuous [propId, areaId]. VhalResult removeContinuousSubscriberLocked(const ClientIdType& clientId, @@ -147,6 +174,9 @@ class SubscriptionManager final { // Checks whether the manager is empty. For testing purpose. bool isEmpty(); + bool isValueUpdatedLocked(const CallbackType& callback, const VehiclePropValue& value) + REQUIRES(mLock); + // Get the interval in nanoseconds accroding to sample rate. static android::base::Result getIntervalNanos(float sampleRateHz); }; diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 111a6ec98d..ee2de6df50 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -695,6 +695,8 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { optionCopy.sampleRate = getDefaultSampleRateHz( optionCopy.sampleRate, config.minSampleRate, config.maxSampleRate); + // TODO: set this to false if VUR is not supported for the [propId, areaId]. + optionCopy.enableVariableUpdateRate = false; continuousSubscriptions.push_back(std::move(optionCopy)); } else { onChangeSubscriptions.push_back(std::move(optionCopy)); diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp index a7c797b9e4..29d81a75e7 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp @@ -42,11 +42,13 @@ using ::ndk::ScopedAStatus; constexpr float ONE_SECOND_IN_NANOS = 1'000'000'000.; -SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId, float sampleRateHz) { +SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId, float sampleRateHz, + bool enableVur) { SubscribeOptions subscribedOptions; subscribedOptions.propId = propId; subscribedOptions.areaIds = {areaId}; subscribedOptions.sampleRate = sampleRateHz; + subscribedOptions.enableVariableUpdateRate = enableVur; return subscribedOptions; } @@ -79,32 +81,50 @@ Result SubscriptionManager::getIntervalNanos(float sampleRateHz) { return intervalNanos; } -void ContSubConfigs::refreshMaxSampleRateHz() { +void ContSubConfigs::refreshCombinedConfig() { float maxSampleRateHz = 0.; + bool enableVur = true; // This is not called frequently so a brute-focre is okay. More efficient way exists but this // is simpler. - for (const auto& [_, sampleRateHz] : mSampleRateHzByClient) { - if (sampleRateHz > maxSampleRateHz) { - maxSampleRateHz = sampleRateHz; + for (const auto& [_, subConfig] : mConfigByClient) { + if (subConfig.sampleRateHz > maxSampleRateHz) { + maxSampleRateHz = subConfig.sampleRateHz; + } + if (!subConfig.enableVur) { + // If one client does not enable variable update rate, we cannot enable variable update + // rate in IVehicleHardware. + enableVur = false; } } mMaxSampleRateHz = maxSampleRateHz; + mEnableVur = enableVur; } -void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRateHz) { - mSampleRateHzByClient[clientId] = sampleRateHz; - refreshMaxSampleRateHz(); +void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRateHz, bool enableVur) { + mConfigByClient[clientId] = { + .sampleRateHz = sampleRateHz, + .enableVur = enableVur, + }; + refreshCombinedConfig(); } void ContSubConfigs::removeClient(const ClientIdType& clientId) { - mSampleRateHzByClient.erase(clientId); - refreshMaxSampleRateHz(); + mConfigByClient.erase(clientId); + refreshCombinedConfig(); } float ContSubConfigs::getMaxSampleRateHz() const { return mMaxSampleRateHz; } +bool ContSubConfigs::isVurEnabled() const { + return mEnableVur; +} + +bool ContSubConfigs::isVurEnabledForClient(const ClientIdType& clientId) { + return mConfigByClient[clientId].enableVur; +} + VhalResult SubscriptionManager::addOnChangeSubscriberLocked( const PropIdAreaId& propIdAreaId) { if (mClientsByPropIdAreaId.find(propIdAreaId) != mClientsByPropIdAreaId.end()) { @@ -115,7 +135,7 @@ VhalResult SubscriptionManager::addOnChangeSubscriberLocked( int32_t propId = propIdAreaId.propId; int32_t areaId = propIdAreaId.areaId; if (auto status = mVehicleHardware->subscribe( - newSubscribeOptions(propId, areaId, /*updateRateHz=*/0)); + newSubscribeOptions(propId, areaId, /*updateRateHz=*/0, /*enableVur*/ false)); status != StatusCode::OK) { return StatusError(status) << StringPrintf("failed subscribe for prop: %s, areaId: %" PRId32, @@ -125,10 +145,11 @@ VhalResult SubscriptionManager::addOnChangeSubscriberLocked( } VhalResult SubscriptionManager::addContinuousSubscriberLocked( - const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz) { + const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz, + bool enableVur) { // Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases. ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId]; - newConfig.addClient(clientId, sampleRateHz); + newConfig.addClient(clientId, sampleRateHz, enableVur); return updateContSubConfigsLocked(propIdAreaId, newConfig); } @@ -159,24 +180,27 @@ VhalResult SubscriptionManager::removeOnChangeSubscriberLocked( VhalResult SubscriptionManager::updateContSubConfigsLocked(const PropIdAreaId& propIdAreaId, const ContSubConfigs& newConfig) { - if (newConfig.getMaxSampleRateHz() == - mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRateHz()) { + const auto& oldConfig = mContSubConfigsByPropIdArea[propIdAreaId]; + float newRateHz = newConfig.getMaxSampleRateHz(); + float oldRateHz = oldConfig.getMaxSampleRateHz(); + if (newRateHz == oldRateHz && newConfig.isVurEnabled() == oldConfig.isVurEnabled()) { mContSubConfigsByPropIdArea[propIdAreaId] = newConfig; return {}; } - float newRateHz = newConfig.getMaxSampleRateHz(); int32_t propId = propIdAreaId.propId; int32_t areaId = propIdAreaId.areaId; - if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz); - status != StatusCode::OK) { - return StatusError(status) - << StringPrintf("failed to update sample rate for prop: %s, areaId: %" PRId32 - ", sample rate: %f HZ", - propIdToString(propId).c_str(), areaId, newRateHz); + if (newRateHz != oldRateHz) { + if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz); + status != StatusCode::OK) { + return StatusError(status) + << StringPrintf("failed to update sample rate for prop: %s, areaId: %" PRId32 + ", sample rate: %f HZ", + propIdToString(propId).c_str(), areaId, newRateHz); + } } if (newRateHz != 0) { - if (auto status = - mVehicleHardware->subscribe(newSubscribeOptions(propId, areaId, newRateHz)); + if (auto status = mVehicleHardware->subscribe( + newSubscribeOptions(propId, areaId, newRateHz, newConfig.isVurEnabled())); status != StatusCode::OK) { return StatusError(status) << StringPrintf( "failed subscribe for prop: %s, areaId" @@ -228,7 +252,8 @@ VhalResult SubscriptionManager::subscribe(const std::shared_ptr result; if (isContinuousProperty) { - result = addContinuousSubscriberLocked(clientId, propIdAreaId, option.sampleRate); + result = addContinuousSubscriberLocked(clientId, propIdAreaId, option.sampleRate, + option.enableVariableUpdateRate); } else { result = addOnChangeSubscriberLocked(propIdAreaId); } @@ -324,6 +349,34 @@ VhalResult SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdT return {}; } +bool SubscriptionManager::isValueUpdatedLocked(const std::shared_ptr& callback, + const VehiclePropValue& value) { + const auto& it = mContSubValuesByCallback[callback].find(value); + if (it == mContSubValuesByCallback[callback].end()) { + mContSubValuesByCallback[callback].insert(value); + return true; + } + + if (it->timestamp > value.timestamp) { + ALOGE("The updated property value: %s is outdated, ignored", value.toString().c_str()); + return false; + } + + if (it->value == value.value && it->status == value.status) { + // Even though the property value is the same, we need to store the new property event to + // update the timestamp. + mContSubValuesByCallback[callback].insert(value); + ALOGD("The updated property value for propId: %" PRId32 ", areaId: %" PRId32 + " has the " + "same value and status, ignored if VUR is enabled", + it->prop, it->areaId); + return false; + } + + mContSubValuesByCallback[callback].insert(value); + return true; +} + std::unordered_map, std::vector> SubscriptionManager::getSubscribedClients(std::vector&& updatedValues) { std::scoped_lock lockGuard(mLock); @@ -338,8 +391,18 @@ SubscriptionManager::getSubscribedClients(std::vector&& update continue; } - for (const auto& [_, client] : mClientsByPropIdAreaId[propIdAreaId]) { - clients[client].push_back(value); + for (const auto& [client, callback] : mClientsByPropIdAreaId[propIdAreaId]) { + auto& subConfigs = mContSubConfigsByPropIdArea[propIdAreaId]; + // If client wants VUR (and VUR is supported as checked in DefaultVehicleHal), it is + // possible that VUR is not enabled in IVehicleHardware because another client does not + // enable VUR. We will implement VUR filtering here for the client that enables it. + if (subConfigs.isVurEnabledForClient(client) && !subConfigs.isVurEnabled()) { + if (isValueUpdatedLocked(callback, value)) { + clients[callback].push_back(value); + } + } else { + clients[callback].push_back(value); + } } } return clients; diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp index b64c0d7102..db15c8942f 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp @@ -90,6 +90,10 @@ StatusCode MockVehicleHardware::checkHealth() { } StatusCode MockVehicleHardware::subscribe(SubscribeOptions options) { + { + std::scoped_lock lockGuard(mLock); + mSubscribeOptions.push_back(options); + } for (int32_t areaId : options.areaIds) { if (auto status = subscribePropIdAreaId(options.propId, areaId, options.sampleRate); status != StatusCode::OK) { @@ -99,6 +103,16 @@ StatusCode MockVehicleHardware::subscribe(SubscribeOptions options) { return StatusCode::OK; } +std::vector MockVehicleHardware::getSubscribeOptions() { + std::scoped_lock lockGuard(mLock); + return mSubscribeOptions; +} + +void MockVehicleHardware::clearSubscribeOptions() { + std::scoped_lock lockGuard(mLock); + mSubscribeOptions.clear(); +} + StatusCode MockVehicleHardware::subscribePropIdAreaId(int32_t propId, int32_t areaId, float sampleRateHz) { if (sampleRateHz == 0) { diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h index e0d2d662f8..eeca582fa4 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h @@ -95,6 +95,9 @@ class MockVehicleHardware final : public IVehicleHardware { std::set> getSubscribedOnChangePropIdAreaIds(); std::set> getSubscribedContinuousPropIdAreaIds(); + std::vector + getSubscribeOptions(); + void clearSubscribeOptions(); private: mutable std::mutex mLock; @@ -121,6 +124,8 @@ class MockVehicleHardware final : public IVehicleHardware { mGetValueResponder GUARDED_BY(mLock); std::chrono::nanoseconds mEventBatchingWindow GUARDED_BY(mLock) = std::chrono::nanoseconds(0); std::set> mSubOnChangePropIdAreaIds GUARDED_BY(mLock); + std::vector mSubscribeOptions + GUARDED_BY(mLock); template aidl::android::hardware::automotive::vehicle::StatusCode returnResponse( diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp index 049ca8b786..aa5f003dec 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp @@ -43,10 +43,12 @@ using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback; using ::aidl::android::hardware::automotive::vehicle::SetValueResults; using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions; using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors; +using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue; using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues; using ::ndk::ScopedAStatus; using ::ndk::SpAIBinder; +using ::testing::Contains; using ::testing::ElementsAre; using ::testing::UnorderedElementsAre; @@ -518,6 +520,257 @@ TEST_F(SubscriptionManagerTest, testCheckSampleRateHzInvalidZero) { ASSERT_FALSE(SubscriptionManager::checkSampleRateHz(0)); } +TEST_F(SubscriptionManagerTest, testSubscribe_enableVur) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = true, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(options[0])); +} + +TEST_F(SubscriptionManagerTest, testSubscribe_VurStateChange) { + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = true, + }}; + + auto result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(options[0])); + + getHardware()->clearSubscribeOptions(); + result = getManager()->subscribe(getCallbackClient(), options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_TRUE(getHardware()->getSubscribeOptions().empty()); + + std::vector newOptions = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = false, + }}; + result = getManager()->subscribe(getCallbackClient(), newOptions, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(newOptions[0])); +} + +TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_filterUnchangedEvents) { + SpAIBinder binder1 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client1 = IVehicleCallback::fromBinder(binder1); + SpAIBinder binder2 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client2 = IVehicleCallback::fromBinder(binder2); + SubscribeOptions client1Option = { + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = false, + }; + auto result = getManager()->subscribe(client1, {client1Option}, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), UnorderedElementsAre(client1Option)); + + getHardware()->clearSubscribeOptions(); + SubscribeOptions client2Option = { + .propId = 0, + .areaIds = {0, 1}, + .sampleRate = 20.0, + .enableVariableUpdateRate = true, + }; + + result = getManager()->subscribe(client2, {client2Option}, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), + UnorderedElementsAre( + SubscribeOptions{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 20.0, + // This is enabled for client2, but disabled for client1. + .enableVariableUpdateRate = false, + }, + SubscribeOptions{ + .propId = 0, + .areaIds = {1}, + .sampleRate = 20.0, + .enableVariableUpdateRate = true, + })); + + std::vector propertyEvents = {{ + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .timestamp = 1, + }, + { + .prop = 0, + .areaId = 1, + .value = {.int32Values = {1}}, + .timestamp = 1, + }}; + auto clients = + getManager()->getSubscribedClients(std::vector(propertyEvents)); + + ASSERT_THAT(clients[client1], UnorderedElementsAre(propertyEvents[0])); + ASSERT_THAT(clients[client2], UnorderedElementsAre(propertyEvents[0], propertyEvents[1])); + + // If the same property events happen again with a new timestamp. + // VUR is disabled for client1, enabled for client2. + clients = getManager()->getSubscribedClients({{ + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .timestamp = 2, + }}); + + ASSERT_FALSE(clients.find(client1) == clients.end()) + << "Must not filter out property events if VUR is not enabled"; + ASSERT_TRUE(clients.find(client2) == clients.end()) + << "Must filter out property events if VUR is enabled"; +} + +TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_mustNotFilterStatusChange) { + SpAIBinder binder1 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client1 = IVehicleCallback::fromBinder(binder1); + SpAIBinder binder2 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client2 = IVehicleCallback::fromBinder(binder2); + SubscribeOptions client1Option = { + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = false, + }; + auto result = getManager()->subscribe(client1, {client1Option}, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), UnorderedElementsAre(client1Option)); + + getHardware()->clearSubscribeOptions(); + SubscribeOptions client2Option = { + .propId = 0, + .areaIds = {0, 1}, + .sampleRate = 20.0, + .enableVariableUpdateRate = true, + }; + + result = getManager()->subscribe(client2, {client2Option}, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + ASSERT_THAT(getHardware()->getSubscribeOptions(), + UnorderedElementsAre( + SubscribeOptions{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 20.0, + // This is enabled for client2, but disabled for client1. + .enableVariableUpdateRate = false, + }, + SubscribeOptions{ + .propId = 0, + .areaIds = {1}, + .sampleRate = 20.0, + .enableVariableUpdateRate = true, + })); + + VehiclePropValue propValue1 = { + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .timestamp = 1, + }; + auto clients = getManager()->getSubscribedClients(std::vector({propValue1})); + + ASSERT_THAT(clients[client1], UnorderedElementsAre(propValue1)); + + // A new event with the same value, but different status must not be filtered out. + VehiclePropValue propValue2 = { + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .status = VehiclePropertyStatus::UNAVAILABLE, + .timestamp = 2, + }; + clients = getManager()->getSubscribedClients({propValue2}); + + ASSERT_THAT(clients[client1], UnorderedElementsAre(propValue2)) + << "Must not filter out property events that has status change"; +} + +TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_timestampUpdated_filterOutdatedEvent) { + SpAIBinder binder1 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client1 = IVehicleCallback::fromBinder(binder1); + SpAIBinder binder2 = ndk::SharedRefBase::make()->asBinder(); + std::shared_ptr client2 = IVehicleCallback::fromBinder(binder2); + std::vector options = {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = true, + }}; + + // client1 subscribe with VUR enabled. + auto result = getManager()->subscribe(client1, options, true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + // Let client2 subscribe with VUR disabled so that we enabled VUR in DefaultVehicleHal layer. + result = getManager()->subscribe(client2, + {{ + .propId = 0, + .areaIds = {0}, + .sampleRate = 10.0, + .enableVariableUpdateRate = false, + }}, + true); + ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message(); + + VehiclePropValue value0 = { + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .timestamp = 1, + }; + auto clients = getManager()->getSubscribedClients({value0}); + + ASSERT_THAT(clients[client1], UnorderedElementsAre(value0)); + + // A new event with the same value arrived. This must update timestamp to 3. + VehiclePropValue value1 = { + .prop = 0, + .areaId = 0, + .value = {.int32Values = {0}}, + .timestamp = 3, + }; + clients = getManager()->getSubscribedClients({value1}); + + ASSERT_TRUE(clients.find(client1) == clients.end()) + << "Must filter out duplicate property events if VUR is enabled"; + + // The latest timestamp is 3, so even though the value is not the same, this is outdated and + // must be ignored. + VehiclePropValue value2 = { + .prop = 0, + .areaId = 0, + .value = {.int32Values = {1}}, + .timestamp = 2, + }; + clients = getManager()->getSubscribedClients({value1}); + + ASSERT_TRUE(clients.find(client1) == clients.end()) + << "Must filter out outdated property events if VUR is enabled"; +} + } // namespace vehicle } // namespace automotive } // namespace hardware -- GitLab From b3f1cfd0a557dc5207bda1c9f13a03989a17c1a5 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Tue, 24 Oct 2023 17:47:32 -0700 Subject: [PATCH 212/376] Overwrite enableVUR to false if not supported. If VUR is not supported for a specific [propId, areaId], even if the client enables it, it should be disabled in VHAL. Test: atest DefaultVehicleHalTest Bug: 306748801 Change-Id: I52fa9bd3fa6e1230402c23ef1174713816d878fc --- .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 36 +++++- .../impl/vhal/test/DefaultVehicleHalTest.cpp | 118 +++++++++++++++++- 2 files changed, 150 insertions(+), 4 deletions(-) diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index ee2de6df50..d85cc09c94 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -695,9 +695,39 @@ ScopedAStatus DefaultVehicleHal::subscribe(const CallbackType& callback, if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) { optionCopy.sampleRate = getDefaultSampleRateHz( optionCopy.sampleRate, config.minSampleRate, config.maxSampleRate); - // TODO: set this to false if VUR is not supported for the [propId, areaId]. - optionCopy.enableVariableUpdateRate = false; - continuousSubscriptions.push_back(std::move(optionCopy)); + if (!optionCopy.enableVariableUpdateRate) { + continuousSubscriptions.push_back(std::move(optionCopy)); + } else { + // If clients enables to VUR, we need to check whether VUR is supported for the + // specific [propId, areaId] and overwrite the option to disable if not supported. + std::vector areasVurEnabled; + std::vector areasVurDisabled; + for (int32_t areaId : optionCopy.areaIds) { + const VehicleAreaConfig* areaConfig = getAreaConfig(propId, areaId, config); + if (areaConfig == nullptr) { + areasVurDisabled.push_back(areaId); + continue; + } + if (!areaConfig->supportVariableUpdateRate) { + areasVurDisabled.push_back(areaId); + continue; + } + areasVurEnabled.push_back(areaId); + } + if (!areasVurEnabled.empty()) { + SubscribeOptions optionVurEnabled = optionCopy; + optionVurEnabled.areaIds = areasVurEnabled; + optionVurEnabled.enableVariableUpdateRate = true; + continuousSubscriptions.push_back(std::move(optionVurEnabled)); + } + + if (!areasVurDisabled.empty()) { + // We use optionCopy for areas with VUR disabled. + optionCopy.areaIds = areasVurDisabled; + optionCopy.enableVariableUpdateRate = false; + continuousSubscriptions.push_back(std::move(optionCopy)); + } + } } else { onChangeSubscriptions.push_back(std::move(optionCopy)); } diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp index e7756129a9..7195d97a8b 100644 --- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp +++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp @@ -98,12 +98,22 @@ constexpr int32_t AREA_CONTINUOUS_PROP = 10005 + 0x10000000 + 0x03000000 + 0x004 constexpr int32_t READ_ONLY_PROP = 10006 + 0x10000000 + 0x01000000 + 0x00400000; // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 constexpr int32_t WRITE_ONLY_PROP = 10007 + 0x10000000 + 0x01000000 + 0x00400000; +// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32 +constexpr int32_t GLOBAL_CONTINUOUS_PROP_NO_VUR = 10008 + 0x10000000 + 0x01000000 + 0x00400000; int32_t testInt32VecProp(size_t i) { // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC return static_cast(i) + 0x10000000 + 0x01000000 + 0x00410000; } +std::string toString(const std::vector& options) { + std::string optionsStr; + for (const auto& option : options) { + optionsStr += option.toString() + "\n"; + } + return optionsStr; +} + struct PropConfigCmp { bool operator()(const VehiclePropConfig& a, const VehiclePropConfig& b) const { return (a.prop < b.prop); @@ -245,8 +255,18 @@ class DefaultVehicleHalTest : public testing::Test { .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }); // A global continuous property. + testConfigs.push_back(VehiclePropConfig{.prop = GLOBAL_CONTINUOUS_PROP, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.0, + .maxSampleRate = 100.0, + .areaConfigs = {{ + .areaId = 0, + .supportVariableUpdateRate = true, + }}}); + // A global continuous property that does not support VUR. testConfigs.push_back(VehiclePropConfig{ - .prop = GLOBAL_CONTINUOUS_PROP, + .prop = GLOBAL_CONTINUOUS_PROP_NO_VUR, .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 0.0, @@ -286,11 +306,13 @@ class DefaultVehicleHalTest : public testing::Test { .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT), .minInt32Value = 0, .maxInt32Value = 100, + .supportVariableUpdateRate = true, }, { .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT), .minInt32Value = 0, .maxInt32Value = 100, + .supportVariableUpdateRate = false, }, }, }); @@ -1352,6 +1374,62 @@ TEST_F(DefaultVehicleHalTest, testSubscribeGlobalContinuousRateOutOfRange) { EXPECT_EQ(countClients(), static_cast(1)); } +TEST_F(DefaultVehicleHalTest, testSubscribeContinuous_propNotSupportVur) { + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 20.0, + .enableVariableUpdateRate = true, + }, + { + .propId = GLOBAL_CONTINUOUS_PROP_NO_VUR, + .sampleRate = 30.0, + .enableVariableUpdateRate = true, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + auto receivedSubscribeOptions = getHardware()->getSubscribeOptions(); + ASSERT_THAT(receivedSubscribeOptions, UnorderedElementsAre( + SubscribeOptions{ + .propId = GLOBAL_CONTINUOUS_PROP, + .areaIds = {0}, + .enableVariableUpdateRate = true, + .sampleRate = 20.0, + }, + SubscribeOptions{ + .propId = GLOBAL_CONTINUOUS_PROP_NO_VUR, + .areaIds = {0}, + .enableVariableUpdateRate = false, + .sampleRate = 30.0, + })) + << "received unexpected subscribe options: " << toString(receivedSubscribeOptions); +} + +TEST_F(DefaultVehicleHalTest, testSubscribeContinuous_propSupportVurNotEnabled) { + std::vector options = { + { + .propId = GLOBAL_CONTINUOUS_PROP, + .sampleRate = 20.0, + .enableVariableUpdateRate = false, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + auto receivedSubscribeOptions = getHardware()->getSubscribeOptions(); + ASSERT_THAT(receivedSubscribeOptions, UnorderedElementsAre(SubscribeOptions{ + .propId = GLOBAL_CONTINUOUS_PROP, + .areaIds = {0}, + .enableVariableUpdateRate = false, + .sampleRate = 20.0, + })) + << "received unexpected subscribe options: " << toString(receivedSubscribeOptions); +} + TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { std::vector options = { { @@ -1404,6 +1482,44 @@ TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) { ASSERT_GE(rightCount, static_cast(5)); } +TEST_F(DefaultVehicleHalTest, testAreaContinuous_areaNotSupportVur) { + std::vector options = { + { + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 20.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)}, + .enableVariableUpdateRate = true, + }, + { + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 10.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_RIGHT)}, + .enableVariableUpdateRate = true, + }, + }; + + auto status = getClient()->subscribe(getCallbackClient(), options, 0); + + ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage(); + auto receivedSubscribeOptions = getHardware()->getSubscribeOptions(); + ASSERT_THAT(receivedSubscribeOptions, + UnorderedElementsAre( + SubscribeOptions{ + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 20.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)}, + .enableVariableUpdateRate = true, + }, + SubscribeOptions{ + .propId = AREA_CONTINUOUS_PROP, + .sampleRate = 10.0, + .areaIds = {toInt(VehicleAreaWindow::ROW_1_RIGHT)}, + // Area2 actually does not support VUR. + .enableVariableUpdateRate = false, + })) + << "received unexpected subscribe options: " << toString(receivedSubscribeOptions); +} + TEST_F(DefaultVehicleHalTest, testUnsubscribeOnChange) { std::vector options = { { -- GitLab From edb969a9d559c4ecf349460a8f85706e767c7e6d Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Thu, 26 Oct 2023 14:27:57 -0700 Subject: [PATCH 213/376] Fix proto converter and support VUR. Fix proto converter bug while parsing supported enum values. Need to populate supportedEnumValues with a vector first before storing the values because by default it is an empty nullopt. This CL also adds logic for parsing supportVUR. Test: atest VehicleHalProtoMessageConverterTest Bug: 306748801 Change-Id: Ice087a6f0298770d47f51a8d36c7857445df1de3 --- automotive/vehicle/TEST_MAPPING | 3 +++ .../src/ProtoMessageConverter.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING index 02ad8bb953..e1a90cba39 100644 --- a/automotive/vehicle/TEST_MAPPING +++ b/automotive/vehicle/TEST_MAPPING @@ -51,6 +51,9 @@ "include-filter": "com.android.car.hal.fakevhal.FakeVehicleStubUnitTest" } ] + }, + { + "name": "VehicleHalProtoMessageConverterTest" } ] } diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp index 6b789bb7a9..491aa10843 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp @@ -78,6 +78,7 @@ void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropCo protoACfg->add_supported_enum_values(supportedEnumValue); } } + protoACfg->set_support_variable_update_rate(areaConfig.supportVariableUpdateRate); } } @@ -100,9 +101,14 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo .maxInt64Value = protoAcfg.max_int64_value(), .minFloatValue = protoAcfg.min_float_value(), .maxFloatValue = protoAcfg.max_float_value(), + .supportVariableUpdateRate = protoAcfg.support_variable_update_rate(), }; - COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig), - supportedEnumValues.value()); + if (protoAcfg.supported_enum_values().size() != 0) { + vehicleAreaConfig.supportedEnumValues = std::vector(); + COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig), + supportedEnumValues.value()); + } + return vehicleAreaConfig; }; CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg); -- GitLab From bf5189cb2f18da74057aec62658e93dd981ef14b Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Wed, 30 Aug 2023 22:01:50 +0000 Subject: [PATCH 214/376] Add SvStatus interval tests Bug: 298260386 Test: atest VtsHalGnssTargetTest Change-Id: I2a592147641c143c6d33435e60a79fc5f8424f3f --- gnss/aidl/default/Gnss.cpp | 16 ++- gnss/aidl/default/Gnss.h | 4 + .../aidl/default/GnssMeasurementInterface.cpp | 5 +- gnss/aidl/vts/gnss_hal_test_cases.cpp | 122 +++++++++++++++--- 4 files changed, 126 insertions(+), 21 deletions(-) diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp index f1b9cbfd3f..c31f991b9d 100644 --- a/gnss/aidl/default/Gnss.cpp +++ b/gnss/aidl/default/Gnss.cpp @@ -115,7 +115,9 @@ ScopedAStatus Gnss::start() { mGnssMeasurementInterface->setLocationEnabled(true); this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN); mThread = std::thread([this]() { - this->reportSvStatus(); + if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) { + this->reportSvStatus(); + } if (!mFirstFixReceived) { std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS)); mFirstFixReceived = true; @@ -124,7 +126,9 @@ ScopedAStatus Gnss::start() { if (!mIsActive) { break; } - this->reportSvStatus(); + if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) { + this->reportSvStatus(); + } this->reportNmea(); auto currentLocation = getLocationFromHW(); @@ -386,4 +390,12 @@ ndk::ScopedAStatus Gnss::getExtensionMeasurementCorrections( return ndk::ScopedAStatus::ok(); } +void Gnss::setGnssMeasurementEnabled(const bool enabled) { + mGnssMeasurementEnabled = enabled; +} + +void Gnss::setGnssMeasurementInterval(const long intervalMs) { + mGnssMeasurementIntervalMs = intervalMs; +} + } // namespace aidl::android::hardware::gnss diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h index 00540cd62b..245d60785f 100644 --- a/gnss/aidl/default/Gnss.h +++ b/gnss/aidl/default/Gnss.h @@ -85,6 +85,8 @@ class Gnss : public BnGnss { override; void reportSvStatus() const; + void setGnssMeasurementEnabled(const bool enabled); + void setGnssMeasurementInterval(const long intervalMs); std::shared_ptr mGnssConfiguration; std::shared_ptr mGnssPowerIndication; std::shared_ptr mGnssMeasurementInterface; @@ -101,10 +103,12 @@ class Gnss : public BnGnss { static std::shared_ptr sGnssCallback; std::atomic mMinIntervalMs; + std::atomic mGnssMeasurementIntervalMs; std::atomic mIsActive; std::atomic mIsSvStatusActive; std::atomic mIsNmeaActive; std::atomic mFirstFixReceived; + std::atomic mGnssMeasurementEnabled; std::thread mThread; ::android::hardware::gnss::common::ThreadBlocker mThreadBlocker; diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp index f7e4d4a542..f3242138cb 100644 --- a/gnss/aidl/default/GnssMeasurementInterface.cpp +++ b/gnss/aidl/default/GnssMeasurementInterface.cpp @@ -76,6 +76,7 @@ ndk::ScopedAStatus GnssMeasurementInterface::setCallbackWithOptions( stop(); } mIntervalMs = std::max(options.intervalMs, 1000); + mGnss->setGnssMeasurementInterval(mIntervalMs); start(options.enableCorrVecOutputs, options.enableFullTracking); return ndk::ScopedAStatus::ok(); @@ -104,6 +105,7 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs, } mIsActive = true; + mGnss->setGnssMeasurementEnabled(true); mThreads.emplace_back(std::thread([this, enableCorrVecOutputs, enableFullTracking]() { waitForStoppingThreads(); mThreadBlocker.reset(); @@ -129,7 +131,7 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs, auto measurement = Utils::getMockMeasurement(enableCorrVecOutputs, enableFullTracking); this->reportMeasurement(measurement); - if (!mLocationEnabled) { + if (!mLocationEnabled || mLocationIntervalMs > mIntervalMs) { mGnss->reportSvStatus(); } } @@ -142,6 +144,7 @@ void GnssMeasurementInterface::start(const bool enableCorrVecOutputs, void GnssMeasurementInterface::stop() { ALOGD("stop"); mIsActive = false; + mGnss->setGnssMeasurementEnabled(false); mThreadBlocker.notify(); for (auto iter = mThreads.begin(); iter != mThreads.end(); ++iter) { if (iter->joinable()) { diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp index aa8bdfdf16..9381a0a12e 100644 --- a/gnss/aidl/vts/gnss_hal_test_cases.cpp +++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp @@ -1430,13 +1430,13 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_WithoutLocation) { startMeasurementWithInterval(intervals[i], iGnssMeasurement, callback); std::vector measurementDeltas; - std::vector svInfoListTimestampsDeltas; + std::vector svInfoListDeltas; collectMeasurementIntervals(callback, numEvents[i], /* timeoutSeconds= */ 10, measurementDeltas); if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { - collectSvInfoListTimestamps(numEvents[i], /* timeoutSeconds= */ 10, - svInfoListTimestampsDeltas); + collectSvInfoListTimestamps(numEvents[i], /* timeoutSeconds= */ 10, svInfoListDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); } status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); @@ -1444,8 +1444,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_WithoutLocation) { assertMeanAndStdev(intervals[i], measurementDeltas); if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { - assertMeanAndStdev(intervals[i], svInfoListTimestampsDeltas); - EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + assertMeanAndStdev(intervals[i], svInfoListDeltas); } } } @@ -1477,13 +1476,25 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnBeforeMeasurement) { auto callback = sp::make(); startMeasurementWithInterval(intervalMs, iGnssMeasurement, callback); - std::vector deltas; - collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, deltas); + std::vector measurementDeltas; + std::vector svInfoListDeltas; + + collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, + measurementDeltas); + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + collectSvInfoListTimestamps(/*numEvents=*/10, /* timeoutSeconds= */ 10, + svInfoListDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + } status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); - assertMeanAndStdev(locationIntervalMs, deltas); + assertMeanAndStdev(locationIntervalMs, measurementDeltas); + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + // Verify the SvStatus interval is 1s (not 2s) + assertMeanAndStdev(locationIntervalMs, svInfoListDeltas); + } } StopAndClearLocations(); } @@ -1516,16 +1527,37 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_LocationOnAfterMeasurement) { // Start location and verify the measurements are received at 1Hz StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false); - std::vector deltas; - collectMeasurementIntervals(callback, /*numEvents=*/10, kFirstMeasTimeoutSec, deltas); - assertMeanAndStdev(locationIntervalMs, deltas); + std::vector measurementDeltas; + std::vector svInfoListDeltas; + collectMeasurementIntervals(callback, /*numEvents=*/10, kFirstMeasTimeoutSec, + measurementDeltas); + assertMeanAndStdev(locationIntervalMs, measurementDeltas); + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + collectSvInfoListTimestamps(/*numEvents=*/10, /* timeoutSeconds= */ 10, + svInfoListDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + // Verify the SvStatus intervals are at 1s interval + assertMeanAndStdev(locationIntervalMs, svInfoListDeltas); + } // Stop location request and verify the measurements are received at 2s intervals StopAndClearLocations(); - callback->gnss_data_cbq_.reset(); - deltas.clear(); - collectMeasurementIntervals(callback, /*numEvents=*/5, kFirstMeasTimeoutSec, deltas); - assertMeanAndStdev(intervalMs, deltas); + measurementDeltas.clear(); + collectMeasurementIntervals(callback, /*numEvents=*/5, kFirstMeasTimeoutSec, + measurementDeltas); + assertMeanAndStdev(intervalMs, measurementDeltas); + + if (aidl_gnss_hal_->getInterfaceVersion() >= 3) { + svInfoListDeltas.clear(); + collectSvInfoListTimestamps(/*numEvents=*/5, /* timeoutSeconds= */ 10, + svInfoListDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + // Verify the SvStatus intervals are at 2s interval + for (const int& delta : svInfoListDeltas) { + ALOGD("svInfoListDelta: %d", delta); + } + assertMeanAndStdev(intervalMs, svInfoListDeltas); + } status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); @@ -1587,8 +1619,7 @@ TEST_P(GnssHalTest, TestGnssMeasurementIntervals_changeIntervals) { * TestGnssMeasurementIsFullTracking * 1. Start measurement with enableFullTracking=true. Verify the received measurements have * isFullTracking=true. - * 2. Start measurement with enableFullTracking = false. Verify the received measurements have - * isFullTracking=false. + * 2. Start measurement with enableFullTracking = false. * 3. Do step 1 again. */ TEST_P(GnssHalTest, TestGnssMeasurementIsFullTracking) { @@ -1675,4 +1706,59 @@ TEST_P(GnssHalTest, TestAccumulatedDeltaRange) { ASSERT_TRUE(accumulatedDeltaRangeFound); status = iGnssMeasurement->close(); ASSERT_TRUE(status.isOk()); -} \ No newline at end of file +} + +/* + * TestSvStatusIntervals: + * 1. start measurement and location with various intervals + * 2. verify the SvStatus are received at expected interval + */ +TEST_P(GnssHalTest, TestSvStatusIntervals) { + if (aidl_gnss_hal_->getInterfaceVersion() <= 2) { + return; + } + ALOGD("TestSvStatusIntervals"); + sp iGnssMeasurement; + auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(iGnssMeasurement != nullptr); + + std::vector locationIntervals{1000, 2000, INT_MAX}; + std::vector measurementIntervals{1000, 2000, INT_MAX}; + + for (auto& locationIntervalMs : locationIntervals) { + for (auto& measurementIntervalMs : measurementIntervals) { + if (locationIntervalMs == INT_MAX && measurementIntervalMs == INT_MAX) { + continue; + } + auto measurementCallback = sp::make(); + // Start measurement + if (measurementIntervalMs < INT_MAX) { + startMeasurementWithInterval(measurementIntervalMs, iGnssMeasurement, + measurementCallback); + } + // Start location + if (locationIntervalMs < INT_MAX) { + StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false); + } + ALOGD("location@%d(ms), measurement@%d(ms)", locationIntervalMs, measurementIntervalMs); + std::vector svInfoListDeltas; + collectSvInfoListTimestamps(/*numEvents=*/5, /* timeoutSeconds= */ 10, + svInfoListDeltas); + EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0); + + int svStatusInterval = std::min(locationIntervalMs, measurementIntervalMs); + assertMeanAndStdev(svStatusInterval, svInfoListDeltas); + + if (locationIntervalMs < INT_MAX) { + // Stop location request + StopAndClearLocations(); + } + if (measurementIntervalMs < INT_MAX) { + // Stop measurement request + status = iGnssMeasurement->close(); + ASSERT_TRUE(status.isOk()); + } + } + } +} -- GitLab From 25409e5b6b2226ab9f372101dbe9dc825ca39f9f Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 6 Sep 2023 10:36:24 -0700 Subject: [PATCH 215/376] Refactor utils and VTS for HD radio HAL support Refactored AIDL broadcast radio HAL utils library to both support version 2 HAL and guarantee backward compatibility for version 1 HAL implementation using version 1 utils lib. Updated VTS to support HAL of both AIDL versions. Bug: 280300929 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I31e631c794f51c8df230b984837dfb4299864e5c --- broadcastradio/aidl/vts/Android.bp | 4 +- .../VtsHalBroadcastradioAidlTargetTest.cpp | 79 ++++-- broadcastradio/common/utilsaidl/Android.bp | 26 +- .../include/broadcastradio-utils-aidl/Utils.h | 1 - .../broadcastradio-utils-aidl/UtilsV2.h | 35 +++ .../common/utilsaidl/{ => src}/Utils.cpp | 27 +- .../common/utilsaidl/src/UtilsV2.cpp | 240 ++++++++++++++++++ 7 files changed, 373 insertions(+), 39 deletions(-) create mode 100644 broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h rename broadcastradio/common/utilsaidl/{ => src}/Utils.cpp (95%) create mode 100644 broadcastradio/common/utilsaidl/src/UtilsV2.cpp diff --git a/broadcastradio/aidl/vts/Android.bp b/broadcastradio/aidl/vts/Android.bp index b60387ef49..87e48a9ebe 100644 --- a/broadcastradio/aidl/vts/Android.bp +++ b/broadcastradio/aidl/vts/Android.bp @@ -35,8 +35,8 @@ cc_test { "libxml2", ], static_libs: [ - "android.hardware.broadcastradio-V1-ndk", - "android.hardware.broadcastradio@common-utils-aidl-lib", + "android.hardware.broadcastradio-V2-ndk", + "android.hardware.broadcastradio@common-utils-aidl-lib-V2", "android.hardware.broadcastradio@vts-utils-lib", "libgmock", ], diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 790d60b252..72869ccd9b 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,6 @@ using ::aidl::android::hardware::broadcastradio::utils::makeSelectorDab; using ::aidl::android::hardware::broadcastradio::utils::resultToInt; using ::ndk::ScopedAStatus; using ::ndk::SharedRefBase; -using ::std::string; using ::std::vector; using ::testing::_; using ::testing::AnyNumber; @@ -73,20 +73,29 @@ const ConfigFlag kConfigFlagValues[] = { ConfigFlag::DAB_FM_SOFT_LINKING, }; -void printSkipped(const string& msg) { +constexpr int32_t kAidlVersion1 = 1; +constexpr int32_t kAidlVersion2 = 2; + +void printSkipped(const std::string& msg) { const auto testInfo = testing::UnitTest::GetInstance()->current_test_info(); LOG(INFO) << "[ SKIPPED ] " << testInfo->test_case_name() << "." << testInfo->name() << " with message: " << msg; } -bool isValidAmFmFreq(int64_t freq) { +bool isValidAmFmFreq(int64_t freq, int aidlVersion) { ProgramIdentifier id = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq); - return bcutils::isValid(id); + if (aidlVersion == kAidlVersion1) { + return bcutils::isValid(id); + } else if (aidlVersion == kAidlVersion2) { + return bcutils::isValidV2(id); + } + LOG(ERROR) << "Unknown AIDL version " << aidlVersion; + return false; } -void validateRange(const AmFmBandRange& range) { - EXPECT_TRUE(isValidAmFmFreq(range.lowerBound)); - EXPECT_TRUE(isValidAmFmFreq(range.upperBound)); +void validateRange(const AmFmBandRange& range, int aidlVersion) { + EXPECT_TRUE(isValidAmFmFreq(range.lowerBound, aidlVersion)); + EXPECT_TRUE(isValidAmFmFreq(range.upperBound, aidlVersion)); EXPECT_LT(range.lowerBound, range.upperBound); EXPECT_GT(range.spacing, 0u); EXPECT_EQ((range.upperBound - range.lowerBound) % range.spacing, 0u); @@ -142,7 +151,7 @@ class CallbackFlag final { class TunerCallbackImpl final : public BnTunerCallback { public: - TunerCallbackImpl(); + explicit TunerCallbackImpl(int32_t aidlVersion); ScopedAStatus onTuneFailed(Result result, const ProgramSelector& selector) override; ScopedAStatus onCurrentProgramInfoChanged(const ProgramInfo& info) override; ScopedAStatus onProgramListUpdated(const ProgramListChunk& chunk) override; @@ -160,6 +169,7 @@ class TunerCallbackImpl final : public BnTunerCallback { private: std::mutex mLock; + int32_t mCallbackAidlVersion; bool mAntennaConnectionState GUARDED_BY(mLock); ProgramInfo mCurrentProgramInfo GUARDED_BY(mLock); bcutils::ProgramInfoSet mProgramList GUARDED_BY(mLock); @@ -171,7 +181,7 @@ struct AnnouncementListenerMock : public BnAnnouncementListener { MOCK_METHOD1(onListUpdated, ScopedAStatus(const vector&)); }; -class BroadcastRadioHalTest : public testing::TestWithParam { +class BroadcastRadioHalTest : public testing::TestWithParam { protected: void SetUp() override; void TearDown() override; @@ -183,14 +193,17 @@ class BroadcastRadioHalTest : public testing::TestWithParam { std::shared_ptr mModule; Properties mProperties; std::shared_ptr mCallback; + int32_t mAidlVersion; }; -MATCHER_P(InfoHasId, id, string(negation ? "does not contain" : "contains") + " " + id.toString()) { +MATCHER_P(InfoHasId, id, + std::string(negation ? "does not contain" : "contains") + " " + id.toString()) { vector ids = bcutils::getAllIds(arg.selector, id.type); return ids.end() != find(ids.begin(), ids.end(), id.value); } -TunerCallbackImpl::TunerCallbackImpl() { +TunerCallbackImpl::TunerCallbackImpl(int32_t aidlVersion) { + mCallbackAidlVersion = aidlVersion; mAntennaConnectionState = true; } @@ -230,7 +243,12 @@ ScopedAStatus TunerCallbackImpl::onCurrentProgramInfoChanged(const ProgramInfo& physically > IdentifierType::SXM_CHANNEL); if (logically == IdentifierType::AMFM_FREQUENCY_KHZ) { - std::optional ps = bcutils::getMetadataString(info, Metadata::rdsPs); + std::optional ps; + if (mCallbackAidlVersion == kAidlVersion1) { + ps = bcutils::getMetadataString(info, Metadata::rdsPs); + } else { + ps = bcutils::getMetadataStringV2(info, Metadata::rdsPs); + } if (ps.has_value()) { EXPECT_NE(::android::base::Trim(*ps), "") << "Don't use empty RDS_PS as an indicator of missing RSD PS data."; @@ -323,9 +341,13 @@ void BroadcastRadioHalTest::SetUp() { EXPECT_FALSE(mProperties.product.empty()); EXPECT_GT(mProperties.supportedIdentifierTypes.size(), 0u); - mCallback = SharedRefBase::make(); + // get AIDL HAL version + ASSERT_TRUE(mModule->getInterfaceVersion(&mAidlVersion).isOk()); + EXPECT_GE(mAidlVersion, kAidlVersion1); + EXPECT_LE(mAidlVersion, kAidlVersion2); // set callback + mCallback = SharedRefBase::make(mAidlVersion); EXPECT_TRUE(mModule->setTunerCallback(mCallback).isOk()); } @@ -443,7 +465,7 @@ TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfigRanges) { EXPECT_GT(config.ranges.size(), 0u); for (const auto& range : config.ranges) { - validateRange(range); + validateRange(range, mAidlVersion); EXPECT_EQ(range.seekSpacing % range.spacing, 0u); EXPECT_GE(range.seekSpacing, range.spacing); } @@ -494,7 +516,7 @@ TEST_P(BroadcastRadioHalTest, GetAmFmRegionConfigCapabilitiesRanges) { EXPECT_GT(config.ranges.size(), 0u); for (const auto& range : config.ranges) { - validateRange(range); + validateRange(range, mAidlVersion); EXPECT_EQ(range.seekSpacing, 0u); } } @@ -522,11 +544,17 @@ TEST_P(BroadcastRadioHalTest, GetDabRegionConfig) { std::regex re("^[A-Z0-9][A-Z0-9 ]{0,5}[A-Z0-9]$"); for (const auto& entry : config) { - EXPECT_TRUE(std::regex_match(string(entry.label), re)); + EXPECT_TRUE(std::regex_match(std::string(entry.label), re)); ProgramIdentifier id = bcutils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, entry.frequencyKhz); - EXPECT_TRUE(bcutils::isValid(id)); + if (mAidlVersion == kAidlVersion1) { + EXPECT_TRUE(bcutils::isValid(id)); + } else if (mAidlVersion == kAidlVersion2) { + EXPECT_TRUE(bcutils::isValidV2(id)); + } else { + LOG(ERROR) << "Unknown callback AIDL version " << mAidlVersion; + } } } @@ -1175,10 +1203,21 @@ TEST_P(BroadcastRadioHalTest, HdRadioStationNameId) { continue; } - std::optional name = bcutils::getMetadataString(program, Metadata::programName); - if (!name) { - name = bcutils::getMetadataString(program, Metadata::rdsPs); + std::optional name; + if (mAidlVersion == kAidlVersion1) { + name = bcutils::getMetadataString(program, Metadata::programName); + if (!name) { + name = bcutils::getMetadataString(program, Metadata::rdsPs); + } + } else if (mAidlVersion == kAidlVersion2) { + name = bcutils::getMetadataStringV2(program, Metadata::programName); + if (!name) { + name = bcutils::getMetadataStringV2(program, Metadata::rdsPs); + } + } else { + LOG(ERROR) << "Unknown HAL AIDL version " << mAidlVersion; } + ASSERT_TRUE(name.has_value()); ProgramIdentifier expectedId = bcutils::makeHdRadioStationName(*name); diff --git a/broadcastradio/common/utilsaidl/Android.bp b/broadcastradio/common/utilsaidl/Android.bp index fa6de19363..4ec635b173 100644 --- a/broadcastradio/common/utilsaidl/Android.bp +++ b/broadcastradio/common/utilsaidl/Android.bp @@ -25,6 +25,29 @@ package { cc_library_static { name: "android.hardware.broadcastradio@common-utils-aidl-lib", + defaults: [ + "VtsBroadcastRadioDefaults", + ], + shared_libs: [ + "android.hardware.broadcastradio-V1-ndk", + ], +} + +cc_library_static { + name: "android.hardware.broadcastradio@common-utils-aidl-lib-V2", + defaults: [ + "VtsBroadcastRadioDefaults", + ], + srcs: [ + "src/UtilsV2.cpp", + ], + shared_libs: [ + "android.hardware.broadcastradio-V2-ndk", + ], +} + +cc_defaults { + name: "VtsBroadcastRadioDefaults", vendor_available: true, relative_install_path: "hw", cflags: [ @@ -37,11 +60,10 @@ cc_library_static { "-std=c++1z", ], srcs: [ - "Utils.cpp", + "src/Utils.cpp", ], export_include_dirs: ["include"], shared_libs: [ - "android.hardware.broadcastradio-V1-ndk", "libbase", ], static_libs: [ diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h index ee85a178da..b6fb33f444 100644 --- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h +++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h @@ -17,7 +17,6 @@ #pragma once #include -#include #include #include #include diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h new file mode 100644 index 0000000000..e411aa446d --- /dev/null +++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace aidl::android::hardware::broadcastradio { + +namespace utils { + +bool isValidV2(const ProgramIdentifier& id); +bool isValidV2(const ProgramSelector& sel); +std::optional getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag); + +} // namespace utils + +} // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/common/utilsaidl/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp similarity index 95% rename from broadcastradio/common/utilsaidl/Utils.cpp rename to broadcastradio/common/utilsaidl/src/Utils.cpp index de4f52926d..28753180a6 100644 --- a/broadcastradio/common/utilsaidl/Utils.cpp +++ b/broadcastradio/common/utilsaidl/src/Utils.cpp @@ -31,7 +31,6 @@ namespace utils { namespace { using ::android::base::EqualsIgnoreCase; -using ::std::string; using ::std::vector; const int64_t kValueForNotFoundIdentifier = 0; @@ -207,7 +206,7 @@ bool isValid(const ProgramIdentifier& id) { uint64_t val = static_cast(id.value); bool valid = true; - auto expect = [&valid](bool condition, const string& message) { + auto expect = [&valid](bool condition, const std::string& message) { if (!condition) { valid = false; LOG(ERROR) << "identifier not valid, expected " << message; @@ -278,9 +277,9 @@ bool isValid(const ProgramIdentifier& id) { case IdentifierType::SXM_CHANNEL: expect(val < 1000u, "SXM channel < 1000"); break; - case IdentifierType::VENDOR_START: - case IdentifierType::VENDOR_END: - // skip + default: + expect(id.type >= IdentifierType::VENDOR_START && id.type <= IdentifierType::VENDOR_END, + "Undefined identifier type"); break; } @@ -452,10 +451,10 @@ std::optional getMetadataString(const ProgramInfo& info, const Meta return metadataString; } -ProgramIdentifier makeHdRadioStationName(const string& name) { +ProgramIdentifier makeHdRadioStationName(const std::string& name) { constexpr size_t maxlen = 8; - string shortName; + std::string shortName; shortName.reserve(maxlen); const auto& loc = std::locale::classic(); @@ -484,7 +483,7 @@ IdentifierType getType(int typeAsInt) { return static_cast(typeAsInt); } -bool parseArgInt(const string& s, int* out) { +bool parseArgInt(const std::string& s, int* out) { return ::android::base::ParseInt(s, out); } @@ -492,7 +491,7 @@ bool parseArgLong(const std::string& s, long* out) { return ::android::base::ParseInt(s, out); } -bool parseArgBool(const string& s, bool* out) { +bool parseArgBool(const std::string& s, bool* out) { if (EqualsIgnoreCase(s, "true")) { *out = true; } else if (EqualsIgnoreCase(s, "false")) { @@ -503,7 +502,7 @@ bool parseArgBool(const string& s, bool* out) { return true; } -bool parseArgDirection(const string& s, bool* out) { +bool parseArgDirection(const std::string& s, bool* out) { if (EqualsIgnoreCase(s, "up")) { *out = true; } else if (EqualsIgnoreCase(s, "down")) { @@ -514,8 +513,8 @@ bool parseArgDirection(const string& s, bool* out) { return true; } -bool parseArgIdentifierTypeArray(const string& s, vector* out) { - for (const string& val : ::android::base::Split(s, ",")) { +bool parseArgIdentifierTypeArray(const std::string& s, vector* out) { + for (const std::string& val : ::android::base::Split(s, ",")) { int outInt; if (!parseArgInt(val, &outInt)) { return false; @@ -526,8 +525,8 @@ bool parseArgIdentifierTypeArray(const string& s, vector* out) { } bool parseProgramIdentifierList(const std::string& s, vector* out) { - for (const string& idStr : ::android::base::Split(s, ",")) { - const vector idStrPair = ::android::base::Split(idStr, ":"); + for (const std::string& idStr : ::android::base::Split(s, ",")) { + const vector idStrPair = ::android::base::Split(idStr, ":"); if (idStrPair.size() != 2) { return false; } diff --git a/broadcastradio/common/utilsaidl/src/UtilsV2.cpp b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp new file mode 100644 index 0000000000..ef739df117 --- /dev/null +++ b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "BcRadioAidlDef.utilsV2" + +#include "broadcastradio-utils-aidl/UtilsV2.h" + +#include +#include + +namespace aidl::android::hardware::broadcastradio { + +namespace utils { + +bool isValidV2(const ProgramIdentifier& id) { + uint64_t val = static_cast(id.value); + bool valid = true; + + auto expect = [&valid](bool condition, const std::string& message) { + if (!condition) { + valid = false; + LOG(ERROR) << "identifier not valid, expected " << message; + } + }; + + switch (id.type) { + case IdentifierType::INVALID: + expect(false, "IdentifierType::INVALID"); + break; + case IdentifierType::DAB_FREQUENCY_KHZ: + expect(val > 100000u, "f > 100MHz"); + [[fallthrough]]; + case IdentifierType::AMFM_FREQUENCY_KHZ: + case IdentifierType::DRMO_FREQUENCY_KHZ: + expect(val > 100u, "f > 100kHz"); + expect(val < 10000000u, "f < 10GHz"); + break; + case IdentifierType::RDS_PI: + expect(val != 0u, "RDS PI != 0"); + expect(val <= 0xFFFFu, "16bit id"); + break; + case IdentifierType::HD_STATION_ID_EXT: { + uint64_t stationId = val & 0xFFFFFFFF; // 32bit + val >>= 32; + uint64_t subchannel = val & 0xF; // 4bit + val >>= 4; + uint64_t freq = val & 0x3FFFF; // 18bit + expect(stationId != 0u, "HD station id != 0"); + expect(subchannel < 8u, "HD subch < 8"); + expect(freq > 100u, "f > 100kHz"); + expect(freq < 10000000u, "f < 10GHz"); + break; + } + case IdentifierType::HD_STATION_NAME: { + while (val > 0) { + char ch = static_cast(val & 0xFF); + val >>= 8; + expect((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z'), + "HD_STATION_NAME does not match [A-Z0-9]+"); + } + break; + } + case IdentifierType::DAB_SID_EXT: { + uint64_t sid = val & 0xFFFFFFFF; // 32bit + val >>= 32; + uint64_t ecc = val & 0xFF; // 8bit + expect(sid != 0u, "DAB SId != 0"); + expect(ecc >= 0xA0u && ecc <= 0xF6u, "Invalid ECC, see ETSI TS 101 756 V2.1.1"); + break; + } + case IdentifierType::DAB_ENSEMBLE: + expect(val != 0u, "DAB ensemble != 0"); + expect(val <= 0xFFFFu, "16bit id"); + break; + case IdentifierType::DAB_SCID: + expect(val > 0xFu, "12bit SCId (not 4bit SCIdS)"); + expect(val <= 0xFFFu, "12bit id"); + break; + case IdentifierType::DRMO_SERVICE_ID: + expect(val != 0u, "DRM SId != 0"); + expect(val <= 0xFFFFFFu, "24bit id"); + break; + case IdentifierType::SXM_SERVICE_ID: + expect(val != 0u, "SXM SId != 0"); + expect(val <= 0xFFFFFFFFu, "32bit id"); + break; + case IdentifierType::SXM_CHANNEL: + expect(val < 1000u, "SXM channel < 1000"); + break; + case IdentifierType::HD_STATION_LOCATION: { + uint64_t latitudeBit = val & 0x1; + expect(latitudeBit == 1u, "Latitude comes first"); + val >>= 27; + uint64_t latitudePad = val & 0x1Fu; + expect(latitudePad == 0u, "Latitude padding"); + val >>= 5; + uint64_t longitudeBit = val & 0x1; + expect(longitudeBit == 1u, "Longitude comes next"); + val >>= 27; + uint64_t longitudePad = val & 0x1Fu; + expect(longitudePad == 0u, "Latitude padding"); + break; + } + default: + expect(id.type >= IdentifierType::VENDOR_START && id.type <= IdentifierType::VENDOR_END, + "Undefined identifier type"); + break; + } + + return valid; +} + +bool isValidV2(const ProgramSelector& sel) { + if (sel.primaryId.type != IdentifierType::AMFM_FREQUENCY_KHZ && + sel.primaryId.type != IdentifierType::RDS_PI && + sel.primaryId.type != IdentifierType::HD_STATION_ID_EXT && + sel.primaryId.type != IdentifierType::DAB_SID_EXT && + sel.primaryId.type != IdentifierType::DRMO_SERVICE_ID && + sel.primaryId.type != IdentifierType::SXM_SERVICE_ID && + (sel.primaryId.type < IdentifierType::VENDOR_START || + sel.primaryId.type > IdentifierType::VENDOR_END)) { + return false; + } + return isValidV2(sel.primaryId); +} + +std::optional getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag) { + auto isRdsPs = [tag](const Metadata& item) { return item.getTag() == tag; }; + + auto it = std::find_if(info.metadata.begin(), info.metadata.end(), isRdsPs); + if (it == info.metadata.end()) { + return std::nullopt; + } + + std::string metadataString; + switch (it->getTag()) { + case Metadata::rdsPs: + metadataString = it->get(); + break; + case Metadata::rdsPty: + metadataString = std::to_string(it->get()); + break; + case Metadata::rbdsPty: + metadataString = std::to_string(it->get()); + break; + case Metadata::rdsRt: + metadataString = it->get(); + break; + case Metadata::songTitle: + metadataString = it->get(); + break; + case Metadata::songArtist: + metadataString = it->get(); + break; + case Metadata::songAlbum: + metadataString = it->get(); + break; + case Metadata::stationIcon: + metadataString = std::to_string(it->get()); + break; + case Metadata::albumArt: + metadataString = std::to_string(it->get()); + break; + case Metadata::programName: + metadataString = it->get(); + break; + case Metadata::dabEnsembleName: + metadataString = it->get(); + break; + case Metadata::dabEnsembleNameShort: + metadataString = it->get(); + break; + case Metadata::dabServiceName: + metadataString = it->get(); + break; + case Metadata::dabServiceNameShort: + metadataString = it->get(); + break; + case Metadata::dabComponentName: + metadataString = it->get(); + break; + case Metadata::dabComponentNameShort: + metadataString = it->get(); + break; + case Metadata::genre: + metadataString = it->get(); + break; + case Metadata::commentShortDescription: + metadataString = it->get(); + break; + case Metadata::commentActualText: + metadataString = it->get(); + break; + case Metadata::commercial: + metadataString = it->get(); + break; + case Metadata::ufids: { + auto& ufids = it->get(); + metadataString = "["; + for (const auto& ufid : ufids) { + metadataString += std::string(ufid) + ","; + } + if (ufids.empty()) { + metadataString += "]"; + } else { + metadataString[metadataString.size() - 1] = ']'; + } + } break; + case Metadata::hdStationNameShort: + metadataString = it->get(); + break; + case Metadata::hdStationNameLong: + metadataString = it->get(); + break; + case Metadata::hdSubChannelsAvailable: + metadataString = std::to_string(it->get()); + break; + default: + LOG(ERROR) << "Metadata " << it->toString() << " is not converted."; + return std::nullopt; + } + return metadataString; +} + +} // namespace utils + +} // namespace aidl::android::hardware::broadcastradio -- GitLab From 31c541c228d17f2e7461429a6b0611ae3a247c8c Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Thu, 7 Sep 2023 17:00:57 -0700 Subject: [PATCH 216/376] Upgrade default bcRadio AIDL HAL impl to version 2 Bug: 280300929 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I4bc9b24bf421bad8d980de2c82434abdf7cae74c --- broadcastradio/aidl/default/Android.bp | 6 +++--- broadcastradio/aidl/default/BroadcastRadio.cpp | 3 ++- broadcastradio/aidl/default/broadcastradio-default.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp index e95208c0a2..743365a073 100644 --- a/broadcastradio/aidl/default/Android.bp +++ b/broadcastradio/aidl/default/Android.bp @@ -26,11 +26,11 @@ package { cc_defaults { name: "BroadcastRadioHalDefaults", static_libs: [ - "android.hardware.broadcastradio@common-utils-aidl-lib", + "android.hardware.broadcastradio@common-utils-aidl-lib-V2", "android.hardware.broadcastradio@common-utils-lib", ], shared_libs: [ - "android.hardware.broadcastradio-V1-ndk", + "android.hardware.broadcastradio-V2-ndk", "libbase", "libbinder_ndk", "liblog", @@ -84,7 +84,7 @@ cc_fuzz { ], static_libs: [ "DefaultBroadcastRadioHal", - "android.hardware.broadcastradio-V1-ndk", + "android.hardware.broadcastradio-V2-ndk", ], srcs: [ "fuzzer.cpp", diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp index 8584921fba..54186b009d 100644 --- a/broadcastradio/aidl/default/BroadcastRadio.cpp +++ b/broadcastradio/aidl/default/BroadcastRadio.cpp @@ -16,6 +16,7 @@ #include "BroadcastRadio.h" #include +#include #include "resources.h" #include @@ -221,7 +222,7 @@ ScopedAStatus BroadcastRadio::tune(const ProgramSelector& program) { resultToInt(Result::NOT_SUPPORTED), "selector is not supported"); } - if (!utils::isValid(program)) { + if (!utils::isValidV2(program)) { LOG(ERROR) << __func__ << ": selector is not valid: " << program.toString(); return ScopedAStatus::fromServiceSpecificErrorWithMessage( resultToInt(Result::INVALID_ARGUMENTS), "selector is not valid"); diff --git a/broadcastradio/aidl/default/broadcastradio-default.xml b/broadcastradio/aidl/default/broadcastradio-default.xml index acf35f98a5..a57b7247c8 100644 --- a/broadcastradio/aidl/default/broadcastradio-default.xml +++ b/broadcastradio/aidl/default/broadcastradio-default.xml @@ -1,7 +1,7 @@ android.hardware.broadcastradio - 1 + 2 IBroadcastRadio/amfm IBroadcastRadio/dab -- GitLab From 7157173f347dddbee4c6537cb252c193cf08b301 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 31 Oct 2023 16:28:37 +0000 Subject: [PATCH 217/376] Added new VehicleAreConfig.aidl fields to ProtoMessageConverter Bug: 290801790 Test: atest VehicleHalProtoMessageConverterTest Change-Id: I8111bde08861a4b66e0fb9acb08dee2cec39719a --- .../proto_message_converter/src/ProtoMessageConverter.cpp | 2 ++ .../hardware/automotive/vehicle/VehicleAreaConfig.proto | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp index 6b789bb7a9..19911a3c20 100644 --- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp +++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp @@ -67,6 +67,7 @@ void aidlToProto(const aidl_vehicle::VehiclePropConfig& in, proto::VehiclePropCo for (auto& areaConfig : in.areaConfigs) { auto* protoACfg = out->add_area_configs(); protoACfg->set_area_id(areaConfig.areaId); + protoACfg->set_access(static_cast(toInt(areaConfig.access))); protoACfg->set_min_int64_value(areaConfig.minInt64Value); protoACfg->set_max_int64_value(areaConfig.maxInt64Value); protoACfg->set_min_float_value(areaConfig.minFloatValue); @@ -94,6 +95,7 @@ void protoToAidl(const proto::VehiclePropConfig& in, aidl_vehicle::VehiclePropCo auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) { auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{ .areaId = protoAcfg.area_id(), + .access = static_cast(protoAcfg.access()), .minInt32Value = protoAcfg.min_int32_value(), .maxInt32Value = protoAcfg.max_int32_value(), .minInt64Value = protoAcfg.min_int64_value(), diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto index 8093658477..7ea8540cc3 100644 --- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto +++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto @@ -18,6 +18,8 @@ syntax = "proto3"; package android.hardware.automotive.vehicle.proto; +import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto"; + /* Must be in sync with VehicleAreaConfig.aidl. */ message VehicleAreaConfig { /* Area id is ignored for VehiclePropertyGroup:GLOBAL properties. */ @@ -43,6 +45,6 @@ message VehicleAreaConfig { * assumed all @data_enum values are supported unless specified through another mechanism. */ repeated int64 supported_enum_values = 8; - int32 access = 9; + VehiclePropertyAccess access = 9; bool support_variable_update_rate = 10; }; -- GitLab From 1f3f0ac11cb8edac5d4127bd791598fe90430494 Mon Sep 17 00:00:00 2001 From: sadiqsada Date: Tue, 22 Aug 2023 12:41:27 -0700 Subject: [PATCH 218/376] Add IPTV default implementation Frontend::tune(): create a streamer using plugin interface to read a byte and return LOCKED event if byte is read Demux::setFrontendDataSource():open a new stream to read data from the socket and push the data read to DVR FMQ. Test: atest VtsHalTvTunerTargetTest Bug: 288170590 Change-Id: Ibbe85739edc1ed1be50ab29fbc3b63969340186a --- tv/tuner/aidl/default/Android.bp | 1 + tv/tuner/aidl/default/Demux.cpp | 224 ++++++++++++++++++------- tv/tuner/aidl/default/Demux.h | 25 +++ tv/tuner/aidl/default/Dvr.cpp | 32 ++++ tv/tuner/aidl/default/Dvr.h | 15 ++ tv/tuner/aidl/default/Frontend.cpp | 86 +++++++++- tv/tuner/aidl/default/Frontend.h | 9 + tv/tuner/aidl/default/Timer.h | 17 ++ tv/tuner/aidl/default/dtv_plugin.cpp | 130 ++++++++++++++ tv/tuner/aidl/default/dtv_plugin.h | 31 ++++ tv/tuner/aidl/default/dtv_plugin_api.h | 137 +++++++++++++++ 11 files changed, 645 insertions(+), 62 deletions(-) create mode 100644 tv/tuner/aidl/default/Timer.h create mode 100644 tv/tuner/aidl/default/dtv_plugin.cpp create mode 100644 tv/tuner/aidl/default/dtv_plugin.h create mode 100644 tv/tuner/aidl/default/dtv_plugin_api.h diff --git a/tv/tuner/aidl/default/Android.bp b/tv/tuner/aidl/default/Android.bp index 65fa82163a..ed97d9cfc7 100644 --- a/tv/tuner/aidl/default/Android.bp +++ b/tv/tuner/aidl/default/Android.bp @@ -23,6 +23,7 @@ cc_defaults { "TimeFilter.cpp", "Tuner.cpp", "service.cpp", + "dtv_plugin.cpp", ], static_libs: [ "libaidlcommonsupport", diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp index 11e7131220..5be819e991 100644 --- a/tv/tuner/aidl/default/Demux.cpp +++ b/tv/tuner/aidl/default/Demux.cpp @@ -20,7 +20,9 @@ #include #include +#include #include +#include #include "Demux.h" namespace aidl { @@ -29,6 +31,15 @@ namespace hardware { namespace tv { namespace tuner { +using ::aidl::android::hardware::common::fmq::MQDescriptor; +using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite; +using ::android::AidlMessageQueue; +using ::android::hardware::EventFlag; + +using FilterMQ = AidlMessageQueue; +using AidlMQ = AidlMessageQueue; +using AidlMQDesc = MQDescriptor; + #define WAIT_TIMEOUT 3000000000 Demux::Demux(int32_t demuxId, uint32_t filterTypes) { @@ -45,6 +56,111 @@ Demux::~Demux() { close(); } +::ndk::ScopedAStatus Demux::openDvr(DvrType in_type, int32_t in_bufferSize, + const std::shared_ptr& in_cb, + std::shared_ptr* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + if (in_cb == nullptr) { + ALOGW("[Demux] DVR callback can't be null"); + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + + set::iterator it; + switch (in_type) { + case DvrType::PLAYBACK: + mDvrPlayback = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, + this->ref()); + if (!mDvrPlayback->createDvrMQ()) { + ALOGE("[Demux] cannot create dvr message queue"); + mDvrPlayback = nullptr; + *_aidl_return = mDvrPlayback; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); + } + + for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { + if (!mDvrPlayback->addPlaybackFilter(*it, mFilters[*it])) { + ALOGE("[Demux] Can't get filter info for DVR playback"); + mDvrPlayback = nullptr; + *_aidl_return = mDvrPlayback; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); + } + } + + ALOGI("Playback normal case"); + + *_aidl_return = mDvrPlayback; + return ::ndk::ScopedAStatus::ok(); + case DvrType::RECORD: + mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, + this->ref()); + if (!mDvrRecord->createDvrMQ()) { + mDvrRecord = nullptr; + *_aidl_return = mDvrRecord; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::UNKNOWN_ERROR)); + } + + *_aidl_return = mDvrRecord; + return ::ndk::ScopedAStatus::ok(); + default: + *_aidl_return = nullptr; + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } +} + +void Demux::readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf, + size_t buf_size, int timeout_ms, int buffer_timeout) { + Timer *timer, *fullBufferTimer; + while (mDemuxIptvReadThreadRunning) { + if (mIsIptvDvrFMQFull && fullBufferTimer->get_elapsed_time_ms() > buffer_timeout) { + ALOGE("DVR FMQ has not been flushed within timeout of %d ms", buffer_timeout); + delete fullBufferTimer; + break; + } + timer = new Timer(); + ssize_t bytes_read = interface->read_stream(streamer, buf, buf_size, timeout_ms); + if (bytes_read == 0) { + double elapsed_time = timer->get_elapsed_time_ms(); + if (elapsed_time > timeout_ms) { + ALOGE("[Demux] timeout reached - elapsed_time: %f, timeout: %d", elapsed_time, + timeout_ms); + } + ALOGE("[Demux] Cannot read data from the socket"); + delete timer; + break; + } + + delete timer; + ALOGI("Number of bytes read: %zd", bytes_read); + int result = mDvrPlayback->writePlaybackFMQ(buf, bytes_read); + + switch (result) { + case DVR_WRITE_FAILURE_REASON_FMQ_FULL: + if (!mIsIptvDvrFMQFull) { + mIsIptvDvrFMQFull = true; + fullBufferTimer = new Timer(); + } + ALOGI("Waiting for client to flush DVR FMQ."); + break; + case DVR_WRITE_FAILURE_REASON_UNKNOWN: + ALOGE("Failed to write data into DVR FMQ for unknown reason"); + break; + case DVR_WRITE_SUCCESS: + ALOGI("Wrote %d bytes to DVR FMQ", bytes_read); + break; + default: + ALOGI("Invalid DVR Status"); + } + } + mDemuxIptvReadThreadRunning = false; +} + ::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) { ALOGV("%s", __FUNCTION__); @@ -52,7 +168,6 @@ Demux::~Demux() { return ::ndk::ScopedAStatus::fromServiceSpecificError( static_cast(Result::NOT_INITIALIZED)); } - mFrontend = mTuner->getFrontendById(in_frontendId); if (mFrontend == nullptr) { return ::ndk::ScopedAStatus::fromServiceSpecificError( @@ -61,6 +176,58 @@ Demux::~Demux() { mTuner->setFrontendAsDemuxSource(in_frontendId, mDemuxId); + // if mFrontend is an IPTV frontend, create streamer to read TS data from socket + if (mFrontend->getFrontendType() == FrontendType::IPTV) { + // create a DVR instance on the demux + shared_ptr iptvDvr; + + std::shared_ptr dvrPlaybackCallback = + ::ndk::SharedRefBase::make(); + + ::ndk::ScopedAStatus status = + openDvr(DvrType::PLAYBACK, IPTV_BUFFER_SIZE, dvrPlaybackCallback, &iptvDvr); + if (status.isOk()) { + ALOGI("DVR instance created"); + } + + // get plugin interface from frontend + dtv_plugin* interface = mFrontend->getIptvPluginInterface(); + if (interface == nullptr) { + ALOGE("[Demux] getIptvPluginInterface(): plugin interface is null"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); + } + ALOGI("[Demux] getIptvPluginInterface(): plugin interface is not null"); + + // get streamer object from Frontend instance + dtv_streamer* streamer = mFrontend->getIptvPluginStreamer(); + if (streamer == nullptr) { + ALOGE("[Demux] getIptvPluginStreamer(): streamer is null"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_STATE)); + } + ALOGI("[Demux] getIptvPluginStreamer(): streamer is not null"); + + // get transport description from frontend + string transport_desc = mFrontend->getIptvTransportDescription(); + ALOGI("[Demux] getIptvTransportDescription(): transport_desc: %s", transport_desc.c_str()); + + // call read_stream on the socket to populate the buffer with TS data + // while thread is alive, keep reading data + int timeout_ms = 20; + int buffer_timeout = 10000; // 10s + void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE); + if (buf == nullptr) ALOGI("malloc buf failed"); + ALOGI("[ INFO ] Allocated buffer of size %d", IPTV_BUFFER_SIZE); + ALOGI("Getting FMQ from DVR instance to write socket data"); + mDemuxIptvReadThreadRunning = true; + mDemuxIptvReadThread = std::thread(&Demux::readIptvThreadLoop, this, interface, streamer, + buf, IPTV_BUFFER_SIZE, timeout_ms, buffer_timeout); + if (mDemuxIptvReadThread.joinable()) { + mDemuxIptvReadThread.join(); + } + free(buf); + } return ::ndk::ScopedAStatus::ok(); } @@ -193,61 +360,6 @@ Demux::~Demux() { return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus Demux::openDvr(DvrType in_type, int32_t in_bufferSize, - const std::shared_ptr& in_cb, - std::shared_ptr* _aidl_return) { - ALOGV("%s", __FUNCTION__); - - if (in_cb == nullptr) { - ALOGW("[Demux] DVR callback can't be null"); - *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromServiceSpecificError( - static_cast(Result::INVALID_ARGUMENT)); - } - - set::iterator it; - switch (in_type) { - case DvrType::PLAYBACK: - mDvrPlayback = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, - this->ref()); - if (!mDvrPlayback->createDvrMQ()) { - mDvrPlayback = nullptr; - *_aidl_return = mDvrPlayback; - return ::ndk::ScopedAStatus::fromServiceSpecificError( - static_cast(Result::UNKNOWN_ERROR)); - } - - for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) { - if (!mDvrPlayback->addPlaybackFilter(*it, mFilters[*it])) { - ALOGE("[Demux] Can't get filter info for DVR playback"); - mDvrPlayback = nullptr; - *_aidl_return = mDvrPlayback; - return ::ndk::ScopedAStatus::fromServiceSpecificError( - static_cast(Result::UNKNOWN_ERROR)); - } - } - - *_aidl_return = mDvrPlayback; - return ::ndk::ScopedAStatus::ok(); - case DvrType::RECORD: - mDvrRecord = ndk::SharedRefBase::make(in_type, in_bufferSize, in_cb, - this->ref()); - if (!mDvrRecord->createDvrMQ()) { - mDvrRecord = nullptr; - *_aidl_return = mDvrRecord; - return ::ndk::ScopedAStatus::fromServiceSpecificError( - static_cast(Result::UNKNOWN_ERROR)); - } - - *_aidl_return = mDvrRecord; - return ::ndk::ScopedAStatus::ok(); - default: - *_aidl_return = nullptr; - return ::ndk::ScopedAStatus::fromServiceSpecificError( - static_cast(Result::INVALID_ARGUMENT)); - } -} - ::ndk::ScopedAStatus Demux::connectCiCam(int32_t in_ciCamId) { ALOGV("%s", __FUNCTION__); diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h index 7d7aee4c89..a23063f8ad 100644 --- a/tv/tuner/aidl/default/Demux.h +++ b/tv/tuner/aidl/default/Demux.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include @@ -28,7 +29,9 @@ #include "Filter.h" #include "Frontend.h" #include "TimeFilter.h" +#include "Timer.h" #include "Tuner.h" +#include "dtv_plugin.h" using namespace std; @@ -44,6 +47,8 @@ using ::android::AidlMessageQueue; using ::android::hardware::EventFlag; using FilterMQ = AidlMessageQueue; +using AidlMQ = AidlMessageQueue; +using AidlMQDesc = MQDescriptor; class Dvr; class Filter; @@ -51,6 +56,19 @@ class Frontend; class TimeFilter; class Tuner; +class DvrPlaybackCallback : public BnDvrCallback { + public: + virtual ::ndk::ScopedAStatus onPlaybackStatus(PlaybackStatus status) override { + ALOGD("demux.h: playback status %d", status); + return ndk::ScopedAStatus::ok(); + } + + virtual ::ndk::ScopedAStatus onRecordStatus(RecordStatus status) override { + ALOGD("Record Status %hhd", status); + return ndk::ScopedAStatus::ok(); + } +}; + class Demux : public BnDemux { public: Demux(int32_t demuxId, uint32_t filterTypes); @@ -85,6 +103,8 @@ class Demux : public BnDemux { void setIsRecording(bool isRecording); bool isRecording(); void startFrontendInputLoop(); + void readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf, size_t size, + int timeout_ms, int buffer_timeout); /** * A dispatcher to read and dispatch input data to all the started filters. @@ -167,11 +187,16 @@ class Demux : public BnDemux { // Thread handlers std::thread mFrontendInputThread; + std::thread mDemuxIptvReadThread; + + // track whether the DVR FMQ for IPTV Playback is full + bool mIsIptvDvrFMQFull = false; /** * If a specific filter's writing loop is still running */ std::atomic mFrontendInputThreadRunning; + std::atomic mDemuxIptvReadThreadRunning; std::atomic mKeepFetchingDataFromFrontend; /** diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp index c046ae3130..9fad53b70a 100644 --- a/tv/tuner/aidl/default/Dvr.cpp +++ b/tv/tuner/aidl/default/Dvr.cpp @@ -236,6 +236,20 @@ void Dvr::playbackThreadLoop() { ALOGD("[Dvr] playback thread ended."); } +void Dvr::maySendIptvPlaybackStatusCallback() { + lock_guard lock(mPlaybackStatusLock); + int availableToRead = mDvrMQ->availableToRead(); + int availableToWrite = mDvrMQ->availableToWrite(); + + PlaybackStatus newStatus = checkPlaybackStatusChange(availableToWrite, availableToRead, + IPTV_PLAYBACK_STATUS_THRESHOLD_HIGH, + IPTV_PLAYBACK_STATUS_THRESHOLD_LOW); + if (mPlaybackStatus != newStatus) { + mCallback->onPlaybackStatus(newStatus); + mPlaybackStatus = newStatus; + } +} + void Dvr::maySendPlaybackStatusCallback() { lock_guard lock(mPlaybackStatusLock); int availableToRead = mDvrMQ->availableToRead(); @@ -443,6 +457,24 @@ bool Dvr::startFilterDispatcher(bool isVirtualFrontend, bool isRecording) { return true; } +int Dvr::writePlaybackFMQ(void* buf, size_t size) { + lock_guard lock(mWriteLock); + ALOGI("Playback status: %d", mPlaybackStatus); + if (mPlaybackStatus == PlaybackStatus::SPACE_FULL) { + ALOGW("[Dvr] stops writing and wait for the client side flushing."); + return DVR_WRITE_FAILURE_REASON_FMQ_FULL; + } + ALOGI("availableToWrite before: %d", mDvrMQ->availableToWrite()); + if (mDvrMQ->write((int8_t*)buf, size)) { + mDvrEventFlag->wake(static_cast(DemuxQueueNotifyBits::DATA_READY)); + ALOGI("availableToWrite: %d", mDvrMQ->availableToWrite()); + maySendIptvPlaybackStatusCallback(); + return DVR_WRITE_SUCCESS; + } + maySendIptvPlaybackStatusCallback(); + return DVR_WRITE_FAILURE_REASON_UNKNOWN; +} + bool Dvr::writeRecordFMQ(const vector& data) { lock_guard lock(mWriteLock); if (mRecordStatus == RecordStatus::OVERFLOW) { diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h index 293c533cfc..4af187bce4 100644 --- a/tv/tuner/aidl/default/Dvr.h +++ b/tv/tuner/aidl/default/Dvr.h @@ -43,6 +43,19 @@ using ::android::hardware::EventFlag; using DvrMQ = AidlMessageQueue; +const int DVR_WRITE_SUCCESS = 0; +const int DVR_WRITE_FAILURE_REASON_FMQ_FULL = 1; +const int DVR_WRITE_FAILURE_REASON_UNKNOWN = 2; + +const int TS_SIZE = 188; +const int IPTV_BUFFER_SIZE = TS_SIZE * 7 * 8; // defined in service_streamer_udp in cbs v3 project + +// Thresholds are defined to indicate how full the buffers are. +const double HIGH_THRESHOLD_PERCENT = 0.90; +const double LOW_THRESHOLD_PERCENT = 0.15; +const int IPTV_PLAYBACK_STATUS_THRESHOLD_HIGH = IPTV_BUFFER_SIZE * HIGH_THRESHOLD_PERCENT; +const int IPTV_PLAYBACK_STATUS_THRESHOLD_LOW = IPTV_BUFFER_SIZE * LOW_THRESHOLD_PERCENT; + struct MediaEsMetaData { bool isAudio; int startIndex; @@ -80,6 +93,7 @@ class Dvr : public BnDvr { * Return false is any of the above processes fails. */ bool createDvrMQ(); + int writePlaybackFMQ(void* buf, size_t size); bool writeRecordFMQ(const std::vector& data); bool addPlaybackFilter(int64_t filterId, std::shared_ptr filter); bool removePlaybackFilter(int64_t filterId); @@ -102,6 +116,7 @@ class Dvr : public BnDvr { bool readDataFromMQ(); void getMetaDataValue(int& index, int8_t* dataOutputBuffer, int& value); void maySendPlaybackStatusCallback(); + void maySendIptvPlaybackStatusCallback(); void maySendRecordStatusCallback(); PlaybackStatus checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead, int64_t highThreshold, int64_t lowThreshold); diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index cd072bfe8d..6bdbac55ff 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -213,21 +213,83 @@ Frontend::~Frontend() { return ::ndk::ScopedAStatus::ok(); } -::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& /* in_settings */) { - ALOGV("%s", __FUNCTION__); +void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) { + ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms); + if (bytes_read == 0) { + ALOGI("[ ERROR ] Tune byte couldn't be read."); + return; + } + mCallback->onEvent(FrontendEventType::LOCKED); + mIsLocked = true; +} + +::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& in_settings) { if (mCallback == nullptr) { - ALOGW("[ WARN ] Frontend callback is not set when tune"); + ALOGW("[ WARN ] Frontend callback is not set for tunin0g"); return ::ndk::ScopedAStatus::fromServiceSpecificError( static_cast(Result::INVALID_STATE)); } if (mType != FrontendType::IPTV) { mTuner->frontendStartTune(mId); + mCallback->onEvent(FrontendEventType::LOCKED); + mIsLocked = true; + } else { + // This is a reference implementation for IPTV. It uses an additional socket buffer. + // Vendors can use hardware memory directly to make the implementation more performant. + ALOGI("[ INFO ] Frontend type is set to IPTV, tag = %d id=%d", in_settings.getTag(), + mId); + + // load udp plugin for reading TS data + const char* path = "/vendor/lib/iptv_udp_plugin.so"; + DtvPlugin* plugin = new DtvPlugin(path); + if (!plugin) { + ALOGE("Failed to create DtvPlugin, plugin_path is invalid"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + bool plugin_loaded = plugin->load(); + if (!plugin_loaded) { + ALOGE("Failed to load plugin"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + mIptvPluginInterface = plugin->interface(); + + // validate content_url format + std::string content_url = in_settings.get()->contentUrl; + std::string transport_desc = "{ \"uri\": \"" + content_url + "\"}"; + ALOGI("[ INFO ] transport_desc: %s", transport_desc.c_str()); + bool is_transport_desc_valid = plugin->validate(transport_desc.c_str()); + if (!is_transport_desc_valid) { // not of format protocol://ip:port + ALOGE("[ INFO ] transport_desc is not valid"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + mIptvTransportDescription = transport_desc; + + // create a streamer and open it for reading data + dtv_streamer* streamer = mIptvPluginInterface->create_streamer(); + mIptvPluginStreamer = streamer; + int open_fd = mIptvPluginInterface->open_stream(streamer, transport_desc.c_str()); + if (open_fd < 0) { + ALOGE("[ INFO ] could not open stream"); + return ::ndk::ScopedAStatus::fromServiceSpecificError( + static_cast(Result::INVALID_ARGUMENT)); + } + ALOGI("[ INFO ] open_stream successful, open_fd=%d", open_fd); + + size_t buf_size = 1; + int timeout_ms = 2000; + void* buf = malloc(sizeof(char) * buf_size); + if (buf == nullptr) ALOGI("malloc buf failed [TUNE]"); + ALOGI("[ INFO ] [Tune] Allocated buffer of size %zu", buf_size); + mIptvFrontendTuneThread = + std::thread(&Frontend::readTuneByte, this, streamer, buf, buf_size, timeout_ms); + if (mIptvFrontendTuneThread.joinable()) mIptvFrontendTuneThread.join(); + free(buf); } - mCallback->onEvent(FrontendEventType::LOCKED); - mIsLocked = true; - return ::ndk::ScopedAStatus::ok(); } @@ -1002,6 +1064,18 @@ int32_t Frontend::getFrontendId() { return mId; } +dtv_plugin* Frontend::getIptvPluginInterface() { + return mIptvPluginInterface; +} + +string Frontend::getIptvTransportDescription() { + return mIptvTransportDescription; +} + +dtv_streamer* Frontend::getIptvPluginStreamer() { + return mIptvPluginStreamer; +} + bool Frontend::supportsSatellite() { return mType == FrontendType::DVBS || mType == FrontendType::ISDBS || mType == FrontendType::ISDBS3; diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 85bd636cc4..17a1aeeb40 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -21,6 +21,7 @@ #include #include #include "Tuner.h" +#include "dtv_plugin.h" using namespace std; @@ -60,6 +61,10 @@ class Frontend : public BnFrontend { FrontendType getFrontendType(); int32_t getFrontendId(); string getSourceFile(); + dtv_plugin* getIptvPluginInterface(); + string getIptvTransportDescription(); + dtv_streamer* getIptvPluginStreamer(); + void readTuneByte(dtv_streamer* streamer, void* buf, size_t size, int timeout_ms); bool isLocked(); void getFrontendInfo(FrontendInfo* _aidl_return); void setTunerService(std::shared_ptr tuner); @@ -81,6 +86,10 @@ class Frontend : public BnFrontend { std::ifstream mFrontendData; FrontendCapabilities mFrontendCaps; vector mFrontendStatusCaps; + dtv_plugin* mIptvPluginInterface; + string mIptvTransportDescription; + dtv_streamer* mIptvPluginStreamer; + std::thread mIptvFrontendTuneThread; }; } // namespace tuner diff --git a/tv/tuner/aidl/default/Timer.h b/tv/tuner/aidl/default/Timer.h new file mode 100644 index 0000000000..c6327cbbe7 --- /dev/null +++ b/tv/tuner/aidl/default/Timer.h @@ -0,0 +1,17 @@ +#include +using namespace std::chrono; +class Timer { + public: + Timer() { start_time = steady_clock::now(); } + + ~Timer() { stop_time = steady_clock::now(); } + + double get_elapsed_time_ms() { + auto current_time = std::chrono::steady_clock::now(); + return duration_cast(current_time - start_time).count(); + } + + private: + time_point start_time; + time_point stop_time; +}; \ No newline at end of file diff --git a/tv/tuner/aidl/default/dtv_plugin.cpp b/tv/tuner/aidl/default/dtv_plugin.cpp new file mode 100644 index 0000000000..4e73ee5878 --- /dev/null +++ b/tv/tuner/aidl/default/dtv_plugin.cpp @@ -0,0 +1,130 @@ +#include "dtv_plugin.h" +#include +#include +#include + +DtvPlugin::DtvPlugin(const char* plugin_path) { + path_ = plugin_path; + basename_ = basename(path_); + module_ = NULL; + interface_ = NULL; + loaded_ = false; +} + +DtvPlugin::~DtvPlugin() { + if (module_ != NULL) { + if (dlclose(module_)) ALOGE("DtvPlugin: Failed to close plugin '%s'", basename_); + } +} + +bool DtvPlugin::load() { + ALOGI("Loading plugin '%s' from path '%s'", basename_, path_); + + module_ = dlopen(path_, RTLD_LAZY); + if (module_ == NULL) { + ALOGE("DtvPlugin::Load::Failed to load plugin '%s'", basename_); + ALOGE("dlopen error: %s", dlerror()); + return false; + } + + interface_ = (dtv_plugin*)dlsym(module_, "plugin_entry"); + + if (interface_ == NULL) { + ALOGE("plugin_entry is NULL."); + goto error; + } + + if (!interface_->get_transport_types || !interface_->get_streamer_count || + !interface_->validate || !interface_->create_streamer || !interface_->destroy_streamer || + !interface_->open_stream || !interface_->close_stream || !interface_->read_stream) { + ALOGW("Plugin: missing one or more callbacks"); + goto error; + } + + loaded_ = true; + + return true; + +error: + if (dlclose(module_)) ALOGE("Failed to close plugin '%s'", basename_); + + return false; +} + +int DtvPlugin::getStreamerCount() { + if (!loaded_) { + ALOGE("DtvPlugin::GetStreamerCount: Plugin '%s' not loaded!", basename_); + return 0; + } + + return interface_->get_streamer_count(); +} + +bool DtvPlugin::isTransportTypeSupported(const char* transport_type) { + const char** transport; + + if (!loaded_) { + ALOGE("Plugin '%s' not loaded!", basename_); + return false; + } + + transport = interface_->get_transport_types(); + if (transport == NULL) return false; + + while (*transport) { + if (strcmp(transport_type, *transport) == 0) return true; + transport++; + } + + return false; +} + +bool DtvPlugin::validate(const char* transport_desc) { + if (!loaded_) { + ALOGE("Plugin '%s' is not loaded!", basename_); + return false; + } + + return interface_->validate(transport_desc); +} + +bool DtvPlugin::getProperty(const char* key, void* value, int* size) { + if (!loaded_) { + ALOGE("Plugin '%s' is not loaded!", basename_); + return false; + } + + if (!interface_->get_property) return false; + + *size = interface_->get_property(NULL, key, value, *size); + + return *size < 0 ? false : true; +} + +bool DtvPlugin::setProperty(const char* key, const void* value, int size) { + int ret; + + if (!loaded_) { + ALOGE("Plugin '%s': not loaded!", basename_); + return false; + } + + if (!interface_->set_property) return false; + + ret = interface_->set_property(NULL, key, value, size); + + return ret < 0 ? false : true; +} + +struct dtv_plugin* DtvPlugin::interface() { + if (!loaded_) { + ALOGE("Plugin '%s' is not loaded!", basename_); + return NULL; + } + + return interface_; +} + +const char* DtvPlugin::pluginBasename() { + return basename_; +} diff --git a/tv/tuner/aidl/default/dtv_plugin.h b/tv/tuner/aidl/default/dtv_plugin.h new file mode 100644 index 0000000000..0ee5489d2a --- /dev/null +++ b/tv/tuner/aidl/default/dtv_plugin.h @@ -0,0 +1,31 @@ +#ifndef LIVE_DTV_PLUGIN_H_ +#define LIVE_DTV_PLUGIN_H_ + +#include +#include "dtv_plugin_api.h" + +class DtvPlugin { + public: + DtvPlugin(const char* plugin_path); + ~DtvPlugin(); + + bool load(); + int getStreamerCount(); + bool validate(const char* transport_desc); + bool isTransportTypeSupported(const char* transport_type); + // /* plugin-wide properties */ + bool getProperty(const char* key, void* value, int* size); + bool setProperty(const char* key, const void* value, int size); + + struct dtv_plugin* interface(); + const char* pluginBasename(); + + protected: + const char* path_; + char* basename_; + void* module_; + struct dtv_plugin* interface_; + bool loaded_; +}; + +#endif // LIVE_DTV_PLUGIN_H_ diff --git a/tv/tuner/aidl/default/dtv_plugin_api.h b/tv/tuner/aidl/default/dtv_plugin_api.h new file mode 100644 index 0000000000..8fe7c1d24e --- /dev/null +++ b/tv/tuner/aidl/default/dtv_plugin_api.h @@ -0,0 +1,137 @@ +#ifndef LIVE_DTV_PLUGIN_API_H_ +#define LIVE_DTV_PLUGIN_API_H_ + +#include + +struct dtv_streamer; + +struct dtv_plugin { + uint32_t version; + + /** + * get_transport_types() - Retrieve a list of supported transport types. + * + * Return: A NULL-terminated list of supported transport types. + */ + const char** (*get_transport_types)(void); + + /** + * get_streamer_count() - Get number of streamers that can be created. + * + * Return: The number of streamers that can be created. + */ + int (*get_streamer_count)(void); + + /** + * validate() - Check if transport description is valid. + * @transport_desc: NULL-terminated transport description in json format. + * + * Return: 1 if valid, 0 otherwise. + */ + int (*validate)(const char* transport_desc); + + /** + * create_streamer() - Create a streamer object. + * + * Return: A pointer to a new streamer object. + */ + struct dtv_streamer* (*create_streamer)(void); + + /** + * destroy_streamer() - Free a streamer object and all associated resources. + * @st: Pointer to a streamer object + */ + void (*destroy_streamer)(struct dtv_streamer* streamer); + + /** + * set_property() - Set a key/value pair property. + * @streamer: Pointer to a streamer object (may be NULL for plugin-wide properties). + * @key: NULL-terminated property name. + * @value: Property value. + * @size: Property value size. + * + * Return: 0 if success, -1 otherwise. + */ + int (*set_property)(struct dtv_streamer* streamer, const char* key, const void* value, + size_t size); + + /** + * get_property() - Get a property's value. + * @streamer: Pointer to a streamer (may be NULL for plugin-wide properties). + * @key: NULL-terminated property name. + * @value: Property value. + * @size: Property value size. + * + * Return: >= 0 if success, -1 otherwise. + * + * If size is 0, get_property will return the size needed to hold the value. + */ + int (*get_property)(struct dtv_streamer* streamer, const char* key, void* value, size_t size); + + /** + * add_pid() - Add a TS filter on a given pid. + * @streamer: The streamer that outputs the TS. + * @pid: The pid to add to the TS output. + * + * Return: 0 if success, -1 otherwise. + * + * This function is optional but can be useful if a hardware remux is + * available. + */ + int (*add_pid)(struct dtv_streamer* streamer, int pid); + + /** + * remove_pid() - Remove a TS filter on a given pid. + * @streamer: The streamer that outputs the TS. + * @pid: The pid to remove from the TS output. + * + * Return: 0 if success, -1 otherwise. + * + * This function is optional. + */ + int (*remove_pid)(struct dtv_streamer* streamer, int pid); + + /** + * open_stream() - Open a stream from a transport description. + * @streamer: The streamer which will handle the stream. + * @transport_desc: NULL-terminated transport description in json format. + * + * The streamer will allocate the resources and make the appropriate + * connections to handle this transport. + * This function returns a file descriptor that can be polled for events. + * + * Return: A file descriptor if success, -1 otherwise. + */ + int (*open_stream)(struct dtv_streamer* streamer, const char* transport_desc); + + /** + * close_stream() - Release an open stream. + * @streamer: The streamer from which the stream should be released. + */ + void (*close_stream)(struct dtv_streamer* streamer); + + /** + * read_stream() - Read stream data. + * @streamer: The streamer to read from. + * @buf: The destination buffer. + * @count: The number of bytes to read. + * @timeout_ms: Timeout in ms. + * + * Return: The number of bytes read, -1 if error. + */ + ssize_t (*read_stream)(struct dtv_streamer* streamer, void* buf, size_t count, int timeout_ms); +}; + +struct dtv_plugin_event { + int id; + char data[0]; +}; + +enum { + DTV_PLUGIN_EVENT_SIGNAL_LOST = 1, + DTV_PLUGIN_EVENT_SIGNAL_READY, +}; + +#define PROPERTY_STATISTICS "statistics" + +#endif // LIVE_DTV_PLUGIN_API_H_ -- GitLab From d59b506c84de62bb7849ba399f64bc6429ed9505 Mon Sep 17 00:00:00 2001 From: Vlad Popa Date: Tue, 31 Oct 2023 12:33:20 -0700 Subject: [PATCH 219/376] CSD: remove unused library Test: manual build Bug: 209491695 Change-Id: I4eabeb92c0882db61bb530b438e59fb990d3c351 --- audio/aidl/default/Android.bp | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp index de247f1da5..8710758e71 100644 --- a/audio/aidl/default/Android.bp +++ b/audio/aidl/default/Android.bp @@ -39,38 +39,6 @@ cc_defaults { ], } -cc_library { - name: "libaudioservicesounddoseimpl", - vendor: true, - defaults: [ - "latest_android_media_audio_common_types_ndk_shared", - "latest_android_hardware_audio_core_sounddose_ndk_shared", - "latest_android_hardware_audio_sounddose_ndk_shared", - ], - export_include_dirs: ["include"], - srcs: [ - "SoundDose.cpp", - ], - shared_libs: [ - "libaudio_aidl_conversion_common_ndk", - "libaudioutils", - "libbase", - "libbinder_ndk", - "libcutils", - "libutils", - ], - cflags: [ - "-Wall", - "-Wextra", - "-Werror", - "-Wthread-safety", - "-DBACKEND_NDK", - ], - visibility: [ - "//hardware/interfaces/audio/aidl/sounddose/default", - ], -} - cc_library { name: "libaudioserviceexampleimpl", defaults: [ -- GitLab From 6f1af8f9f7e2d6f22f3d1eea774d4f4087bab5f1 Mon Sep 17 00:00:00 2001 From: Shunkai Yao Date: Tue, 10 Oct 2023 19:26:07 +0000 Subject: [PATCH 220/376] Add defaults for audio AIDL interfaces - with defaults user don't have to change their Android.bp when there is a update - update AIDL audio interfaces with android.media.audio.common.types - update Spatialization and HeadTracking AIDL usage Bug: 273373363 Bug: 293370815 Test: m Test: lunch panther-trunk_staging-userdebug; m; test Bluetooth Audio Change-Id: Ic9d8afc1d4e19e4243c66065b0a5d29156632851 Merged-In: Ic9d8afc1d4e19e4243c66065b0a5d29156632851 --- audio/aidl/Android.bp | 71 +++++++++++++------ audio/aidl/common/Android.bp | 8 ++- audio/aidl/default/Android.bp | 6 +- ...oid.hardware.audio.effect.service-aidl.xml | 2 +- .../android.hardware.audio.service-aidl.xml | 8 +-- audio/aidl/sounddose/Android.bp | 4 +- audio/aidl/vts/Android.bp | 2 +- automotive/audiocontrol/aidl/Android.bp | 39 ++++++++-- .../aidl/default/audiocontrol-default.xml | 2 +- automotive/audiocontrol/aidl/vts/Android.bp | 4 +- bluetooth/audio/aidl/Android.bp | 23 +++++- bluetooth/audio/aidl/default/Android.bp | 4 +- .../audio/aidl/default/bluetooth_audio.xml | 2 +- bluetooth/audio/aidl/vts/Android.bp | 6 +- bluetooth/audio/utils/Android.bp | 4 +- common/aidl/Android.bp | 2 +- .../compatibility_matrix.9.xml | 12 ++-- .../exclude/fcm_exclude.cpp | 1 + soundtrigger/aidl/Android.bp | 14 +++- 19 files changed, 155 insertions(+), 59 deletions(-) diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp index 5a009fe674..0ab990a670 100644 --- a/audio/aidl/Android.bp +++ b/audio/aidl/Android.bp @@ -34,6 +34,7 @@ aidl_interface { name: "android.hardware.audio.common", defaults: [ "android.hardware.audio_defaults", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/common/AudioOffloadMetadata.aidl", @@ -42,10 +43,7 @@ aidl_interface { "android/hardware/audio/common/SinkMetadata.aidl", "android/hardware/audio/common/SourceMetadata.aidl", ], - frozen: true, - imports: [ - "android.media.audio.common.types-V2", - ], + frozen: false, backend: { cpp: { enabled: true, @@ -83,7 +81,7 @@ aidl_interface { } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_common = "android.hardware.audio.common-V2" +latest_android_hardware_audio_common = "android.hardware.audio.common-V3" // Modules that depend on android.hardware.audio.common directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -109,10 +107,21 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_common_import_interface", + imports: [ + latest_android_hardware_audio_common, + ], +} + aidl_interface { name: "android.hardware.audio.core", defaults: [ "android.hardware.audio_defaults", + "latest_android_hardware_audio_common_import_interface", + "latest_android_hardware_audio_core_sounddose_import_interface", + "latest_android_hardware_audio_effect_import_interface", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/core/AudioPatch.aidl", @@ -137,10 +146,6 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V2", - "android.hardware.audio.core.sounddose-V1", - "android.hardware.audio.effect-V1", - "android.media.audio.common.types-V2", ], backend: { // The C++ backend is disabled transitively due to use of FMQ. @@ -167,11 +172,11 @@ aidl_interface { // IMPORTANT: Update latest_android_hardware_audio_core every time you // add the latest frozen version to versions_with_info ], - frozen: true, + frozen: false, } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_core = "android.hardware.audio.core-V1" +latest_android_hardware_audio_core = "android.hardware.audio.core-V2" // Modules that depend on android.hardware.audio.core directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -190,18 +195,23 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_core_import_interface", + imports: [ + latest_android_hardware_audio_core, + ], +} + // Used for the standalone sounddose HAL aidl_interface { name: "android.hardware.audio.core.sounddose", defaults: [ "android.hardware.audio_defaults", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/core/sounddose/ISoundDose.aidl", ], - imports: [ - "android.media.audio.common.types-V2", - ], backend: { // The C++ backend is disabled transitively due to use of FMQ by the core HAL. cpp: { @@ -220,11 +230,11 @@ aidl_interface { // IMPORTANT: Update latest_android_hardware_audio_core_sounddose every time you // add the latest frozen version to versions_with_info ], - frozen: true, + frozen: false, } // Note: This should always be one version ahead of the last frozen version -latest_android_hardware_audio_core_sounddose = "android.hardware.audio.core.sounddose-V1" +latest_android_hardware_audio_core_sounddose = "android.hardware.audio.core.sounddose-V2" // Modules that depend on android.hardware.audio.core.sounddose directly can include // the following cc_defaults to avoid explicitly managing dependency versions @@ -236,6 +246,13 @@ cc_defaults { ], } +cc_defaults { + name: "latest_android_hardware_audio_core_sounddose_ndk_export_shared_lib_header", + export_shared_lib_headers: [ + latest_android_hardware_audio_core_sounddose + "-ndk", + ], +} + cc_defaults { name: "latest_android_hardware_audio_core_sounddose_ndk_static", static_libs: [ @@ -243,10 +260,19 @@ cc_defaults { ], } +aidl_interface_defaults { + name: "latest_android_hardware_audio_core_sounddose_import_interface", + imports: [ + latest_android_hardware_audio_core_sounddose, + ], +} + aidl_interface { name: "android.hardware.audio.effect", defaults: [ "android.hardware.audio_defaults", + "latest_android_hardware_audio_common_import_interface", + "latest_android_media_audio_common_types_import_interface", ], srcs: [ "android/hardware/audio/effect/AcousticEchoCanceler.aidl", @@ -280,8 +306,6 @@ aidl_interface { imports: [ "android.hardware.common-V2", "android.hardware.common.fmq-V1", - "android.hardware.audio.common-V2", - "android.media.audio.common.types-V2", ], backend: { // The C++ backend is disabled transitively due to use of FMQ. @@ -303,11 +327,11 @@ aidl_interface { ], }, ], - frozen: true, + frozen: false, } -latest_android_hardware_audio_effect = "android.hardware.audio.effect-V1" +latest_android_hardware_audio_effect = "android.hardware.audio.effect-V2" cc_defaults { name: "latest_android_hardware_audio_effect_ndk_shared", @@ -322,3 +346,10 @@ cc_defaults { latest_android_hardware_audio_effect + "-ndk", ], } + +aidl_interface_defaults { + name: "latest_android_hardware_audio_effect_import_interface", + imports: [ + latest_android_hardware_audio_effect, + ], +} diff --git a/audio/aidl/common/Android.bp b/audio/aidl/common/Android.bp index 4c6a74e563..85ece3b026 100644 --- a/audio/aidl/common/Android.bp +++ b/audio/aidl/common/Android.bp @@ -45,8 +45,8 @@ cc_library { name: "libaudioaidlranges", host_supported: true, vendor_available: true, - static_libs: [ - "android.hardware.audio.effect-V1-ndk", + defaults: [ + "latest_android_hardware_audio_effect_ndk_shared", ], export_include_dirs: ["include"], header_libs: ["libaudioaidl_headers"], @@ -59,8 +59,10 @@ cc_test { name: "libaudioaidlcommon_test", host_supported: true, vendor_available: true, + defaults: [ + "latest_android_media_audio_common_types_ndk_static", + ], static_libs: [ - "android.media.audio.common.types-V1-ndk", "libaudioaidlcommon", ], shared_libs: [ diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp index 9aa86b58c3..06984c33c4 100644 --- a/audio/aidl/default/Android.bp +++ b/audio/aidl/default/Android.bp @@ -69,6 +69,7 @@ cc_library { "latest_android_media_audio_common_types_ndk_shared", "latest_android_hardware_audio_core_ndk_shared", "latest_android_hardware_audio_core_sounddose_ndk_shared", + "latest_android_hardware_bluetooth_audio_ndk_shared", ], export_include_dirs: ["include"], srcs: [ @@ -116,7 +117,6 @@ cc_library { "audio_policy_engine_configuration_aidl_default", ], shared_libs: [ - "android.hardware.bluetooth.audio-V3-ndk", "libaudio_aidl_conversion_common_ndk", "libbluetooth_audio_session_aidl", "libmedia_helper", @@ -141,15 +141,15 @@ cc_binary { vintf_fragments: ["android.hardware.audio.service-aidl.xml"], defaults: [ "aidlaudioservice_defaults", - "latest_android_media_audio_common_types_ndk_shared", "latest_android_hardware_audio_core_sounddose_ndk_shared", "latest_android_hardware_audio_core_ndk_shared", + "latest_android_hardware_bluetooth_audio_ndk_shared", + "latest_android_media_audio_common_types_ndk_shared", ], static_libs: [ "libaudioserviceexampleimpl", ], shared_libs: [ - "android.hardware.bluetooth.audio-V3-ndk", "libaudio_aidl_conversion_common_ndk", "libbluetooth_audio_session_aidl", "libmedia_helper", diff --git a/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml b/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml index fdc53a339c..05a825db1b 100644 --- a/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml +++ b/audio/aidl/default/android.hardware.audio.effect.service-aidl.xml @@ -1,7 +1,7 @@ android.hardware.audio.effect - 1 + 2 IFactory/default diff --git a/audio/aidl/default/android.hardware.audio.service-aidl.xml b/audio/aidl/default/android.hardware.audio.service-aidl.xml index 57f61c9b2c..2a518763f1 100644 --- a/audio/aidl/default/android.hardware.audio.service-aidl.xml +++ b/audio/aidl/default/android.hardware.audio.service-aidl.xml @@ -1,22 +1,22 @@ android.hardware.audio.core - 1 + 2 IModule/default android.hardware.audio.core - 1 + 2 IModule/r_submix android.hardware.audio.core - 1 + 2 IModule/bluetooth android.hardware.audio.core - 1 + 2 IConfig/default enrollment success (true/false) + // | |--> progress_steps + // | + // |-->enrollment id + // + // + // progress_steps + // -[acquiredInfo,...]+ + // ---------------------------- --------------------- + // | |-> sequence of acquiredInfo code + // | --> time duration of the step in ms + // + // E.g. 1:2000-[21,1108,5,6,1],1000-[1113,4,1]:true + // A success enrollement of id 1 by 2 steps + // 1st step lasts 2000ms with acquiredInfo codes (21,1108,5,6,1) + // 2nd step lasts 1000ms with acquiredInfo codes (1113,4,1) + // + std::string defaultNextEnrollment = + "1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true"; + auto nextEnroll = FaceHalProperties::next_enrollment().value_or(defaultNextEnrollment); + auto parts = Util::split(nextEnroll, ":"); + if (parts.size() != 3) { + LOG(ERROR) << "Fail: invalid next_enrollment:" << nextEnroll; cb->onError(Error::VENDOR, 0 /* vendorError */); return; } - auto enrollmentId = std::stoi(parts[0]); - const int numBuckets = parts.size() - 1; - for (size_t i = 1; i < parts.size(); i++) { - auto enrollHit = Util::split(parts[i], ":"); - if (enrollHit.size() != 3) { - LOG(ERROR) << "Error when unpacking enrollment hit: " << parts[i]; - cb->onError(Error::VENDOR, 0 /* vendorError */); - } - std::string bucket = enrollHit[0]; - std::string delay = enrollHit[1]; - std::string succeeds = enrollHit[2]; - - SLEEP_MS(std::stoi(delay)); - - if (shouldCancel(cancel)) { - LOG(ERROR) << "Fail: cancel"; - cb->onError(Error::CANCELED, 0 /* vendorCode */); - return; + auto progress = Util::parseEnrollmentCapture(parts[1]); + for (size_t i = 0; i < progress.size(); i += 2) { + auto left = (progress.size() - i) / 2 - 1; + auto duration = progress[i][0]; + auto acquired = progress[i + 1]; + auto N = acquired.size(); + + for (int j = 0; j < N; j++) { + SLEEP_MS(duration / N); + + if (shouldCancel(cancel)) { + LOG(ERROR) << "Fail: cancel"; + cb->onError(Error::CANCELED, 0 /* vendorCode */); + return; + } + EnrollmentFrame frame = {}; + auto ac = convertAcquiredInfo(acquired[j]); + frame.data.acquiredInfo = ac.first; + frame.data.vendorCode = ac.second; + frame.stage = (i == 0 && j == 0) ? EnrollmentStage::FIRST_FRAME_RECEIVED + : (i == progress.size() - 2 && j == N - 1) + ? EnrollmentStage::ENROLLMENT_FINISHED + : EnrollmentStage::WAITING_FOR_CENTERING; + cb->onEnrollmentFrame(frame); } - if (!IS_TRUE(succeeds)) { // end and failed - LOG(ERROR) << "Fail: requested by caller: " << parts[i]; + if (left == 0 && !IS_TRUE(parts[2])) { // end and failed + LOG(ERROR) << "Fail: requested by caller: " << nextEnroll; + FaceHalProperties::next_enrollment({}); cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); - return; - } - - EnrollmentFrame frame; - - frame.data.acquiredInfo = AcquiredInfo::GOOD; - frame.data.vendorCode = 0; - cb->onEnrollmentFrame(frame); - - frame.data.acquiredInfo = AcquiredInfo::VENDOR; - frame.data.vendorCode = std::stoi(bucket); - cb->onEnrollmentFrame(frame); - - int remainingBuckets = numBuckets - i; - if (remainingBuckets > 0) { - cb->onEnrollmentProgress(enrollmentId, remainingBuckets); + } else { // progress and update props if last time + LOG(INFO) << "onEnroll: " << enrollmentId << " left: " << left; + if (left == 0) { + auto enrollments = FaceHalProperties::enrollments(); + enrollments.emplace_back(enrollmentId); + FaceHalProperties::enrollments(enrollments); + FaceHalProperties::next_enrollment({}); + // change authenticatorId after new enrollment + auto id = FaceHalProperties::authenticator_id().value_or(0); + auto newId = id + 1; + FaceHalProperties::authenticator_id(newId); + LOG(INFO) << "Enrolled: " << enrollmentId; + } + cb->onEnrollmentProgress(enrollmentId, left); } } - - auto enrollments = FaceHalProperties::enrollments(); - enrollments.push_back(enrollmentId); - FaceHalProperties::enrollments(enrollments); - LOG(INFO) << "enrolled : " << enrollmentId; - cb->onEnrollmentProgress(enrollmentId, 0); } void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/, diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md index 516a7aaea7..922525836d 100644 --- a/biometrics/face/aidl/default/README.md +++ b/biometrics/face/aidl/default/README.md @@ -1,30 +1,35 @@ # Face Virtual HAL (VHAL) -This is a virtual HAL implementation that is backed by system properties -instead of actual hardware. It's intended for testing and UI development -on debuggable builds to allow devices to masquerade as alternative device -types and for emulators. -Note: The virtual face HAL feature development will be done in phases. Refer to this doc often for -the latest supported features +This is a virtual HAL implementation that is backed by system properties instead +of actual hardware. It's intended for testing and UI development on debuggable +builds to allow devices to masquerade as alternative device types and for +emulators. Note: The virtual face HAL feature development will be done in +phases. Refer to this doc often for the latest supported features ## Supported Devices -The face virtual hal is automatically built in in all debug builds (userdebug and eng) for the latest pixel devices and CF. -The instructions in this doc applies to all +The face virtual hal is automatically built in in all debug builds (userdebug
    +and eng) for the latest pixel devices and CF. The instructions in this doc
    +applies to all ## Enabling Face Virtual HAL -On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is not enabled. Therefore real Face HAL is used. -Face VHAL enabling is gated by the following two AND conditions: -1. The Face VHAL feature flag (as part of Trunk-development strategy) must be tured until the flags life-cycle ends. -2. The Face VHAL must be enabled via sysprop -See adb commands below +On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is
    +not enabled. Therefore real Face HAL is used. Face VHAL enabling is gated by the
    +following two AND conditions:
    +1. The Face VHAL feature flag (as part ofTrunk-development strategy) must be
    + turned on until the flags life-cycle ends. +2. The Face VHAL must be enabled via sysprop. -##Getting Stared +See the adb commands below -A basic use case for a successful authentication via Face VHAL is given as an exmple below. +## Getting Stared + +A basic use case for a successful authentication via Face VHAL is given as an +exmple below. ### Enabling VHAL + ```shell $ adb root $ adb shell device_config put biometrics_framework com.android.server.biometrics.face_vhal_feature true @@ -35,6 +40,7 @@ $ adb reboot ``` ### Direct Enrollment + ```shell $ adb shell locksettings set-pin 0000 $ adb shell setprop persist.vendor.face.virtual.enrollments 1 @@ -42,22 +48,47 @@ $ adb shell cmd face syncadb shell cmd face sync ``` ## Authenticating -To authenticate successfully, the captured (hit) must match the enrollment id set above. To trigger -authentication failure, set the hit id to a different value. + +To authenticate successfully, the captured (hit) must match the enrollment id
    +set above. To trigger authentication failure, set the hit id to a different value. ```shell $ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 $ adb shell setprop vendor.face.virtual.enrollment_hit 1 ``` -Refer to face.sysprop for full supported features of authentication, such as error and acquiredInfo insertion +### AcquiredInfo +AcquiredInfo codes can be sent during authentication by specifying the sysprop.
    +The codes is sent in sequence and in the interval of operation_authentication_duration/numberOfAcquiredInfoCode +```shell +$ adb shell setprop vendor.face.virtual.operation_authenticate_acquired 6,9,1013 +``` +Refer to [AcquiredInfo.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl) for full face acquiredInfo codes. +Note: For vendor specific acquired info, acquiredInfo = 1000 + vendorCode. + +### Error Insertion +Error can be inserted during authentction by specifying the authenticate_error sysprop. +```shell +$ adb shell setprop vendor.face.virtual.operation_authenticate_error 4 +``` +Refer to [Error.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl) for full face error codes + + +## Enrollment via Settings -## Enrollment via Setup +Enrollment process is specified by sysprop `next_enrollment` in the following format ```shell -# authenticar_id,bucket_id:duration:(true|false).... -$ adb shell setprop vendor.face.virtual.next_enrollment 1,0:500:true,5:250:true,10:150:true,15:500:true -$ walk thru the manual enrollment process by following screen instructions +Format: : + ----:-----------------------------------:--------- + | | |--->sucess (true/false) + | |--> progress_step(s) + | + |-->enrollment_id -# If you would like to get rid of the enrollment, run the follwoing command -$ adb shell setprop persist.vendor.face.virtual.enrollments \"\" +E.g. +$ adb shell setprop vendor.face.virtual.next_enrollment 1:6000-[21,8,1,1108,1,10,1113,1,1118,1124]:true ``` +If next_enrollment prop is not set, the following default value is used:
    +  defaultNextEnrollment="1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true"
    +Note: Enrollment data and configuration can be supported upon request in case of needs + diff --git a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp index 6897dc4aba..69c9bf457b 100644 --- a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp +++ b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp @@ -45,6 +45,7 @@ class TestSessionCallback : public BnSessionCallback { }; ::ndk::ScopedAStatus onEnrollmentProgress(int32_t enrollmentId, int32_t remaining) override { if (remaining == 0) mLastEnrolled = enrollmentId; + mRemaining = remaining; return ndk::ScopedAStatus::ok(); }; @@ -128,6 +129,7 @@ class TestSessionCallback : public BnSessionCallback { bool mAuthenticatorIdInvalidated = false; bool mLockoutPermanent = false; int mInteractionDetectedCount = 0; + int mRemaining = -1; }; class FakeFaceEngineTest : public ::testing::Test { @@ -193,7 +195,7 @@ TEST_F(FakeFaceEngineTest, AuthenticatorIdInvalidate) { } TEST_F(FakeFaceEngineTest, Enroll) { - FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:true"); + FaceHalProperties::next_enrollment("1,0:1000-[21,5,6,7,1],1100-[1118,1108,1]:true"); keymaster::HardwareAuthToken hat{.mac = {2, 4}}; mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, mCancel.get_future()); @@ -201,10 +203,11 @@ TEST_F(FakeFaceEngineTest, Enroll) { ASSERT_EQ(1, FaceHalProperties::enrollments().size()); ASSERT_EQ(1, FaceHalProperties::enrollments()[0].value()); ASSERT_EQ(1, mCallback->mLastEnrolled); + ASSERT_EQ(0, mCallback->mRemaining); } TEST_F(FakeFaceEngineTest, EnrollFails) { - FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false"); + FaceHalProperties::next_enrollment("1,0:1000-[21,5,6,7,1],1100-[1118,1108,1]:false"); keymaster::HardwareAuthToken hat{.mac = {2, 4}}; mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, mCancel.get_future()); @@ -213,7 +216,7 @@ TEST_F(FakeFaceEngineTest, EnrollFails) { } TEST_F(FakeFaceEngineTest, EnrollCancel) { - FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false"); + FaceHalProperties::next_enrollment("1:2000-[21,8,9],300:false"); keymaster::HardwareAuthToken hat{.mac = {2, 4}}; mCancel.set_value(); mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/, @@ -221,7 +224,7 @@ TEST_F(FakeFaceEngineTest, EnrollCancel) { ASSERT_EQ(Error::CANCELED, mCallback->mError); ASSERT_EQ(-1, mCallback->mLastEnrolled); ASSERT_EQ(0, FaceHalProperties::enrollments().size()); - ASSERT_FALSE(FaceHalProperties::next_enrollment().has_value()); + ASSERT_TRUE(FaceHalProperties::next_enrollment().has_value()); } TEST_F(FakeFaceEngineTest, Authenticate) { -- GitLab From 0afb3e8202b984415a4720337a1df8e50c171a56 Mon Sep 17 00:00:00 2001 From: Diya Bera Date: Tue, 5 Dec 2023 10:15:35 -0800 Subject: [PATCH 305/376] Add @hide to AIDL interfaces Test: N/A Bug: 303480396 Change-Id: I51aab72929a9242b513dfa836e682ed29bf4cbc0 --- .../android/hardware/biometrics/face/AcquiredInfo.aidl | 1 + .../android/hardware/biometrics/face/AuthenticationFrame.aidl | 1 + .../current/android/hardware/biometrics/face/BaseFrame.aidl | 1 + .../current/android/hardware/biometrics/face/Cell.aidl | 1 + .../android/hardware/biometrics/face/EnrollmentFrame.aidl | 1 + .../android/hardware/biometrics/face/EnrollmentStage.aidl | 1 + .../hardware/biometrics/face/EnrollmentStageConfig.aidl | 1 + .../android/hardware/biometrics/face/EnrollmentType.aidl | 1 + .../current/android/hardware/biometrics/face/Error.aidl | 1 + .../android/hardware/biometrics/face/FaceEnrollOptions.aidl | 1 + .../android/hardware/biometrics/face/FaceSensorType.aidl | 1 + .../current/android/hardware/biometrics/face/Feature.aidl | 1 + .../current/android/hardware/biometrics/face/IFace.aidl | 1 + .../current/android/hardware/biometrics/face/ISession.aidl | 1 + .../android/hardware/biometrics/face/ISessionCallback.aidl | 1 + .../current/android/hardware/biometrics/face/SensorProps.aidl | 1 + .../aidl/android/hardware/biometrics/face/AcquiredInfo.aidl | 4 +++- .../android/hardware/biometrics/face/AuthenticationFrame.aidl | 1 + .../face/aidl/android/hardware/biometrics/face/BaseFrame.aidl | 1 + .../face/aidl/android/hardware/biometrics/face/Cell.aidl | 1 + .../android/hardware/biometrics/face/EnrollmentFrame.aidl | 1 + .../android/hardware/biometrics/face/EnrollmentStage.aidl | 1 + .../hardware/biometrics/face/EnrollmentStageConfig.aidl | 3 +++ .../aidl/android/hardware/biometrics/face/EnrollmentType.aidl | 3 +++ .../face/aidl/android/hardware/biometrics/face/Error.aidl | 4 +++- .../android/hardware/biometrics/face/FaceEnrollOptions.aidl | 1 + .../aidl/android/hardware/biometrics/face/FaceSensorType.aidl | 3 +++ .../face/aidl/android/hardware/biometrics/face/Feature.aidl | 3 +++ .../face/aidl/android/hardware/biometrics/face/IFace.aidl | 3 +++ .../face/aidl/android/hardware/biometrics/face/ISession.aidl | 1 + .../android/hardware/biometrics/face/ISessionCallback.aidl | 3 +++ .../aidl/android/hardware/biometrics/face/SensorProps.aidl | 3 +++ 32 files changed, 50 insertions(+), 2 deletions(-) diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl index 5312ca16d6..1420cdcee5 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum AcquiredInfo { UNKNOWN, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl index 20bc76779b..bbaca1249a 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable AuthenticationFrame { android.hardware.biometrics.face.BaseFrame data; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl index 67b5cf4169..1dd0a9c3d4 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable BaseFrame { android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl index 6be8c8e975..d423a69e95 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable Cell { int x; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl index 0ea10d6ddb..90be5d0ad4 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable EnrollmentFrame { @nullable android.hardware.biometrics.face.Cell cell; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl index a203dbec18..89b06ca2b0 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum EnrollmentStage { UNKNOWN, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index 48db2cf615..ee1c01ade2 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable EnrollmentStageConfig { android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl index da1e8a3e95..180ea5dcf2 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum EnrollmentType { DEFAULT, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl index 28eb420587..5761e31653 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum Error { UNKNOWN, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl index 23fa1474c9..c96153112d 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable FaceEnrollOptions { android.hardware.keymaster.HardwareAuthToken hardwareAuthToken; diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl index bf1677ceec..ec03733a3f 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum FaceSensorType { UNKNOWN, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl index 924e6af44e..3337df8688 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @Backing(type="byte") @VintfStability enum Feature { REQUIRE_ATTENTION, diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl index fc4a4d04bb..1ae76de543 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability interface IFace { android.hardware.biometrics.face.SensorProps[] getSensorProps(); diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl index 4d99f5a562..b655d5f5b2 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability interface ISession { void generateChallenge(); diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl index bbace29aa0..c6c035b1d0 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability interface ISessionCallback { void onChallengeGenerated(in long challenge); diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl index 8b3c51bb12..918332b85d 100644 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl @@ -32,6 +32,7 @@ // later when a module using the interface is updated, e.g., Mainline modules. package android.hardware.biometrics.face; +/* @hide */ @VintfStability parcelable SensorProps { android.hardware.biometrics.common.CommonProps commonProps; diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl index cf68421062..48b3e8c4cc 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.face; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum AcquiredInfo { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl index be61a20c6f..08ef9730d1 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -20,6 +20,7 @@ import android.hardware.biometrics.face.BaseFrame; /** * Describes an individual frame captured during authentication. + * @hide */ @VintfStability parcelable AuthenticationFrame { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl index 58ad01a0c0..e407d915f8 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl @@ -22,6 +22,7 @@ import android.hardware.biometrics.face.AcquiredInfo; * Metadata of an individual frame. Can be used by the framework to provide user feedback. * This parcelable is part of AuthenticationFrame and EnrollmentFrame, and shouldn't be used * independently of those parcelables. + * @hide */ @VintfStability parcelable BaseFrame { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl index 77f33b96f3..8960d57edb 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl @@ -18,6 +18,7 @@ package android.hardware.biometrics.face; /** * Coordinates of an enrollment UI cell in a vendor-defined coordinate system. + * @hide */ @VintfStability parcelable Cell { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl index ecb0e79aca..15f019cb37 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -22,6 +22,7 @@ import android.hardware.biometrics.face.EnrollmentStage; /** * Describes an individual frame captured during enrollment. + * @hide */ @VintfStability parcelable EnrollmentFrame { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl index 5974838e01..1a3c029a8c 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -18,6 +18,7 @@ package android.hardware.biometrics.face; /** * Enrollment stages that can be mapped to the enrollment UI actions in the framework. + * @hide */ @VintfStability @Backing(type="byte") diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl index a8fa9abc8e..362d752aa3 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -19,6 +19,9 @@ package android.hardware.biometrics.face; import android.hardware.biometrics.face.Cell; import android.hardware.biometrics.face.EnrollmentStage; +/** + * @hide + */ @VintfStability parcelable EnrollmentStageConfig { /** diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl index c960933996..5d92087d82 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl @@ -16,6 +16,9 @@ package android.hardware.biometrics.face; +/** + * @hide + */ @VintfStability @Backing(type="byte") enum EnrollmentType { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl index e99415ac36..77d4717093 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl @@ -15,7 +15,9 @@ */ package android.hardware.biometrics.face; - +/** + * @hide + */ @VintfStability @Backing(type="byte") enum Error { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl index 75e39786a5..c57fb55ccb 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl @@ -26,6 +26,7 @@ import android.view.Surface; /** * Enroll options used to pass information to the HAL when requesting an enroll operation. + * @hide */ @VintfStability parcelable FaceEnrollOptions { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl index a5ed2e84e7..bf315a5250 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl @@ -16,6 +16,9 @@ package android.hardware.biometrics.face; +/** + * @hide + */ @VintfStability @Backing(type="byte") enum FaceSensorType { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl index bff1a022b7..9cbab5522a 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl @@ -16,6 +16,9 @@ package android.hardware.biometrics.face; +/** + * @hide + */ @VintfStability @Backing(type="byte") enum Feature { diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl index 65c589f192..0ead43598c 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl @@ -20,6 +20,9 @@ import android.hardware.biometrics.face.ISession; import android.hardware.biometrics.face.ISessionCallback; import android.hardware.biometrics.face.SensorProps; +/** + * @hide + */ @VintfStability interface IFace { /** diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl index 825af0c6fd..26cb361482 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl @@ -42,6 +42,7 @@ import android.hardware.keymaster.HardwareAuthToken; * ISession only supports execution of one operation at a time, regardless of whether it's * cancellable or not. The framework must wait for a corresponding callback indicating the end of * the current operation before a new operation can be started. + * @hide */ @VintfStability diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl index 9eb575cc3c..b38e366f98 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl @@ -23,6 +23,9 @@ import android.hardware.biometrics.face.Error; import android.hardware.biometrics.face.Feature; import android.hardware.keymaster.HardwareAuthToken; +/** + * @hide + */ @VintfStability interface ISessionCallback { /** diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl index 5f881ca1d3..09fd9e5093 100644 --- a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl +++ b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl @@ -19,6 +19,9 @@ package android.hardware.biometrics.face; import android.hardware.biometrics.common.CommonProps; import android.hardware.biometrics.face.FaceSensorType; +/** + * @hide + */ @VintfStability parcelable SensorProps { /** -- GitLab From ac1e3152ca46db8fec7b7b315bc42cda2d448e76 Mon Sep 17 00:00:00 2001 From: Bharatt Kukreja Date: Tue, 21 Nov 2023 16:37:07 +0000 Subject: [PATCH 306/376] Camera: Add getSessionCharacteristics API Add API to fetch characteristics for a given session configuration. Test: Build Bug: 303645857 Change-Id: I07cb6eb3b0d63454899b2df1497ba120aa762142 --- .../hardware/camera/device/ICameraDevice.aidl | 1 + .../hardware/camera/device/ICameraDevice.aidl | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl index 903ef608ee..f73483a4b3 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl @@ -45,4 +45,5 @@ interface ICameraDevice { int getTorchStrengthLevel(); android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type); boolean isStreamCombinationWithSettingsSupported(in android.hardware.camera.device.StreamConfiguration streams); + android.hardware.camera.device.CameraMetadata getSessionCharacteristics(in android.hardware.camera.device.StreamConfiguration sessionConfig); } diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl index a2bdd59e9d..3a1d7625d5 100644 --- a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl @@ -435,4 +435,34 @@ interface ICameraDevice { * */ boolean isStreamCombinationWithSettingsSupported(in StreamConfiguration streams); + + /** + * getSessionCharacteristics + * + * Gets the session characteristics associated with a particular session + * configuration by the CameraDevice. + * + * For Android 15, the characteristics which need to be set are: + * - ANDROID_CONTROL_ZOOM_RATIO_RANGE + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * The camera device cannot be opened due to an internal + * error. + * CAMERA_DISCONNECTED: + * An external camera device has been disconnected, and is no longer + * available. This camera device interface is now stale, and a new + * instance must be acquired if the device is reconnected. All + * subsequent calls on this interface must return + * CAMERA_DISCONNECTED. + * ILLEGAL_ARGUMENT: + * If the given session configuration is not supported. + * + * @param sessionConfig: The session configuration for which the + * characteristics are being fetched. + * + * @return The static metadata for this particular session config, or an + * empty metadata structure if a service specific error is returned. + */ + CameraMetadata getSessionCharacteristics(in StreamConfiguration sessionConfig); } -- GitLab From 7d1bdeb2d4b5e930a01361481f5a65671d1aaf31 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Tue, 5 Dec 2023 18:57:11 +0000 Subject: [PATCH 307/376] Add android.hardware.wifi.common as a dependency in the supplicant VTS tests. Bug: 296069900 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: I1f6bd7d4c019c39ed9fdfc56db2bc446542f7be2 --- wifi/supplicant/aidl/vts/functional/Android.bp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp index 4eec180b9a..b2356a0c12 100644 --- a/wifi/supplicant/aidl/vts/functional/Android.bp +++ b/wifi/supplicant/aidl/vts/functional/Android.bp @@ -42,6 +42,7 @@ cc_test { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi.common-V1-ndk", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", "android.hardware.wifi.supplicant-V3-ndk", @@ -78,6 +79,7 @@ cc_test { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi.common-V1-ndk", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", "android.hardware.wifi.supplicant-V3-ndk", @@ -114,6 +116,7 @@ cc_test { "android.hardware.wifi@1.3", "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", + "android.hardware.wifi.common-V1-ndk", "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", "android.hardware.wifi.supplicant-V3-ndk", -- GitLab From 0fe91de0cdaff9cd316abba74ecaf21677941657 Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Tue, 5 Dec 2023 17:34:04 +0530 Subject: [PATCH 308/376] Add new onDeviceFoundWithParams callback to the Supplicant AIDL interface. Also mark the previous onDeviceFound callbacks as deprecated. Bug: 296069900 Test: atest VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: Ibeaf20832292a680adf94703b7a0eda1dc9f82d5 --- .../ISupplicantP2pIfaceCallback.aidl | 7 ++ .../supplicant/P2pDeviceFoundEventParams.aidl | 48 ++++++++++ .../ISupplicantP2pIfaceCallback.aidl | 14 +++ .../supplicant/P2pDeviceFoundEventParams.aidl | 92 +++++++++++++++++++ .../supplicant_p2p_iface_aidl_test.cpp | 5 + 5 files changed, 166 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 8aa593fdb8..851e85107b 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -34,6 +34,9 @@ package android.hardware.wifi.supplicant; @VintfStability interface ISupplicantP2pIfaceCallback { + /** + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDeviceFoundWithParams. + */ oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo); oneway void onDeviceLost(in byte[] p2pDeviceAddress); oneway void onFindStopped(); @@ -60,9 +63,13 @@ interface ISupplicantP2pIfaceCallback { */ oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress); oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency); + /** + * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onDeviceFoundWithParams. + */ oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes); oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams); oneway void onPeerClientJoined(in android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams clientJoinedEventParams); oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams); oneway void onProvisionDiscoveryCompletedEvent(in android.hardware.wifi.supplicant.P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams); + oneway void onDeviceFoundWithParams(in android.hardware.wifi.supplicant.P2pDeviceFoundEventParams deviceFoundEventParams); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl new file mode 100644 index 0000000000..ee8e6dc186 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pDeviceFoundEventParams { + byte[6] srcAddress; + byte[6] p2pDeviceAddress; + byte[] primaryDeviceType; + String deviceName; + int configMethods; + byte deviceCapabilities; + int groupCapabilities; + byte[] wfdDeviceInfo; + byte[] wfdR2DeviceInfo; + byte[] vendorElemBytes; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 8befc0db09..11cd867933 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.supplicant.P2pDeviceFoundEventParams; import android.hardware.wifi.supplicant.P2pGroupCapabilityMask; import android.hardware.wifi.supplicant.P2pGroupStartedEventParams; import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams; @@ -38,6 +39,9 @@ import android.hardware.wifi.supplicant.WpsDevPasswordId; oneway interface ISupplicantP2pIfaceCallback { /** * Used to indicate that a P2P device has been found. + *

    + * @deprecated This callback is deprecated from AIDL v2, newer HAL should call + * onDeviceFoundWithParams. * * @param srcAddress MAC address of the device found. This must either * be the P2P device address or the P2P interface address. @@ -228,6 +232,9 @@ oneway interface ISupplicantP2pIfaceCallback { /** * Used to indicate that a P2P device has been found. + *

    + * @deprecated This callback is deprecated from AIDL v3, newer HAL should call + * onDeviceFoundWithParams. * * @param srcAddress MAC address of the device found. This must either * be the P2P device address for a peer which is not in a group, @@ -288,4 +295,11 @@ oneway interface ISupplicantP2pIfaceCallback { */ void onProvisionDiscoveryCompletedEvent( in P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams); + + /** + * Used to indicate that a P2P device has been found. + * + * @param deviceFoundEventParams Parameters associated with the device found event. + */ + void onDeviceFoundWithParams(in P2pDeviceFoundEventParams deviceFoundEventParams); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl new file mode 100644 index 0000000000..15917b6419 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; + +/** + * Parameters passed as a part of a P2P Device found event. + */ +@VintfStability +parcelable P2pDeviceFoundEventParams { + /** + * MAC address of the device found. This must either be the P2P device address + * for a peer which is not in a group, or the P2P interface address for + * a peer which is a Group Owner. + */ + byte[6] srcAddress; + + /** + * P2P device address. + */ + byte[6] p2pDeviceAddress; + + /** + * Type of device. Refer to section B.1 of the Wifi P2P Technical + * specification v1.2. + */ + byte[] primaryDeviceType; + + /** + * Name of the device. + */ + String deviceName; + + /** + * Mask of |WpsConfigMethods| indicating the WPS configuration methods + * supported by the device. + */ + int configMethods; + + /** + * Refer to section 4.1.4 of the Wifi P2P Technical specification v1.2. + */ + byte deviceCapabilities; + + /** + * Mask of |P2pGroupCapabilityMask| indicating the group capabilities. + * Refer to section 4.1.4 of the Wifi P2P Technical specification v1.2. + */ + int groupCapabilities; + + /** + * WFD device info as described in section 5.1.2 of the WFD technical + * specification v1.0.0. + */ + byte[] wfdDeviceInfo; + + /** + * WFD R2 device info as described in section 5.1.12 of WFD technical + * specification v2.1. + */ + byte[] wfdR2DeviceInfo; + + /** + * Vendor-specific information element bytes. The format of an + * information element is EID (1 byte) + Length (1 Byte) + Payload which is + * defined in Section 9.4.4 TLV encodings of 802.11-2016 IEEE Standard for + * Information technology. The length indicates the size of the payload. + * Multiple information elements may be appended within the byte array. + */ + byte[] vendorElemBytes; + + /** + * Optional vendor-specific data. + * Null value indicates that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp index 0db1653099..3f96414a0e 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp @@ -35,6 +35,7 @@ using aidl::android::hardware::wifi::supplicant::IfaceType; using aidl::android::hardware::wifi::supplicant::ISupplicant; using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface; using aidl::android::hardware::wifi::supplicant::MiracastMode; +using aidl::android::hardware::wifi::supplicant::P2pDeviceFoundEventParams; using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask; using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask; using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams; @@ -199,6 +200,10 @@ class SupplicantP2pIfaceCallback : public BnSupplicantP2pIfaceCallback { /* provisionDiscoveryCompletedEventParams */) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onDeviceFoundWithParams( + const P2pDeviceFoundEventParams& /* deviceFoundEventParams */) override { + return ndk::ScopedAStatus::ok(); + } }; class SupplicantP2pIfaceAidlTest : public testing::TestWithParam { -- GitLab From 05c548cb58a35b5572fcc43269577f2600a15874 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Sat, 2 Dec 2023 01:20:10 -0800 Subject: [PATCH 309/376] Add DRIVER_DROWSINESS_ATTENTION_WARNING to HAL layer. Bug: 292142225 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:DriverDrowsinessAttentionWarningTest Test: atest AndroidCarApiTest:DriverDrowsinessAttentionWarningTest Change-Id: I6e838cba6c6ee78cfb73d83582bd5b3e66d2cb20 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 +- .../java/ChangeModeForVehicleProperty.java | 3 +- .../java/EnumForVehicleProperty.java | 3 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 ++ .../config/DefaultProperties.json | 18 ++++++++ .../hardware/src/FakeVehicleHardware.cpp | 8 ++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../DriverDrowsinessAttentionWarning.aidl | 40 +++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../DriverDrowsinessAttentionWarning.aidl | 44 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 21 +++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++ 14 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 84aef2e06c..2e5b0b6d60 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -276,6 +276,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess::READ}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index e259a4d141..507a20becb 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -276,6 +276,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 1d18560a04..792a528992 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -267,7 +267,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 6d0be78564..6b88403cbe 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -267,7 +267,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index 2e8e6fde12..afc70730a9 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -94,7 +94,8 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, List.of(CruiseControlCommand.class)), Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, List.of(HandsOnDetectionDriverState.class, ErrorState.class)), Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, List.of(HandsOnDetectionWarning.class, ErrorState.class)), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)), + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 1638f3c122..8dd84b91e2 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -42,6 +42,7 @@ using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlState; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; +using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; @@ -255,6 +256,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["DriverDrowsinessAttentionState"] = std::make_unique>(); + mConstantParsersByType["DriverDrowsinessAttentionWarning"] = + std::make_unique>(); mConstantParsersByType["ErrorState"] = std::make_unique>(); mConstantParsersByType["AutomaticEmergencyBrakingState"] = std::make_unique>(); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index af3d34ea6a..fe6257567a 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3586,6 +3586,24 @@ ] } }, + { + "property": "VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING", + "defaultValue": { + "int32Values": [ + "DriverDrowsinessAttentionWarning::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_DISABLED", + "DriverDrowsinessAttentionWarning::NO_WARNING", + "DriverDrowsinessAttentionWarning::WARNING" + ] + } + ] + }, { "property": "VehicleProperty::INITIAL_USER_INFO" }, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 7a3be08571..97ef5ae7eb 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -54,6 +54,7 @@ namespace { using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; +using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::GetValueRequest; using ::aidl::android::hardware::automotive::vehicle::GetValueResult; @@ -200,6 +201,13 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE), }, }, + // Driver Drowsiness and Attention Warning + { + toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED), + { + toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING), + }, + }, }; } // namespace diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index d4180a31f2..829e4e3a99 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl new file mode 100644 index 0000000000..dbf2364d4b --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum DriverDrowsinessAttentionWarning { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} 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 4a82d811f4..e84e5c70a6 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 @@ -274,4 +274,5 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */, DRIVER_DROWSINESS_ATTENTION_STATE = (((0x101A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411098 */, DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED = (((0x101B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313947 */, + DRIVER_DROWSINESS_ATTENTION_WARNING = (((0x101C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411100 */, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl new file mode 100644 index 0000000000..53b66b9e50 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current warning state of the driver drowsiness and attention monitoring + * system. + */ +@VintfStability +@Backing(type="int") +enum DriverDrowsinessAttentionWarning { + /** + * This state is used as an alternative for any DriverDrowsinessAttentionWarning value that is + * defined in the platform. Ideally, implementations of + * VehicleProperty#DRIVER_DROWSINESS_ATTENTION_WARNING should not use this state. The framework + * can use this field to remain backwards compatible if DriverDrowsinessAttentionWarning is + * extended to include additional states. + */ + OTHER = 0, + /** + * When the driver drowsiness and attention warning is enabled, and the driver's current + * drowsiness and attention level does not warrant the system to send a warning. + */ + NO_WARNING = 1, + /** + * When the driver drowsiness and attention warning is enabled, and the system is warning the + * driver based on its assessment of the driver's current drowsiness and attention level. + */ + WARNING = 2, +} 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 ce311fb27e..b69641a286 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5159,6 +5159,27 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED = 0x101B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Driver drowsiness and attention warning. + * + * Returns whether a warning is being sent to the driver for being drowsy or not attentive. + * + * Generally, this property should return a valid state defined in + * DriverDrowsinessAttentionWarning or ErrorState. For example, if the feature is not available + * due to some temporary state, that information should be conveyed through an ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both DriverDrowsinessAttentionWarning (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum DriverDrowsinessAttentionWarning + * @data_enum ErrorState + */ + DRIVER_DROWSINESS_ATTENTION_WARNING = + 0x101C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 8aed8815bb..0a628015f3 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -639,6 +639,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarning VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningConfig) { + verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 51770b0d709dc985c21e05c1793784d265788c80 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Sat, 2 Dec 2023 15:27:31 -0800 Subject: [PATCH 310/376] Add DRIVER_DISTRACTION_SYSTEM_ENABLED to HAL layer. Bug: 292142225 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I554725c48aa570a1d79db49d6090163b989e2fbc --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 ++- .../java/ChangeModeForVehicleProperty.java | 3 ++- .../config/DefaultProperties.json | 8 +++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 22 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 43 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 2e5b0b6d60..a59c15eb17 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -277,6 +277,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess::READ}, + {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 507a20becb..9d228974e9 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -277,6 +277,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 792a528992..ed9ae525f7 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -268,7 +268,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 6b88403cbe..d1cefbc704 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -268,7 +268,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index fe6257567a..c1f1d06dda 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3604,6 +3604,14 @@ } ] }, + { + "property": "VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, { "property": "VehicleProperty::INITIAL_USER_INFO" }, 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 e84e5c70a6..c8c206e30a 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 @@ -275,4 +275,5 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_STATE = (((0x101A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411098 */, DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED = (((0x101B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313947 */, DRIVER_DROWSINESS_ATTENTION_WARNING = (((0x101C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411100 */, + DRIVER_DISTRACTION_SYSTEM_ENABLED = (((0x101D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313949 */, } 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 b69641a286..a04a9208de 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5180,6 +5180,28 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_WARNING = 0x101C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Enable or disable driver distraction monitoring. + * + * Set true to enable driver distraction monitoring and false to disable driver + * distraction monitoring. When driver distraction monitoring is enabled, a system + * inside the vehicle should be monitoring the distraction level of the driver and + * warn the driver if needed. + * + * In general, DRIVER_DISTRACTION_SYSTEM_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, that information must be conveyed + * through the ErrorState values in the DRIVER_DISTRACTION_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + DRIVER_DISTRACTION_SYSTEM_ENABLED = + 0x101D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 0a628015f3..3e8b9a1323 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -645,6 +645,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarning VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionSystemEnabledConfig) { + verifyProperty(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From a342b723fde70177585608f9e3fe3fcb80793349 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Mon, 4 Dec 2023 00:40:45 -0800 Subject: [PATCH 311/376] Add DRIVER_DISTRACTION_STATE to HAL layer. Bug: 292142225 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:DriverDistractionStateTest Test: atest AndroidCarApiTest:DriverDistractionStateTest Change-Id: I413291427b3d6243214d42c9efef63e29ab3e8da --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 +- .../java/ChangeModeForVehicleProperty.java | 3 +- .../java/EnumForVehicleProperty.java | 3 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 ++ .../config/DefaultProperties.json | 18 ++++++++ .../hardware/src/FakeVehicleHardware.cpp | 8 ++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/DriverDistractionState.aidl | 40 +++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/DriverDistractionState.aidl | 44 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 24 ++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++ 14 files changed, 153 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index a59c15eb17..339ea3f2d6 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -278,6 +278,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 9d228974e9..63e07418ee 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -278,6 +278,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index ed9ae525f7..5d933dd304 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -269,7 +269,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index d1cefbc704..8317d19b52 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -269,7 +269,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index afc70730a9..db8d6c8b56 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -95,7 +95,8 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, List.of(HandsOnDetectionDriverState.class, ErrorState.class)), Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, List.of(HandsOnDetectionWarning.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)), - Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)) + Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 8dd84b91e2..5f91f70a4c 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -41,6 +41,7 @@ using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProper using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlState; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; +using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState; @@ -258,6 +259,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["DriverDrowsinessAttentionWarning"] = std::make_unique>(); + mConstantParsersByType["DriverDistractionState"] = + std::make_unique>(); mConstantParsersByType["ErrorState"] = std::make_unique>(); mConstantParsersByType["AutomaticEmergencyBrakingState"] = std::make_unique>(); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index c1f1d06dda..cbf91ce86a 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3612,6 +3612,24 @@ ] } }, + { + "property": "VehicleProperty::DRIVER_DISTRACTION_STATE", + "defaultValue": { + "int32Values": [ + "DriverDistractionState::NOT_DISTRACTED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_DISABLED", + "DriverDistractionState::NOT_DISTRACTED", + "DriverDistractionState::DISTRACTED" + ] + } + ] + }, { "property": "VehicleProperty::INITIAL_USER_INFO" }, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 97ef5ae7eb..8c09385179 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -53,6 +53,7 @@ namespace { using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; +using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::ErrorState; @@ -208,6 +209,13 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING), }, }, + // Driver Distraction + { + toInt(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED), + { + toInt(VehicleProperty::DRIVER_DISTRACTION_STATE), + }, + }, }; } // namespace diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 829e4e3a99..841ec32e66 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl new file mode 100644 index 0000000000..54c02d53d1 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum DriverDistractionState { + OTHER = 0, + NOT_DISTRACTED = 1, + DISTRACTED = 2, +} 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 c8c206e30a..0271553e59 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 @@ -276,4 +276,5 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED = (((0x101B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313947 */, DRIVER_DROWSINESS_ATTENTION_WARNING = (((0x101C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411100 */, DRIVER_DISTRACTION_SYSTEM_ENABLED = (((0x101D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313949 */, + DRIVER_DISTRACTION_STATE = (((0x101E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411102 */, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl new file mode 100644 index 0000000000..f350a6c41d --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current state of driver distraction monitoring. + * + * This enum could be extended in future releases to include additional feature states. + */ +@VintfStability +@Backing(type="int") +enum DriverDistractionState { + /** + * This state is used as an alternative for any DriverDistractionState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#DRIVER_DISTRACTION_STATE should not use this state. The framework + * can use this field to remain backwards compatible if DriverDistractionState is + * extended to include additional states. + */ + OTHER = 0, + /** + * The system detects that the driver is attentive / not distracted. + */ + NOT_DISTRACTED = 1, + /** + * The system detects that the driver is distracted, which can be anything that reduces the + * driver's foucs on the primary task of driving/controlling the vehicle. + */ + DISTRACTED = 2, +} 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 a04a9208de..ff7fdb48e0 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5202,6 +5202,30 @@ enum VehicleProperty { DRIVER_DISTRACTION_SYSTEM_ENABLED = 0x101D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Driver distraction state. + * + * Returns the current detected driver distraction state. + * + * Generally, this property should return a valid state defined in the DriverDistractionState or + * ErrorState. For example, if the feature is not available due to some temporary state, that + * information should be conveyed through ErrorState. + * + * If the vehicle is sending a warning to the user because the driver is too distracted, the + * warning should be surfaced through {@link #DRIVER_DISTRACTION_WARNING}. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both DriverDistractionState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum DriverDistractionState + * @data_enum ErrorState + */ + DRIVER_DISTRACTION_STATE = + 0x101E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 3e8b9a1323..71c4c74ef1 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -651,6 +651,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionSystemEnabledCo VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionStateConfig) { + verifyProperty(VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From c62166e3ab02baa1c6cbff922157bcfb5a5c0909 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Mon, 4 Dec 2023 02:17:36 -0800 Subject: [PATCH 312/376] Add DRIVER_DISTRACTION_WARNING_ENABLED to HAL layer. Bug: 292142225 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I6315dd0e7eb63c9e4e2314ae00b027ba7543e192 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 ++- .../java/ChangeModeForVehicleProperty.java | 3 ++- .../config/DefaultProperties.json | 8 +++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 23 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 44 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 339ea3f2d6..9104a6e3b2 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -279,6 +279,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 63e07418ee..f24cb730fb 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -279,6 +279,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 5d933dd304..734e0db167 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -270,7 +270,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 8317d19b52..df73c8c36b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -270,7 +270,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index cbf91ce86a..69f8e6e7c2 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3630,6 +3630,14 @@ } ] }, + { + "property": "VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } + }, { "property": "VehicleProperty::INITIAL_USER_INFO" }, 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 0271553e59..68beaef7e6 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 @@ -277,4 +277,5 @@ enum VehicleProperty { DRIVER_DROWSINESS_ATTENTION_WARNING = (((0x101C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411100 */, DRIVER_DISTRACTION_SYSTEM_ENABLED = (((0x101D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313949 */, DRIVER_DISTRACTION_STATE = (((0x101E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411102 */, + DRIVER_DISTRACTION_WARNING_ENABLED = (((0x101F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313951 */, } 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 ff7fdb48e0..ca220cd6dc 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5226,6 +5226,29 @@ enum VehicleProperty { DRIVER_DISTRACTION_STATE = 0x101E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Enable or disable driver distraction warnings. + * + * Set true to enable driver distraction warnings and false to disable driver distraction + * warnings. + * + * When driver distraction warnings are enabled, the driver distraction monitoring system inside + * the vehicle should warn the driver when it detects the driver is distracted. + * + * In general, DRIVER_DISTRACTION_WARNING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, that information must be conveyed + * through the ErrorState values in the DRIVER_DISTRACTION_WARNING property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + DRIVER_DISTRACTION_WARNING_ENABLED = + 0x101F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 71c4c74ef1..adfa35b32b 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -657,6 +657,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionStateConfig) { VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningEnabledConfig) { + verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 9a0925e15f722d61274522f32b4848db0a0d770a Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Mon, 4 Dec 2023 03:52:23 -0800 Subject: [PATCH 313/376] Add DRIVER_DISTRACTION_WARNING to HAL layer. Bug: 292142225 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Test: atest CtsCarTestCases:DriverDistractionWarningTest Test: atest AndroidCarApiTest:DriverDistractionWarningTest Change-Id: Ib5ef9c8bd4f0f2a73a92e8ee08e6835ad24f95da --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 +- .../java/ChangeModeForVehicleProperty.java | 3 +- .../java/EnumForVehicleProperty.java | 3 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 ++ .../config/DefaultProperties.json | 18 ++++++++ .../hardware/src/FakeVehicleHardware.cpp | 9 ++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/DriverDistractionWarning.aidl | 40 +++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/DriverDistractionWarning.aidl | 43 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 21 +++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++ 14 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 9104a6e3b2..3a1f098cda 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -280,6 +280,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index f24cb730fb..5a5829875d 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -280,6 +280,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 734e0db167..4bc18524aa 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -271,7 +271,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index df73c8c36b..1e00d9f36f 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -271,7 +271,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index db8d6c8b56..958d84b7c5 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -96,7 +96,8 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, List.of(HandsOnDetectionWarning.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)), + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 5f91f70a4c..e4d134e893 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -42,6 +42,7 @@ using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlState; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState; +using ::aidl::android::hardware::automotive::vehicle::DriverDistractionWarning; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState; @@ -261,6 +262,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["DriverDistractionState"] = std::make_unique>(); + mConstantParsersByType["DriverDistractionWarning"] = + std::make_unique>(); mConstantParsersByType["ErrorState"] = std::make_unique>(); mConstantParsersByType["AutomaticEmergencyBrakingState"] = std::make_unique>(); diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 69f8e6e7c2..e462609390 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3638,6 +3638,24 @@ ] } }, + { + "property": "VehicleProperty::DRIVER_DISTRACTION_WARNING", + "defaultValue": { + "int32Values": [ + "DriverDistractionWarning::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_DISABLED", + "DriverDistractionWarning::NO_WARNING", + "DriverDistractionWarning::WARNING" + ] + } + ] + }, { "property": "VehicleProperty::INITIAL_USER_INFO" }, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 8c09385179..8f41971849 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -54,6 +54,7 @@ namespace { using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState; +using ::aidl::android::hardware::automotive::vehicle::DriverDistractionWarning; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; using ::aidl::android::hardware::automotive::vehicle::ErrorState; @@ -214,6 +215,14 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED), { toInt(VehicleProperty::DRIVER_DISTRACTION_STATE), + toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING), + }, + }, + // Driver Distraction Warning + { + toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED), + { + toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING), }, }, }; diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 841ec32e66..6c1d0a040a 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl new file mode 100644 index 0000000000..9236b1c278 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum DriverDistractionWarning { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} 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 68beaef7e6..649396a6b0 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 @@ -278,4 +278,5 @@ enum VehicleProperty { DRIVER_DISTRACTION_SYSTEM_ENABLED = (((0x101D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313949 */, DRIVER_DISTRACTION_STATE = (((0x101E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411102 */, DRIVER_DISTRACTION_WARNING_ENABLED = (((0x101F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313951 */, + DRIVER_DISTRACTION_WARNING = (((0x1020 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411104 */, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl new file mode 100644 index 0000000000..a4b1984a58 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the current warning state of the driver distraction monitoring system. + */ +@VintfStability +@Backing(type="int") +enum DriverDistractionWarning { + /** + * This state is used as an alternative for any DriverDistractionWarning value that is + * defined in the platform. Ideally, implementations of + * VehicleProperty#DRIVER_DISTRACTION_WARNING should not use this state. The framework + * can use this field to remain backwards compatible if DriverDistractionWarning is + * extended to include additional states. + */ + OTHER = 0, + /** + * When the driver distraction warning is enabled and the driver's current distraction level + * does not warrant the system to send a warning. + */ + NO_WARNING = 1, + /** + * When the driver distraction warning is enabled and the system is warning the driver based on + * its assessment of the driver's current distraction level. + */ + WARNING = 2, +} 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 ca220cd6dc..8784fc8bdb 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5249,6 +5249,27 @@ enum VehicleProperty { DRIVER_DISTRACTION_WARNING_ENABLED = 0x101F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Driver distraction warning. + * + * Returns whether a warning is being sent to the driver for being distracted. + * + * Generally, this property should return a valid state defined in DriverDistractionWarning or + * ErrorState. For example, if the feature is not available due to some temporary state, that + * information should be conveyed through an ErrorState. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both DriverDistractionWarning (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum DriverDistractionWarning + * @data_enum ErrorState + */ + DRIVER_DISTRACTION_WARNING = + 0x1020 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index adfa35b32b..6f81807ce9 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -663,6 +663,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningEnabledC VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningConfig) { + verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) { verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 890be571515938879b7128e4d615fddc030860d3 Mon Sep 17 00:00:00 2001 From: Vincent Wang Date: Thu, 30 Nov 2023 07:36:41 +0000 Subject: [PATCH 314/376] Update biometrics HAL interface version(1/2) In order to pass fold/unfold information to HAL during face auth, add a new filed into OperationContext.aidl and update biometric HAL interface version Test: Build pass Bug: 305284901 Change-Id: Iddb2be85a4aae8ab0fa7880258151ebe9f5cf6c3 --- biometrics/common/util/Android.bp | 2 +- biometrics/face/aidl/Android.bp | 2 +- biometrics/face/aidl/default/Android.bp | 4 ++-- biometrics/fingerprint/aidl/Android.bp | 4 ++-- .../fingerprint/aidl/default/Android.bp | 20 +++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/biometrics/common/util/Android.bp b/biometrics/common/util/Android.bp index b990812856..599c491772 100644 --- a/biometrics/common/util/Android.bp +++ b/biometrics/common/util/Android.bp @@ -13,6 +13,6 @@ cc_library { shared_libs: [ "libbase", "libbinder_ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common-V4-ndk", ], } diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 6c8cd78945..0d977a950d 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -14,7 +14,7 @@ aidl_interface { "android/hardware/biometrics/face/**/*.aidl", ], imports: [ - "android.hardware.biometrics.common-V3", + "android.hardware.biometrics.common-V4", "android.hardware.common-V2", "android.hardware.keymaster-V4", ], diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index ecd0934e0c..4816219251 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -40,7 +40,7 @@ cc_binary { ], stl: "c++_static", static_libs: [ - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.biometrics.common.thread", "android.hardware.biometrics.common.util", "android.hardware.biometrics.face-V4-ndk", @@ -75,7 +75,7 @@ cc_test { static_libs: [ "libandroid.hardware.biometrics.face.VirtualProps", "android.hardware.biometrics.face-V4-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.keymaster-V4-ndk", "android.hardware.biometrics.common.util", ], diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp index c543a93f08..1a099a54cb 100644 --- a/biometrics/fingerprint/aidl/Android.bp +++ b/biometrics/fingerprint/aidl/Android.bp @@ -14,7 +14,7 @@ aidl_interface { "android/hardware/biometrics/fingerprint/**/*.aidl", ], imports: [ - "android.hardware.biometrics.common-V3", + "android.hardware.biometrics.common-V4", "android.hardware.keymaster-V4", ], stability: "vintf", @@ -50,5 +50,5 @@ aidl_interface { }, ], - frozen: true, + frozen: false, } diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp index a173a00d12..c3ec4d0f44 100644 --- a/biometrics/fingerprint/aidl/default/Android.bp +++ b/biometrics/fingerprint/aidl/default/Android.bp @@ -30,8 +30,8 @@ cc_binary { static_libs: [ "libandroid.hardware.biometrics.fingerprint.VirtualProps", "libbase", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.biometrics.common.thread", "android.hardware.biometrics.common.util", "android.hardware.keymaster-V4-ndk", @@ -54,8 +54,8 @@ cc_test { ], static_libs: [ "libandroid.hardware.biometrics.fingerprint.VirtualProps", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.keymaster-V4-ndk", "android.hardware.biometrics.common.util", ], @@ -80,8 +80,8 @@ cc_test { ], static_libs: [ "libandroid.hardware.biometrics.fingerprint.VirtualProps", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.keymaster-V4-ndk", "android.hardware.biometrics.common.util", ], @@ -104,8 +104,8 @@ cc_test { ], static_libs: [ "libandroid.hardware.biometrics.fingerprint.VirtualProps", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.keymaster-V4-ndk", "android.hardware.biometrics.common.util", ], @@ -130,8 +130,8 @@ cc_test { ], static_libs: [ "libandroid.hardware.biometrics.fingerprint.VirtualProps", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.keymaster-V4-ndk", "android.hardware.biometrics.common.util", ], -- GitLab From c4cd70fb5e3c9bffd2d245807e09df931a509cec Mon Sep 17 00:00:00 2001 From: Gil Cukierman Date: Wed, 6 Dec 2023 15:08:17 +0000 Subject: [PATCH 315/376] Fix 2g and 3g ConnectionEvent In 2g and 3g there is no separate ciphering and integrity algorithms on the non-access stratum vs. the access stratum. Instead, there is potentially a different ciphering algorithm on circuit switched vs. packet services. Bug: 283336425 Change-Id: I06dbeec1b01dbfdb6b6f541a3c8544fe6bc26fe4 Test: atest VtsHalRadioTargetTest --- .../radio/network/ConnectionEvent.aidl | 26 +++++++-------- .../radio/network/ConnectionEvent.aidl | 32 +++++++++---------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl index 31613222e5..eedb8edefa 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl @@ -35,18 +35,16 @@ package android.hardware.radio.network; /* @hide */ @Backing(type="int") @JavaDerive(toString=true) @VintfStability enum ConnectionEvent { - CS_SERVICE_GSM = 0, - SIGNALLING_GSM = 1, - PS_SERVICE_GPRS = 2, - SIGNALLING_GPRS = 3, - PS_SERVICE_3G = 4, - SIGNALLING_3G = 5, - NAS_SIGNALLING_LTE = 6, - AS_SIGNALLING_LTE = 7, - VOLTE_SIP = 8, - VOLTE_RTP = 9, - NAS_SIGNALLING_5G = 10, - AS_SIGNALLING_5G = 11, - VONR_SIP = 12, - VONR_RTP = 13, + CS_SIGNALLING_GSM = 0, + PS_SIGNALLING_GPRS = 1, + CS_SIGNALLING_3G = 2, + PS_SIGNALLING_3G = 3, + NAS_SIGNALLING_LTE = 4, + AS_SIGNALLING_LTE = 5, + VOLTE_SIP = 6, + VOLTE_RTP = 7, + NAS_SIGNALLING_5G = 8, + AS_SIGNALLING_5G = 9, + VONR_SIP = 10, + VONR_RTP = 11, } diff --git a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl index 639ba891dd..2e39ebf791 100644 --- a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl +++ b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl @@ -25,31 +25,31 @@ package android.hardware.radio.network; @Backing(type="int") @JavaDerive(toString=true) enum ConnectionEvent { - // 2G GSM - CS_SERVICE_GSM = 0, - SIGNALLING_GSM = 1, + // 2G GSM circuit switched + CS_SIGNALLING_GSM = 0, // 2G GPRS packet services - PS_SERVICE_GPRS = 2, - SIGNALLING_GPRS = 3, + PS_SIGNALLING_GPRS = 1, - // 3G packet services - PS_SERVICE_3G = 4, - SIGNALLING_3G = 5, + // 3G circuit switched + CS_SIGNALLING_3G = 2, + + // 3G packet switched + PS_SIGNALLING_3G = 3, // 4G LTE packet services - NAS_SIGNALLING_LTE = 6, - AS_SIGNALLING_LTE = 7, + NAS_SIGNALLING_LTE = 4, + AS_SIGNALLING_LTE = 5, // VoLTE - VOLTE_SIP = 8, - VOLTE_RTP = 9, + VOLTE_SIP = 6, + VOLTE_RTP = 7, // 5G packet services - NAS_SIGNALLING_5G = 10, - AS_SIGNALLING_5G = 11, + NAS_SIGNALLING_5G = 8, + AS_SIGNALLING_5G = 9, // VoNR - VONR_SIP = 12, - VONR_RTP = 13, + VONR_SIP = 10, + VONR_RTP = 11, } -- GitLab From 05f785aff0b18543f2a6aa9965a881679cf41329 Mon Sep 17 00:00:00 2001 From: Gil Cukierman Date: Wed, 6 Dec 2023 15:42:43 +0000 Subject: [PATCH 316/376] Remove EEA4_ZUC EEA4_ZUC is not a known algorithm. Bug:283336425 Change-Id: I57d12b2ed4c3ce30c81f1c8db687354175636d0d Test: atest VtsHalRadioTargetTest --- .../android/hardware/radio/network/SecurityAlgorithm.aidl | 1 - radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl | 1 - 2 files changed, 2 deletions(-) diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl index 97ce004bbf..166450154c 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl @@ -53,7 +53,6 @@ enum SecurityAlgorithm { EEA1 = 42, EEA2 = 43, EEA3 = 44, - EEA4_ZUC = 45, NEA0 = 55, NEA1 = 56, NEA2 = 57, diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl index 6d2c018b3b..71c654c53d 100644 --- a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl +++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl @@ -52,7 +52,6 @@ enum SecurityAlgorithm { EEA1 = 42, EEA2 = 43, EEA3 = 44, - EEA4_ZUC = 45, // 5G PS services (3GPP TS 33.401 for 5G NSA and 3GPP TS 33.501 for 5G SA) NEA0 = 55, -- GitLab From 3374a838c351f2cffdb5ec2317cc2a8024f7fbbe Mon Sep 17 00:00:00 2001 From: Gil Cukierman Date: Wed, 6 Dec 2023 18:31:13 +0000 Subject: [PATCH 317/376] Clarify that NAS stands for Non-Access Stratum Change-Id: I509919905c89ac0ef80f7c1972b06623b6c71fd5 Bug: 315159207 Test: m Change-Id: I509919905c89ac0ef80f7c1972b06623b6c71fd5 --- .../android/hardware/radio/network/NasProtocolMessage.aidl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl b/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl index 1225c41915..5a23661b83 100644 --- a/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl +++ b/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl @@ -17,8 +17,9 @@ package android.hardware.radio.network; /** - * Each enum value represents a message type on the NAS. The relevant cellular generation is noted. - * Sample spec references are provided, but generally only reference one network generation's spec. + * Each enum value represents a message type on the Non-Access Stratum (NAS). The relevant cellular + * generation is noted for each message type. Sample spec references are provided, but generally + * only reference one network generation's spec. * * @hide */ -- GitLab From b3a55af391480820e8688b1a6baf89da39e7ce63 Mon Sep 17 00:00:00 2001 From: Joshua McCloskey Date: Tue, 5 Dec 2023 22:16:08 +0000 Subject: [PATCH 318/376] Freezing face api Test: N/A Change-Id: Ibc6f6130a3e825ed20dcf27d30bbdc3f13d29cc3 --- biometrics/face/aidl/Android.bp | 10 ++- .../android.hardware.biometrics.face/4/.hash | 1 + .../biometrics/face/AcquiredInfo.aidl | 64 +++++++++++++++++++ .../biometrics/face/AuthenticationFrame.aidl | 38 +++++++++++ .../hardware/biometrics/face/BaseFrame.aidl | 43 +++++++++++++ .../hardware/biometrics/face/Cell.aidl | 40 ++++++++++++ .../biometrics/face/EnrollmentFrame.aidl | 40 ++++++++++++ .../biometrics/face/EnrollmentStage.aidl | 44 +++++++++++++ .../face/EnrollmentStageConfig.aidl | 39 +++++++++++ .../biometrics/face/EnrollmentType.aidl | 39 +++++++++++ .../hardware/biometrics/face/Error.aidl | 46 +++++++++++++ .../biometrics/face/FaceEnrollOptions.aidl | 46 +++++++++++++ .../biometrics/face/FaceSensorType.aidl | 40 ++++++++++++ .../hardware/biometrics/face/Feature.aidl | 40 ++++++++++++ .../hardware/biometrics/face/IFace.aidl | 39 +++++++++++ .../hardware/biometrics/face/ISession.aidl | 62 ++++++++++++++++++ .../biometrics/face/ISessionCallback.aidl | 56 ++++++++++++++++ .../hardware/biometrics/face/SensorProps.aidl | 47 ++++++++++++++ .../compatibility_matrix.8.xml | 2 +- 19 files changed, 734 insertions(+), 2 deletions(-) create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 6c8cd78945..efd114af20 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -60,8 +60,16 @@ aidl_interface { "android.hardware.keymaster-V4", ], }, + { + version: "4", + imports: [ + "android.hardware.biometrics.common-V3", + "android.hardware.common-V2", + "android.hardware.keymaster-V4", + ], + }, ], - frozen: false, + frozen: true, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash new file mode 100644 index 0000000000..dda89e4336 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash @@ -0,0 +1 @@ +33be703fa4cde5f04f976fa3f29d15fa4f3e70c5 diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl new file mode 100644 index 0000000000..5312ca16d6 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum AcquiredInfo { + UNKNOWN, + GOOD, + INSUFFICIENT, + TOO_BRIGHT, + TOO_DARK, + TOO_CLOSE, + TOO_FAR, + FACE_TOO_HIGH, + FACE_TOO_LOW, + FACE_TOO_RIGHT, + FACE_TOO_LEFT, + POOR_GAZE, + NOT_DETECTED, + TOO_MUCH_MOTION, + RECALIBRATE, + TOO_DIFFERENT, + TOO_SIMILAR, + PAN_TOO_EXTREME, + TILT_TOO_EXTREME, + ROLL_TOO_EXTREME, + FACE_OBSCURED, + START, + SENSOR_DIRTY, + VENDOR, + FIRST_FRAME_RECEIVED, + DARK_GLASSES_DETECTED, + MOUTH_COVERING_DETECTED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl new file mode 100644 index 0000000000..20bc76779b --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable AuthenticationFrame { + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl new file mode 100644 index 0000000000..67b5cf4169 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable BaseFrame { + android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; + int vendorCode; + float pan; + float tilt; + float distance; + boolean isCancellable; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl new file mode 100644 index 0000000000..6be8c8e975 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable Cell { + int x; + int y; + int z; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl new file mode 100644 index 0000000000..0ea10d6ddb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable EnrollmentFrame { + @nullable android.hardware.biometrics.face.Cell cell; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl new file mode 100644 index 0000000000..a203dbec18 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum EnrollmentStage { + UNKNOWN, + FIRST_FRAME_RECEIVED, + WAITING_FOR_CENTERING, + HOLD_STILL_IN_CENTER, + ENROLLING_MOVEMENT_1, + ENROLLING_MOVEMENT_2, + ENROLLMENT_FINISHED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl new file mode 100644 index 0000000000..48db2cf615 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable EnrollmentStageConfig { + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + List cells; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl new file mode 100644 index 0000000000..da1e8a3e95 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum EnrollmentType { + DEFAULT, + ACCESSIBILITY, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl new file mode 100644 index 0000000000..28eb420587 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum Error { + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + REENROLL_REQUIRED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl new file mode 100644 index 0000000000..23fa1474c9 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable FaceEnrollOptions { + android.hardware.keymaster.HardwareAuthToken hardwareAuthToken; + android.hardware.biometrics.face.EnrollmentType enrollmentType; + android.hardware.biometrics.face.Feature[] features; + /** + * @deprecated use {@link surfacePreview} instead {@link NativeHandle} a handle used to render content from the face HAL. Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}] should be set at one time. + */ + @nullable android.hardware.common.NativeHandle nativeHandlePreview; + @nullable android.view.Surface surfacePreview; + @nullable android.hardware.biometrics.common.OperationContext context; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl new file mode 100644 index 0000000000..bf1677ceec --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum FaceSensorType { + UNKNOWN, + RGB, + IR, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl new file mode 100644 index 0000000000..924e6af44e --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@Backing(type="byte") @VintfStability +enum Feature { + REQUIRE_ATTENTION, + REQUIRE_DIVERSE_POSES, + DEBUG, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl new file mode 100644 index 0000000000..fc4a4d04bb --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface IFace { + android.hardware.biometrics.face.SensorProps[] getSensorProps(); + android.hardware.biometrics.face.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.face.ISessionCallback cb); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl new file mode 100644 index 0000000000..4d99f5a562 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); + /** + * @deprecated use {@link enrollWithOptions} instead. + */ + android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface); + android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); + android.hardware.biometrics.common.ICancellationSignal detectInteraction(); + void enumerateEnrollments(); + void removeEnrollments(in int[] enrollmentIds); + void getFeatures(); + void setFeature(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.Feature feature, boolean enabled); + void getAuthenticatorId(); + void invalidateAuthenticatorId(); + void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); + void close(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + /** + * @deprecated use {@link enrollWithOptions} instead. + */ + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithOptions(in android.hardware.biometrics.face.FaceEnrollOptions options); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl new file mode 100644 index 0000000000..bbace29aa0 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +interface ISessionCallback { + void onChallengeGenerated(in long challenge); + void onChallengeRevoked(in long challenge); + void onAuthenticationFrame(in android.hardware.biometrics.face.AuthenticationFrame frame); + void onEnrollmentFrame(in android.hardware.biometrics.face.EnrollmentFrame frame); + void onError(in android.hardware.biometrics.face.Error error, in int vendorCode); + void onEnrollmentProgress(in int enrollmentId, int remaining); + void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat); + void onAuthenticationFailed(); + void onLockoutTimed(in long durationMillis); + void onLockoutPermanent(); + void onLockoutCleared(); + void onInteractionDetected(); + void onEnrollmentsEnumerated(in int[] enrollmentIds); + void onFeaturesRetrieved(in android.hardware.biometrics.face.Feature[] features); + void onFeatureSet(android.hardware.biometrics.face.Feature feature); + void onEnrollmentsRemoved(in int[] enrollmentIds); + void onAuthenticatorIdRetrieved(in long authenticatorId); + void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl new file mode 100644 index 0000000000..8b3c51bb12 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +@VintfStability +parcelable SensorProps { + android.hardware.biometrics.common.CommonProps commonProps; + android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN; + boolean halControlsPreview; + int previewDisplayId; + int enrollPreviewWidth; + int enrollPreviewHeight; + float enrollTranslationX; + float enrollTranslationY; + float enrollPreviewScale; + boolean supportsDetectInteraction; +} diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 905778882a..777eb84e2c 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -116,7 +116,7 @@ android.hardware.biometrics.face - 3 + 3-4 IFace default -- GitLab From 7d0e5e927b0f69df52a02db3db17ac85b4362284 Mon Sep 17 00:00:00 2001 From: Kai Shi Date: Mon, 20 Nov 2023 19:23:36 -0800 Subject: [PATCH 319/376] Add the HAL support for getCachedScanResult. Bug: 269485350 Test: adb shell cmd wifi get-cached-scan-data Test: adb shell halutil -get_cached_scan_results Test: hardware/interfaces/wifi/aidl/default/tests/runtests.sh Change-Id: Ie94fbdd51a21c25c6aefa4afbd40cfcaabbe0f8c --- .../android/hardware/wifi/CachedScanData.aidl | 39 ++++++++++++ .../hardware/wifi/CachedScanResult.aidl | 44 +++++++++++++ .../android/hardware/wifi/IWifiStaIface.aidl | 1 + .../android/hardware/wifi/CachedScanData.aidl | 35 +++++++++++ .../hardware/wifi/CachedScanResult.aidl | 55 ++++++++++++++++ .../android/hardware/wifi/IWifiStaIface.aidl | 13 ++++ wifi/aidl/default/aidl_struct_util.cpp | 63 +++++++++++++++++++ wifi/aidl/default/aidl_struct_util.h | 5 ++ .../tests/aidl_struct_util_unit_tests.cpp | 51 +++++++++++++++ wifi/aidl/default/wifi_legacy_hal.cpp | 15 +++-- wifi/aidl/default/wifi_legacy_hal.h | 14 ++++- wifi/aidl/default/wifi_sta_iface.cpp | 20 ++++++ wifi/aidl/default/wifi_sta_iface.h | 2 + 13 files changed, 349 insertions(+), 8 deletions(-) create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl create mode 100644 wifi/aidl/android/hardware/wifi/CachedScanData.aidl create mode 100644 wifi/aidl/android/hardware/wifi/CachedScanResult.aidl diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl new file mode 100644 index 0000000000..cd4a456917 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable CachedScanData { + int[] scannedFrequenciesMhz; + android.hardware.wifi.CachedScanResult[] cachedScanResults; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl new file mode 100644 index 0000000000..1806b0f534 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable CachedScanResult { + long timeStampInUs; + byte[] ssid; + byte[6] bssid; + int rssiDbm; + int frequencyMhz; + android.hardware.wifi.WifiChannelWidthInMhz channelWidthMhz; + android.hardware.wifi.WifiRatePreamble preambleType; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl index 923deff01f..b557cc2779 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl @@ -61,6 +61,7 @@ interface IWifiStaIface { void stopRssiMonitoring(in int cmdId); void stopSendingKeepAlivePackets(in int cmdId); void setDtimMultiplier(in int multiplier); + android.hardware.wifi.CachedScanData getCachedScanData(); @Backing(type="int") @VintfStability enum FeatureSetMask { APF = (1 << 0) /* 1 */, diff --git a/wifi/aidl/android/hardware/wifi/CachedScanData.aidl b/wifi/aidl/android/hardware/wifi/CachedScanData.aidl new file mode 100644 index 0000000000..feda079ffd --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/CachedScanData.aidl @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.CachedScanResult; + +/** + * Scan data cached in Wifi firmware + */ +@VintfStability +parcelable CachedScanData { + /** + * List of scanned frequencies in MHz. + */ + int[] scannedFrequenciesMhz; + + /** + * List of scan results. + */ + CachedScanResult[] cachedScanResults; +} diff --git a/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl b/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl new file mode 100644 index 0000000000..9c9dbc723e --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +import android.hardware.wifi.WifiChannelWidthInMhz; +import android.hardware.wifi.WifiRatePreamble; + +/** + * Scan result cached in Wifi firmware + */ +@VintfStability +parcelable CachedScanResult { + /** + * Time in micro seconds since boot when the scan was done + */ + long timeStampInUs; + /** + * SSID of beacon excluding null. + */ + byte[] ssid; + /** + * BSSID of beacon + */ + byte[6] bssid; + /** + * Beacon received signal stength indicatior (RSSI), in dbm + */ + int rssiDbm; + /** + * Frequency of beacon, in MHz + */ + int frequencyMhz; + /** + * Channel bandwidth of found network + */ + WifiChannelWidthInMhz channelWidthMhz; + /** + * Supported rate and preamble type + */ + WifiRatePreamble preambleType; +} diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl index 6d6afafc12..fd59564cf3 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi; +import android.hardware.wifi.CachedScanData; import android.hardware.wifi.IWifiStaIfaceEventCallback; import android.hardware.wifi.StaApfPacketFilterCapabilities; import android.hardware.wifi.StaBackgroundScanCapabilities; @@ -552,4 +553,16 @@ interface IWifiStaIface { * |WifiStatusCode.ERROR_UNKNOWN| */ void setDtimMultiplier(in int multiplier); + + /** + * Get the cached scan data. + * + * @return Instance of |CachedScanData|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + CachedScanData getCachedScanData(); } diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 83e11939fd..b39ccbaef4 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -3362,6 +3362,69 @@ bool convertLegacyIfaceCombinationsMatrixToChipMode( return true; } +bool convertCachedScanReportToAidl(const legacy_hal::WifiCachedScanReport& report, + CachedScanData* aidl_scan_data) { + if (!aidl_scan_data) { + return false; + } + *aidl_scan_data = {}; + + std::vector aidl_scan_results; + for (const auto& result : report.results) { + CachedScanResult aidl_scan_result; + if (!convertCachedScanResultToAidl(result, report.ts, &aidl_scan_result)) { + return false; + } + aidl_scan_results.push_back(aidl_scan_result); + } + aidl_scan_data->cachedScanResults = aidl_scan_results; + + aidl_scan_data->scannedFrequenciesMhz = report.scanned_freqs; + return true; +} + +bool convertCachedScanResultToAidl(const legacy_hal::wifi_cached_scan_result& legacy_scan_result, + uint64_t ts_us, CachedScanResult* aidl_scan_result) { + if (!aidl_scan_result) { + return false; + } + *aidl_scan_result = {}; + aidl_scan_result->timeStampInUs = ts_us - legacy_scan_result.age_ms * 1000; + if (aidl_scan_result->timeStampInUs < 0) { + aidl_scan_result->timeStampInUs = 0; + return false; + } + size_t max_len_excluding_null = sizeof(legacy_scan_result.ssid) - 1; + size_t ssid_len = strnlen((const char*)legacy_scan_result.ssid, max_len_excluding_null); + aidl_scan_result->ssid = + std::vector(legacy_scan_result.ssid, legacy_scan_result.ssid + ssid_len); + aidl_scan_result->bssid = std::array(); + std::copy(legacy_scan_result.bssid, legacy_scan_result.bssid + 6, + std::begin(aidl_scan_result->bssid)); + aidl_scan_result->frequencyMhz = legacy_scan_result.chanspec.primary_frequency; + aidl_scan_result->channelWidthMhz = + convertLegacyWifiChannelWidthToAidl(legacy_scan_result.chanspec.width); + aidl_scan_result->rssiDbm = legacy_scan_result.rssi; + aidl_scan_result->preambleType = convertScanResultFlagsToPreambleType(legacy_scan_result.flags); + return true; +} + +WifiRatePreamble convertScanResultFlagsToPreambleType(int flags) { + if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_EHT_OPS_PRESENT) > 0) { + return WifiRatePreamble::EHT; + } + if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT) > 0) { + return WifiRatePreamble::HE; + } + if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_VHT_OPS_PRESENT) > 0) { + return WifiRatePreamble::VHT; + } + if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_HT_OPS_PRESENT) > 0) { + return WifiRatePreamble::HT; + } + return WifiRatePreamble::OFDM; +} + } // namespace aidl_struct_util } // namespace wifi } // namespace hardware diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h index e4ff9638bb..b59c453ea6 100644 --- a/wifi/aidl/default/aidl_struct_util.h +++ b/wifi/aidl/default/aidl_struct_util.h @@ -202,6 +202,11 @@ bool convertLegacyNanBootstrappingConfirmIndToAidl( const legacy_hal::NanBootstrappingConfirmInd& legacy_ind, NanBootstrappingConfirmInd* aidl_ind); uint32_t convertAidlChannelCategoryToLegacy(uint32_t aidl_channel_category_mask); +bool convertCachedScanReportToAidl(const legacy_hal::WifiCachedScanReport& report, + CachedScanData* aidl_scan_data); +bool convertCachedScanResultToAidl(const legacy_hal::wifi_cached_scan_result& legacy_scan_result, + uint64_t ts_us, CachedScanResult* aidl_scan_result); +WifiRatePreamble convertScanResultFlagsToPreambleType(int flags); } // namespace aidl_struct_util } // namespace wifi } // namespace hardware diff --git a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp index 995a13d996..2a030eee1a 100644 --- a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp +++ b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp @@ -35,6 +35,12 @@ byte LCI[] = {0x27, 0x1A, 0x1, 0x00, 0x8, 0x01, 0x00, 0x08, 0x00, 0x10, 0x52, 0x2c, 0x00, 0x00, 0x41, 0x06, 0x03, 0x06, 0x00, 0x80}; byte LCR[] = {0x27, 0xE, 0x1, 0x00, 0xB, 0x01, 0x00, 0x0b, 0x00, 0x09, 0x55, 0x53, 0x18, 0x05, 0x39, 0x34, 0x30, 0x34, 0x33}; + +constexpr int kNumScanResult = 2; +constexpr int kRssi[] = {-60, -70}; +constexpr uint8_t kBssid[] = {0x12, 0x34, 0x56, 0x78, 0x9a, 0}; +constexpr uint8_t kSsidLen = 6; +constexpr char kSsid[] = {'a', 'b', 'c', 'd', 'e', '\0'}; } // namespace namespace aidl { @@ -883,6 +889,51 @@ TEST_F(AidlStructUtilTest, convertLegacyVectorOfRttResultV2ToAidl) { } } +TEST_F(AidlStructUtilTest, convertCachedScanReportToAidl) { + legacy_hal::WifiCachedScanReport hw_report; + + hw_report.ts = 10000000; + std::vector scanned_freqs{5260, 2437, 5200}; + std::vector results; + hw_report.scanned_freqs = scanned_freqs; + + for (int i = 0; i < kNumScanResult; i++) { + wifi_cached_scan_result result; + result.age_ms = i * 1000; + result.capability = i; + memcpy(result.ssid, kSsid, kSsidLen); + result.ssid_len = kSsidLen; + memcpy(result.bssid, kBssid, 6); + result.flags = WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT; + result.rssi = kRssi[i]; + result.chanspec = {legacy_hal::WIFI_CHAN_WIDTH_40, 0, 0, i}; + results.push_back(result); + } + hw_report.results = results; + + CachedScanData aidl_data; + aidl_struct_util::convertCachedScanReportToAidl(hw_report, &aidl_data); + + EXPECT_EQ(scanned_freqs.size(), aidl_data.scannedFrequenciesMhz.size()); + EXPECT_EQ(scanned_freqs[2], aidl_data.scannedFrequenciesMhz[2]); + EXPECT_EQ(5260, aidl_data.scannedFrequenciesMhz[0]); + EXPECT_EQ(kNumScanResult, (int)aidl_data.cachedScanResults.size()); + for (int i = 0; i < kNumScanResult; i++) { + EXPECT_EQ(hw_report.results[i].rssi, aidl_data.cachedScanResults[i].rssiDbm); + EXPECT_EQ(i, aidl_data.cachedScanResults[i].frequencyMhz); + int64_t expected_ts = 10000000 - i * 1000 * 1000; + EXPECT_EQ(expected_ts, aidl_data.cachedScanResults[i].timeStampInUs); + EXPECT_EQ(WifiRatePreamble::HE, aidl_data.cachedScanResults[i].preambleType); + EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_40, aidl_data.cachedScanResults[i].channelWidthMhz); + for (int k = 0; k < 6; k++) { + EXPECT_EQ(kBssid[k], aidl_data.cachedScanResults[i].bssid[k]); + } + for (int k = 0; k < kSsidLen; k++) { + EXPECT_EQ(kSsid[k], aidl_data.cachedScanResults[i].ssid[k]); + } + } +} + } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp index 209670bc69..5f3e313418 100644 --- a/wifi/aidl/default/wifi_legacy_hal.cpp +++ b/wifi/aidl/default/wifi_legacy_hal.cpp @@ -439,6 +439,7 @@ void onAsyncChreNanRttState(chre_nan_rtt_state state) { // Callback to report cached scan results std::function on_cached_scan_results_internal_callback; void onSyncCachedScanResults(wifi_cached_scan_report* cache_report) { + const auto lock = aidl_sync_util::acquireGlobalLock(); if (on_cached_scan_results_internal_callback) { on_cached_scan_results_internal_callback(cache_report); } @@ -1858,13 +1859,16 @@ wifi_error WifiLegacyHal::enableWifiTxPowerLimits(const std::string& iface_name, return global_func_table_.wifi_enable_tx_power_limits(getIfaceHandle(iface_name), enable); } -wifi_error WifiLegacyHal::getWifiCachedScanResults( - const std::string& iface_name, const CachedScanResultsCallbackHandlers& handler) { - on_cached_scan_results_internal_callback = handler.on_cached_scan_results; - +wifi_error WifiLegacyHal::getWifiCachedScanResults(const std::string& iface_name, + WifiCachedScanReport& report) { + on_cached_scan_results_internal_callback = [&report](wifi_cached_scan_report* report_ptr) { + report.results.assign(report_ptr->results, report_ptr->results + report_ptr->result_cnt); + report.scanned_freqs.assign(report_ptr->scanned_freq_list, + report_ptr->scanned_freq_list + report_ptr->scanned_freq_num); + report.ts = report_ptr->ts; + }; wifi_error status = global_func_table_.wifi_get_cached_scan_results(getIfaceHandle(iface_name), {onSyncCachedScanResults}); - on_cached_scan_results_internal_callback = nullptr; return status; } @@ -1934,6 +1938,7 @@ void WifiLegacyHal::invalidate() { on_twt_event_info_frame_received_callback = nullptr; on_twt_event_device_notify_callback = nullptr; on_chre_nan_rtt_internal_callback = nullptr; + on_cached_scan_results_internal_callback = nullptr; } } // namespace legacy_hal diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h index 5168a8bccf..8e7c1b83d0 100644 --- a/wifi/aidl/default/wifi_legacy_hal.h +++ b/wifi/aidl/default/wifi_legacy_hal.h @@ -256,6 +256,7 @@ using ::WIFI_BAND_ABG_WITH_DFS; using ::WIFI_BAND_BG; using ::WIFI_BAND_UNSPECIFIED; using ::wifi_cached_scan_report; +using ::wifi_cached_scan_result; using ::wifi_cached_scan_results; using ::WIFI_CHAN_WIDTH_10; using ::WIFI_CHAN_WIDTH_160; @@ -422,6 +423,12 @@ struct LinkLayerMlStats { bool valid; }; +struct WifiCachedScanReport { + uint64_t ts; + std::vector scanned_freqs; + std::vector results; +}; + #pragma GCC diagnostic pop // The |WLAN_DRIVER_WAKE_REASON_CNT.cmd_event_wake_cnt| and @@ -532,8 +539,9 @@ struct ChreCallbackHandlers { std::function on_wifi_chre_nan_rtt_state; }; -// Cached Scan Results response and event callbacks struct. -struct CachedScanResultsCallbackHandlers { +using on_cached_scan_results_callback = std::function; + +struct CachedScanResultsCallbfackHandlers { // Callback for Cached Scan Results std::function on_cached_scan_results; }; @@ -776,7 +784,7 @@ class WifiLegacyHal { wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable); wifi_error getWifiCachedScanResults(const std::string& iface_name, - const CachedScanResultsCallbackHandlers& handler); + WifiCachedScanReport& report); std::pair getWifiChipCapabilities(); wifi_error enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag); wifi_error setMloMode(wifi_mlo_mode mode); diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp index 800813f166..0ae428f179 100644 --- a/wifi/aidl/default/wifi_sta_iface.cpp +++ b/wifi/aidl/default/wifi_sta_iface.cpp @@ -219,6 +219,11 @@ ndk::ScopedAStatus WifiStaIface::setDtimMultiplier(int32_t in_multiplier) { &WifiStaIface::setDtimMultiplierInternal, in_multiplier); } +ndk::ScopedAStatus WifiStaIface::getCachedScanData(CachedScanData* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::getCachedScanDataInternal, _aidl_return); +} + std::pair WifiStaIface::getNameInternal() { return {ifname_, ndk::ScopedAStatus::ok()}; } @@ -540,6 +545,21 @@ ndk::ScopedAStatus WifiStaIface::setDtimMultiplierInternal(const int multiplier) return createWifiStatusFromLegacyError(legacy_status); } +std::pair WifiStaIface::getCachedScanDataInternal() { + legacy_hal::WifiCachedScanReport cached_scan_report; + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->getWifiCachedScanResults(ifname_, cached_scan_report); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {CachedScanData{}, createWifiStatusFromLegacyError(legacy_status)}; + } + CachedScanData aidl_scan_data; + if (!aidl_struct_util::convertCachedScanReportToAidl(cached_scan_report, &aidl_scan_data)) { + return {CachedScanData{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + + return {aidl_scan_data, ndk::ScopedAStatus::ok()}; +} + } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h index 3d7ec4d4b2..fe05c21483 100644 --- a/wifi/aidl/default/wifi_sta_iface.h +++ b/wifi/aidl/default/wifi_sta_iface.h @@ -90,6 +90,7 @@ class WifiStaIface : public BnWifiStaIface { ndk::ScopedAStatus getFactoryMacAddress(std::array* _aidl_return) override; ndk::ScopedAStatus setScanMode(bool in_enable) override; ndk::ScopedAStatus setDtimMultiplier(int32_t in_multiplier) override; + ndk::ScopedAStatus getCachedScanData(CachedScanData* _aidl_return) override; private: // Corresponding worker functions for the AIDL methods. @@ -130,6 +131,7 @@ class WifiStaIface : public BnWifiStaIface { std::pair, ndk::ScopedAStatus> getFactoryMacAddressInternal(); ndk::ScopedAStatus setScanModeInternal(bool enable); ndk::ScopedAStatus setDtimMultiplierInternal(const int multiplier); + std::pair getCachedScanDataInternal(); void setWeakPtr(std::weak_ptr ptr); -- GitLab From 8efe3759f8019fd8229b1b8c82cf8d552819678e Mon Sep 17 00:00:00 2001 From: Les Lee Date: Fri, 10 Nov 2023 02:51:56 +0000 Subject: [PATCH 320/376] wifi: Supports setVoipMode in HAL Bug: 295885471 Test: manual test, wifi works normally Change-Id: I20e1479de84fa892c986929eebc692b33f5607a1 --- .../android/hardware/wifi/IWifiChip.aidl | 6 ++++ .../aidl/android/hardware/wifi/IWifiChip.aidl | 29 +++++++++++++++++++ wifi/aidl/default/wifi_chip.cpp | 23 +++++++++++++++ wifi/aidl/default/wifi_chip.h | 2 ++ 4 files changed, 60 insertions(+) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl index 2d7fe03b30..db82a6e4c1 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl @@ -84,6 +84,7 @@ interface IWifiChip { void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag); void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode); @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData); + void setVoipMode(in android.hardware.wifi.IWifiChip.VoipMode mode); const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF; @Backing(type="int") @VintfStability enum FeatureSetMask { @@ -162,6 +163,11 @@ interface IWifiChip { NAN_INSTANT_MODE = (1 << 2) /* 4 */, } @Backing(type="int") @VintfStability + enum VoipMode { + OFF = 0, + VOICE = 1, + } + @Backing(type="int") @VintfStability enum ChannelCategoryMask { INDOOR_CHANNEL = (1 << 0) /* 1 */, DFS_CHANNEL = (1 << 1) /* 2 */, diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl index 733ff625b1..cf4c88446c 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl @@ -384,6 +384,16 @@ interface IWifiChip { NAN_INSTANT_MODE = 1 << 2, } + /** + * This enum represents the different VoIP mode that can be set through |setVoipMode|. + */ + @VintfStability + @Backing(type="int") + enum VoipMode { + OFF = 0, + VOICE = 1, + } + /** * Configure the Chip. * This may NOT be called to reconfigure a chip due to an internal @@ -1173,4 +1183,23 @@ interface IWifiChip { @PropagateAllowBlocking IWifiApIface createApOrBridgedApIface( in IfaceConcurrencyType iface, in OuiKeyedData[] vendorData); + + /** + * API to set the wifi VoIP mode. + * + * The VoIP mode is a hint to the HAL to enable or disable Wi-Fi VoIP + * optimization. The optimization should be enabled if the mode is NOT set to |OFF|. + * Furthermore, HAL should implement relevant optimization techniques based on the + * current operational mode. + * + * Note: Wi-Fi VoIP optimization may trade-off power against Wi-Fi + * performance but it provides better voice quility. + * + * @param mode Voip mode as defined by the enum |VoipMode| + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|, + * |WifiStatusCode.ERROR_INVALID_ARGS|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void setVoipMode(in VoipMode mode); } diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp index d72775c143..2db3b4aa60 100644 --- a/wifi/aidl/default/wifi_chip.cpp +++ b/wifi/aidl/default/wifi_chip.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -605,6 +606,11 @@ ndk::ScopedAStatus WifiChip::setMloMode(const ChipMloMode in_mode) { &WifiChip::setMloModeInternal, in_mode); } +ndk::ScopedAStatus WifiChip::setVoipMode(const VoipMode in_mode) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID, + &WifiChip::setVoipModeInternal, in_mode); +} + void WifiChip::invalidateAndRemoveAllIfaces() { invalidateAndClearBridgedApAll(); invalidateAndClearAll(ap_ifaces_); @@ -1913,6 +1919,23 @@ ndk::ScopedAStatus WifiChip::setMloModeInternal(const WifiChip::ChipMloMode in_m return createWifiStatusFromLegacyError(legacy_hal_.lock()->setMloMode(mode)); } +ndk::ScopedAStatus WifiChip::setVoipModeInternal(const WifiChip::VoipMode in_mode) { + const auto ifname = getFirstActiveWlanIfaceName(); + wifi_voip_mode mode; + switch (in_mode) { + case WifiChip::VoipMode::VOICE: + mode = wifi_voip_mode::WIFI_VOIP_MODE_ON; + break; + case WifiChip::VoipMode::OFF: + mode = wifi_voip_mode::WIFI_VOIP_MODE_OFF; + break; + default: + PLOG(ERROR) << "Error: invalid mode: " << toString(in_mode); + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + return createWifiStatusFromLegacyError(legacy_hal_.lock()->setVoipMode(ifname, mode)); +} + } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h index c6517db6f9..ffd507f801 100644 --- a/wifi/aidl/default/wifi_chip.h +++ b/wifi/aidl/default/wifi_chip.h @@ -158,6 +158,7 @@ class WifiChip : public BnWifiChip { int32_t in_channelCategoryEnableFlag) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override; + ndk::ScopedAStatus setVoipMode(const VoipMode in_mode) override; private: void invalidateAndRemoveAllIfaces(); @@ -269,6 +270,7 @@ class WifiChip : public BnWifiChip { getSupportedRadioCombinationsInternal(); std::pair getWifiChipCapabilitiesInternal(); ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode); + ndk::ScopedAStatus setVoipModeInternal(const VoipMode in_mode); void retrieveDynamicIfaceCombination(); void setWeakPtr(std::weak_ptr ptr); -- GitLab From 774a9c0f44c2f45ac08aebed29b81fbd890bfddd Mon Sep 17 00:00:00 2001 From: Vincent Wang Date: Wed, 6 Dec 2023 09:09:07 +0000 Subject: [PATCH 321/376] Update biometrics HAL interface version(2/2) In order to pass fold/unfold information to HAL during face auth, add a new filed into OperationContext.aidl and update biometric HAL interface version Test: Build pass Bug: 305284901 Change-Id: I886440a6332ba8c2555b29322c05f27edb7a5d44 --- biometrics/fingerprint/aidl/default/fingerprint-example.xml | 2 +- compatibility_matrices/compatibility_matrix.9.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.xml b/biometrics/fingerprint/aidl/default/fingerprint-example.xml index e977b98a64..827813ffc0 100644 --- a/biometrics/fingerprint/aidl/default/fingerprint-example.xml +++ b/biometrics/fingerprint/aidl/default/fingerprint-example.xml @@ -1,7 +1,7 @@ android.hardware.biometrics.fingerprint - 3 + 4 IFingerprint/virtual diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 33e5a7db4f..023690d7d0 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -134,7 +134,7 @@ android.hardware.biometrics.fingerprint - 3 + 3-4 IFingerprint default -- GitLab From b792cda368b2db0d3e2ff9124b3fe90c7d22ab5b Mon Sep 17 00:00:00 2001 From: Les Lee Date: Fri, 10 Nov 2023 08:31:55 +0000 Subject: [PATCH 322/376] wifi: Supports new feature flag about Voip mode ag/25582780 is the vts for this aidl change. Bug: 295885471 Test: manual test, wifi works normally Change-Id: I74f8861d43a2a5850dfb3b5b57575858d7f61398 --- .../current/android/hardware/wifi/IWifiChip.aidl | 1 + wifi/aidl/android/hardware/wifi/IWifiChip.aidl | 4 ++++ wifi/aidl/default/aidl_struct_util.cpp | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl index db82a6e4c1..5ed7517766 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl @@ -97,6 +97,7 @@ interface IWifiChip { WIGIG = (1 << 6) /* 64 */, SET_AFC_CHANNEL_ALLOWANCE = (1 << 7) /* 128 */, T2LM_NEGOTIATION = (1 << 8) /* 256 */, + SET_VOIP_MODE = (1 << 9) /* 512 */, } @VintfStability parcelable ChipConcurrencyCombinationLimit { diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl index cf4c88446c..d12d26c65c 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl @@ -83,6 +83,10 @@ interface IWifiChip { * Chip supports Tid-To-Link mapping negotiation. */ T2LM_NEGOTIATION = 1 << 8, + /** + * Chip supports voip mode setting. + */ + SET_VOIP_MODE = 1 << 9, } /** diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 99420bd2bc..bec3e83007 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -59,6 +59,8 @@ IWifiChip::FeatureSetMask convertLegacyChipFeatureToAidl(uint64_t feature) { return IWifiChip::FeatureSetMask::P2P_RAND_MAC; case WIFI_FEATURE_AFC_CHANNEL: return IWifiChip::FeatureSetMask::SET_AFC_CHANNEL_ALLOWANCE; + case WIFI_FEATURE_SET_VOIP_MODE: + return IWifiChip::FeatureSetMask::SET_VOIP_MODE; }; CHECK(false) << "Unknown legacy feature: " << feature; return {}; @@ -109,7 +111,8 @@ bool convertLegacyChipFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* aidl WIFI_FEATURE_INFRA_60G, WIFI_FEATURE_SET_LATENCY_MODE, WIFI_FEATURE_P2P_RAND_MAC, - WIFI_FEATURE_AFC_CHANNEL}; + WIFI_FEATURE_AFC_CHANNEL, + WIFI_FEATURE_SET_VOIP_MODE}; for (const auto feature : features) { if (feature & legacy_feature_set) { *aidl_feature_set |= static_cast(convertLegacyChipFeatureToAidl(feature)); -- GitLab From b5d73ee5ce037e07a887470b03b6188875196894 Mon Sep 17 00:00:00 2001 From: Les Lee Date: Tue, 5 Dec 2023 09:19:42 +0000 Subject: [PATCH 323/376] wifi: rename mode 'ON' to 'VOICE'. To improve clarity and accommodate future functionalities, we should rename the existing 'ON' mode to 'VOICE'. This change establishes 'VOICE' as the fundamental mode for VOIP operations. Additionally, it paves the way for adding future modes, such as 'VOICE_VIDEO', as the system evolves. Bug: 295885471 Test: TH Change-Id: Ie3b54f02cf3c73b5a9c2a805ec36703dfd541666 --- wifi/aidl/default/wifi_chip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp index 2db3b4aa60..9b9c565dd5 100644 --- a/wifi/aidl/default/wifi_chip.cpp +++ b/wifi/aidl/default/wifi_chip.cpp @@ -1924,7 +1924,7 @@ ndk::ScopedAStatus WifiChip::setVoipModeInternal(const WifiChip::VoipMode in_mod wifi_voip_mode mode; switch (in_mode) { case WifiChip::VoipMode::VOICE: - mode = wifi_voip_mode::WIFI_VOIP_MODE_ON; + mode = wifi_voip_mode::WIFI_VOIP_MODE_VOICE; break; case WifiChip::VoipMode::OFF: mode = wifi_voip_mode::WIFI_VOIP_MODE_OFF; -- GitLab From 7d422812c7aa0f8cca24c5fdb01a8f2a287af3c1 Mon Sep 17 00:00:00 2001 From: maheshkkv Date: Thu, 16 Nov 2023 17:32:50 -0800 Subject: [PATCH 324/376] Add HAL support for IEEE 802.11 az ranging Bug: 295619650 Test: m Change-Id: Ieba17a1414afa8fddca7d0d87e786c760c6789e5 --- .../hardware/wifi/RttCapabilities.aidl | 5 + .../android/hardware/wifi/RttConfig.aidl | 3 + .../android/hardware/wifi/RttPreamble.aidl | 1 + .../android/hardware/wifi/RttResult.aidl | 3 + .../android/hardware/wifi/RttType.aidl | 2 + .../hardware/wifi/RttCapabilities.aidl | 34 +++- .../aidl/android/hardware/wifi/RttConfig.aidl | 26 ++- .../android/hardware/wifi/RttPreamble.aidl | 1 + .../aidl/android/hardware/wifi/RttResult.aidl | 59 +++++-- wifi/aidl/android/hardware/wifi/RttType.aidl | 13 ++ wifi/aidl/default/aidl_struct_util.cpp | 166 +++++++++++++++--- wifi/aidl/default/aidl_struct_util.h | 11 ++ wifi/aidl/default/wifi_legacy_hal.cpp | 52 ++++++ wifi/aidl/default/wifi_legacy_hal.h | 14 ++ wifi/aidl/default/wifi_legacy_hal_stubs.cpp | 2 + wifi/aidl/default/wifi_rtt_controller.cpp | 60 ++++++- 16 files changed, 400 insertions(+), 52 deletions(-) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl index cf64687c50..56ef2d204d 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl @@ -42,4 +42,9 @@ parcelable RttCapabilities { android.hardware.wifi.RttPreamble preambleSupport; android.hardware.wifi.RttBw bwSupport; byte mcVersion; + android.hardware.wifi.RttPreamble azPreambleSupport; + android.hardware.wifi.RttBw azBwSupport; + boolean ntbInitiatorSupported; + boolean ntbResponderSupported; + int maxTxLtfRepetitionCount; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl index ccdf2cee68..b7830bd126 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl @@ -48,4 +48,7 @@ parcelable RttConfig { int burstDuration; android.hardware.wifi.RttPreamble preamble; android.hardware.wifi.RttBw bw; + int ntbMinMeasurementTimeMillis; + int ntbMaxMeasurementTimeMillis; + int txLtfRepetitionCount; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl index de26f28f81..280246451e 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl @@ -34,6 +34,7 @@ package android.hardware.wifi; @Backing(type="int") @VintfStability enum RttPreamble { + INVALID = 0, LEGACY = 0x1, HT = 0x2, VHT = 0x4, diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl index 8375dcb148..30f5f58b52 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl @@ -59,4 +59,7 @@ parcelable RttResult { android.hardware.wifi.WifiInformationElement lcr; int channelFreqMHz; android.hardware.wifi.RttBw packetBw; + int txLtfRepetitionCount; + int ntbMinMeasurementTimeMillis; + int ntbMaxMeasurementTimeMillis; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl index 2b6087a6bc..cb25673af3 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl @@ -36,4 +36,6 @@ package android.hardware.wifi; enum RttType { ONE_SIDED = 1, TWO_SIDED = 2, + TWO_SIDED_11MC = TWO_SIDED /* 2 */, + TWO_SIDED_11AZ_NTB = 3, } diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl index 7c47ed5f9c..0352ec8ea6 100644 --- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl +++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl @@ -33,24 +33,25 @@ parcelable RttCapabilities { */ boolean rttFtmSupported; /** - * Whether initiator supports LCI request. Applies to 2-sided RTT. + * Whether initiator supports Location Configuration Information (LCI) request. Applies to + * 2-sided RTT. */ boolean lciSupported; /** - * Whether initiator supports LCR request. Applies to 2-sided RTT. + * Whether initiator supports Location Civic Report (LCR) request. Applies to 2-sided RTT. */ boolean lcrSupported; /** - * Whether 11mc responder mode is supported. + * Whether IEEE 802.11mc responder mode is supported. */ boolean responderSupported; /** - * Bit mask indicating what preamble is supported by initiator. + * Bit mask indicating what preamble is supported by IEEE 802.11mc initiator. * Combination of |RttPreamble| values. */ RttPreamble preambleSupport; /** - * Bit mask indicating what BW is supported by initiator. + * Bit mask indicating what BW is supported by IEEE 802.11mc initiator. * Combination of |RttBw| values. */ RttBw bwSupport; @@ -59,4 +60,27 @@ parcelable RttCapabilities { * For instance, version 4.0 must be 40 and version 4.3 must be 43 etc. */ byte mcVersion; + /** + * Bit mask indicating what preamble is supported by IEEE 802.11az initiator. + * Combination of |RttPreamble| values. + */ + RttPreamble azPreambleSupport; + /** + * Bit mask indicating what BW is supported by IEEE 802.11az initiator. + * Combination of |RttBw| values. + */ + RttBw azBwSupport; + /** + * Whether the initiator supports IEEE 802.11az Non-Trigger-based (non-TB) measurement. + */ + boolean ntbInitiatorSupported; + /** + * Whether IEEE 802.11az Non-Trigger-based (non-TB) responder mode is supported. + */ + boolean ntbResponderSupported; + /** + * Maximum HE LTF repetitions the IEEE 802.11az initiator is capable of transmitting in the + * preamble of I2R NDP. + */ + int maxTxLtfRepetitionCount; } diff --git a/wifi/aidl/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/android/hardware/wifi/RttConfig.aidl index fc2c2e0e7e..e970656229 100644 --- a/wifi/aidl/android/hardware/wifi/RttConfig.aidl +++ b/wifi/aidl/android/hardware/wifi/RttConfig.aidl @@ -32,7 +32,7 @@ parcelable RttConfig { */ byte[6] addr; /** - * 1-sided or 2-sided RTT. + * 1-sided or 2-sided RTT (IEEE 802.11mc or IEEE 802. 11az). */ RttType type; /** @@ -47,6 +47,8 @@ parcelable RttConfig { * Time interval between bursts (units: 100 ms). * Applies to 1-sided and 2-sided RTT multi-burst requests. * Range: 0-31, 0: no preference by initiator (2-sided RTT). + * + * Note: Applicable to IEEE 802.11mc only. */ int burstPeriod; /** @@ -60,6 +62,9 @@ parcelable RttConfig { * number of RTT results is the following: * for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst) * for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1) + * + * Note: Applicable to IEEE 802.11mc only. For IEEE 802.11az refer + * |RttConfig.txLtfRepetitionCount|. */ int numBurst; /** @@ -70,6 +75,8 @@ parcelable RttConfig { * equals the number of FTM frames that the * initiator will request that the responder sends * in a single frame. + * + * Note: Applicable to IEEE 802.11mc only. */ int numFramesPerBurst; /** @@ -95,8 +102,8 @@ parcelable RttConfig { */ boolean mustRequestLcr; /** - * Applies to 1-sided and 2-sided RTT. Valid values will - * be 2-11 and 15 as specified by the 802.11mc std for + * Applies to 1-sided and 2-sided IEEE 802.11mc RTT. Valid values will + * be 2-11 and 15 as specified by the IEEE 802.11mc std for * the FTM parameter burst duration. In a multi-burst * request, if responder overrides with larger value, * the initiator will return failure. In a single-burst @@ -113,4 +120,17 @@ parcelable RttConfig { * RTT BW to be used in the RTT frames. */ RttBw bw; + /** + * IEEE 802.11az Non-Trigger-based (non-TB) minimum measurement time in milliseconds. + */ + int ntbMinMeasurementTimeMillis; + /** + * IEEE 802.11az Non-Trigger-based (non-TB) maximum measurement time in milliseconds. + */ + int ntbMaxMeasurementTimeMillis; + /** + * Multiple transmissions of HE-LTF symbols in an HE Ranging NDP. A value of 1 indicates no + * repetition. + */ + int txLtfRepetitionCount; } diff --git a/wifi/aidl/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/android/hardware/wifi/RttPreamble.aidl index e460a94978..21df171bf6 100644 --- a/wifi/aidl/android/hardware/wifi/RttPreamble.aidl +++ b/wifi/aidl/android/hardware/wifi/RttPreamble.aidl @@ -22,6 +22,7 @@ package android.hardware.wifi; @VintfStability @Backing(type="int") enum RttPreamble { + INVALID = 0, LEGACY = 0x1, HT = 0x2, VHT = 0x4, diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl index 6c45e2c349..2cb0afa317 100644 --- a/wifi/aidl/android/hardware/wifi/RttResult.aidl +++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl @@ -33,6 +33,8 @@ parcelable RttResult { byte[6] addr; /** * Burst number in a multi-burst request. + * + * Note: Applicable to 1-sided RTT and 2-sided IEEE 802.11mc only. */ int burstNum; /** @@ -45,7 +47,7 @@ parcelable RttResult { int successNumber; /** * Maximum number of "FTM frames per burst" supported by - * the responder STA. Applies to 2-sided RTT only. + * the responder STA. Applies to 2-sided IEEE 802.11mc RTT only. * If reponder overrides with larger value: * - for single-burst request, initiator will truncate the * larger value and send a TMR_STOP after receiving as @@ -59,10 +61,8 @@ parcelable RttResult { */ RttStatus status; /** - * If status is RTT_STATUS_FAIL_BUSY_TRY_LATER, - * this will be the time provided by the responder as to - * when the request can be tried again. Applies to 2-sided - * RTT only. In sec, 1-31 sec. + * If status is RTT_STATUS_FAIL_BUSY_TRY_LATER, this will be the time provided by the responder + * as to when the request can be tried again. Applies to 2-sided RTT only. In sec, 1-31 sec. */ byte retryAfterDuration; /** @@ -104,11 +104,13 @@ parcelable RttResult { */ int distanceInMm; /** - * Standard deviation in mm (optional). + * Standard deviation in mm. */ int distanceSdInMm; /** * Difference between max and min distance recorded in mm (optional). + * + * Note: Only applicable for IEEE 802.11mc */ int distanceSpreadInMm; /** @@ -116,21 +118,20 @@ parcelable RttResult { */ long timeStampInUs; /** - * Actual time taken by the FW to finish one burst - * measurement (in ms). Applies to 1-sided and 2-sided RTT. + * Actual time taken by the FW to finish one burst measurement (in ms). Applies to 1-sided + * and 2-sided IEEE 802.11mc RTT. */ int burstDurationInMs; /** - * Number of bursts allowed by the responder. Applies - * to 2-sided RTT only. + * Number of bursts allowed by the responder. Applies to 2-sided IEEE 802.11mc RTT only. */ int negotiatedBurstNum; /** - * For 11mc only. + * For IEEE 802.11mc and IEEE 802.11az only. */ WifiInformationElement lci; /** - * For 11mc only. + * For IEEE 802.11mc and IEEE 802.11az only. */ WifiInformationElement lcr; /** @@ -140,8 +141,38 @@ parcelable RttResult { int channelFreqMHz; /** * RTT packet bandwidth. - * This value is an average bandwidth of the bandwidths of measurement - * frames. Cap the average close to a specific valid RttBw. + * This value is an average bandwidth of the bandwidths of measurement frames. Cap the average + * close to a specific valid RttBw. */ RttBw packetBw; + /** + * IEEE 802.11az Transmit LTF repetitions used to get this result. + */ + int txLtfRepetitionCount; + /** + * Minimum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the + * IEEE 802.11az responder. + * + * After initial non-TB negotiation, if the next ranging request for this peer comes in between + * [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding + * sequence for dynamic non-TB measurement. + * + * If the ranging request for this peer comes sooner than minimum measurement time, vendor + * software shall return the cached result of the last measurement including the time stamp + * |RttResult.timestamp|. + */ + int ntbMinMeasurementTimeMillis; + /** + * Maximum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the + * IEEE 802.11az responder. + * + * After initial non-TB negotiation, if the next ranging request for this peer comes in between + * [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding + * sequence for dynamic non-TB measurement. + * + * If the ranging request for this peer comes later than the maximum measurement time, vendor + * software shall clean up any existing IEEE 802.11ax non-TB ranging session and re-do the + * non-TB ranging negotiation. + */ + int ntbMaxMeasurementTimeMillis; } diff --git a/wifi/aidl/android/hardware/wifi/RttType.aidl b/wifi/aidl/android/hardware/wifi/RttType.aidl index e95a92875a..3f1a2f165b 100644 --- a/wifi/aidl/android/hardware/wifi/RttType.aidl +++ b/wifi/aidl/android/hardware/wifi/RttType.aidl @@ -23,5 +23,18 @@ package android.hardware.wifi; @Backing(type="int") enum RttType { ONE_SIDED = 1, + /** + * Two-sided RTT 11mc type. + * + * Note: TWO_SIDED was used for IEEE 802.11mc. Use TWO_SIDED_11MC for IEEE 802.11mc instead. + */ TWO_SIDED = 2, + /** + * Two-sided RTT 11mc type is same as two-sided. + */ + TWO_SIDED_11MC = TWO_SIDED, + /** + * Two-sided RTT 11az non trigger based (non-TB) type. + */ + TWO_SIDED_11AZ_NTB = 3, } diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 99420bd2bc..95ff7a2466 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -2418,8 +2418,11 @@ legacy_hal::wifi_rtt_type convertAidlRttTypeToLegacy(RttType type) { switch (type) { case RttType::ONE_SIDED: return legacy_hal::RTT_TYPE_1_SIDED; - case RttType::TWO_SIDED: - return legacy_hal::RTT_TYPE_2_SIDED; + case RttType::TWO_SIDED_11MC: + // Same as RttType::TWO_SIDED + return legacy_hal::RTT_TYPE_2_SIDED_11MC; + case RttType::TWO_SIDED_11AZ_NTB: + return legacy_hal::RTT_TYPE_2_SIDED_11AZ_NTB; }; CHECK(false); } @@ -2428,8 +2431,11 @@ RttType convertLegacyRttTypeToAidl(legacy_hal::wifi_rtt_type type) { switch (type) { case legacy_hal::RTT_TYPE_1_SIDED: return RttType::ONE_SIDED; - case legacy_hal::RTT_TYPE_2_SIDED: - return RttType::TWO_SIDED; + case legacy_hal::RTT_TYPE_2_SIDED_11MC: + // Same as legacy_hal::RTT_TYPE_2_SIDED + return RttType::TWO_SIDED_11MC; + case legacy_hal::RTT_TYPE_2_SIDED_11AZ_NTB: + return RttType::TWO_SIDED_11AZ_NTB; }; CHECK(false) << "Unknown legacy type: " << type; } @@ -2509,6 +2515,8 @@ legacy_hal::wifi_rtt_preamble convertAidlRttPreambleToLegacy(RttPreamble type) { return legacy_hal::WIFI_RTT_PREAMBLE_HE; case RttPreamble::EHT: return legacy_hal::WIFI_RTT_PREAMBLE_EHT; + case RttPreamble::INVALID: + return legacy_hal::WIFI_RTT_PREAMBLE_INVALID; }; CHECK(false); } @@ -2525,6 +2533,8 @@ RttPreamble convertLegacyRttPreambleToAidl(legacy_hal::wifi_rtt_preamble type) { return RttPreamble::HE; case legacy_hal::WIFI_RTT_PREAMBLE_EHT: return RttPreamble::EHT; + case legacy_hal::WIFI_RTT_PREAMBLE_INVALID: + return RttPreamble::INVALID; }; CHECK(false) << "Unknown legacy type: " << type; } @@ -2714,6 +2724,21 @@ bool convertAidlRttConfigToLegacy(const RttConfig& aidl_config, return true; } +bool convertAidlRttConfigToLegacyV3(const RttConfig& aidl_config, + legacy_hal::wifi_rtt_config_v3* legacy_config) { + if (!legacy_config) { + return false; + } + *legacy_config = {}; + if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config->rtt_config))) { + return false; + } + legacy_config->tx_ltf_repetition_count = aidl_config.txLtfRepetitionCount; + legacy_config->ntb_min_measurement_time_millis = aidl_config.ntbMinMeasurementTimeMillis; + legacy_config->ntb_max_measurement_time_millis = aidl_config.ntbMaxMeasurementTimeMillis; + return true; +} + bool convertAidlVectorOfRttConfigToLegacy( const std::vector& aidl_configs, std::vector* legacy_configs) { @@ -2723,7 +2748,24 @@ bool convertAidlVectorOfRttConfigToLegacy( *legacy_configs = {}; for (const auto& aidl_config : aidl_configs) { legacy_hal::wifi_rtt_config legacy_config; - if (!convertAidlRttConfigToLegacy(aidl_config, &legacy_config)) { + if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config))) { + return false; + } + legacy_configs->push_back(legacy_config); + } + return true; +} + +bool convertAidlVectorOfRttConfigToLegacyV3( + const std::vector& aidl_configs, + std::vector* legacy_configs) { + if (!legacy_configs) { + return false; + } + *legacy_configs = {}; + for (const auto& aidl_config : aidl_configs) { + legacy_hal::wifi_rtt_config_v3 legacy_config; + if (!convertAidlRttConfigToLegacyV3(aidl_config, &legacy_config)) { return false; } legacy_configs->push_back(legacy_config); @@ -2792,40 +2834,84 @@ bool convertLegacyRttResponderToAidl(const legacy_hal::wifi_rtt_responder& legac return true; } -bool convertLegacyRttCapabilitiesToAidl( - const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, - RttCapabilities* aidl_capabilities) { - if (!aidl_capabilities) { - return false; - } - *aidl_capabilities = {}; - aidl_capabilities->rttOneSidedSupported = legacy_capabilities.rtt_one_sided_supported; - aidl_capabilities->rttFtmSupported = legacy_capabilities.rtt_ftm_supported; - aidl_capabilities->lciSupported = legacy_capabilities.lci_support; - aidl_capabilities->lcrSupported = legacy_capabilities.lcr_support; - aidl_capabilities->responderSupported = legacy_capabilities.responder_supported; - int32_t preambleSupport = 0; +RttPreamble convertLegacyRttPreambleBitmapToAidl(byte legacyPreambleBitmap) { + int32_t aidlPreambleBitmap = 0; for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT, legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE, legacy_hal::WIFI_RTT_PREAMBLE_EHT}) { - if (legacy_capabilities.preamble_support & flag) { - preambleSupport |= static_cast::type>( + if (legacyPreambleBitmap & flag) { + aidlPreambleBitmap |= static_cast::type>( convertLegacyRttPreambleToAidl(flag)); } } - aidl_capabilities->preambleSupport = static_cast(preambleSupport); - int32_t bwSupport = 0; + + return static_cast(aidlPreambleBitmap); +} + +RttBw convertLegacyRttBwBitmapToAidl(byte legacyBwBitmap) { + int32_t aidlBwBitmap = 0; for (const auto flag : {legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20, legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160, legacy_hal::WIFI_RTT_BW_320}) { - if (legacy_capabilities.bw_support & flag) { - bwSupport |= + if (legacyBwBitmap & flag) { + aidlBwBitmap |= static_cast::type>(convertLegacyRttBwToAidl(flag)); } } - aidl_capabilities->bwSupport = static_cast(bwSupport); + return static_cast(aidlBwBitmap); +} + +bool convertLegacyRttCapabilitiesToAidl( + const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, + RttCapabilities* aidl_capabilities) { + if (!aidl_capabilities) { + return false; + } + *aidl_capabilities = {}; + aidl_capabilities->rttOneSidedSupported = legacy_capabilities.rtt_one_sided_supported; + aidl_capabilities->rttFtmSupported = legacy_capabilities.rtt_ftm_supported; + aidl_capabilities->lciSupported = legacy_capabilities.lci_support; + aidl_capabilities->lcrSupported = legacy_capabilities.lcr_support; + aidl_capabilities->responderSupported = legacy_capabilities.responder_supported; + aidl_capabilities->preambleSupport = + convertLegacyRttPreambleBitmapToAidl(legacy_capabilities.preamble_support); + aidl_capabilities->bwSupport = convertLegacyRttBwBitmapToAidl(legacy_capabilities.bw_support); aidl_capabilities->mcVersion = legacy_capabilities.mc_version; + // Initialize 11az parameters to default + aidl_capabilities->azPreambleSupport = RttPreamble::INVALID; + aidl_capabilities->azBwSupport = RttBw::BW_UNSPECIFIED; + aidl_capabilities->ntbInitiatorSupported = false; + aidl_capabilities->ntbResponderSupported = false; + aidl_capabilities->maxTxLtfRepetitionCount = 0; + return true; +} + +bool convertLegacyRttCapabilitiesV3ToAidl( + const legacy_hal::wifi_rtt_capabilities_v3& legacy_capabilities_v3, + RttCapabilities* aidl_capabilities) { + if (!aidl_capabilities) { + return false; + } + *aidl_capabilities = {}; + aidl_capabilities->rttOneSidedSupported = + legacy_capabilities_v3.rtt_capab.rtt_one_sided_supported; + aidl_capabilities->rttFtmSupported = legacy_capabilities_v3.rtt_capab.rtt_ftm_supported; + aidl_capabilities->lciSupported = legacy_capabilities_v3.rtt_capab.lci_support; + aidl_capabilities->lcrSupported = legacy_capabilities_v3.rtt_capab.lcr_support; + aidl_capabilities->responderSupported = legacy_capabilities_v3.rtt_capab.responder_supported; + aidl_capabilities->preambleSupport = + convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.rtt_capab.preamble_support); + aidl_capabilities->bwSupport = + convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.rtt_capab.bw_support); + aidl_capabilities->mcVersion = legacy_capabilities_v3.rtt_capab.mc_version; + aidl_capabilities->azPreambleSupport = + convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support); + aidl_capabilities->azBwSupport = + convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support); + aidl_capabilities->ntbInitiatorSupported = legacy_capabilities_v3.ntb_initiator_supported; + aidl_capabilities->ntbResponderSupported = legacy_capabilities_v3.ntb_responder_supported; + aidl_capabilities->maxTxLtfRepetitionCount = legacy_capabilities_v3.max_tx_ltf_repetition_count; return true; } @@ -2900,6 +2986,9 @@ bool convertLegacyVectorOfRttResultToAidl( } aidl_result.channelFreqMHz = 0; aidl_result.packetBw = RttBw::BW_UNSPECIFIED; + aidl_result.txLtfRepetitionCount = 0; + aidl_result.ntbMinMeasurementTimeMillis = 0; + aidl_result.ntbMaxMeasurementTimeMillis = 0; aidl_results->push_back(aidl_result); } return true; @@ -2920,6 +3009,33 @@ bool convertLegacyVectorOfRttResultV2ToAidl( aidl_result.channelFreqMHz = legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0; aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw); + aidl_result.txLtfRepetitionCount = 0; + aidl_result.ntbMinMeasurementTimeMillis = 0; + aidl_result.ntbMaxMeasurementTimeMillis = 0; + aidl_results->push_back(aidl_result); + } + return true; +} + +bool convertLegacyVectorOfRttResultV3ToAidl( + const std::vector& legacy_results, + std::vector* aidl_results) { + if (!aidl_results) { + return false; + } + *aidl_results = {}; + for (const auto legacy_result : legacy_results) { + RttResult aidl_result; + if (!convertLegacyRttResultToAidl(legacy_result->rtt_result.rtt_result, &aidl_result)) { + return false; + } + aidl_result.channelFreqMHz = legacy_result->rtt_result.frequency != UNSPECIFIED + ? legacy_result->rtt_result.frequency + : 0; + aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->rtt_result.packet_bw); + aidl_result.txLtfRepetitionCount = legacy_result->tx_ltf_repetition_count; + aidl_result.ntbMinMeasurementTimeMillis = legacy_result->ntb_min_measurement_time_millis; + aidl_result.ntbMaxMeasurementTimeMillis = legacy_result->ntb_max_measurement_time_millis; aidl_results->push_back(aidl_result); } return true; diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h index e4ff9638bb..3b9c81dc11 100644 --- a/wifi/aidl/default/aidl_struct_util.h +++ b/wifi/aidl/default/aidl_struct_util.h @@ -148,6 +148,10 @@ bool convertLegacyNanDataPathScheduleUpdateIndToAidl( // RTT controller conversion methods. bool convertAidlVectorOfRttConfigToLegacy(const std::vector& aidl_configs, std::vector* legacy_configs); +bool convertAidlVectorOfRttConfigToLegacyV3( + const std::vector& aidl_configs, + std::vector* legacy_configs); + bool convertAidlRttLciInformationToLegacy(const RttLciInformation& aidl_info, legacy_hal::wifi_lci_information* legacy_info); bool convertAidlRttLcrInformationToLegacy(const RttLcrInformation& aidl_info, @@ -161,12 +165,19 @@ bool convertLegacyRttResponderToAidl(const legacy_hal::wifi_rtt_responder& legac bool convertLegacyRttCapabilitiesToAidl( const legacy_hal::wifi_rtt_capabilities& legacy_capabilities, RttCapabilities* aidl_capabilities); +bool convertLegacyRttCapabilitiesV3ToAidl( + const legacy_hal::wifi_rtt_capabilities_v3& legacy_capabilities_v3, + RttCapabilities* aidl_capabilities); + bool convertLegacyVectorOfRttResultToAidl( const std::vector& legacy_results, std::vector* aidl_results); bool convertLegacyVectorOfRttResultV2ToAidl( const std::vector& legacy_results, std::vector* aidl_results); +bool convertLegacyVectorOfRttResultV3ToAidl( + const std::vector& legacy_results, + std::vector* aidl_results); uint32_t convertAidlWifiBandToLegacyMacBand(WifiBand band); uint32_t convertAidlWifiIfaceModeToLegacy(uint32_t aidl_iface_mask); uint32_t convertAidlUsableChannelFilterToLegacy(uint32_t aidl_filter_mask); diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp index 209670bc69..c411f296e7 100644 --- a/wifi/aidl/default/wifi_legacy_hal.cpp +++ b/wifi/aidl/default/wifi_legacy_hal.cpp @@ -183,10 +183,13 @@ std::function on_rtt_results_internal_callback_v2; +std::function + on_rtt_results_internal_callback_v3; void invalidateRttResultsCallbacks() { on_rtt_results_internal_callback = nullptr; on_rtt_results_internal_callback_v2 = nullptr; + on_rtt_results_internal_callback_v3 = nullptr; }; void onAsyncRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result* rtt_results[]) { @@ -206,6 +209,15 @@ void onAsyncRttResultsV2(wifi_request_id id, unsigned num_results, } } +void onAsyncRttResultsV3(wifi_request_id id, unsigned num_results, + wifi_rtt_result_v3* rtt_results_v3[]) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_rtt_results_internal_callback_v3) { + on_rtt_results_internal_callback_v3(id, num_results, rtt_results_v3); + invalidateRttResultsCallbacks(); + } +} + // Callbacks for the various NAN operations. // NOTE: These have very little conversions to perform before invoking the user // callbacks. @@ -1251,6 +1263,38 @@ wifi_error WifiLegacyHal::registerSubsystemRestartCallbackHandler( return status; } +wifi_error WifiLegacyHal::startRttRangeRequestV3( + const std::string& iface_name, wifi_request_id id, + const std::vector& rtt_configs, + const on_rtt_results_callback_v3& on_results_user_callback_v3) { + if (on_rtt_results_internal_callback_v3) { + return WIFI_ERROR_NOT_AVAILABLE; + } + + on_rtt_results_internal_callback_v3 = [on_results_user_callback_v3]( + wifi_request_id id, unsigned num_results, + wifi_rtt_result_v3* rtt_results_v3[]) { + if (num_results > 0 && !rtt_results_v3) { + LOG(ERROR) << "Unexpected nullptr in RTT v3 results"; + return; + } + std::vector rtt_results_vec_v3; + std::copy_if(rtt_results_v3, rtt_results_v3 + num_results, + back_inserter(rtt_results_vec_v3), + [](wifi_rtt_result_v3* rtt_result_v3) { return rtt_result_v3 != nullptr; }); + on_results_user_callback_v3(id, rtt_results_vec_v3); + }; + + std::vector rtt_configs_internal(rtt_configs); + wifi_error status = global_func_table_.wifi_rtt_range_request_v3( + id, getIfaceHandle(iface_name), rtt_configs.size(), rtt_configs_internal.data(), + {onAsyncRttResultsV3}); + if (status != WIFI_SUCCESS) { + invalidateRttResultsCallbacks(); + } + return status; +} + wifi_error WifiLegacyHal::startRttRangeRequest( const std::string& iface_name, wifi_request_id id, const std::vector& rtt_configs, @@ -1327,6 +1371,14 @@ std::pair WifiLegacyHal::getRttCapabilities( return {status, rtt_caps}; } +std::pair WifiLegacyHal::getRttCapabilitiesV3( + const std::string& iface_name) { + wifi_rtt_capabilities_v3 rtt_caps_v3; + wifi_error status = global_func_table_.wifi_get_rtt_capabilities_v3(getIfaceHandle(iface_name), + &rtt_caps_v3); + return {status, rtt_caps_v3}; +} + std::pair WifiLegacyHal::getRttResponderInfo( const std::string& iface_name) { wifi_rtt_responder rtt_responder; diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h index 6f012ec857..0f49f423c8 100644 --- a/wifi/aidl/default/wifi_legacy_hal.h +++ b/wifi/aidl/default/wifi_legacy_hal.h @@ -215,6 +215,8 @@ using ::RTT_STATUS_NO_WIFI; using ::RTT_STATUS_SUCCESS; using ::RTT_TYPE_1_SIDED; using ::RTT_TYPE_2_SIDED; +using ::RTT_TYPE_2_SIDED_11AZ_NTB; +using ::RTT_TYPE_2_SIDED_11MC; using ::RX_PKT_FATE_DRV_DROP_FILTER; using ::RX_PKT_FATE_DRV_DROP_INVALID; using ::RX_PKT_FATE_DRV_DROP_NOBUFS; @@ -350,16 +352,20 @@ using ::WIFI_RTT_BW_5; using ::WIFI_RTT_BW_80; using ::WIFI_RTT_BW_UNSPECIFIED; using ::wifi_rtt_capabilities; +using ::wifi_rtt_capabilities_v3; using ::wifi_rtt_config; +using ::wifi_rtt_config_v3; using ::wifi_rtt_preamble; using ::WIFI_RTT_PREAMBLE_EHT; using ::WIFI_RTT_PREAMBLE_HE; using ::WIFI_RTT_PREAMBLE_HT; +using ::WIFI_RTT_PREAMBLE_INVALID; using ::WIFI_RTT_PREAMBLE_LEGACY; using ::WIFI_RTT_PREAMBLE_VHT; using ::wifi_rtt_responder; using ::wifi_rtt_result; using ::wifi_rtt_result_v2; +using ::wifi_rtt_result_v3; using ::wifi_rtt_status; using ::wifi_rtt_type; using ::wifi_rx_packet_fate; @@ -486,6 +492,8 @@ using on_rtt_results_callback = std::function&)>; using on_rtt_results_callback_v2 = std::function&)>; +using on_rtt_results_callback_v3 = + std::function&)>; // Callback for ring buffer data. using on_ring_buffer_data_callback = std::function& rtt_configs, const on_rtt_results_callback& on_results_callback, const on_rtt_results_callback_v2& on_results_callback_v2); + wifi_error startRttRangeRequestV3(const std::string& iface_name, wifi_request_id id, + const std::vector& rtt_configs, + const on_rtt_results_callback_v3& on_results_callback); + wifi_error cancelRttRangeRequest(const std::string& iface_name, wifi_request_id id, const std::vector>& mac_addrs); std::pair getRttCapabilities(const std::string& iface_name); + std::pair getRttCapabilitiesV3( + const std::string& iface_name); std::pair getRttResponderInfo(const std::string& iface_name); wifi_error enableRttResponder(const std::string& iface_name, wifi_request_id id, const wifi_channel_info& channel_hint, uint32_t max_duration_secs, diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp index b5196c9af6..3d59c658a1 100644 --- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp @@ -179,6 +179,8 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_set_scan_mode); populateStubFor(&hal_fn->wifi_set_mlo_mode); populateStubFor(&hal_fn->wifi_get_supported_iface_concurrency_matrix); + populateStubFor(&hal_fn->wifi_get_rtt_capabilities_v3); + populateStubFor(&hal_fn->wifi_rtt_range_request_v3); return true; } diff --git a/wifi/aidl/default/wifi_rtt_controller.cpp b/wifi/aidl/default/wifi_rtt_controller.cpp index a5f6768951..9dee45ca4a 100644 --- a/wifi/aidl/default/wifi_rtt_controller.cpp +++ b/wifi/aidl/default/wifi_rtt_controller.cpp @@ -136,11 +136,45 @@ ndk::ScopedAStatus WifiRttController::registerEventCallbackInternal( ndk::ScopedAStatus WifiRttController::rangeRequestInternal( int32_t cmd_id, const std::vector& rtt_configs) { + // Try 11mc & 11az ranging (v3) + std::vector legacy_configs_v3; + if (!aidl_struct_util::convertAidlVectorOfRttConfigToLegacyV3(rtt_configs, + &legacy_configs_v3)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + std::weak_ptr weak_ptr_this = weak_ptr_this_; + const auto& on_results_callback_v3 = + [weak_ptr_this](legacy_hal::wifi_request_id id, + const std::vector& results) { + const auto shared_ptr_this = weak_ptr_this.lock(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "v3 Callback invoked on an invalid object"; + return; + } + std::vector aidl_results; + if (!aidl_struct_util::convertLegacyVectorOfRttResultV3ToAidl(results, + &aidl_results)) { + LOG(ERROR) << "Failed to convert rtt results v3 to AIDL structs"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onResults(id, aidl_results).isOk()) { + LOG(ERROR) << "Failed to invoke the v3 callback"; + } + } + }; + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequestV3( + ifname_, cmd_id, legacy_configs_v3, on_results_callback_v3); + + if (legacy_status != legacy_hal::WIFI_ERROR_NOT_SUPPORTED) { + return createWifiStatusFromLegacyError(legacy_status); + } + + // Fallback to 11mc ranging. std::vector legacy_configs; if (!aidl_struct_util::convertAidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) { return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); } - std::weak_ptr weak_ptr_this = weak_ptr_this_; const auto& on_results_callback = [weak_ptr_this](legacy_hal::wifi_request_id id, const std::vector& results) { @@ -181,7 +215,7 @@ ndk::ScopedAStatus WifiRttController::rangeRequestInternal( } } }; - legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest( + legacy_status = legacy_hal_.lock()->startRttRangeRequest( ifname_, cmd_id, legacy_configs, on_results_callback, on_results_callback_v2); return createWifiStatusFromLegacyError(legacy_status); } @@ -201,13 +235,29 @@ ndk::ScopedAStatus WifiRttController::rangeCancelInternal(int32_t cmd_id, std::pair WifiRttController::getCapabilitiesInternal() { legacy_hal::wifi_error legacy_status; - legacy_hal::wifi_rtt_capabilities legacy_caps; - std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_); + legacy_hal::wifi_rtt_capabilities_v3 legacy_caps_v3; + std::tie(legacy_status, legacy_caps_v3) = legacy_hal_.lock()->getRttCapabilitiesV3(ifname_); + // Try v3 API first, if it is not supported fallback. + if (legacy_status == legacy_hal::WIFI_ERROR_NOT_SUPPORTED) { + legacy_hal::wifi_rtt_capabilities legacy_caps; + std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {RttCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + + RttCapabilities aidl_caps; + if (!aidl_struct_util::convertLegacyRttCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + return {RttCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; + } + return {aidl_caps, ndk::ScopedAStatus::ok()}; + } + if (legacy_status != legacy_hal::WIFI_SUCCESS) { return {RttCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; } + RttCapabilities aidl_caps; - if (!aidl_struct_util::convertLegacyRttCapabilitiesToAidl(legacy_caps, &aidl_caps)) { + if (!aidl_struct_util::convertLegacyRttCapabilitiesV3ToAidl(legacy_caps_v3, &aidl_caps)) { return {RttCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)}; } return {aidl_caps, ndk::ScopedAStatus::ok()}; -- GitLab From 41498278a34547c79a77ab149c1acc898e31f85a Mon Sep 17 00:00:00 2001 From: Jag Saund Date: Tue, 5 Dec 2023 19:34:41 +0000 Subject: [PATCH 325/376] Camera: Low Light Boost AE Mode Auto-generated file from changes in metadata_definitions.xml Bug: 312803148 Test: Build Successful Change-Id: I7e29a6a9351da9fa03cbaea21286ca7fe1aa910f --- .../camera/metadata/CameraMetadataTag.aidl | 2 + .../camera/metadata/ControlAeMode.aidl | 1 + .../metadata/ControlLowLightBoostState.aidl | 43 +++++++++++++++++++ .../camera/metadata/CameraMetadataTag.aidl | 12 ++++++ .../camera/metadata/ControlAeMode.aidl | 1 + .../metadata/ControlLowLightBoostState.aidl | 34 +++++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl create mode 100644 camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl index b04e486a33..542b296272 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -98,6 +98,8 @@ enum CameraMetadataTag { ANDROID_CONTROL_AUTOFRAMING, ANDROID_CONTROL_AUTOFRAMING_AVAILABLE, ANDROID_CONTROL_AUTOFRAMING_STATE, + ANDROID_CONTROL_LOW_LIGHT_BOOST_INFO_LUMINANCE_RANGE, + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE, ANDROID_DEMOSAIC_MODE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_DEMOSAIC_START /* 131072 */, ANDROID_EDGE_MODE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_EDGE_START /* 196608 */, ANDROID_EDGE_STRENGTH, diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl index 5e1b87178e..c1423aa87e 100644 --- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl @@ -44,4 +44,5 @@ enum ControlAeMode { ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH, ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE, ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH, + ANDROID_CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY, } diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl new file mode 100644 index 0000000000..f8ae0130de --- /dev/null +++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *//* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.camera.metadata; +@Backing(type="int") @VintfStability +enum ControlLowLightBoostState { + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_INACTIVE, + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE, +} diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl index 2fefce0147..6f9b38f9cf 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl @@ -489,6 +489,18 @@ enum CameraMetadataTag { *

    Current state of auto-framing.

    */ ANDROID_CONTROL_AUTOFRAMING_STATE, + /** + * android.control.lowLightBoostInfoLuminanceRange [static, float[], public] + * + *

    The operating luminance range of low light boost measured in lux (lx).

    + */ + ANDROID_CONTROL_LOW_LIGHT_BOOST_INFO_LUMINANCE_RANGE, + /** + * android.control.lowLightBoostState [dynamic, enum, public] + * + *

    Current state of the low light boost AE mode.

    + */ + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE, /** * android.demosaic.mode [controls, enum, system] * diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl index e2f5553aee..70174bed27 100644 --- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl @@ -35,4 +35,5 @@ enum ControlAeMode { ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH, ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE, ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH, + ANDROID_CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY, } diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl new file mode 100644 index 0000000000..67591c8067 --- /dev/null +++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Autogenerated from camera metadata definitions in + * /system/media/camera/docs/metadata_definitions.xml + * *** DO NOT EDIT BY HAND *** + */ + +package android.hardware.camera.metadata; + +/** + * android.control.lowLightBoostState enumeration values + * @see ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE + */ +@VintfStability +@Backing(type="int") +enum ControlLowLightBoostState { + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_INACTIVE, + ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE, +} -- GitLab From b7ec0384dad91a8fd803e3cc63b580aa510e5707 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Tue, 28 Nov 2023 15:16:30 -0800 Subject: [PATCH 326/376] Add discovery session in the bootstrapping request and respond Bug: 292462023 Test: atest SingleDeviceTest Change-Id: I8ec57f5f2af14ccb546c452b82c62652c43f0d4e --- .../hardware/wifi/NanBootstrappingRequest.aidl | 2 ++ .../hardware/wifi/NanBootstrappingResponse.aidl | 1 + .../hardware/wifi/NanBootstrappingRequest.aidl | 12 ++++++++++++ .../hardware/wifi/NanBootstrappingResponse.aidl | 7 +++++++ wifi/aidl/default/aidl_struct_util.cpp | 3 +++ 5 files changed, 25 insertions(+) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl index dd0a5ede2f..b5f78b06b5 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -38,4 +38,6 @@ parcelable NanBootstrappingRequest { byte[6] peerDiscMacAddr; android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; byte[] cookie; + boolean isComeback; + byte discoverySessionId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl index 6dd9b2603a..7b17493d88 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -36,4 +36,5 @@ package android.hardware.wifi; parcelable NanBootstrappingResponse { int bootstrappingInstanceId; boolean acceptRequest; + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl index 4b74cd9e20..e23bd23607 100644 --- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -45,4 +45,16 @@ parcelable NanBootstrappingRequest { * Cookie received from previous |NanBootstrappingConfirmInd| for comeback request. */ byte[] cookie; + + /** + * Identify if it is a request for come back response + */ + boolean isComeback; + + /** + * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in + * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance + * ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl index dbe892316e..a2ee0e60e1 100644 --- a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -29,4 +29,11 @@ parcelable NanBootstrappingResponse { * True if accept the request, false otherwise. */ boolean acceptRequest; + + /** + * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in + * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance + * ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 99420bd2bc..a5b40909e6 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -3202,6 +3202,8 @@ bool convertAidlNanBootstrappingInitiatorRequestToLegacy( legacy_request->cookie_length = aidl_request.cookie.size(); memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length); + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); + legacy_request->comeback = aidl_request.isComeback ? 0x1 : 0x0; return true; } @@ -3219,6 +3221,7 @@ bool convertAidlNanBootstrappingIndicationResponseToLegacy( legacy_request->service_instance_id = aidl_request.bootstrappingInstanceId; legacy_request->rsp_code = aidl_request.acceptRequest ? NAN_BOOTSTRAPPING_REQUEST_ACCEPT : NAN_BOOTSTRAPPING_REQUEST_REJECT; + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); return true; } -- GitLab From b8c242abc7337e34880eeb15d375b3c3401f7497 Mon Sep 17 00:00:00 2001 From: "divya.n1" Date: Wed, 6 Dec 2023 15:09:19 +0530 Subject: [PATCH 327/376] Add capability bit for the roaming mode feature in the Vendor HAL interface. Bug: 269196966 Test: m Change-Id: I0d4e5ed922d88f8e557509d3aa1808e168b5a077 --- .../current/android/hardware/wifi/IWifiStaIface.aidl | 1 + wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl | 4 ++++ wifi/aidl/default/aidl_struct_util.cpp | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl index 923deff01f..7ab260ef83 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl @@ -77,5 +77,6 @@ interface IWifiStaIface { TDLS_OFFCHANNEL = (1 << 11) /* 2048 */, ND_OFFLOAD = (1 << 12) /* 4096 */, KEEP_ALIVE = (1 << 13) /* 8192 */, + ROAMING_MODE_CONTROL = (1 << 14) /* 16384 */, } } diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl index 6d6afafc12..27e28018b6 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl @@ -99,6 +99,10 @@ interface IWifiStaIface { * Support for keep alive packet offload. */ KEEP_ALIVE = 1 << 13, + /** + * Support for configuring roaming mode. + */ + ROAMING_MODE_CONTROL = 1 << 14, } /** diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 99420bd2bc..6fd58136b8 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -92,6 +92,8 @@ IWifiStaIface::FeatureSetMask convertLegacyStaIfaceFeatureToAidl(uint64_t featur return IWifiStaIface::FeatureSetMask::ND_OFFLOAD; case WIFI_FEATURE_MKEEP_ALIVE: return IWifiStaIface::FeatureSetMask::KEEP_ALIVE; + case WIFI_FEATURE_ROAMING_MODE_CONTROL: + return IWifiStaIface::FeatureSetMask::ROAMING_MODE_CONTROL; }; CHECK(false) << "Unknown legacy feature: " << feature; return {}; @@ -457,7 +459,8 @@ bool convertLegacyStaIfaceFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* {WIFI_FEATURE_GSCAN, WIFI_FEATURE_LINK_LAYER_STATS, WIFI_FEATURE_RSSI_MONITOR, WIFI_FEATURE_CONTROL_ROAMING, WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND, WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO, WIFI_FEATURE_TDLS, - WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE}) { + WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE, + WIFI_FEATURE_ROAMING_MODE_CONTROL}) { if (feature & legacy_feature_set) { *aidl_feature_set |= static_cast(convertLegacyStaIfaceFeatureToAidl(feature)); } -- GitLab From d43d834d768f0bcaf3cf2f2b37c29c5bcd035a15 Mon Sep 17 00:00:00 2001 From: Liana Kazanova Date: Thu, 7 Dec 2023 20:59:34 +0000 Subject: [PATCH 328/376] Revert "Freezing face api" This reverts commit b3a55af391480820e8688b1a6baf89da39e7ce63. Reason for revert: Potential culprit for b/315354499 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: Iab8a208df0704007b9ee29a3673c623eb968ce1b --- biometrics/face/aidl/Android.bp | 10 +-- .../android.hardware.biometrics.face/4/.hash | 1 - .../biometrics/face/AcquiredInfo.aidl | 64 ------------------- .../biometrics/face/AuthenticationFrame.aidl | 38 ----------- .../hardware/biometrics/face/BaseFrame.aidl | 43 ------------- .../hardware/biometrics/face/Cell.aidl | 40 ------------ .../biometrics/face/EnrollmentFrame.aidl | 40 ------------ .../biometrics/face/EnrollmentStage.aidl | 44 ------------- .../face/EnrollmentStageConfig.aidl | 39 ----------- .../biometrics/face/EnrollmentType.aidl | 39 ----------- .../hardware/biometrics/face/Error.aidl | 46 ------------- .../biometrics/face/FaceEnrollOptions.aidl | 46 ------------- .../biometrics/face/FaceSensorType.aidl | 40 ------------ .../hardware/biometrics/face/Feature.aidl | 40 ------------ .../hardware/biometrics/face/IFace.aidl | 39 ----------- .../hardware/biometrics/face/ISession.aidl | 62 ------------------ .../biometrics/face/ISessionCallback.aidl | 56 ---------------- .../hardware/biometrics/face/SensorProps.aidl | 47 -------------- .../compatibility_matrix.8.xml | 2 +- 19 files changed, 2 insertions(+), 734 deletions(-) delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl delete mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index efd114af20..6c8cd78945 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -60,16 +60,8 @@ aidl_interface { "android.hardware.keymaster-V4", ], }, - { - version: "4", - imports: [ - "android.hardware.biometrics.common-V3", - "android.hardware.common-V2", - "android.hardware.keymaster-V4", - ], - }, ], - frozen: true, + frozen: false, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash deleted file mode 100644 index dda89e4336..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash +++ /dev/null @@ -1 +0,0 @@ -33be703fa4cde5f04f976fa3f29d15fa4f3e70c5 diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl deleted file mode 100644 index 5312ca16d6..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum AcquiredInfo { - UNKNOWN, - GOOD, - INSUFFICIENT, - TOO_BRIGHT, - TOO_DARK, - TOO_CLOSE, - TOO_FAR, - FACE_TOO_HIGH, - FACE_TOO_LOW, - FACE_TOO_RIGHT, - FACE_TOO_LEFT, - POOR_GAZE, - NOT_DETECTED, - TOO_MUCH_MOTION, - RECALIBRATE, - TOO_DIFFERENT, - TOO_SIMILAR, - PAN_TOO_EXTREME, - TILT_TOO_EXTREME, - ROLL_TOO_EXTREME, - FACE_OBSCURED, - START, - SENSOR_DIRTY, - VENDOR, - FIRST_FRAME_RECEIVED, - DARK_GLASSES_DETECTED, - MOUTH_COVERING_DETECTED, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl deleted file mode 100644 index 20bc76779b..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable AuthenticationFrame { - android.hardware.biometrics.face.BaseFrame data; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl deleted file mode 100644 index 67b5cf4169..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable BaseFrame { - android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; - int vendorCode; - float pan; - float tilt; - float distance; - boolean isCancellable; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl deleted file mode 100644 index 6be8c8e975..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable Cell { - int x; - int y; - int z; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl deleted file mode 100644 index 0ea10d6ddb..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable EnrollmentFrame { - @nullable android.hardware.biometrics.face.Cell cell; - android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; - android.hardware.biometrics.face.BaseFrame data; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl deleted file mode 100644 index a203dbec18..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum EnrollmentStage { - UNKNOWN, - FIRST_FRAME_RECEIVED, - WAITING_FOR_CENTERING, - HOLD_STILL_IN_CENTER, - ENROLLING_MOVEMENT_1, - ENROLLING_MOVEMENT_2, - ENROLLMENT_FINISHED, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl deleted file mode 100644 index 48db2cf615..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable EnrollmentStageConfig { - android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; - List cells; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl deleted file mode 100644 index da1e8a3e95..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum EnrollmentType { - DEFAULT, - ACCESSIBILITY, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl deleted file mode 100644 index 28eb420587..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum Error { - UNKNOWN, - HW_UNAVAILABLE, - UNABLE_TO_PROCESS, - TIMEOUT, - NO_SPACE, - CANCELED, - UNABLE_TO_REMOVE, - VENDOR, - REENROLL_REQUIRED, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl deleted file mode 100644 index 23fa1474c9..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2023 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable FaceEnrollOptions { - android.hardware.keymaster.HardwareAuthToken hardwareAuthToken; - android.hardware.biometrics.face.EnrollmentType enrollmentType; - android.hardware.biometrics.face.Feature[] features; - /** - * @deprecated use {@link surfacePreview} instead {@link NativeHandle} a handle used to render content from the face HAL. Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}] should be set at one time. - */ - @nullable android.hardware.common.NativeHandle nativeHandlePreview; - @nullable android.view.Surface surfacePreview; - @nullable android.hardware.biometrics.common.OperationContext context; -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl deleted file mode 100644 index bf1677ceec..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum FaceSensorType { - UNKNOWN, - RGB, - IR, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl deleted file mode 100644 index 924e6af44e..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@Backing(type="byte") @VintfStability -enum Feature { - REQUIRE_ATTENTION, - REQUIRE_DIVERSE_POSES, - DEBUG, -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl deleted file mode 100644 index fc4a4d04bb..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -interface IFace { - android.hardware.biometrics.face.SensorProps[] getSensorProps(); - android.hardware.biometrics.face.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.face.ISessionCallback cb); -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl deleted file mode 100644 index 4d99f5a562..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -interface ISession { - void generateChallenge(); - void revokeChallenge(in long challenge); - android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); - /** - * @deprecated use {@link enrollWithOptions} instead. - */ - android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface); - android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); - android.hardware.biometrics.common.ICancellationSignal detectInteraction(); - void enumerateEnrollments(); - void removeEnrollments(in int[] enrollmentIds); - void getFeatures(); - void setFeature(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.Feature feature, boolean enabled); - void getAuthenticatorId(); - void invalidateAuthenticatorId(); - void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); - void close(); - android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); - /** - * @deprecated use {@link enrollWithOptions} instead. - */ - android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context); - android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); - void onContextChanged(in android.hardware.biometrics.common.OperationContext context); - android.hardware.biometrics.common.ICancellationSignal enrollWithOptions(in android.hardware.biometrics.face.FaceEnrollOptions options); -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl deleted file mode 100644 index bbace29aa0..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -interface ISessionCallback { - void onChallengeGenerated(in long challenge); - void onChallengeRevoked(in long challenge); - void onAuthenticationFrame(in android.hardware.biometrics.face.AuthenticationFrame frame); - void onEnrollmentFrame(in android.hardware.biometrics.face.EnrollmentFrame frame); - void onError(in android.hardware.biometrics.face.Error error, in int vendorCode); - void onEnrollmentProgress(in int enrollmentId, int remaining); - void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat); - void onAuthenticationFailed(); - void onLockoutTimed(in long durationMillis); - void onLockoutPermanent(); - void onLockoutCleared(); - void onInteractionDetected(); - void onEnrollmentsEnumerated(in int[] enrollmentIds); - void onFeaturesRetrieved(in android.hardware.biometrics.face.Feature[] features); - void onFeatureSet(android.hardware.biometrics.face.Feature feature); - void onEnrollmentsRemoved(in int[] enrollmentIds); - void onAuthenticatorIdRetrieved(in long authenticatorId); - void onAuthenticatorIdInvalidated(in long newAuthenticatorId); - void onSessionClosed(); -} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl deleted file mode 100644 index 8b3c51bb12..0000000000 --- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL file. Do not edit it manually. There are -// two cases: -// 1). this is a frozen version file - do not edit this in any case. -// 2). this is a 'current' file. If you make a backwards compatible change to -// the interface (from the latest frozen version), the build system will -// prompt you to update this file with `m -update-api`. -// -// You must not make a backward incompatible change to any AIDL file built -// with the aidl_interface module type with versions property set. The module -// type is used to build AIDL files in a way that they can be used across -// independently updatable components of the system. If a device is shipped -// with such a backward incompatible change, it has a high risk of breaking -// later when a module using the interface is updated, e.g., Mainline modules. - -package android.hardware.biometrics.face; -@VintfStability -parcelable SensorProps { - android.hardware.biometrics.common.CommonProps commonProps; - android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN; - boolean halControlsPreview; - int previewDisplayId; - int enrollPreviewWidth; - int enrollPreviewHeight; - float enrollTranslationX; - float enrollTranslationY; - float enrollPreviewScale; - boolean supportsDetectInteraction; -} diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 777eb84e2c..905778882a 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -116,7 +116,7 @@
    android.hardware.biometrics.face - 3-4 + 3 IFace default -- GitLab From 5b2ded4fa7a19b4dcb5d52e633b867e6eb9d9d0d Mon Sep 17 00:00:00 2001 From: Lei Ju Date: Tue, 5 Dec 2023 15:08:21 -0800 Subject: [PATCH 329/376] Add an API to get the name of the HAL client Bug: 315039707 Test: manual test by 1) run VTS context hub test and pass on pixel; 2) call the API in HAL and verify the string name returned. Change-Id: I6a42482ea5232b8664849821ba4ef63c49484086 --- .../contexthub/IContextHubCallback.aidl | 1 + .../contexthub/IContextHubCallback.aidl | 10 +++++++++- .../vts/VtsAidlHalContextHubTargetTest.cpp | 20 +++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl index d0099ffedb..4e99082ea8 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl @@ -40,5 +40,6 @@ interface IContextHubCallback { void handleTransactionResult(in int transactionId, in boolean success); void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); byte[16] getUuid(); + String getName(); const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; } diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl index 41fb266d9b..ebfc4d8c9f 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl @@ -92,12 +92,20 @@ interface IContextHubCallback { /** * This callback is passed to the HAL implementation to allow the HAL to request a UUID that - * uniquely identifies an IContextHubCallback. + * uniquely identifies a client. * * @return a byte array representating the UUID */ byte[16] getUuid(); + /** + * This callback gets the name of a client implementing this IContextHubCallback interface, + * which must be a hard-coded string and does not change at runtime. + * + *

    The name provides a human-readable way to identify a client for troubleshooting purpose. + */ + String getName(); + /** * Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the * Contexthub service must respond. diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index e780857f24..76b25b688e 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -49,8 +49,9 @@ using ::android::hardware::contexthub::vts_utils::kNonExistentAppId; using ::android::hardware::contexthub::vts_utils::waitForCallback; // 6612b522-b717-41c8-b48d-c0b1cc64e142 -const std::array kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, - 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42}; +constexpr std::array kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8, + 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42}; +const String16 kName{"VtsAidlHalContextHubTargetTest"}; class ContextHubAidl : public testing::TestWithParam> { public: @@ -135,6 +136,11 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH *out_uuid = kUuid; return Status::ok(); } + + Status getName(::android::String16* out_name) override { + *out_name = kName; + return Status::ok(); + } }; TEST_P(ContextHubAidl, TestRegisterCallback) { @@ -171,6 +177,11 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } + Status getName(::android::String16* out_name) override { + *out_name = kName; + return Status::ok(); + } + std::promise> promise; }; @@ -242,6 +253,11 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } + Status getName(::android::String16* out_name) override { + *out_name = kName; + return Status::ok(); + } + uint32_t expectedTransactionId = 0; std::promise promise; }; -- GitLab From b2d54bf98423c3e268eb345ceab6ffe7d79b1c45 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 4 Dec 2023 18:35:49 -0800 Subject: [PATCH 330/376] Return config using a copy not a pointer. Introduce VehiclePropertyStore.getPropConfig that returns a copy of the config instead of a constant pointer. If the internal map is updated, the pointer might become invalid, so it is safer to just return a copy. We do not modify the existing API for backward compatibility. Test: atest VehiclePropertyStoreTest Bug: 308202443 Change-Id: I769866a09577cc69d25276349b7688cabcbc0c20 --- .../hardware/src/FakeVehicleHardware.cpp | 24 +++++++++---------- .../common/include/VehiclePropertyStore.h | 8 ++++++- .../utils/common/src/VehiclePropertyStore.cpp | 11 +++++++++ .../common/test/VehiclePropertyStoreTest.cpp | 12 +++++----- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index acee9b327b..23f446bebb 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -304,13 +304,13 @@ void FakeVehicleHardware::init() { } // OBD2_LIVE_FRAME and OBD2_FREEZE_FRAME must be configured in default configs. - auto maybeObd2LiveFrame = mServerSidePropStore->getConfig(OBD2_LIVE_FRAME); + auto maybeObd2LiveFrame = mServerSidePropStore->getPropConfig(OBD2_LIVE_FRAME); if (maybeObd2LiveFrame.has_value()) { - mFakeObd2Frame->initObd2LiveFrame(*maybeObd2LiveFrame.value()); + mFakeObd2Frame->initObd2LiveFrame(maybeObd2LiveFrame.value()); } - auto maybeObd2FreezeFrame = mServerSidePropStore->getConfig(OBD2_FREEZE_FRAME); + auto maybeObd2FreezeFrame = mServerSidePropStore->getPropConfig(OBD2_FREEZE_FRAME); if (maybeObd2FreezeFrame.has_value()) { - mFakeObd2Frame->initObd2FreezeFrame(*maybeObd2FreezeFrame.value()); + mFakeObd2Frame->initObd2FreezeFrame(maybeObd2FreezeFrame.value()); } mServerSidePropStore->setOnValueChangeCallback( @@ -472,7 +472,7 @@ void FakeVehicleHardware::updateHvacTemperatureValueSuggestionInput( VhalResult FakeVehicleHardware::setHvacTemperatureValueSuggestion( const VehiclePropValue& hvacTemperatureValueSuggestion) { auto hvacTemperatureSetConfigResult = - mServerSidePropStore->getConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)); + mServerSidePropStore->getPropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)); if (!hvacTemperatureSetConfigResult.ok()) { return StatusError(getErrorCode(hvacTemperatureSetConfigResult)) << StringPrintf( @@ -499,7 +499,7 @@ VhalResult FakeVehicleHardware::setHvacTemperatureValueSuggestion( } auto updatedValue = mValuePool->obtain(hvacTemperatureValueSuggestion); - const auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfigResult.value()->configArray; + const auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfigResult.value().configArray; auto& hvacTemperatureValueSuggestionInput = updatedValue->value.floatValues; updateHvacTemperatureValueSuggestionInput(hvacTemperatureSetConfigArray, @@ -822,14 +822,14 @@ void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId, int32_ void FakeVehicleHardware::sendAdasPropertiesState(int32_t propertyId, int32_t state) { auto& adasDependentPropIds = mAdasEnabledPropToAdasPropWithErrorState.find(propertyId)->second; for (auto dependentPropId : adasDependentPropIds) { - auto dependentPropConfigResult = mServerSidePropStore->getConfig(dependentPropId); + auto dependentPropConfigResult = mServerSidePropStore->getPropConfig(dependentPropId); if (!dependentPropConfigResult.ok()) { ALOGW("Failed to get config for ADAS property 0x%x, error: %s", dependentPropId, getErrorMsg(dependentPropConfigResult).c_str()); continue; } auto& dependentPropConfig = dependentPropConfigResult.value(); - for (auto& areaConfig : dependentPropConfig->areaConfigs) { + for (auto& areaConfig : dependentPropConfig.areaConfigs) { int32_t hardcoded_state = state; // TODO: restore old/initial values here instead of hardcoded value (b/295542701) if (state == 1 && dependentPropId == toInt(VehicleProperty::CRUISE_CONTROL_TYPE)) { @@ -1702,12 +1702,12 @@ std::string FakeVehicleHardware::dumpSpecificProperty(const std::vectorgetConfig(prop); + auto result = mServerSidePropStore->getPropConfig(prop); if (!result.ok()) { msg += StringPrintf("No property %d\n", prop); continue; } - msg += dumpOnePropertyByConfig(rowNumber++, *result.value()); + msg += dumpOnePropertyByConfig(rowNumber++, result.value()); } return msg; } @@ -2014,7 +2014,7 @@ void FakeVehicleHardware::registerOnPropertySetErrorEvent( StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) { int32_t propId = options.propId; - auto configResult = mServerSidePropStore->getConfig(propId); + auto configResult = mServerSidePropStore->getPropConfig(propId); if (!configResult.ok()) { ALOGE("subscribe: property: %" PRId32 " is not supported", propId); return StatusCode::INVALID_ARG; @@ -2024,7 +2024,7 @@ StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) { for (int areaId : options.areaIds) { if (StatusCode status = subscribePropIdAreaIdLocked(propId, areaId, options.sampleRate, options.enableVariableUpdateRate, - *configResult.value()); + configResult.value()); status != StatusCode::OK) { return status; } diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index ef36532801..7b328f2e9e 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -143,11 +143,17 @@ class VehiclePropertyStore final { std::vector getAllConfigs() const EXCLUDES(mLock); - // Get the property config for the requested property. + // Deprecated, use getPropConfig instead. This is unsafe to use if registerProperty overwrites + // an existing config. android::base::Result getConfig(int32_t propId) const EXCLUDES(mLock); + // Get the property config for the requested property. + android::base::Result + getPropConfig(int32_t propId) const EXCLUDES(mLock); + // Set a callback that would be called when a property value has been updated. void setOnValueChangeCallback(const OnValueChangeCallback& callback) EXCLUDES(mLock); diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index 7d9d8b70ba..4171cf710a 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -318,6 +318,17 @@ VhalResult VehiclePropertyStore::getConfig(int32_t pro return &record->propConfig; } +VhalResult VehiclePropertyStore::getPropConfig(int32_t propId) const { + std::scoped_lock g(mLock); + + const VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered"; + } + + return record->propConfig; +} + void VehiclePropertyStore::setOnValueChangeCallback( const VehiclePropertyStore::OnValueChangeCallback& callback) { std::scoped_lock g(mLock); diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index 625652e41e..328d2440e3 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -101,16 +101,16 @@ TEST_F(VehiclePropertyStoreTest, testGetAllConfigs) { ASSERT_EQ(configs.size(), static_cast(2)); } -TEST_F(VehiclePropertyStoreTest, testGetConfig) { - VhalResult result = - mStore->getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); +TEST_F(VehiclePropertyStoreTest, testGetPropConfig) { + VhalResult result = + mStore->getPropConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY)); ASSERT_RESULT_OK(result); - ASSERT_EQ(*(result.value()), mConfigFuelCapacity); + ASSERT_EQ(result.value(), mConfigFuelCapacity); } -TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) { - VhalResult result = mStore->getConfig(INVALID_PROP_ID); +TEST_F(VehiclePropertyStoreTest, testGetPropConfigWithInvalidPropId) { + VhalResult result = mStore->getPropConfig(INVALID_PROP_ID); EXPECT_FALSE(result.ok()) << "expect error when getting a config for an invalid property ID"; EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG); -- GitLab From 863a1b2e54a0e58f15849aa91f84e49fa3ce05e9 Mon Sep 17 00:00:00 2001 From: Yu Shan Date: Mon, 4 Dec 2023 16:32:00 -0800 Subject: [PATCH 331/376] Use batched property updates in IVehicleHardware. This CL demonstrates how IVehicleHardware layer can batch property update events for all continuous properties subscribed at the same interval. For example, previously, 4 areas for tire pressure, despite subscribed with the same interval, will generate 4 property update events through 4 binder calls. Since they are updated at the same time, all the 4 events can be sent through one binder call. Note that this is different from the batching done at DefaultVehicleHal side where the property events are put into a queue for batching. If IVehicleHardware layer can provides batching, then we can avoid the extra latency introduced by batching in DefaultVehicleHal layer. In order to achieve batching, this CL adds several functions to VehiclePropertyStore that operates on a list of values. Note that VehiclePropertyStore is still backward compatible with this CL, meaning that old APIs are not affected. But in order to achieve better performance, caller can migrate to the newer APIs. Test: atest FakeVehicleHardwareTest VehicleHalVehicleUtilsTest Bug: 314850840 Change-Id: I94a13d3ed2b90aede4d627f73ce2f2828bb3e740 --- .../hardware/include/FakeVehicleHardware.h | 24 ++- .../hardware/src/FakeVehicleHardware.cpp | 139 ++++++++++++++---- .../common/include/VehiclePropertyStore.h | 28 +++- .../utils/common/src/VehiclePropertyStore.cpp | 109 ++++++++++---- .../common/test/VehiclePropertyStoreTest.cpp | 128 ++++++++++++++++ .../aidl/impl/vhal/src/DefaultVehicleHal.cpp | 1 + 6 files changed, 363 insertions(+), 66 deletions(-) diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h index 26fdee6372..8cd92b3b89 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h @@ -142,6 +142,16 @@ class FakeVehicleHardware : public IVehicleHardware { void handleRequestsOnce(); }; + struct RefreshInfo { + VehiclePropertyStore::EventMode eventMode; + int64_t intervalInNanos; + }; + + struct ActionForInterval { + std::unordered_set propIdAreaIdsToRefresh; + std::shared_ptr recurrentAction; + }; + const std::unique_ptr mFakeObd2Frame; const std::unique_ptr mFakeUserHal; // RecurrentTimer is thread-safe. @@ -154,8 +164,9 @@ class FakeVehicleHardware : public IVehicleHardware { std::unique_ptr mOnPropertySetErrorCallback; std::mutex mLock; - std::unordered_map, PropIdAreaIdHash> - mRecurrentActions GUARDED_BY(mLock); + std::unordered_map mRefreshInfoByPropIdAreaId + GUARDED_BY(mLock); + std::unordered_map mActionByIntervalInNanos GUARDED_BY(mLock); std::unordered_map mSavedProps GUARDED_BY(mLock); std::unordered_set mSubOnChangePropIdAreaIds GUARDED_BY(mLock); @@ -183,6 +194,10 @@ class FakeVehicleHardware : public IVehicleHardware { void onValueChangeCallback( const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) EXCLUDES(mLock); + // The callback that would be called when multiple vehicle property value changes happen. + void onValuesChangeCallback( + std::vector values) + EXCLUDES(mLock); // Load the config files in format '*.json' from the directory and parse the config files // into a map from property ID to ConfigDeclarations. void loadPropConfigsFromDir(const std::string& dirPath, @@ -276,6 +291,11 @@ class FakeVehicleHardware : public IVehicleHardware { const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& vehiclePropConfig) REQUIRES(mLock); + void registerRefreshLocked(PropIdAreaId propIdAreaId, VehiclePropertyStore::EventMode eventMode, + float sampleRateHz) REQUIRES(mLock); + void unregisterRefreshLocked(PropIdAreaId propIdAreaId) REQUIRES(mLock); + void refreshTimeStampForInterval(int64_t intervalInNanos) EXCLUDES(mLock); + static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp( aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action, int32_t keyCode, int32_t targetDisplay); diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 23f446bebb..c77a90f854 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -313,8 +313,9 @@ void FakeVehicleHardware::init() { mFakeObd2Frame->initObd2FreezeFrame(maybeObd2FreezeFrame.value()); } - mServerSidePropStore->setOnValueChangeCallback( - [this](const VehiclePropValue& value) { return onValueChangeCallback(value); }); + mServerSidePropStore->setOnValuesChangeCallback([this](std::vector values) { + return onValuesChangeCallback(std::move(values)); + }); } std::vector FakeVehicleHardware::getAllPropertyConfigs() const { @@ -2047,6 +2048,81 @@ bool FakeVehicleHardware::isVariableUpdateRateSupported(const VehiclePropConfig& return false; } +void FakeVehicleHardware::refreshTimeStampForInterval(int64_t intervalInNanos) { + std::unordered_map + eventModeByPropIdAreaId; + + { + std::scoped_lock lockGuard(mLock); + + if (mActionByIntervalInNanos.find(intervalInNanos) == mActionByIntervalInNanos.end()) { + ALOGE("No actions scheduled for the interval: %" PRId64 ", ignore the refresh request", + intervalInNanos); + return; + } + + ActionForInterval actionForInterval = mActionByIntervalInNanos[intervalInNanos]; + + // Make a copy so that we don't hold the lock while trying to refresh the timestamp. + // Refreshing the timestamp will inovke onValueChangeCallback which also requires lock, so + // we must not hold lock. + for (const PropIdAreaId& propIdAreaId : actionForInterval.propIdAreaIdsToRefresh) { + const RefreshInfo& refreshInfo = mRefreshInfoByPropIdAreaId[propIdAreaId]; + eventModeByPropIdAreaId[propIdAreaId] = refreshInfo.eventMode; + } + } + + mServerSidePropStore->refreshTimestamps(eventModeByPropIdAreaId); +} + +void FakeVehicleHardware::registerRefreshLocked(PropIdAreaId propIdAreaId, + VehiclePropertyStore::EventMode eventMode, + float sampleRateHz) { + if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) != mRefreshInfoByPropIdAreaId.end()) { + unregisterRefreshLocked(propIdAreaId); + } + + int64_t intervalInNanos = static_cast(1'000'000'000. / sampleRateHz); + RefreshInfo refreshInfo = { + .eventMode = eventMode, + .intervalInNanos = intervalInNanos, + }; + mRefreshInfoByPropIdAreaId[propIdAreaId] = refreshInfo; + + if (mActionByIntervalInNanos.find(intervalInNanos) != mActionByIntervalInNanos.end()) { + // If we have already registered for this interval, then add the action info to the + // actions list. + mActionByIntervalInNanos[intervalInNanos].propIdAreaIdsToRefresh.insert(propIdAreaId); + return; + } + + // This is the first action for the interval, register a timer callback for that interval. + auto action = std::make_shared( + [this, intervalInNanos] { refreshTimeStampForInterval(intervalInNanos); }); + mActionByIntervalInNanos[intervalInNanos] = ActionForInterval{ + .propIdAreaIdsToRefresh = {propIdAreaId}, + .recurrentAction = action, + }; + mRecurrentTimer->registerTimerCallback(intervalInNanos, action); +} + +void FakeVehicleHardware::unregisterRefreshLocked(PropIdAreaId propIdAreaId) { + if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) == mRefreshInfoByPropIdAreaId.end()) { + ALOGW("PropId: %" PRId32 ", areaId: %" PRId32 " was not registered for refresh, ignore", + propIdAreaId.propId, propIdAreaId.areaId); + return; + } + + int64_t intervalInNanos = mRefreshInfoByPropIdAreaId[propIdAreaId].intervalInNanos; + auto& actionForInterval = mActionByIntervalInNanos[intervalInNanos]; + actionForInterval.propIdAreaIdsToRefresh.erase(propIdAreaId); + if (actionForInterval.propIdAreaIdsToRefresh.empty()) { + mRecurrentTimer->unregisterTimerCallback(actionForInterval.recurrentAction); + mActionByIntervalInNanos.erase(intervalInNanos); + } + mRefreshInfoByPropIdAreaId.erase(propIdAreaId); +} + StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked( int32_t propId, int32_t areaId, float sampleRateHz, bool enableVariableUpdateRate, const VehiclePropConfig& vehiclePropConfig) { @@ -2066,11 +2142,6 @@ StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked( ALOGE("Must not use sample rate 0 for a continuous property"); return StatusCode::INTERNAL_ERROR; } - if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) { - mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); - } - int64_t intervalInNanos = static_cast(1'000'000'000. / sampleRateHz); - // For continuous properties, we must generate a new onPropertyChange event // periodically according to the sample rate. auto eventMode = VehiclePropertyStore::EventMode::ALWAYS; @@ -2078,12 +2149,8 @@ StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked( enableVariableUpdateRate) { eventMode = VehiclePropertyStore::EventMode::ON_VALUE_CHANGE; } - auto action = - std::make_shared([this, propId, areaId, eventMode] { - mServerSidePropStore->refreshTimestamp(propId, areaId, eventMode); - }); - mRecurrentTimer->registerTimerCallback(intervalInNanos, action); - mRecurrentActions[propIdAreaId] = action; + + registerRefreshLocked(propIdAreaId, eventMode, sampleRateHz); return StatusCode::OK; } } @@ -2094,39 +2161,47 @@ StatusCode FakeVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) { .propId = propId, .areaId = areaId, }; - if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) { - mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]); - mRecurrentActions.erase(propIdAreaId); + if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) != mRefreshInfoByPropIdAreaId.end()) { + unregisterRefreshLocked(propIdAreaId); } mSubOnChangePropIdAreaIds.erase(propIdAreaId); return StatusCode::OK; } void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) { - if (mOnPropertyChangeCallback == nullptr) { - return; - } + ATRACE_CALL(); + onValuesChangeCallback({value}); +} - PropIdAreaId propIdAreaId{ - .propId = value.prop, - .areaId = value.areaId, - }; +void FakeVehicleHardware::onValuesChangeCallback(std::vector values) { + ATRACE_CALL(); + std::vector subscribedUpdatedValues; { std::scoped_lock lockGuard(mLock); - if (mRecurrentActions.find(propIdAreaId) == mRecurrentActions.end() && - mSubOnChangePropIdAreaIds.find(propIdAreaId) == mSubOnChangePropIdAreaIds.end()) { - if (FAKE_VEHICLEHARDWARE_DEBUG) { - ALOGD("The updated property value: %s is not subscribed, ignore", - value.toString().c_str()); - } + if (mOnPropertyChangeCallback == nullptr) { return; } + + for (const auto& value : values) { + PropIdAreaId propIdAreaId{ + .propId = value.prop, + .areaId = value.areaId, + }; + if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) == mRefreshInfoByPropIdAreaId.end() && + mSubOnChangePropIdAreaIds.find(propIdAreaId) == mSubOnChangePropIdAreaIds.end()) { + if (FAKE_VEHICLEHARDWARE_DEBUG) { + ALOGD("The updated property value: %s is not subscribed, ignore", + value.toString().c_str()); + } + continue; + } + + subscribedUpdatedValues.push_back(value); + } } - std::vector updatedValues; - updatedValues.push_back(value); - (*mOnPropertyChangeCallback)(std::move(updatedValues)); + (*mOnPropertyChangeCallback)(std::move(subscribedUpdatedValues)); } void FakeVehicleHardware::loadPropConfigsFromDir( diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h index 7b328f2e9e..d9599ed72c 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h @@ -48,21 +48,21 @@ class VehiclePropertyStore final { enum class EventMode : uint8_t { /** - * Only invoke OnValueChangeCallback if the new property value (ignoring timestamp) is - * different than the existing value. + * Only invoke OnValueChangeCallback or OnValuesChangeCallback if the new property value + * (ignoring timestamp) is different than the existing value. * * This should be used for regular cases. */ ON_VALUE_CHANGE, /** - * Always invoke OnValueChangeCallback. + * Always invoke OnValueChangeCallback or OnValuesChangeCallback. * * This should be used for the special properties that are used for delivering event, e.g. * HW_KEY_INPUT. */ ALWAYS, /** - * Never invoke OnValueChangeCallback. + * Never invoke OnValueChangeCallback or OnValuesChangeCalblack. * * This should be used for continuous property subscription when the sample rate for the * subscription is smaller than the refresh rate for the property. E.g., the vehicle speed @@ -82,6 +82,10 @@ class VehiclePropertyStore final { using OnValueChangeCallback = std::function; + // Callback when one or more property values have been updated or new values added. + using OnValuesChangeCallback = std::function)>; + // Function that used to calculate unique token for given VehiclePropValue. using TokenFunction = std::function; @@ -99,7 +103,8 @@ class VehiclePropertyStore final { // 'status' would be initialized to {@code VehiclePropertyStatus::AVAILABLE}, if this is to // override an existing value, the status for the existing value would be used for the // overridden value. - // 'EventMode' controls whether the 'OnValueChangeCallback' will be called for this operation. + // 'EventMode' controls whether the 'OnValueChangeCallback' or 'OnValuesChangeCallback' will be + // called for this operation. // If 'useCurrentTimestamp' is true, the property value will be set to the current timestamp. VhalResult writeValue(VehiclePropValuePool::RecyclableType propValue, bool updateStatus = false, @@ -111,6 +116,11 @@ class VehiclePropertyStore final { // without generating event. This operation is atomic with other writeValue operations. void refreshTimestamp(int32_t propId, int32_t areaId, EventMode eventMode) EXCLUDES(mLock); + // Refresh the timestamp for multiple [propId, areaId]s. + void refreshTimestamps( + std::unordered_map eventModeByPropIdAreaId) + EXCLUDES(mLock); + // Remove a given property value from the property store. The 'propValue' would be used to // generate the key for the value to remove. void removeValue( @@ -157,6 +167,13 @@ class VehiclePropertyStore final { // Set a callback that would be called when a property value has been updated. void setOnValueChangeCallback(const OnValueChangeCallback& callback) EXCLUDES(mLock); + // Set a callback that would be called when one or more property values have been updated. + // For backward compatibility, this is optional. If this is not set, then multiple property + // updates will be delivered through multiple OnValueChangeCallback instead. + // It is recommended to set this and batch the property update events for better performance. + // If this is set, then OnValueChangeCallback will not be used. + void setOnValuesChangeCallback(const OnValuesChangeCallback& callback) EXCLUDES(mLock); + inline std::shared_ptr getValuePool() { return mValuePool; } private: @@ -184,6 +201,7 @@ class VehiclePropertyStore final { mutable std::mutex mLock; std::unordered_map mRecordsByPropId GUARDED_BY(mLock); OnValueChangeCallback mOnValueChangeCallback GUARDED_BY(mLock); + OnValuesChangeCallback mOnValuesChangeCallback GUARDED_BY(mLock); const Record* getRecordLocked(int32_t propId) const; diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp index 4171cf710a..6a2a695254 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp @@ -113,6 +113,9 @@ VhalResult VehiclePropertyStore::writeValue(VehiclePropValuePool::Recyclab bool valueUpdated = true; VehiclePropValue updatedValue; OnValueChangeCallback onValueChangeCallback = nullptr; + OnValuesChangeCallback onValuesChangeCallback = nullptr; + int32_t propId; + int32_t areaId; { std::scoped_lock g(mLock); @@ -122,7 +125,8 @@ VhalResult VehiclePropertyStore::writeValue(VehiclePropValuePool::Recyclab propValue->timestamp = elapsedRealtimeNano(); } - int32_t propId = propValue->prop; + propId = propValue->prop; + areaId = propValue->areaId; VehiclePropertyStore::Record* record = getRecordLocked(propId); if (record == nullptr) { @@ -163,52 +167,96 @@ VhalResult VehiclePropertyStore::writeValue(VehiclePropValuePool::Recyclab return {}; } updatedValue = *(record->values[recId]); - if (mOnValueChangeCallback == nullptr) { - return {}; - } + + onValuesChangeCallback = mOnValuesChangeCallback; onValueChangeCallback = mOnValueChangeCallback; } + if (onValuesChangeCallback == nullptr && onValueChangeCallback == nullptr) { + ALOGW("No callback registered, ignoring property update for propId: %" PRId32 + ", area ID: %" PRId32, + propId, areaId); + return {}; + } + // Invoke the callback outside the lock to prevent dead-lock. if (eventMode == EventMode::ALWAYS || valueUpdated) { - onValueChangeCallback(updatedValue); + if (onValuesChangeCallback != nullptr) { + onValuesChangeCallback({updatedValue}); + } else { + onValueChangeCallback(updatedValue); + } } return {}; } void VehiclePropertyStore::refreshTimestamp(int32_t propId, int32_t areaId, EventMode eventMode) { - VehiclePropValue updatedValue; + std::unordered_map eventModeByPropIdAreaId; + PropIdAreaId propIdAreaId = { + .propId = propId, + .areaId = areaId, + }; + eventModeByPropIdAreaId[propIdAreaId] = eventMode; + refreshTimestamps(eventModeByPropIdAreaId); +} + +void VehiclePropertyStore::refreshTimestamps( + std::unordered_map eventModeByPropIdAreaId) { + std::vector updatedValues; + OnValuesChangeCallback onValuesChangeCallback = nullptr; OnValueChangeCallback onValueChangeCallback = nullptr; { std::scoped_lock g(mLock); - VehiclePropertyStore::Record* record = getRecordLocked(propId); - if (record == nullptr) { - return; - } + onValuesChangeCallback = mOnValuesChangeCallback; + onValueChangeCallback = mOnValueChangeCallback; - VehiclePropValue propValue = { - .areaId = areaId, - .prop = propId, - .value = {}, - }; + for (const auto& [propIdAreaId, eventMode] : eventModeByPropIdAreaId) { + int32_t propId = propIdAreaId.propId; + int32_t areaId = propIdAreaId.areaId; + VehiclePropertyStore::Record* record = getRecordLocked(propId); + if (record == nullptr) { + continue; + } - VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); - if (auto it = record->values.find(recId); it != record->values.end()) { - it->second->timestamp = elapsedRealtimeNano(); - updatedValue = *(it->second); - } else { - return; - } - if (!mOnValueChangeCallback) { - return; + VehiclePropValue propValue = { + .areaId = areaId, + .prop = propId, + .value = {}, + }; + + VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record); + if (auto it = record->values.find(recId); it != record->values.end()) { + it->second->timestamp = elapsedRealtimeNano(); + if (eventMode == EventMode::ALWAYS) { + updatedValues.push_back(*(it->second)); + } + } else { + continue; + } } - onValueChangeCallback = mOnValueChangeCallback; } // Invoke the callback outside the lock to prevent dead-lock. - if (eventMode == EventMode::ALWAYS) { - onValueChangeCallback(updatedValue); + if (updatedValues.empty()) { + return; + } + if (!onValuesChangeCallback && !onValueChangeCallback) { + // If no callback is set, then we don't have to do anything. + for (const auto& updateValue : updatedValues) { + ALOGW("No callback registered, ignoring property update for propId: %" PRId32 + ", area ID: %" PRId32, + updateValue.prop, updateValue.areaId); + } + return; + } + if (onValuesChangeCallback != nullptr) { + onValuesChangeCallback(updatedValues); + } else { + // Fallback to use multiple onValueChangeCallback + for (const auto& updateValue : updatedValues) { + onValueChangeCallback(updateValue); + } } } @@ -336,6 +384,13 @@ void VehiclePropertyStore::setOnValueChangeCallback( mOnValueChangeCallback = callback; } +void VehiclePropertyStore::setOnValuesChangeCallback( + const VehiclePropertyStore::OnValuesChangeCallback& callback) { + std::scoped_lock g(mLock); + + mOnValuesChangeCallback = callback; +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp index 328d2440e3..6646b7e752 100644 --- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp @@ -20,6 +20,7 @@ #include #include #include +#include namespace android { namespace hardware { @@ -527,6 +528,133 @@ TEST_F(VehiclePropertyStoreTest, testPropertyChangeCallbackUseVehiclePropertySto ASSERT_EQ(configs.size(), static_cast(2)); } +TEST_F(VehiclePropertyStoreTest, testOnValuesChangeCallback) { + std::vector updatedValues; + VehiclePropValue fuelCapacity = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity))); + + mStore->setOnValuesChangeCallback( + [&updatedValues](std::vector values) { updatedValues = values; }); + + fuelCapacity.value.floatValues[0] = 2.0; + fuelCapacity.timestamp = 1; + + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity))); + + ASSERT_THAT(updatedValues, ElementsAre(fuelCapacity)); +} + +TEST_F(VehiclePropertyStoreTest, testRefreshTimestamp) { + std::vector updatedValues; + mStore->setOnValuesChangeCallback( + [&updatedValues](std::vector values) { updatedValues = values; }); + + int64_t now = elapsedRealtimeNano(); + int propId = toInt(VehicleProperty::TIRE_PRESSURE); + int areaId = WHEEL_FRONT_LEFT; + VehiclePropValue tirePressure = { + .prop = propId, + .areaId = areaId, + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure))); + updatedValues.clear(); + + mStore->refreshTimestamp(propId, areaId, VehiclePropertyStore::EventMode::ALWAYS); + + ASSERT_EQ(updatedValues.size(), 1u); + ASSERT_EQ(updatedValues[0].prop, propId); + ASSERT_EQ(updatedValues[0].areaId, areaId); + ASSERT_EQ(updatedValues[0].value.floatValues[0], 1.0); + int64_t timestamp = updatedValues[0].timestamp; + ASSERT_GE(timestamp, now); + + auto result = mStore->readValue(tirePressure); + + ASSERT_RESULT_OK(result); + ASSERT_EQ((result.value())->timestamp, timestamp); +} + +TEST_F(VehiclePropertyStoreTest, testRefreshTimestamp_eventModeOnValueChange) { + std::vector updatedValues; + mStore->setOnValuesChangeCallback( + [&updatedValues](std::vector values) { updatedValues = values; }); + + int64_t now = elapsedRealtimeNano(); + int propId = toInt(VehicleProperty::TIRE_PRESSURE); + int areaId = WHEEL_FRONT_LEFT; + VehiclePropValue tirePressure = { + .prop = propId, + .areaId = areaId, + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure))); + updatedValues.clear(); + + mStore->refreshTimestamp(propId, areaId, VehiclePropertyStore::EventMode::ON_VALUE_CHANGE); + + ASSERT_EQ(updatedValues.size(), 0u) + << "Must generate no property update events if only the timestamp is refreshed"; + + auto result = mStore->readValue(tirePressure); + + ASSERT_RESULT_OK(result); + ASSERT_GE((result.value())->timestamp, now) + << "Even though event mode is on value change, the store timestamp must be updated"; +} + +TEST_F(VehiclePropertyStoreTest, testRefreshTimestamps) { + std::vector updatedValues; + mStore->setOnValuesChangeCallback( + [&updatedValues](std::vector values) { updatedValues = values; }); + + int64_t now = elapsedRealtimeNano(); + int propId1 = toInt(VehicleProperty::INFO_FUEL_CAPACITY); + int areaId1 = 0; + VehiclePropValue fuelCapacity = { + .prop = propId1, + .areaId = areaId1, + .value = {.floatValues = {1.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity))); + + int propId2 = toInt(VehicleProperty::TIRE_PRESSURE); + int areaId2 = WHEEL_FRONT_LEFT; + VehiclePropValue tirePressure = { + .prop = propId2, + .areaId = areaId2, + .value = {.floatValues = {2.0}}, + }; + ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure))); + updatedValues.clear(); + + std::unordered_map + eventModeByPropIdAreaId; + eventModeByPropIdAreaId[PropIdAreaId{ + .propId = propId1, + .areaId = areaId1, + }] = VehiclePropertyStore::EventMode::ALWAYS; + eventModeByPropIdAreaId[PropIdAreaId{ + .propId = propId2, + .areaId = areaId2, + }] = VehiclePropertyStore::EventMode::ALWAYS; + + mStore->refreshTimestamps(eventModeByPropIdAreaId); + + ASSERT_EQ(updatedValues.size(), 2u); + ASSERT_EQ(updatedValues[0].prop, propId1); + ASSERT_EQ(updatedValues[0].areaId, areaId1); + ASSERT_EQ(updatedValues[0].value.floatValues[0], 1.0); + ASSERT_GE(updatedValues[0].timestamp, now); + ASSERT_EQ(updatedValues[1].prop, propId2); + ASSERT_EQ(updatedValues[1].areaId, areaId2); + ASSERT_EQ(updatedValues[1].value.floatValues[0], 2.0); + ASSERT_GE(updatedValues[1].timestamp, now); +} + } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp index 847f3b8df3..76d2f316ca 100644 --- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp +++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp @@ -194,6 +194,7 @@ void DefaultVehicleHal::handleBatchedPropertyEvents(std::vector& subscriptionManager, std::vector&& updatedValues) { + ATRACE_CALL(); auto manager = subscriptionManager.lock(); if (manager == nullptr) { ALOGW("the SubscriptionManager is destroyed, DefaultVehicleHal is ending"); -- GitLab From 307691384fabb5b9d7ffe3f9b435ccb992eea10c Mon Sep 17 00:00:00 2001 From: Nagendra Prasad Nagarle Basavaraju Date: Tue, 5 Dec 2023 03:10:04 +0000 Subject: [PATCH 332/376] VTS setGetAllowedNetworkTypesBitmap handle "LTE + LTE_CA" response Handle RIL reporting response for getAllowedNetworkTypesBitmap() with "LTE + LTE_CA" until Android T. Bug: 308538353 Test: atest VtsHalRadioTargetTest Change-Id: I32242dff1ab7f2f1923674e7880b547f6e55de93 --- radio/aidl/vts/radio_network_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp index a6ee2a68e6..32b246aa44 100644 --- a/radio/aidl/vts/radio_network_test.cpp +++ b/radio/aidl/vts/radio_network_test.cpp @@ -90,6 +90,11 @@ TEST_P(RadioNetworkTest, setGetAllowedNetworkTypesBitmap) { serial = GetRandomSerialNumber(); + // get aidl version + int32_t aidl_version; + ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version); + ASSERT_OK(aidl_status); + // save current value radio_network->getAllowedNetworkTypesBitmap(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -125,6 +130,11 @@ TEST_P(RadioNetworkTest, setGetAllowedNetworkTypesBitmap) { RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED, RadioError::NO_RESOURCES})); if (radioRsp_network->rspInfo.error == RadioError::NONE) { + if (aidl_version < 2) { + radioRsp_network->networkTypeBitmapResponse + &= ~static_cast(RadioAccessFamily::LTE_CA); + } + // verify we get the value we set EXPECT_EQ(radioRsp_network->networkTypeBitmapResponse, allowedNetworkTypesBitmap); } -- GitLab From 3d8c680f0a217b4faed3ace590c9890eb6adb35e Mon Sep 17 00:00:00 2001 From: TeYuan Wang Date: Tue, 21 Nov 2023 14:58:20 -0800 Subject: [PATCH 333/376] thermal: support more temperature and cooling device type Bug: 312540064 Test: build Change-Id: I6e11a181a09640e3f597344dbcbb7571b7e49453 --- compatibility_matrices/compatibility_matrix.9.xml | 2 +- thermal/aidl/Android.bp | 2 +- .../current/android/hardware/thermal/CoolingType.aidl | 4 ++++ .../current/android/hardware/thermal/TemperatureType.aidl | 8 +++++++- thermal/aidl/android/hardware/thermal/CoolingType.aidl | 4 ++++ .../aidl/android/hardware/thermal/TemperatureType.aidl | 6 ++++++ thermal/aidl/default/Android.bp | 2 +- thermal/aidl/default/thermal-example.xml | 2 +- thermal/aidl/vts/Android.bp | 2 +- 9 files changed, 26 insertions(+), 6 deletions(-) diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml index 023690d7d0..0b6f1127c1 100644 --- a/compatibility_matrices/compatibility_matrix.9.xml +++ b/compatibility_matrices/compatibility_matrix.9.xml @@ -577,7 +577,7 @@ android.hardware.thermal - 1 + 2 IThermal default diff --git a/thermal/aidl/Android.bp b/thermal/aidl/Android.bp index 9382b941b0..734aab7d0e 100644 --- a/thermal/aidl/Android.bp +++ b/thermal/aidl/Android.bp @@ -45,6 +45,6 @@ aidl_interface { imports: [], }, ], - frozen: true, + frozen: false, } diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl index 1f87cf29ae..5e88aa056c 100644 --- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl +++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl @@ -46,4 +46,8 @@ enum CoolingType { POWER_AMPLIFIER, DISPLAY, SPEAKER, + WIFI, + CAMERA, + FLASHLIGHT, + USB_PORT, } diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl index e9710a7987..665a36e8b1 100644 --- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl +++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl @@ -35,7 +35,7 @@ package android.hardware.thermal; /* @hide */ @Backing(type="int") @VintfStability enum TemperatureType { - UNKNOWN = (-1), + UNKNOWN = (-1) /* -1 */, CPU = 0, GPU = 1, BATTERY = 2, @@ -50,4 +50,10 @@ enum TemperatureType { DISPLAY = 11, MODEM = 12, SOC = 13, + WIFI = 14, + CAMERA = 15, + FLASHLIGHT = 16, + SPEAKER = 17, + AMBIENT = 18, + POGO = 19, } diff --git a/thermal/aidl/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/android/hardware/thermal/CoolingType.aidl index 08beb55d83..c00028debc 100644 --- a/thermal/aidl/android/hardware/thermal/CoolingType.aidl +++ b/thermal/aidl/android/hardware/thermal/CoolingType.aidl @@ -34,4 +34,8 @@ enum CoolingType { POWER_AMPLIFIER, DISPLAY, SPEAKER, + WIFI, + CAMERA, + FLASHLIGHT, + USB_PORT, } diff --git a/thermal/aidl/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/android/hardware/thermal/TemperatureType.aidl index 467d096439..ce2a9fcf7e 100644 --- a/thermal/aidl/android/hardware/thermal/TemperatureType.aidl +++ b/thermal/aidl/android/hardware/thermal/TemperatureType.aidl @@ -44,4 +44,10 @@ enum TemperatureType { DISPLAY = 11, MODEM = 12, SOC = 13, + WIFI = 14, + CAMERA = 15, + FLASHLIGHT = 16, + SPEAKER = 17, + AMBIENT = 18, + POGO = 19, } diff --git a/thermal/aidl/default/Android.bp b/thermal/aidl/default/Android.bp index 451e1e2c88..9fe62cebdb 100644 --- a/thermal/aidl/default/Android.bp +++ b/thermal/aidl/default/Android.bp @@ -27,7 +27,7 @@ cc_binary { vendor: true, stl: "c++_static", static_libs: [ - "android.hardware.thermal-V1-ndk", + "android.hardware.thermal-V2-ndk", "libbase", ], shared_libs: [ diff --git a/thermal/aidl/default/thermal-example.xml b/thermal/aidl/default/thermal-example.xml index bdee7446f0..08dc68ca04 100644 --- a/thermal/aidl/default/thermal-example.xml +++ b/thermal/aidl/default/thermal-example.xml @@ -1,7 +1,7 @@ android.hardware.thermal - 1 + 2 IThermal/default diff --git a/thermal/aidl/vts/Android.bp b/thermal/aidl/vts/Android.bp index b00eb33b1d..0812811738 100644 --- a/thermal/aidl/vts/Android.bp +++ b/thermal/aidl/vts/Android.bp @@ -32,7 +32,7 @@ cc_test { "libbinder_ndk", ], static_libs: [ - "android.hardware.thermal-V1-ndk", + "android.hardware.thermal-V2-ndk", ], test_suites: [ "vts", -- GitLab From dc9ead77777cd8a8b5c75be6334af2ca80957c26 Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Tue, 28 Nov 2023 15:58:22 +0530 Subject: [PATCH 334/376] Add findWithParams and connectWithParams to the P2P Supplicant AIDL Interface Also deprecates the previous find and connect methods. Bug: 296069900 Test: m Change-Id: I764b3a7e54a6676fab9d1f4728fdbca8ce4b3c6f --- .../wifi/supplicant/ISupplicantP2pIface.aidl | 14 ++++ .../wifi/supplicant/P2pConnectInfo.aidl | 44 ++++++++++++ .../wifi/supplicant/P2pDiscoveryInfo.aidl | 41 +++++++++++ .../hardware/wifi/supplicant/P2pScanType.aidl | 40 +++++++++++ .../wifi/supplicant/ISupplicantP2pIface.aidl | 45 ++++++++++-- .../wifi/supplicant/P2pConnectInfo.aidl | 68 +++++++++++++++++++ .../wifi/supplicant/P2pDiscoveryInfo.aidl | 49 +++++++++++++ .../hardware/wifi/supplicant/P2pScanType.aidl | 37 ++++++++++ 8 files changed, 334 insertions(+), 4 deletions(-) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index 19e6728420..0729646c9a 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -43,10 +43,16 @@ interface ISupplicantP2pIface { void cancelServiceDiscovery(in long identifier); void cancelWps(in String groupIfName); void configureExtListen(in int periodInMillis, in int intervalInMillis); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use connectWithParams. + */ String connect(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod, in String preSelectedPin, in boolean joinExistingGroup, in boolean persistent, in int goIntent); byte[] createNfcHandoverRequestMessage(); byte[] createNfcHandoverSelectMessage(); void enableWfd(in boolean enable); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams. + */ void find(in int timeoutInSec); void flush(); void flushServices(); @@ -93,8 +99,16 @@ interface ISupplicantP2pIface { String startWpsPinDisplay(in String groupIfName, in byte[] bssid); void startWpsPinKeypad(in String groupIfName, in String pin); void stopFind(); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams. + */ void findOnSocialChannels(in int timeoutInSec); + /** + * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams. + */ void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec); void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes); void configureEapolIpAddressAllocationParams(in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd); + String connectWithParams(in android.hardware.wifi.supplicant.P2pConnectInfo connectInfo); + void findWithParams(in android.hardware.wifi.supplicant.P2pDiscoveryInfo discoveryInfo); } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl new file mode 100644 index 0000000000..f4662de122 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pConnectInfo { + byte[6] peerAddress; + android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod; + String preSelectedPin; + boolean joinExistingGroup; + boolean persistent; + int goIntent; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl new file mode 100644 index 0000000000..5b7dd3f043 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable P2pDiscoveryInfo { + android.hardware.wifi.supplicant.P2pScanType scanType; + int frequencyMhz; + int timeoutInSec; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl new file mode 100644 index 0000000000..ff3efd2063 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@Backing(type="int") @VintfStability +enum P2pScanType { + FULL, + SOCIAL, + SPECIFIC_FREQ, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl index e58422c8ea..983ed154a4 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl @@ -16,11 +16,14 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; import android.hardware.wifi.supplicant.FreqRange; import android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback; import android.hardware.wifi.supplicant.ISupplicantP2pNetwork; import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.MiracastMode; +import android.hardware.wifi.supplicant.P2pConnectInfo; +import android.hardware.wifi.supplicant.P2pDiscoveryInfo; import android.hardware.wifi.supplicant.P2pFrameTypeMask; import android.hardware.wifi.supplicant.P2pGroupCapabilityMask; import android.hardware.wifi.supplicant.WpsConfigMethods; @@ -176,6 +179,9 @@ interface ISupplicantP2pIface { * Start P2P group formation with a discovered P2P peer. This includes * optional group owner negotiation, group interface setup, provisioning, * and establishing data connection. + *

    + * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * connectWithParams. * * @param peerAddress MAC address of the device to connect to. * @param provisionMethod Provisioning method to use. @@ -236,6 +242,9 @@ interface ISupplicantP2pIface { /** * Initiate a P2P service discovery with an optional timeout. + *

    + * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * findWithParams. * * @param timeoutInSec Max time to be spent is performing discovery. * Set to 0 to indefinitely continue discovery until an explicit @@ -782,8 +791,9 @@ interface ISupplicantP2pIface { /** * Initiate a P2P device discovery only on social channels. - * - * Full P2P discovery is performed through |ISupplicantP2pIface.find| method. + *

    + * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * findWithParams. * * @param timeoutInSec The maximum amount of time that should be spent in performing device * discovery. @@ -798,8 +808,9 @@ interface ISupplicantP2pIface { /** * Initiate a P2P device discovery on a specific frequency. - * - * Full P2P discovery is performed through |ISupplicantP2pIface.find| method. + *

    + * @deprecated This method is deprecated from AIDL v3, newer HALs should use + * findWithParams. * * @param freqInHz the frequency to be scanned. * @param timeoutInSec Max time to be spent is performing discovery. @@ -845,4 +856,30 @@ interface ISupplicantP2pIface { */ void configureEapolIpAddressAllocationParams( in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd); + + /** + * Start P2P group formation with a discovered P2P peer. This includes + * optional group owner negotiation, group interface setup, provisioning, + * and establishing data connection. + * + * @param connectInfo Parameters associated with this connection request. + * @return Pin generated, if |provisionMethod| uses one of the + * generated |PIN*| methods. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + */ + String connectWithParams(in P2pConnectInfo connectInfo); + + /** + * Initiate a P2P service discovery with an optional timeout. + * + * @param discoveryInfo Parameters associated with this discovery request. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_IFACE_INVALID| + * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| + */ + void findWithParams(in P2pDiscoveryInfo discoveryInfo); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl new file mode 100644 index 0000000000..f09b476392 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; +import android.hardware.wifi.supplicant.WpsProvisionMethod; + +/** + * Request parameters used for |ISupplicantP2pIface.connectWithParams| + */ +@VintfStability +parcelable P2pConnectInfo { + /** + * MAC address of the device to connect to. + */ + byte[6] peerAddress; + + /** + * Provisioning method to use. + */ + WpsProvisionMethod provisionMethod; + + /** + * Pin to be used, if |provisionMethod| uses one of the + * preselected |PIN*| methods. + */ + String preSelectedPin; + + /** + * Indicates that this is a command to join an existing group as a client. + * This means that the group owner negotiation step can be skipped. + * This must send a Provision Discovery Request message to the + * target group owner before associating for WPS provisioning. + */ + boolean joinExistingGroup; + + /** + * Used to request a persistent group to be formed. + */ + boolean persistent; + + /** + * Used to override the default Intent for this group owner + * negotiation (Values from 1-15). Refer to section 4.1.6 in + * Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.7. + */ + int goIntent; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl new file mode 100644 index 0000000000..ddb8a3d640 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.common.OuiKeyedData; +import android.hardware.wifi.supplicant.P2pScanType; + +/** + * Request parameters used for |ISupplicantP2pIface.findWithParams| + */ +@VintfStability +parcelable P2pDiscoveryInfo { + /** + * P2P scan type. + */ + P2pScanType scanType; + + /** + * Frequency to scan in MHz. Only valid the scan type is |P2pScanType.SPECIFIC_FREQ| + */ + int frequencyMhz; + + /** + * Max time, in seconds, to be spent in performing discovery. + * Set to 0 to indefinitely continue discovery until an explicit + * |stopFind| is sent. + */ + int timeoutInSec; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl new file mode 100644 index 0000000000..1ab14c40ef --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Scan types used in P2P. + */ +@VintfStability +@Backing(type="int") +enum P2pScanType { + /** + * All channels. + */ + FULL, + /** + * Social channels. + */ + SOCIAL, + /** + * Specific channel. + */ + SPECIFIC_FREQ, +} -- GitLab From 1652753c51e5e30c39d7abf407d4dcf58e29c363 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Wed, 6 Dec 2023 22:12:23 +0000 Subject: [PATCH 335/376] Add QosCharacteristics to the supplicant AIDL interface. Bug: 300870302 Test: m Change-Id: I91f44cad643c08d97def359939755597a93fee38 --- .../wifi/supplicant/MsduDeliveryInfo.aidl | 51 ++++++++ .../wifi/supplicant/QosCharacteristics.aidl | 59 +++++++++ .../wifi/supplicant/QosPolicyScsData.aidl | 7 + .../wifi/supplicant/MsduDeliveryInfo.aidl | 54 ++++++++ .../wifi/supplicant/QosCharacteristics.aidl | 120 ++++++++++++++++++ .../wifi/supplicant/QosPolicyScsData.aidl | 21 +++ 6 files changed, 312 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl new file mode 100644 index 0000000000..792e08d2cd --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable MsduDeliveryInfo { + android.hardware.wifi.supplicant.MsduDeliveryInfo.DeliveryRatio deliveryRatio; + byte countExponent; + @Backing(type="byte") @VintfStability + enum DeliveryRatio { + RATIO_95 = 1, + RATIO_96 = 2, + RATIO_97 = 3, + RATIO_98 = 4, + RATIO_99 = 5, + RATIO_99_9 = 6, + RATIO_99_99 = 7, + RATIO_99_999 = 8, + RATIO_99_9999 = 9, + } +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl new file mode 100644 index 0000000000..dacac8c49a --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable QosCharacteristics { + int minServiceIntervalUs; + int maxServiceIntervalUs; + int minDataRateKbps; + int delayBoundUs; + int optionalFieldMask; + char maxMsduSizeOctets; + int serviceStartTimeUs; + byte serviceStartTimeLinkId; + int meanDataRateKbps; + int burstSizeOctets; + char msduLifetimeMs; + android.hardware.wifi.supplicant.MsduDeliveryInfo msduDeliveryInfo; + @Backing(type="int") @VintfStability + enum QosCharacteristicsMask { + MAX_MSDU_SIZE = (1 << 0) /* 1 */, + SERVICE_START_TIME = (1 << 1) /* 2 */, + SERVICE_START_TIME_LINK_ID = (1 << 2) /* 4 */, + MEAN_DATA_RATE = (1 << 3) /* 8 */, + BURST_SIZE = (1 << 4) /* 16 */, + MSDU_LIFETIME = (1 << 5) /* 32 */, + MSDU_DELIVERY_INFO = (1 << 6) /* 64 */, + } +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl index 4e5e8ae961..20be616fbb 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -22,4 +22,11 @@ parcelable QosPolicyScsData { byte policyId; byte userPriority; android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams; + android.hardware.wifi.supplicant.QosPolicyScsData.LinkDirection direction; + @nullable android.hardware.wifi.supplicant.QosCharacteristics QosCharacteristics; + @Backing(type="byte") @VintfStability + enum LinkDirection { + DOWNLINK, + UPLINK, + } } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl new file mode 100644 index 0000000000..8065f63b85 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * MSDU delivery information. + * See Section 9.4.2.316 of the IEEE P802.11be/D4.0 Standard. + */ +@VintfStability +parcelable MsduDeliveryInfo { + /** + * Enums for the |deliveryRatio| field. + * See Table 9-404t of the IEEE P802.11be/D4.0 Standard. + */ + @VintfStability + @Backing(type="byte") + enum DeliveryRatio { + RATIO_95 = 1, // 95% + RATIO_96 = 2, // 96% + RATIO_97 = 3, // 97% + RATIO_98 = 4, // 98% + RATIO_99 = 5, // 99% + RATIO_99_9 = 6, // 99.9% + RATIO_99_99 = 7, // 99.99% + RATIO_99_999 = 8, // 99.999% + RATIO_99_9999 = 9, // 99.9999% + } + + /** + * Percentage of the MSDUs that are expected to be delivered successfully. + */ + DeliveryRatio deliveryRatio; + + /** + * Exponent from which the number of incoming MSDUs is computed. The number of incoming + * MSDUs is 10^countExponent, and is used to determine the MSDU delivery ratio. + * Must be a number between 0 and 15 (inclusive). + */ + byte countExponent; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl new file mode 100644 index 0000000000..be5ef91356 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +import android.hardware.wifi.supplicant.MsduDeliveryInfo; + +/** + * Additional QoS parameters as defined in Section 9.4.2.316 + * of the IEEE P802.11be/D4.0 Standard. + */ +@VintfStability +parcelable QosCharacteristics { + /** + * Unsigned integer specifying the minimum interval (in microseconds) between the start of + * two consecutive service periods (SPs) that are allocated for frame exchanges. + * The value must be non-zero. + */ + int minServiceIntervalUs; + + /** + * Unsigned integer specifying the maximum interval (in microseconds) between the start of two + * consecutive SPs that are allocated for frame exchanges. The value must be non-zero. + */ + int maxServiceIntervalUs; + + /** + * Unsigned integer specifying the lowest data rate (in kilobits/sec) + * for the transport of MSDUs or A-MSDUs belonging to the traffic flow. + * The value must be non-zero. + */ + int minDataRateKbps; + + /** + * Unsigned integer specifying the maximum amount of time (in microseconds) + * targeted to transport an MSDU or A-MSDU belonging to the traffic flow. + * The value must be non-zero. + */ + int delayBoundUs; + + /** + * Enum values indicating which optional fields are provided. + * See Figure 9-1001au of the IEEE P802.11be/D4.0 Standard. + */ + @VintfStability + @Backing(type="int") + enum QosCharacteristicsMask { + MAX_MSDU_SIZE = 1 << 0, + SERVICE_START_TIME = 1 << 1, + SERVICE_START_TIME_LINK_ID = 1 << 2, + MEAN_DATA_RATE = 1 << 3, + BURST_SIZE = 1 << 4, + MSDU_LIFETIME = 1 << 5, + MSDU_DELIVERY_INFO = 1 << 6, + } + + /** + * Mask of |QosCharacteristicsMask| indicating which optional fields are provided. + */ + int optionalFieldMask; + + /** + * Unsigned 16-bit value specifying the maximum size (in octets) of an MSDU + * belonging to the traffic flow. The value must be non-zero if provided. + */ + char maxMsduSizeOctets; + + /** + * Unsigned integer specifying the anticipated time (in microseconds) when + * the traffic starts for the associated TID. + */ + int serviceStartTimeUs; + + /** + * The four LSBs indicate the link identifier that corresponds to the link for which the + * TSF timer is used to indicate the Service Start Time. The four MSBs should not be used. + * This field is present if |serviceStartTimeUs| is included and is not present otherwise. + */ + byte serviceStartTimeLinkId; + + /** + * Unsigned integer indicating the data rate specified (in kilobits/sec) for transport of MSDUs + * or A-MSDUs belonging to the traffic flow. The value must be non-zero if provided. + */ + int meanDataRateKbps; + + /** + * Unsigned integer specififying the maximum burst (in octets) of the MSDUs or A-MSDUs + * belonging to the traffic flow that arrive at the MAC SAP within any time duration equal + * to the value specified in the |delayBound| field. The value must be non-zero if provided. + */ + int burstSizeOctets; + + /** + * Unsigned 16-bit integer specifying the maximum amount of time (in milliseconds) since the + * arrival of the MSDU at the MAC data service interface beyond which the MSDU is not useful + * even if received by the receiver. The amount of time specified in this field is larger than + * or equal to the amount of time specified in the |delayBound| field, if present. The value + * must be non-zero if provided. + */ + char msduLifetimeMs; + + /** + * MSDU delivery information. See |MsduDeliveryInfo| for more details. + */ + MsduDeliveryInfo msduDeliveryInfo; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl index 86a4dac216..76f5a9a832 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -1,5 +1,6 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.supplicant.QosCharacteristics; import android.hardware.wifi.supplicant.QosPolicyClassifierParams; /** @@ -21,4 +22,24 @@ parcelable QosPolicyScsData { * QoS policy SCS classifier type information. */ QosPolicyClassifierParams classifierParams; + + /** + * Enum values for the |direction| field. + */ + @VintfStability + @Backing(type="byte") + enum LinkDirection { + DOWNLINK, + UPLINK, // Only applies to trigger-based traffic (Wi-Fi 6+) + } + + /** + * Direction of data described by this element. + */ + LinkDirection direction; + + /** + * Additional parameters available in QoS R3. + */ + @nullable QosCharacteristics QosCharacteristics; } -- GitLab From 38565ccd51beaa1ac0dc55cd46274572c323651b Mon Sep 17 00:00:00 2001 From: Manali Bhutiyani Date: Sat, 11 Nov 2023 06:16:24 +0000 Subject: [PATCH 336/376] [hwc-batching] AIDL changes for HWC command batching support. This CL adds the new aidl/apis for HWC command batching feature. Bug: 290685621 Test: atest VtsHalGraphicsComposer3_TargetTest atest PerInstance/GraphicsComposerAidlBatchedCommandTest Change-Id: I9e8a8afefb03e04a4cd4d8db36d72e29d30e975f --- .../graphics/composer3/LayerCommand.aidl | 2 + .../LayerLifecycleBatchCommandType.aidl | 40 ++++++++++++ .../graphics/composer3/LayerCommand.aidl | 14 +++++ .../LayerLifecycleBatchCommandType.aidl | 39 ++++++++++++ .../graphics/composer3/ComposerClientWriter.h | 10 +++ .../VtsHalGraphicsComposer3_TargetTest.cpp | 63 +++++++++++++++++++ 6 files changed, 168 insertions(+) create mode 100644 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl create mode 100644 graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl index 6d32218af1..87c8c18443 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl @@ -55,4 +55,6 @@ parcelable LayerCommand { @nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob; @nullable android.hardware.graphics.common.Rect[] blockingRegion; @nullable int[] bufferSlotsToClear; + android.hardware.graphics.composer3.LayerLifecycleBatchCommandType layerLifecycleBatchCommandType; + int newBufferSlotCount; } diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl new file mode 100644 index 0000000000..ac78cd51f9 --- /dev/null +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.graphics.composer3; +@Backing(type="int") @VintfStability +enum LayerLifecycleBatchCommandType { + MODIFY = 0, + CREATE = 1, + DESTROY = 2, +} diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index fd50be9cfe..e961c48700 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl @@ -23,6 +23,7 @@ import android.hardware.graphics.common.Rect; import android.hardware.graphics.composer3.Buffer; import android.hardware.graphics.composer3.Color; import android.hardware.graphics.composer3.LayerBrightness; +import android.hardware.graphics.composer3.LayerLifecycleBatchCommandType; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; import android.hardware.graphics.composer3.ParcelableDataspace; @@ -265,4 +266,17 @@ parcelable LayerCommand { * be freed. */ @nullable int[] bufferSlotsToClear; + + /** + * Specifies if this layer command is on type modify, create or destroy. + * This command is replacing the older IComposerClient.createLayer and destroyLayer + * and making it more efficient with reduced aidls to the HAL. + * The HAL will report the errors by setting CommandResultPayload::CommandError. + */ + LayerLifecycleBatchCommandType layerLifecycleBatchCommandType; + + /** + * Specifies the number of buffer slot to be reserved. + */ + int newBufferSlotCount; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl new file mode 100644 index 0000000000..ec2d55f791 --- /dev/null +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2023, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.graphics.composer3; + +/** + * Possible batch command types for a given layer. + */ +@VintfStability +@Backing(type="int") +enum LayerLifecycleBatchCommandType { + /** + * Layer attributes are being modified for already created layer. + */ + MODIFY = 0, + /** + * This indicates that the current LayerCommand should also create the layer, + * before processing the other attributes in the LayerCommand. + */ + CREATE = 1, + /** + * This indicates that the current LayerCommand should also destroyes the layer, + * after processing the other attributes in the LayerCommand. + */ + DESTROY = 2, +} diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h index c7bd5e0d11..a1ccbfe047 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -99,6 +100,15 @@ class ComposerClientWriter final { getBufferCommand(slot, buffer, releaseFence)); } + void setLayerLifecycleBatchCommandType(int64_t display, int64_t layer, + LayerLifecycleBatchCommandType cmd) { + getLayerCommand(display, layer).layerLifecycleBatchCommandType = cmd; + } + + void setNewBufferSlotCount(int64_t display, int64_t layer, int32_t newBufferSlotToCount) { + getLayerCommand(display, layer).newBufferSlotCount = newBufferSlotToCount; + } + void validateDisplay(int64_t display, std::optional expectedPresentTime, int32_t frameIntervalNs) { diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index ca1b6d82de..a53eb384e7 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -2913,6 +2913,69 @@ TEST_P(GraphicsComposerAidlCommandTest, MultiThreadedPresent) { } } +class GraphicsComposerAidlBatchedCommandTest : public GraphicsComposerAidlCommandTest { + protected: + void SetUp() override { + GraphicsComposerAidlCommandTest::SetUp(); + if (getInterfaceVersion() <= 2) { + GTEST_SKIP() << "Device interface version is expected to be >= 3"; + } + } + void TearDown() override { + const auto errors = mReader.takeErrors(); + ASSERT_TRUE(mReader.takeErrors().empty()); + ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown()); + } +}; + +TEST_P(GraphicsComposerAidlBatchedCommandTest, CreateBatchedCommand) { + auto& writer = getWriter(getPrimaryDisplayId()); + int64_t layer = 5; + writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer, + LayerLifecycleBatchCommandType::CREATE); + writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp, + VtsComposerClient::kNoFrameIntervalNs); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + +TEST_P(GraphicsComposerAidlBatchedCommandTest, DestroyBatchedCommand) { + auto& writer = getWriter(getPrimaryDisplayId()); + int64_t layer = 5; + writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer, + LayerLifecycleBatchCommandType::CREATE); + writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1); + writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp, + VtsComposerClient::kNoFrameIntervalNs); + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); + writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer, + LayerLifecycleBatchCommandType::DESTROY); + layer++; + writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer, + LayerLifecycleBatchCommandType::CREATE); + writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1); + + execute(); + ASSERT_TRUE(mReader.takeErrors().empty()); +} + +TEST_P(GraphicsComposerAidlBatchedCommandTest, NoCreateDestroyBatchedCommandIncorrectLayer) { + auto& writer = getWriter(getPrimaryDisplayId()); + int64_t layer = 5; + writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer, + LayerLifecycleBatchCommandType::DESTROY); + execute(); + const auto errors = mReader.takeErrors(); + ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_LAYER); +} + +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlBatchedCommandTest); +INSTANTIATE_TEST_SUITE_P( + PerInstance, GraphicsComposerAidlBatchedCommandTest, + testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), + ::android::PrintInstanceNameToString); GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest); INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandTest, -- GitLab From 3bab613b4add6b6b9ab1231cabdf3bd610e54587 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 6 Dec 2023 16:07:43 -0800 Subject: [PATCH 337/376] Add HD radio tune VTS Bug: 315206962 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: I04f3f5c0e98d5c4a6d018805001809b3a23fa08a --- .../VtsHalBroadcastradioAidlTargetTest.cpp | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 72869ccd9b..79d3e60e8d 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -701,6 +701,59 @@ TEST_P(BroadcastRadioHalTest, FmTune) { << "FM freq " << freq << " kHz is not sent back by callback."; } +/** + * Test tuning with HD selector. + * + * Verifies that: + * - if AM/FM HD selector is not supported, the method returns NOT_SUPPORTED; + * - if it is supported, the method succeeds; + * - after a successful tune call, onCurrentProgramInfoChanged callback is + * invoked carrying a proper selector; + * - program changes to a program info with the program selector requested. + */ +TEST_P(BroadcastRadioHalTest, HdTune) { + LOG(DEBUG) << "HdTune Test"; + auto programList = getProgramList(); + if (!programList) { + printSkipped("Empty station list, tune cannot be performed"); + return; + } + ProgramSelector hdSel = {}; + ProgramIdentifier physicallyTunedToExpected = {}; + bool hdStationPresent = false; + for (auto&& programInfo : *programList) { + if (programInfo.selector.primaryId.type != IdentifierType::HD_STATION_ID_EXT) { + continue; + } + hdSel = programInfo.selector; + hdStationPresent = true; + physicallyTunedToExpected = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, + bcutils::getAmFmFrequency(hdSel)); + break; + } + if (!hdStationPresent) { + printSkipped("No HD stations in the list, tune cannot be performed"); + return; + } + + // try tuning + auto result = mModule->tune(hdSel); + + // expect a failure if it's not supported + if (!bcutils::isSupported(mProperties, hdSel)) { + EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::NOT_SUPPORTED)); + return; + } + // expect a callback if it succeeds + EXPECT_TRUE(result.isOk()); + EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback()); + ProgramInfo infoCb = mCallback->getCurrentProgramInfo(); + LOG(DEBUG) << "Current program info: " << infoCb.toString(); + // it should tune exactly to what was requested + EXPECT_EQ(infoCb.selector, hdSel); + EXPECT_EQ(infoCb.physicallyTunedTo, physicallyTunedToExpected); +} + /** * Test tuning with DAB selector. * -- GitLab From 3e7448dc2b5ea8a9a2f0784d7eb42aa032f27c34 Mon Sep 17 00:00:00 2001 From: Jeff Pu Date: Thu, 7 Dec 2023 17:25:22 +0000 Subject: [PATCH 338/376] Face Virtual HAL lockout support Bug: 294254230 Test: atest android.hardware.biometrics.face.FakeFaceEngineTest Test: atest android.hardware.biometrics.face.FakeLockoutTrackerTest Change-Id: I4ed3ada4734f595d5f9ac70cf5ed2a94bed378c6 --- biometrics/face/aidl/default/Android.bp | 28 +++ .../face/aidl/default/FakeFaceEngine.cpp | 26 +++ biometrics/face/aidl/default/FakeFaceEngine.h | 16 +- .../face/aidl/default/FakeLockoutTracker.cpp | 138 +++++++++++ .../face/aidl/default/FakeLockoutTracker.h | 70 ++++++ biometrics/face/aidl/default/README.md | 57 ++++- biometrics/face/aidl/default/face.sysprop | 46 +++- .../default/tests/FakeLockoutTrackerTest.cpp | 216 ++++++++++++++++++ 8 files changed, 580 insertions(+), 17 deletions(-) create mode 100644 biometrics/face/aidl/default/FakeLockoutTracker.cpp create mode 100644 biometrics/face/aidl/default/FakeLockoutTracker.h create mode 100644 biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp index 4816219251..4e8390a64e 100644 --- a/biometrics/face/aidl/default/Android.bp +++ b/biometrics/face/aidl/default/Android.bp @@ -30,6 +30,7 @@ cc_binary { "libnativewindow", ], srcs: [ + "FakeLockoutTracker.cpp", "main.cpp", "Face.cpp", "FakeFaceEngine.cpp", @@ -63,6 +64,33 @@ cc_test { srcs: [ "tests/FakeFaceEngineTest.cpp", "FakeFaceEngine.cpp", + "FakeLockoutTracker.cpp", + ], + shared_libs: [ + "libbase", + "libbinder_ndk", + "libnativewindow", + ], + include_dirs: [ + "frameworks/native/aidl/gui", + ], + static_libs: [ + "libandroid.hardware.biometrics.face.VirtualProps", + "android.hardware.biometrics.face-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", + "android.hardware.keymaster-V4-ndk", + "android.hardware.biometrics.common.util", + ], + vendor: true, + test_suites: ["general-tests"], + require_root: true, +} + +cc_test { + name: "android.hardware.biometrics.face.FakeLockoutTrackerTest", + srcs: [ + "tests/FakeLockoutTrackerTest.cpp", + "FakeLockoutTracker.cpp", ], shared_libs: [ "libbase", diff --git a/biometrics/face/aidl/default/FakeFaceEngine.cpp b/biometrics/face/aidl/default/FakeFaceEngine.cpp index dc524bbbcf..7380611853 100644 --- a/biometrics/face/aidl/default/FakeFaceEngine.cpp +++ b/biometrics/face/aidl/default/FakeFaceEngine.cpp @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "FaceVirtualHalEngine" + #include "FakeFaceEngine.h" #include @@ -186,6 +204,10 @@ void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationI return; } + if (mLockoutTracker.checkIfLockout(cb)) { + return; + } + int i = 0; do { if (FaceHalProperties::lockout().value_or(false)) { @@ -197,6 +219,7 @@ void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationI if (FaceHalProperties::operation_authenticate_fails().value_or(false)) { LOG(ERROR) << "Fail: operation_authenticate_fails"; + mLockoutTracker.addFailedAttempt(cb); cb->onAuthenticationFailed(); return; } @@ -231,10 +254,12 @@ void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationI } while (!Util::hasElapsed(now, duration)); if (id > 0 && isEnrolled) { + mLockoutTracker.reset(); cb->onAuthenticationSucceeded(id, {} /* hat */); return; } else { LOG(ERROR) << "Fail: face not enrolled"; + mLockoutTracker.addFailedAttempt(cb); cb->onAuthenticationFailed(); cb->onError(Error::TIMEOUT, 0 /* vendorError*/); return; @@ -389,6 +414,7 @@ void FakeFaceEngine::resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/) { BEGIN_OP(0); FaceHalProperties::lockout(false); + mLockoutTracker.reset(); cb->onLockoutCleared(); } diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h index 06dd396c70..8d9303c491 100644 --- a/biometrics/face/aidl/default/FakeFaceEngine.h +++ b/biometrics/face/aidl/default/FakeFaceEngine.h @@ -16,18 +16,17 @@ #pragma once -#define LOG_TAG "FaceVirtualHal" - #include #include #include #include -#include - #include +#include #include +#include "FakeLockoutTracker.h" + namespace aidl::android::hardware::biometrics::face { namespace face = aidl::android::hardware::biometrics::face; @@ -39,6 +38,7 @@ using aidl::android::hardware::common::NativeHandle; class FakeFaceEngine { public: FakeFaceEngine() : mRandom(std::mt19937::default_seed) {} + virtual ~FakeFaceEngine() {} static face::FaceSensorType GetSensorType(); static common::SensorStrength GetSensorStrength(); @@ -61,6 +61,13 @@ class FakeFaceEngine { void invalidateAuthenticatorIdImpl(ISessionCallback* cb); void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/); + virtual std::string toString() const { + std::ostringstream os; + os << "----- FakeFaceEngine:: -----" << std::endl; + os << mLockoutTracker.toString(); + return os.str(); + } + std::mt19937 mRandom; private: @@ -68,6 +75,7 @@ class FakeFaceEngine { static constexpr int32_t FACE_ERROR_VENDOR_BASE = 1000; std::pair convertAcquiredInfo(int32_t code); std::pair convertError(int32_t code); + FakeLockoutTracker mLockoutTracker; }; } // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/FakeLockoutTracker.cpp b/biometrics/face/aidl/default/FakeLockoutTracker.cpp new file mode 100644 index 0000000000..70bf08ee21 --- /dev/null +++ b/biometrics/face/aidl/default/FakeLockoutTracker.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define LOG_TAG "FaceVirtualHalLockoutTracker" + +#include "FakeLockoutTracker.h" +#include +#include +#include "util/Util.h" + +using namespace ::android::face::virt; + +namespace aidl::android::hardware::biometrics::face { + +void FakeLockoutTracker::reset(bool dueToTimerExpire) { + if (!dueToTimerExpire) { + mFailedCount = 0; + mLastFailedTime = 0; + } + mTimedFailedCount = 0; + mCurrentMode = LockoutMode::kNone; + abortTimer(); +} + +void FakeLockoutTracker::addFailedAttempt(ISessionCallback* cb) { + bool lockoutEnabled = FaceHalProperties::lockout_enable().value_or(false); + bool timedLockoutenabled = FaceHalProperties::lockout_timed_enable().value_or(false); + if (lockoutEnabled) { + mFailedCount++; + mTimedFailedCount++; + mLastFailedTime = Util::getSystemNanoTime(); + int32_t lockoutTimedThreshold = FaceHalProperties::lockout_timed_threshold().value_or(3); + int32_t lockoutPermanetThreshold = + FaceHalProperties::lockout_permanent_threshold().value_or(5); + if (mFailedCount >= lockoutPermanetThreshold) { + mCurrentMode = LockoutMode::kPermanent; + LOG(ERROR) << "FakeLockoutTracker: lockoutPermanent"; + cb->onLockoutPermanent(); + abortTimer(); + } else if (timedLockoutenabled && mTimedFailedCount >= lockoutTimedThreshold) { + if (mCurrentMode == LockoutMode::kNone) { + mCurrentMode = LockoutMode::kTimed; + startLockoutTimer(getTimedLockoutDuration(), cb); + } + LOG(ERROR) << "FakeLockoutTracker: lockoutTimed"; + cb->onLockoutTimed(getLockoutTimeLeft()); + } + } else { + reset(); + } +} + +FakeLockoutTracker::LockoutMode FakeLockoutTracker::getMode() { + return mCurrentMode; +} + +int32_t FakeLockoutTracker::getTimedLockoutDuration() { + return FaceHalProperties::lockout_timed_duration().value_or(10 * 1000); +} + +int64_t FakeLockoutTracker::getLockoutTimeLeft() { + int64_t res = 0; + + if (mLastFailedTime > 0) { + auto now = Util::getSystemNanoTime(); + auto elapsed = (now - mLastFailedTime) / 1000000LL; + res = getTimedLockoutDuration() - elapsed; + LOG(INFO) << "elapsed=" << elapsed << " now = " << now + << " mLastFailedTime=" << mLastFailedTime << " res=" << res; + } + + return res; +} + +bool FakeLockoutTracker::checkIfLockout(ISessionCallback* cb) { + if (mCurrentMode == LockoutMode::kPermanent) { + LOG(ERROR) << "Lockout permanent"; + cb->onLockoutPermanent(); + return true; + } else if (mCurrentMode == LockoutMode::kTimed) { + auto timeLeft = getLockoutTimeLeft(); + LOG(ERROR) << "Lockout timed " << timeLeft; + cb->onLockoutTimed(timeLeft); + return true; + } + return false; +} + +void FakeLockoutTracker::startLockoutTimer(int64_t timeout, ISessionCallback* cb) { + LOG(ERROR) << "startLockoutTimer: to=" << timeout; + if (mIsLockoutTimerStarted) return; + std::function action = + std::bind(&FakeLockoutTracker::lockoutTimerExpired, this, std::placeholders::_1); + std::thread([timeout, action, cb]() { + std::this_thread::sleep_for(std::chrono::milliseconds(timeout)); + action(cb); + }).detach(); + + mIsLockoutTimerStarted = true; +} + +void FakeLockoutTracker::lockoutTimerExpired(ISessionCallback* cb) { + LOG(INFO) << "lockout timer expired"; + mIsLockoutTimerStarted = false; + + if (mIsLockoutTimerAborted) { + mIsLockoutTimerAborted = false; + return; + } + + // if more failures seen since the timer started, need to restart timer again + auto deltaTime = getLockoutTimeLeft(); + if (deltaTime <= 0) { + cb->onLockoutCleared(); + reset(true); + } else { + startLockoutTimer(deltaTime, cb); + } +} + +void FakeLockoutTracker::abortTimer() { + if (mIsLockoutTimerStarted) mIsLockoutTimerAborted = true; +} + +} // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/FakeLockoutTracker.h b/biometrics/face/aidl/default/FakeLockoutTracker.h new file mode 100644 index 0000000000..f2d38f3608 --- /dev/null +++ b/biometrics/face/aidl/default/FakeLockoutTracker.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace aidl::android::hardware::biometrics::face { + +// Lockout implementation for Face Virtual HAL +class FakeLockoutTracker { + public: + FakeLockoutTracker() + : mFailedCount(0), + mLastFailedTime(0), + mIsLockoutTimerStarted(false), + mIsLockoutTimerAborted(false) {} + ~FakeLockoutTracker() {} + + enum class LockoutMode : int8_t { kNone = 0, kTimed, kPermanent }; + + bool checkIfLockout(ISessionCallback*); + void addFailedAttempt(ISessionCallback*); + int64_t getLockoutTimeLeft(); + LockoutMode getMode(); + void reset(bool dueToTimerExpire = false); + inline std::string toString() const { + std::ostringstream os; + os << "----- FakeLockoutTracker:: -----" << std::endl; + os << "mFailedCount:" << mFailedCount; + os << ", mCurrentMode:" << (int)mCurrentMode; + os << ", mLastFailedTime:" << (int)(mLastFailedTime / 1000000LL); + os << ", mIsLockoutTimerStarted:" << mIsLockoutTimerStarted; + os << ", mIsLockoutTimerAborted:" << mIsLockoutTimerAborted; + os << std::endl; + return os.str(); + } + + private: + void startLockoutTimer(int64_t timeout, ISessionCallback* cb); + void lockoutTimerExpired(ISessionCallback* cb); + int32_t getTimedLockoutDuration(); + void abortTimer(); + + private: + int32_t mFailedCount; + int32_t mTimedFailedCount; + int64_t mLastFailedTime; + LockoutMode mCurrentMode; + bool mIsLockoutTimerStarted; + bool mIsLockoutTimerAborted; +}; + +} // namespace aidl::android::hardware::biometrics::face diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md index 922525836d..c9a8cfeeaa 100644 --- a/biometrics/face/aidl/default/README.md +++ b/biometrics/face/aidl/default/README.md @@ -51,31 +51,31 @@ $ adb shell cmd face syncadb shell cmd face sync To authenticate successfully, the captured (hit) must match the enrollment id
    set above. To trigger authentication failure, set the hit id to a different value. -```shell +`shell $ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800 -$ adb shell setprop vendor.face.virtual.enrollment_hit 1 -``` +$ adb shell setprop vendor.face.virtual.enrollment_hit 1` ### AcquiredInfo + AcquiredInfo codes can be sent during authentication by specifying the sysprop.
    The codes is sent in sequence and in the interval of operation_authentication_duration/numberOfAcquiredInfoCode -```shell -$ adb shell setprop vendor.face.virtual.operation_authenticate_acquired 6,9,1013 -``` +`shell +$ adb shell setprop vendor.face.virtual.operation_authenticate_acquired 6,9,1013` Refer to [AcquiredInfo.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl) for full face acquiredInfo codes. Note: For vendor specific acquired info, acquiredInfo = 1000 + vendorCode. ### Error Insertion -Error can be inserted during authentction by specifying the authenticate_error sysprop. -```shell -$ adb shell setprop vendor.face.virtual.operation_authenticate_error 4 -``` -Refer to [Error.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl) for full face error codes +Error can be inserted during authentction by specifying the authenticate_error +sysprop. `shell $ adb shell setprop +vendor.face.virtual.operation_authenticate_error 4` Refer to +[Error.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl) +for full face error codes ## Enrollment via Settings -Enrollment process is specified by sysprop `next_enrollment` in the following format +Enrollment process is specified by sysprop `next_enrollment` in the following +format ```shell Format: : @@ -88,7 +88,40 @@ Format: : E.g. $ adb shell setprop vendor.face.virtual.next_enrollment 1:6000-[21,8,1,1108,1,10,1113,1,1118,1124]:true ``` + If next_enrollment prop is not set, the following default value is used:
      defaultNextEnrollment="1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true"
    Note: Enrollment data and configuration can be supported upon request in case of needs +## Lockout + +Device lockout is based on the number of consecutive failed authentication attempts. There are a few +flavors of lockout mechanisms that are supported by virtula HAL
    + +### Permanent Lockout + +There are two sysprop to control permanent lockout
    +1. general lockout feature enable
    +2. threshold of failed attempts
    +`shell +$ adb shell setprop persist.vendor.face.virtual.lockout_enable true +$ adb shell setprop persist.vendor.face.virtual.lockout_permanent_threshold 3` + +### Temporary Lockout + +There are a few parameters to control temporary lockout (aka timed lockout):
    +1. enable lockout (general lockout feature enable, and timed lcokout enable)
    +2. threshold of failed attempts
    +3. timeout in ms
    +`shell +$ adb shell setprop persist.vendor.face.virtual.lockout_enable true +$ adb shell setprop persist.vendor.face.virtual.lockout_timed_enable true +$ adb shell setprop persist.vendor.face.virtual.lockout_timed_threshold 5 +$ adb shell setprop persist.vendor.face.virtual.lockout_timed_duration 10000` + +### Forced Lockout + +A permanent lockout can be inserted on next authentication attempt independent of the failed
    +attempt count. This is a feature purely for test purpose. +`shell +$ adb shell setprop persist.vendor.face.virtual.lockout true` diff --git a/biometrics/face/aidl/default/face.sysprop b/biometrics/face/aidl/default/face.sysprop index be320151af..95b0b43ca7 100644 --- a/biometrics/face/aidl/default/face.sysprop +++ b/biometrics/face/aidl/default/face.sysprop @@ -92,7 +92,7 @@ prop { api_name: "challenge" } -# if locked out +# if forced to lock out (Default to false) prop { prop_name: "vendor.face.virtual.lockout" type: Boolean @@ -176,3 +176,47 @@ prop { api_name: "operation_authenticate_acquired" } +# whether support lockout based on the failed auth attempts (default: false) +prop { + prop_name: "persist.vendor.face.virtual.lockout_enable" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "lockout_enable" +} + +# whether support timed_lockout based on the failed auth attempts (default: false) +prop { + prop_name: "persist.vendor.face.virtual.lockout_timed_enable" + type: Boolean + scope: Internal + access: ReadWrite + api_name: "lockout_timed_enable" +} + +# temperory lockout threshold in number of consecutive failed auth attempts +prop { + prop_name: "persist.vendor.face.virtual.lockout_timed_threshold" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_timed_threshold" +} + +# temporary lockout duration in ms (default: 10000ms) +prop { + prop_name: "persist.vendor.face.virtual.lockout_timed_duration" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_timed_duration" +} + +# permanently lockout threshold in number of consecutive failed auth attempts +prop { + prop_name: "persist.vendor.face.virtual.lockout_permanent_threshold" + type: Integer + scope: Internal + access: ReadWrite + api_name: "lockout_permanent_threshold" +} diff --git a/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp b/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp new file mode 100644 index 0000000000..fa07d1dfeb --- /dev/null +++ b/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include + +#include "FakeLockoutTracker.h" +#include "util/Util.h" + +using namespace ::android::face::virt; +using namespace ::aidl::android::hardware::biometrics::face; + +namespace aidl::android::hardware::biometrics::face { + +class TestSessionCallback : public BnSessionCallback { + public: + ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onError(face::Error, int32_t /*vendorCode*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentProgress(int32_t /*enrollmentId*/, + int32_t /*remaining*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t /*enrollmentId*/, + const keymaster::HardwareAuthToken&) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticationFailed() override { return ndk::ScopedAStatus::ok(); }; + ::ndk::ScopedAStatus onInteractionDetected() override { return ndk::ScopedAStatus::ok(); }; + ::ndk::ScopedAStatus onEnrollmentsEnumerated(const std::vector&) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentsRemoved( + const std::vector& /*enrollmentIds*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t /*authenticatorId*/) override { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onEnrollmentFrame(const EnrollmentFrame&) override { + return ndk::ScopedAStatus::ok(); + } + ::ndk::ScopedAStatus onFeaturesRetrieved(const std::vector&) { + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onFeatureSet(Feature) override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); } + ::ndk::ScopedAStatus onAuthenticationFrame(const AuthenticationFrame&) override { + return ndk::ScopedAStatus::ok(); + } + + ndk::ScopedAStatus onLockoutTimed(int64_t timeLeft) override { + mLockoutTimed++; + mTimeLeft = timeLeft; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutPermanent() override { + mLockoutPermanent++; + return ndk::ScopedAStatus::ok(); + }; + ::ndk::ScopedAStatus onLockoutCleared() override { + mTimeLeft = 0; + mLockoutTimed = 0; + mLockoutPermanent = 0; + return ndk::ScopedAStatus::ok(); + }; + + int64_t mTimeLeft = 0; + int mLockoutTimed = 0; + int mLockoutPermanent = 0; +}; + +class FakeLockoutTrackerTest : public ::testing::Test { + protected: + static constexpr int32_t LOCKOUT_TIMED_THRESHOLD = 3; + static constexpr int32_t LOCKOUT_PERMANENT_THRESHOLD = 5; + static constexpr int32_t LOCKOUT_TIMED_DURATION = 100; + + void SetUp() override { + FaceHalProperties::lockout_timed_threshold(LOCKOUT_TIMED_THRESHOLD); + FaceHalProperties::lockout_timed_duration(LOCKOUT_TIMED_DURATION); + FaceHalProperties::lockout_permanent_threshold(LOCKOUT_PERMANENT_THRESHOLD); + mCallback = ndk::SharedRefBase::make(); + } + + void TearDown() override { + // reset to default + FaceHalProperties::lockout_timed_threshold(5); + FaceHalProperties::lockout_timed_duration(20); + FaceHalProperties::lockout_permanent_threshold(10000); + FaceHalProperties::lockout_enable(false); + FaceHalProperties::lockout(false); + } + + FakeLockoutTracker mLockoutTracker; + std::shared_ptr mCallback; +}; + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptDisable) { + FaceHalProperties::lockout_enable(false); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD + 1; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); + ASSERT_EQ(0, mCallback->mLockoutTimed); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptPermanent) { + FaceHalProperties::lockout_enable(true); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); + for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD - 1; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_NE(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); + ASSERT_EQ(0, mCallback->mLockoutPermanent); + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); + ASSERT_EQ(1, mCallback->mLockoutPermanent); + ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get())); + ASSERT_EQ(2, mCallback->mLockoutPermanent); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockoutTimed) { + FaceHalProperties::lockout_enable(true); + FaceHalProperties::lockout_timed_enable(true); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kTimed); + ASSERT_EQ(1, mCallback->mLockoutTimed); + ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get())); + ASSERT_EQ(2, mCallback->mLockoutTimed); + // time left + int N = 5; + int64_t prevTimeLeft = INT_MAX; + for (int i = 0; i < N; i++) { + SLEEP_MS(LOCKOUT_TIMED_DURATION / N + 1); + int64_t currTimeLeft = mLockoutTracker.getLockoutTimeLeft(); + ASSERT_TRUE(currTimeLeft < prevTimeLeft); + prevTimeLeft = currTimeLeft; + } + SLEEP_MS(LOCKOUT_TIMED_DURATION / N); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockout_TimedThenPermanent) { + FaceHalProperties::lockout_enable(true); + FaceHalProperties::lockout_timed_enable(true); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kTimed); + SLEEP_MS(LOCKOUT_TIMED_DURATION + 20); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); + for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD - LOCKOUT_TIMED_THRESHOLD; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); +} + +TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockoutTimedTwice) { + FaceHalProperties::lockout_enable(true); + FaceHalProperties::lockout_timed_enable(true); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); + ASSERT_EQ(0, mCallback->mLockoutTimed); + for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + SLEEP_MS(LOCKOUT_TIMED_DURATION / 2); + mLockoutTracker.addFailedAttempt(mCallback.get()); + SLEEP_MS(LOCKOUT_TIMED_DURATION); + ASSERT_EQ(2, mCallback->mLockoutTimed); + ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get())); + SLEEP_MS(LOCKOUT_TIMED_DURATION); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); +} + +TEST_F(FakeLockoutTrackerTest, resetLockout) { + FaceHalProperties::lockout_enable(true); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone); + for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD; i++) + mLockoutTracker.addFailedAttempt(mCallback.get()); + ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent); + mLockoutTracker.reset(); + ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get())); +} + +} // namespace aidl::android::hardware::biometrics::face + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + ABinderProcess_startThreadPool(); + return RUN_ALL_TESTS(); +} -- GitLab From df7736245f7fe92810da2037b6b250b0efa65259 Mon Sep 17 00:00:00 2001 From: Kai Shi Date: Fri, 8 Dec 2023 17:21:55 -0800 Subject: [PATCH 339/376] Add capability bit for the cached scan data feature Test: compilation Bug: 269485350 Change-Id: I94fe5ae67a777bec955794ccd4dba7ea43b3c9aa --- .../current/android/hardware/wifi/IWifiStaIface.aidl | 1 + wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl | 4 ++++ wifi/aidl/default/aidl_struct_util.cpp | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl index f8384130b2..bf4c2c0502 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl @@ -79,5 +79,6 @@ interface IWifiStaIface { ND_OFFLOAD = (1 << 12) /* 4096 */, KEEP_ALIVE = (1 << 13) /* 8192 */, ROAMING_MODE_CONTROL = (1 << 14) /* 16384 */, + CACHED_SCAN_DATA = (1 << 15) /* 32768 */, } } diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl index 3c8b55fa03..03b22179d0 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl @@ -104,6 +104,10 @@ interface IWifiStaIface { * Support for configuring roaming mode. */ ROAMING_MODE_CONTROL = 1 << 14, + /** + * Support for cached scan data report. + */ + CACHED_SCAN_DATA = 1 << 15, } /** diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index cd2ae119bc..ad0ed79927 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -96,6 +96,8 @@ IWifiStaIface::FeatureSetMask convertLegacyStaIfaceFeatureToAidl(uint64_t featur return IWifiStaIface::FeatureSetMask::KEEP_ALIVE; case WIFI_FEATURE_ROAMING_MODE_CONTROL: return IWifiStaIface::FeatureSetMask::ROAMING_MODE_CONTROL; + case WIFI_FEATURE_CACHED_SCAN_RESULTS: + return IWifiStaIface::FeatureSetMask::CACHED_SCAN_DATA; }; CHECK(false) << "Unknown legacy feature: " << feature; return {}; @@ -463,7 +465,7 @@ bool convertLegacyStaIfaceFeaturesToAidl(uint64_t legacy_feature_set, uint32_t* WIFI_FEATURE_CONTROL_ROAMING, WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND, WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO, WIFI_FEATURE_TDLS, WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE, - WIFI_FEATURE_ROAMING_MODE_CONTROL}) { + WIFI_FEATURE_ROAMING_MODE_CONTROL, WIFI_FEATURE_CACHED_SCAN_RESULTS}) { if (feature & legacy_feature_set) { *aidl_feature_set |= static_cast(convertLegacyStaIfaceFeatureToAidl(feature)); } -- GitLab From a7cc8a9acd1e552c422fc451c4a8e8fb02dfb363 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Thu, 7 Dec 2023 17:04:21 -0800 Subject: [PATCH 340/376] Define customized program selector/info comparator Define customized comparators for program selector and program info in broadcast radio AIDL HAL utils library, which can be used to sort program list by the order of frequency in HAL implementation of devices other than emulator. Bug: 315389663 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Ie8de342f3c123d896589751a6244f871ee07eb81 --- .../aidl/default/VirtualProgram.cpp | 44 +---------------- .../include/broadcastradio-utils-aidl/Utils.h | 8 +++ broadcastradio/common/utilsaidl/src/Utils.cpp | 49 +++++++++++++++++++ 3 files changed, 58 insertions(+), 43 deletions(-) diff --git a/broadcastradio/aidl/default/VirtualProgram.cpp b/broadcastradio/aidl/default/VirtualProgram.cpp index dca431d68a..fab4a49450 100644 --- a/broadcastradio/aidl/default/VirtualProgram.cpp +++ b/broadcastradio/aidl/default/VirtualProgram.cpp @@ -93,49 +93,7 @@ VirtualProgram::operator ProgramInfo() const { } bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs) { - auto& l = lhs.selector; - auto& r = rhs.selector; - - if ((utils::hasId(l, IdentifierType::AMFM_FREQUENCY_KHZ) || - l.primaryId.type == IdentifierType::HD_STATION_ID_EXT) && - (utils::hasId(r, IdentifierType::AMFM_FREQUENCY_KHZ) || - r.primaryId.type == IdentifierType::HD_STATION_ID_EXT)) { - uint32_t freq1 = utils::getAmFmFrequency(l); - int subChannel1 = l.primaryId.type == IdentifierType::HD_STATION_ID_EXT - ? utils::getHdSubchannel(l) - : 0; - uint32_t freq2 = utils::getAmFmFrequency(r); - int subChannel2 = r.primaryId.type == IdentifierType::HD_STATION_ID_EXT - ? utils::getHdSubchannel(r) - : 0; - return freq1 < freq2 || (freq1 == freq2 && (l.primaryId.type < r.primaryId.type || - subChannel1 < subChannel2)); - } else if (l.primaryId.type == IdentifierType::DAB_SID_EXT && - r.primaryId.type == IdentifierType::DAB_SID_EXT) { - uint64_t dabFreq1 = utils::getId(l, IdentifierType::DAB_FREQUENCY_KHZ); - uint64_t dabFreq2 = utils::getId(r, IdentifierType::DAB_FREQUENCY_KHZ); - if (dabFreq1 != dabFreq2) { - return dabFreq1 < dabFreq2; - } - uint32_t ecc1 = utils::getDabEccCode(l); - uint32_t ecc2 = utils::getDabEccCode(r); - if (ecc1 != ecc2) { - return ecc1 < ecc2; - } - uint64_t dabEnsemble1 = utils::getId(l, IdentifierType::DAB_ENSEMBLE); - uint64_t dabEnsemble2 = utils::getId(r, IdentifierType::DAB_ENSEMBLE); - if (dabEnsemble1 != dabEnsemble2) { - return dabEnsemble1 < dabEnsemble2; - } - uint32_t sId1 = utils::getDabSId(l); - uint32_t sId2 = utils::getDabSId(r); - return sId1 < sId2 || (sId1 == sId2 && utils::getDabSCIdS(l) < utils::getDabSCIdS(r)); - } - - if (l.primaryId.type != r.primaryId.type) { - return l.primaryId.type < r.primaryId.type; - } - return l.primaryId.value < r.primaryId.value; + return utils::ProgramSelectorComparator()(lhs.selector, rhs.selector); } } // namespace aidl::android::hardware::broadcastradio diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h index bb43903707..3ced685654 100644 --- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h +++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h @@ -143,6 +143,14 @@ ProgramSelector makeSelectorHd(uint64_t stationId, uint64_t subChannel, uint64_t bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel); +struct ProgramSelectorComparator { + bool operator()(const ProgramSelector& lhs, const ProgramSelector& rhs) const; +}; + +struct ProgramInfoComparator { + bool operator()(const ProgramInfo& lhs, const ProgramInfo& rhs) const; +}; + struct ProgramInfoHasher { size_t operator()(const ProgramInfo& info) const; }; diff --git a/broadcastradio/common/utilsaidl/src/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp index 76c3c6a36d..b6474424b3 100644 --- a/broadcastradio/common/utilsaidl/src/Utils.cpp +++ b/broadcastradio/common/utilsaidl/src/Utils.cpp @@ -355,6 +355,55 @@ bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel) { return true; } +bool ProgramSelectorComparator::operator()(const ProgramSelector& lhs, + const ProgramSelector& rhs) const { + if ((utils::hasId(lhs, IdentifierType::AMFM_FREQUENCY_KHZ) || + lhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT) && + (utils::hasId(rhs, IdentifierType::AMFM_FREQUENCY_KHZ) || + rhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT)) { + uint32_t freq1 = utils::getAmFmFrequency(lhs); + int subChannel1 = lhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT + ? utils::getHdSubchannel(lhs) + : 0; + uint32_t freq2 = utils::getAmFmFrequency(rhs); + int subChannel2 = rhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT + ? utils::getHdSubchannel(rhs) + : 0; + return freq1 < freq2 || (freq1 == freq2 && (lhs.primaryId.type < rhs.primaryId.type || + subChannel1 < subChannel2)); + } + if (lhs.primaryId.type == IdentifierType::DAB_SID_EXT && + rhs.primaryId.type == IdentifierType::DAB_SID_EXT) { + uint64_t dabFreq1 = utils::getId(lhs, IdentifierType::DAB_FREQUENCY_KHZ); + uint64_t dabFreq2 = utils::getId(rhs, IdentifierType::DAB_FREQUENCY_KHZ); + if (dabFreq1 != dabFreq2) { + return dabFreq1 < dabFreq2; + } + uint32_t ecc1 = utils::getDabEccCode(lhs); + uint32_t ecc2 = utils::getDabEccCode(rhs); + if (ecc1 != ecc2) { + return ecc1 < ecc2; + } + uint64_t dabEnsemble1 = utils::getId(lhs, IdentifierType::DAB_ENSEMBLE); + uint64_t dabEnsemble2 = utils::getId(rhs, IdentifierType::DAB_ENSEMBLE); + if (dabEnsemble1 != dabEnsemble2) { + return dabEnsemble1 < dabEnsemble2; + } + uint32_t sId1 = utils::getDabSId(lhs); + uint32_t sId2 = utils::getDabSId(rhs); + return sId1 < sId2 || (sId1 == sId2 && utils::getDabSCIdS(lhs) < utils::getDabSCIdS(rhs)); + } + + if (lhs.primaryId.type != rhs.primaryId.type) { + return lhs.primaryId.type < rhs.primaryId.type; + } + return lhs.primaryId.value < rhs.primaryId.value; +} + +bool ProgramInfoComparator::operator()(const ProgramInfo& lhs, const ProgramInfo& rhs) const { + return ProgramSelectorComparator()(lhs.selector, rhs.selector); +} + size_t ProgramInfoHasher::operator()(const ProgramInfo& info) const { const ProgramIdentifier& id = info.selector.primaryId; -- GitLab From 91936643d4c03713db50921b33c62a7c91191eab Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Mon, 11 Dec 2023 23:23:15 +0530 Subject: [PATCH 341/376] Add OuiKeyed Data to Aware AIDL APIs including enable, publish, subscribe, nan pairing request and match events. Bug: 296069900 Test: m Change-Id: I064223e207e16b0ca24f089a9486b649a59ad1f8 --- .../current/android/hardware/wifi/NanConfigRequest.aidl | 1 + .../current/android/hardware/wifi/NanMatchInd.aidl | 1 + .../current/android/hardware/wifi/NanPairingConfirmInd.aidl | 1 + .../current/android/hardware/wifi/NanPairingRequest.aidl | 1 + .../current/android/hardware/wifi/NanPairingRequestInd.aidl | 1 + .../current/android/hardware/wifi/NanPublishRequest.aidl | 1 + .../hardware/wifi/NanRespondToPairingIndicationRequest.aidl | 1 + .../current/android/hardware/wifi/NanSubscribeRequest.aidl | 1 + wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanMatchInd.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl | 6 ++++++ .../hardware/wifi/NanRespondToPairingIndicationRequest.aidl | 6 ++++++ wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl | 6 ++++++ 16 files changed, 56 insertions(+) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl index 5ead6515d0..a3693d6498 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl @@ -45,4 +45,5 @@ parcelable NanConfigRequest { char rssiWindowSize; int macAddressRandomizationIntervalSec; android.hardware.wifi.NanBandSpecificConfig[3] bandSpecificConfig; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl index 317489f223..4acc7732f3 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl @@ -51,4 +51,5 @@ parcelable NanMatchInd { byte[] scid; android.hardware.wifi.NanPairingConfig peerPairingConfig; android.hardware.wifi.NanIdentityResolutionAttribute peerNira; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl index 8ecf22aa01..699ecdce77 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl @@ -40,4 +40,5 @@ parcelable NanPairingConfirmInd { android.hardware.wifi.NanPairingRequestType requestType; boolean enablePairingCache; android.hardware.wifi.NpkSecurityAssociation npksa; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl index 2a644ae63b..121b038b54 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl @@ -40,4 +40,5 @@ parcelable NanPairingRequest { boolean enablePairingCache; byte[16] pairingIdentityKey; android.hardware.wifi.NanPairingSecurityConfig securityConfig; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl index 66762b93e6..57072c04a4 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl @@ -41,4 +41,5 @@ parcelable NanPairingRequestInd { android.hardware.wifi.NanPairingRequestType requestType; boolean enablePairingCache; android.hardware.wifi.NanIdentityResolutionAttribute peerNira; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl index c49f5f9012..bdc83579ad 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl @@ -40,4 +40,5 @@ parcelable NanPublishRequest { boolean autoAcceptDataPathRequests; android.hardware.wifi.NanPairingConfig pairingConfig; byte[16] identityKey; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl index a58890c542..da81c394b7 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl @@ -40,4 +40,5 @@ parcelable NanRespondToPairingIndicationRequest { boolean enablePairingCache; byte[16] pairingIdentityKey; android.hardware.wifi.NanPairingSecurityConfig securityConfig; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl index 96be096d74..bf525a9c7e 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl @@ -43,4 +43,5 @@ parcelable NanSubscribeRequest { android.hardware.wifi.MacAddress[] intfAddr; android.hardware.wifi.NanPairingConfig pairingConfig; byte[16] identityKey; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl b/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl index 82a7b6e754..47561dc08f 100644 --- a/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl @@ -17,6 +17,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanBandSpecificConfig; +import android.hardware.wifi.common.OuiKeyedData; /** * Configuration parameters of NAN. Used when enabling and re-configuring a NAN cluster. @@ -79,4 +80,9 @@ parcelable NanConfigRequest { * Additional configuration provided per band. Indexed by |NanBandIndex|. */ NanBandSpecificConfig[3] bandSpecificConfig; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl index 5a04376c75..622213cf88 100644 --- a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl +++ b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl @@ -19,6 +19,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanCipherSuiteType; import android.hardware.wifi.NanIdentityResolutionAttribute; import android.hardware.wifi.NanPairingConfig; +import android.hardware.wifi.common.OuiKeyedData; /** * Match indication structure. @@ -137,4 +138,9 @@ parcelable NanMatchInd { * The NIRA from peer for NAN pairing verification */ NanIdentityResolutionAttribute peerNira; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl index a5670ec460..692d3d6b16 100644 --- a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl +++ b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl @@ -19,6 +19,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanPairingRequestType; import android.hardware.wifi.NanStatus; import android.hardware.wifi.NpkSecurityAssociation; +import android.hardware.wifi.common.OuiKeyedData; /** * NAN pairing confirmation indication structure. Event indication is @@ -51,4 +52,9 @@ parcelable NanPairingConfirmInd { * The security association negotiated for the pairing, can be cached for future verification */ NpkSecurityAssociation npksa; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl index 0c2080b9e0..950d1e26d7 100644 --- a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl @@ -18,6 +18,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanPairingRequestType; import android.hardware.wifi.NanPairingSecurityConfig; +import android.hardware.wifi.common.OuiKeyedData; /** * NAN pairing initiate request. @@ -54,4 +55,9 @@ parcelable NanPairingRequest { * Security config used for the pairing */ NanPairingSecurityConfig securityConfig; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl index ec8548f0f5..7e98bac96b 100644 --- a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl +++ b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl @@ -18,6 +18,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanIdentityResolutionAttribute; import android.hardware.wifi.NanPairingRequestType; +import android.hardware.wifi.common.OuiKeyedData; /** * NAN pairing request indication message structure. @@ -58,4 +59,9 @@ parcelable NanPairingRequestInd { * The NIRA from peer for NAN pairing verification */ NanIdentityResolutionAttribute peerNira; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl index 956a7dfb26..ae75caf09f 100644 --- a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl @@ -20,6 +20,7 @@ import android.hardware.wifi.NanDiscoveryCommonConfig; import android.hardware.wifi.NanPairingConfig; import android.hardware.wifi.NanPublishType; import android.hardware.wifi.NanTxType; +import android.hardware.wifi.common.OuiKeyedData; /** * Publish request. Specifies a publish discovery operation. @@ -55,4 +56,9 @@ parcelable NanPublishRequest { * The Identity key for pairing, will generate NIRA for verification by the peer */ byte[16] identityKey; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl index fab2a40be6..0527f067de 100644 --- a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl @@ -18,6 +18,7 @@ package android.hardware.wifi; import android.hardware.wifi.NanPairingRequestType; import android.hardware.wifi.NanPairingSecurityConfig; +import android.hardware.wifi.common.OuiKeyedData; /** * Response to a pairing request from a peer. @@ -51,4 +52,9 @@ parcelable NanRespondToPairingIndicationRequest { * Security config used for the pairing */ NanPairingSecurityConfig securityConfig; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl index 0b246eda8c..e7094bf55d 100644 --- a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl @@ -21,6 +21,7 @@ import android.hardware.wifi.NanDiscoveryCommonConfig; import android.hardware.wifi.NanPairingConfig; import android.hardware.wifi.NanSrfType; import android.hardware.wifi.NanSubscribeType; +import android.hardware.wifi.common.OuiKeyedData; /** * Subscribe request. Specifies a subscribe discovery operation. @@ -76,4 +77,9 @@ parcelable NanSubscribeRequest { * The Identity key for pairing, will generate NIRA for verification by the peer */ byte[16] identityKey; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } -- GitLab From 93ee24e67fcd4d8d3e58a44370f1fa4deb0b0791 Mon Sep 17 00:00:00 2001 From: Joshua McCloskey Date: Mon, 11 Dec 2023 22:17:40 +0000 Subject: [PATCH 342/376] Freezing face api Test: N/A Change-Id: I0c0ac52fbdc96ae2a416922ff4c994f0f2909802 --- biometrics/face/aidl/Android.bp | 10 ++- .../android.hardware.biometrics.face/4/.hash | 1 + .../biometrics/face/AcquiredInfo.aidl | 65 +++++++++++++++++++ .../biometrics/face/AuthenticationFrame.aidl | 39 +++++++++++ .../hardware/biometrics/face/BaseFrame.aidl | 44 +++++++++++++ .../hardware/biometrics/face/Cell.aidl | 41 ++++++++++++ .../biometrics/face/EnrollmentFrame.aidl | 41 ++++++++++++ .../biometrics/face/EnrollmentStage.aidl | 45 +++++++++++++ .../face/EnrollmentStageConfig.aidl | 40 ++++++++++++ .../biometrics/face/EnrollmentType.aidl | 40 ++++++++++++ .../hardware/biometrics/face/Error.aidl | 47 ++++++++++++++ .../biometrics/face/FaceEnrollOptions.aidl | 47 ++++++++++++++ .../biometrics/face/FaceSensorType.aidl | 41 ++++++++++++ .../hardware/biometrics/face/Feature.aidl | 41 ++++++++++++ .../hardware/biometrics/face/IFace.aidl | 40 ++++++++++++ .../hardware/biometrics/face/ISession.aidl | 63 ++++++++++++++++++ .../biometrics/face/ISessionCallback.aidl | 57 ++++++++++++++++ .../hardware/biometrics/face/SensorProps.aidl | 48 ++++++++++++++ .../compatibility_matrix.8.xml | 2 +- 19 files changed, 750 insertions(+), 2 deletions(-) create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl create mode 100644 biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp index 0d977a950d..7adf402f81 100644 --- a/biometrics/face/aidl/Android.bp +++ b/biometrics/face/aidl/Android.bp @@ -60,8 +60,16 @@ aidl_interface { "android.hardware.keymaster-V4", ], }, + { + version: "4", + imports: [ + "android.hardware.biometrics.common-V4", + "android.hardware.common-V2", + "android.hardware.keymaster-V4", + ], + }, ], - frozen: false, + frozen: true, } diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash new file mode 100644 index 0000000000..e9a5aa3916 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash @@ -0,0 +1 @@ +c43fbb9be4a662cc9ace640dba21cccdb84c6c21 diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl new file mode 100644 index 0000000000..1420cdcee5 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum AcquiredInfo { + UNKNOWN, + GOOD, + INSUFFICIENT, + TOO_BRIGHT, + TOO_DARK, + TOO_CLOSE, + TOO_FAR, + FACE_TOO_HIGH, + FACE_TOO_LOW, + FACE_TOO_RIGHT, + FACE_TOO_LEFT, + POOR_GAZE, + NOT_DETECTED, + TOO_MUCH_MOTION, + RECALIBRATE, + TOO_DIFFERENT, + TOO_SIMILAR, + PAN_TOO_EXTREME, + TILT_TOO_EXTREME, + ROLL_TOO_EXTREME, + FACE_OBSCURED, + START, + SENSOR_DIRTY, + VENDOR, + FIRST_FRAME_RECEIVED, + DARK_GLASSES_DETECTED, + MOUTH_COVERING_DETECTED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl new file mode 100644 index 0000000000..bbaca1249a --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable AuthenticationFrame { + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl new file mode 100644 index 0000000000..1dd0a9c3d4 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable BaseFrame { + android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN; + int vendorCode; + float pan; + float tilt; + float distance; + boolean isCancellable; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl new file mode 100644 index 0000000000..d423a69e95 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable Cell { + int x; + int y; + int z; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl new file mode 100644 index 0000000000..90be5d0ad4 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable EnrollmentFrame { + @nullable android.hardware.biometrics.face.Cell cell; + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + android.hardware.biometrics.face.BaseFrame data; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl new file mode 100644 index 0000000000..89b06ca2b0 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum EnrollmentStage { + UNKNOWN, + FIRST_FRAME_RECEIVED, + WAITING_FOR_CENTERING, + HOLD_STILL_IN_CENTER, + ENROLLING_MOVEMENT_1, + ENROLLING_MOVEMENT_2, + ENROLLMENT_FINISHED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl new file mode 100644 index 0000000000..ee1c01ade2 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable EnrollmentStageConfig { + android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN; + List cells; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl new file mode 100644 index 0000000000..180ea5dcf2 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum EnrollmentType { + DEFAULT, + ACCESSIBILITY, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl new file mode 100644 index 0000000000..5761e31653 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum Error { + UNKNOWN, + HW_UNAVAILABLE, + UNABLE_TO_PROCESS, + TIMEOUT, + NO_SPACE, + CANCELED, + UNABLE_TO_REMOVE, + VENDOR, + REENROLL_REQUIRED, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl new file mode 100644 index 0000000000..c96153112d --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable FaceEnrollOptions { + android.hardware.keymaster.HardwareAuthToken hardwareAuthToken; + android.hardware.biometrics.face.EnrollmentType enrollmentType; + android.hardware.biometrics.face.Feature[] features; + /** + * @deprecated use {@link surfacePreview} instead {@link NativeHandle} a handle used to render content from the face HAL. Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}] should be set at one time. + */ + @nullable android.hardware.common.NativeHandle nativeHandlePreview; + @nullable android.view.Surface surfacePreview; + @nullable android.hardware.biometrics.common.OperationContext context; +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl new file mode 100644 index 0000000000..ec03733a3f --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum FaceSensorType { + UNKNOWN, + RGB, + IR, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl new file mode 100644 index 0000000000..3337df8688 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@Backing(type="byte") @VintfStability +enum Feature { + REQUIRE_ATTENTION, + REQUIRE_DIVERSE_POSES, + DEBUG, +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl new file mode 100644 index 0000000000..1ae76de543 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +interface IFace { + android.hardware.biometrics.face.SensorProps[] getSensorProps(); + android.hardware.biometrics.face.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.face.ISessionCallback cb); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl new file mode 100644 index 0000000000..b655d5f5b2 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +interface ISession { + void generateChallenge(); + void revokeChallenge(in long challenge); + android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType); + /** + * @deprecated use {@link enrollWithOptions} instead. + */ + android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface); + android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId); + android.hardware.biometrics.common.ICancellationSignal detectInteraction(); + void enumerateEnrollments(); + void removeEnrollments(in int[] enrollmentIds); + void getFeatures(); + void setFeature(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.Feature feature, boolean enabled); + void getAuthenticatorId(); + void invalidateAuthenticatorId(); + void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat); + void close(); + android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context); + /** + * @deprecated use {@link enrollWithOptions} instead. + */ + android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context); + void onContextChanged(in android.hardware.biometrics.common.OperationContext context); + android.hardware.biometrics.common.ICancellationSignal enrollWithOptions(in android.hardware.biometrics.face.FaceEnrollOptions options); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl new file mode 100644 index 0000000000..c6c035b1d0 --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +interface ISessionCallback { + void onChallengeGenerated(in long challenge); + void onChallengeRevoked(in long challenge); + void onAuthenticationFrame(in android.hardware.biometrics.face.AuthenticationFrame frame); + void onEnrollmentFrame(in android.hardware.biometrics.face.EnrollmentFrame frame); + void onError(in android.hardware.biometrics.face.Error error, in int vendorCode); + void onEnrollmentProgress(in int enrollmentId, int remaining); + void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat); + void onAuthenticationFailed(); + void onLockoutTimed(in long durationMillis); + void onLockoutPermanent(); + void onLockoutCleared(); + void onInteractionDetected(); + void onEnrollmentsEnumerated(in int[] enrollmentIds); + void onFeaturesRetrieved(in android.hardware.biometrics.face.Feature[] features); + void onFeatureSet(android.hardware.biometrics.face.Feature feature); + void onEnrollmentsRemoved(in int[] enrollmentIds); + void onAuthenticatorIdRetrieved(in long authenticatorId); + void onAuthenticatorIdInvalidated(in long newAuthenticatorId); + void onSessionClosed(); +} diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl new file mode 100644 index 0000000000..918332b85d --- /dev/null +++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.biometrics.face; +/* @hide */ +@VintfStability +parcelable SensorProps { + android.hardware.biometrics.common.CommonProps commonProps; + android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN; + boolean halControlsPreview; + int previewDisplayId; + int enrollPreviewWidth; + int enrollPreviewHeight; + float enrollTranslationX; + float enrollTranslationY; + float enrollPreviewScale; + boolean supportsDetectInteraction; +} diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml index 905778882a..777eb84e2c 100644 --- a/compatibility_matrices/compatibility_matrix.8.xml +++ b/compatibility_matrices/compatibility_matrix.8.xml @@ -116,7 +116,7 @@ android.hardware.biometrics.face - 3 + 3-4 IFace default -- GitLab From d6f9f8e4ec439350c860b4c0789a38f28e761796 Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 2 Nov 2023 22:35:28 +0000 Subject: [PATCH 343/376] Added VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL to HAL Bug: 309014379 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I8b764ad7eb3fc05874f58d31499e6923bdb557c2 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../java/EnumForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 8 ++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/VehicleAutonomousState.aidl | 43 +++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/VehicleAutonomousState.aidl | 73 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 19 +++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 13 files changed, 159 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 3a1f098cda..ef38432f5a 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -248,6 +248,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE}, {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE}, + {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess::READ}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 5a5829875d..22f3e647db 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -248,6 +248,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::VEHICLE_IN_USE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 4bc18524aa..acadf7d28c 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -240,6 +240,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE), Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyAccess.WRITE), + Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 1e00d9f36f..dfdb85b723 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -240,6 +240,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index 958d84b7c5..3c2cfa2eb2 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -81,6 +81,7 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.TRAILER_PRESENT, List.of(TrailerState.class)), Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, List.of(GsrComplianceRequirementType.class)), Map.entry(VehicleProperty.SHUTDOWN_REQUEST, List.of(VehicleApPowerStateShutdownParam.class)), + Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, List.of(VehicleAutonomousState.class)), Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, List.of(AutomaticEmergencyBrakingState.class, ErrorState.class)), Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, List.of(ForwardCollisionWarningState.class, ErrorState.class)), Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, List.of(BlindSpotWarningState.class, ErrorState.class)), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index e4d134e893..26bda22b66 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -66,6 +66,7 @@ using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow; +using ::aidl::android::hardware::automotive::vehicle::VehicleAutonomousState; using ::aidl::android::hardware::automotive::vehicle::VehicleGear; using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection; using ::aidl::android::hardware::automotive::vehicle::VehicleIgnitionState; @@ -244,6 +245,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["WindshieldWipersSwitch"] = std::make_unique>(); + mConstantParsersByType["VehicleAutonomousState"] = + std::make_unique>(); mConstantParsersByType["EmergencyLaneKeepAssistState"] = std::make_unique>(); mConstantParsersByType["CruiseControlType"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index e462609390..88541d8f7b 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3785,6 +3785,14 @@ ] } }, + { + "property": "VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL", + "defaultValue": { + "int32Values": [ + "VehicleAutonomousState::LEVEL_0" + ] + } + }, { "property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 6c1d0a040a..42cd993267 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl new file mode 100644 index 0000000000..e15e71ed3e --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAutonomousState { + LEVEL_0 = 0, + LEVEL_1 = 1, + LEVEL_2 = 2, + LEVEL_3 = 3, + LEVEL_4 = 4, + LEVEL_5 = 5, +} 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 649396a6b0..84df77472c 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 @@ -246,6 +246,7 @@ enum VehicleProperty { SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410889 */, VEHICLE_IN_USE = (((0x0F4A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313738 */, CLUSTER_HEARTBEAT = (((0x0F4B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 299896651 */, + VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL = (((0x0F4C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410892 */, AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */, AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */, FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl new file mode 100644 index 0000000000..3860e7f222 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the various level of automation that can be expressed by the + * VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL property. + */ +@VintfStability +@Backing(type="int") +enum VehicleAutonomousState { + /** + * No automation. ADAS systems are limited to providing warnings and momentary assistance. The + * driver is in constant supervision of all driving tasks and must steer, brake or accelerate as + * needed to maintain safety, and is still responsible for driving while the ADAS systems are + * engaged. Usage should be in accordance to Level 0 definition in J3016_202104 version of + * vehicle autonomy levels defined by SAE. + */ + LEVEL_0 = 0, + /** + * Driver assistance. ADAS systems can provide steering or brake/acceleration support to the + * driver. The driver is in constant supervision of all driving tasks and must steer, brake or + * accelerate as needed to maintain safety, and is still responsible for driving while the ADAS + * systems are engaged. Usage should be in accordance to Level 1 definition in J3016_202104 + * version of vehicle autonomy levels defined by SAE. + */ + LEVEL_1 = 1, + /** + * Partial automation. ADAS systems can provide both steering and brake/acceleration support to + * the driver at the same time. The driver is in constant supervision of all driving tasks and + * must steer, brake or accelerate as needed to maintain safety, and is still responsible for + * driving while the ADAS systems are engaged. Usage should be in accordance to Level 2 + * definition in J3016_202104 version of vehicle autonomy levels defined by SAE. + */ + LEVEL_2 = 2, + /** + * Conditional automation. ADAS systems can drive the vehicle under limited conditions and will + * not operate unless all required conditions are met. The driver is required to take over + * control of the vehicle when requested to do so by the ADAS systems, however is not + * responsible for driving while the ADAS systems are engaged. Usage should be in accordance to + * Level 3 definition in J3016_202104 version of vehicle autonomy levels defined by SAE. + */ + LEVEL_3 = 3, + /** + * High automation. ADAS systems can drive the vehicle under limited conditions and will not + * operate unless all required conditions are met. The driver is not required to take over + * control of the vehicle and is not responsible for driving while the ADAS systems are engaged. + * Usage should be in accordance to Level 4 definition in J3016_202104 version of vehicle + * autonomy levels defined by SAE. + */ + LEVEL_4 = 4, + /** + * Full automation. ADAS systems can drive the vehicle under all conditions. The driver is not + * required to take over control of the vehicle and is not responsible for driving while the + * ADAS systems are engaged. Usage should be in accordance to Level 5 definition in J3016_202104 + * version of vehicle autonomy levels defined by SAE. + */ + LEVEL_5 = 5, +} 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 8784fc8bdb..1827c8923f 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -4501,6 +4501,25 @@ enum VehicleProperty { CLUSTER_HEARTBEAT = 0x0F4B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.MIXED, + /** + * Current state of vehicle autonomy. + * + * Defines the level of autonomy currently engaged in the vehicle from the J3016_202104 revision + * of the SAE standard levels 0-5, with 0 representing no autonomy and 5 representing full + * driving automation. These levels should be used in accordance with the standards defined in + * https://www.sae.org/standards/content/j3016_202104/ and + * https://www.sae.org/blog/sae-j3016-update + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of VehicleAutonomousState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleAutonomousState + */ + VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL = + 0x0F4C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*********************************************************************************************** * Start of ADAS Properties * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 6f81807ce9..c216e76ca7 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -939,6 +939,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) { VehicleArea::GLOBAL, VehiclePropertyType::MIXED); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationCurrentLevelConfig) { + verifyProperty(VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From b42ccc4de8a32743f106d23cc5ebcefa83e22f98 Mon Sep 17 00:00:00 2001 From: Lei Ju Date: Mon, 11 Dec 2023 15:37:40 -0800 Subject: [PATCH 344/376] Update doc for IContextHub.registerCallback Test: Presubmit Bug: 247124878 Change-Id: I94d869f0f8d1f7a04cea918794aebd03bf505971 --- contexthub/aidl/android/hardware/contexthub/IContextHub.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl index 9683d2d7e4..fea107935f 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -147,7 +147,7 @@ interface IContextHub { /** * Register a callback for the HAL implementation to send asynchronous messages to the service - * from a Context hub. There can only be one callback registered for a single Context Hub ID. + * from a Context hub. Each HAL client can only have one callback for each Context Hub ID. * * A call to this function when a callback has already been registered must override the * previous registration. -- GitLab From c1589c6f917d5321e69a5afd047ade14af73ad8c Mon Sep 17 00:00:00 2001 From: Xiang Wang Date: Mon, 4 Dec 2023 15:25:01 -0800 Subject: [PATCH 345/376] Add GPU_LOAD_UP GPU_LOAD_DOWN session hints Bug: 284324521 Test: n/a Change-Id: Iedf0a037939096cae1719a4fbbbc1eece53d2564 --- .../current/android/hardware/power/SessionHint.aidl | 2 ++ power/aidl/android/hardware/power/SessionHint.aidl | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl index 9c1f381543..cb377191bd 100644 --- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl +++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl @@ -39,4 +39,6 @@ enum SessionHint { CPU_LOAD_RESET = 2, CPU_LOAD_RESUME = 3, POWER_EFFICIENCY = 4, + GPU_LOAD_UP = 5, + GPU_LOAD_DOWN = 6, } diff --git a/power/aidl/android/hardware/power/SessionHint.aidl b/power/aidl/android/hardware/power/SessionHint.aidl index a172e12746..ae91061c60 100644 --- a/power/aidl/android/hardware/power/SessionHint.aidl +++ b/power/aidl/android/hardware/power/SessionHint.aidl @@ -52,4 +52,17 @@ enum SessionHint { * power hint session is noncritical despite its CPU intensity. */ POWER_EFFICIENCY = 4, + + /** + * This hint indicates an increase in GPU workload intensity. It means that + * this hint session needs extra GPU resources to meet the target duration. + * This hint must be sent before reporting the actual duration to the session. + */ + GPU_LOAD_UP = 5, + + /** + * This hint indicates a decrease in GPU workload intensity. It means that + * this hint session can reduce GPU resources and still meet the target duration. + */ + GPU_LOAD_DOWN = 6, } -- GitLab From 1a14f6a8f33158d185128c999ce922a10b819799 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Mon, 4 Dec 2023 22:37:38 -0800 Subject: [PATCH 346/376] Add new VENDOR VehicleArea to HAL layer. Bug: 292141998 Test: atest CtsCarTestCases:CarPropertyConfigTest CtsCarTestCases:CarPropertyManagerTest Change-Id: I454350e19064895f6019430b16d10b9ef4976836 --- .../android/hardware/automotive/vehicle/VehicleArea.aidl | 1 + .../android/hardware/automotive/vehicle/VehicleArea.aidl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl index db867f4cc1..b63003a733 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -40,5 +40,6 @@ enum VehicleArea { SEAT = 0x05000000, DOOR = 0x06000000, WHEEL = 0x07000000, + VENDOR = 0x08000000, MASK = 0x0f000000, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl index 6f7f78386a..259b231f70 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl @@ -49,6 +49,11 @@ enum VehicleArea { DOOR = 0x06000000, /** WHEEL maps to enum VehicleAreaWheel */ WHEEL = 0x07000000, + /** + * A property with the VENDOR vehicle area contains area IDs that are vendor defined. Each area + * ID within this area type must be unique with no overlapping bits set. + */ + VENDOR = 0x08000000, MASK = 0x0f000000, } -- GitLab From aa48e638815e21ef3de2590cd32024cd2da9bac7 Mon Sep 17 00:00:00 2001 From: arunvoddu Date: Wed, 6 Dec 2023 17:52:42 +0000 Subject: [PATCH 347/376] Enhanced AIDLs to fetch the Carrier lock information. Bug: 314835886 Test: Built Successfully Change-Id: I746d202d46bef6366525448706316b61ea6907b1 --- .../hardware/radio/sim/CarrierInfo.aidl | 47 +++++++++++++ .../radio/sim/CarrierRestrictions.aidl | 8 +++ .../android/hardware/radio/sim/Plmn.aidl | 40 +++++++++++ .../radio/sim/SimLockMultiSimPolicy.aidl | 7 ++ .../hardware/radio/sim/CarrierInfo.aidl | 70 +++++++++++++++++++ .../radio/sim/CarrierRestrictions.aidl | 15 +++- .../aidl/android/hardware/radio/sim/Plmn.aidl | 31 ++++++++ .../radio/sim/SimLockMultiSimPolicy.aidl | 42 +++++++++++ 8 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl create mode 100644 radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/sim/Plmn.aidl diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl new file mode 100644 index 0000000000..5838959fb5 --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +/* @hide */ +@JavaDerive(toString=true) @VintfStability +parcelable CarrierInfo { + String mcc; + String mnc; + @nullable String spn; + @nullable String gid1; + @nullable String gid2; + @nullable String imsiPrefix; + @nullable List ephlmn; + @nullable String iccid; + @nullable String impi; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl index 84cdf5d1a7..a5b8dc96f6 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -35,10 +35,18 @@ package android.hardware.radio.sim; /* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CarrierRestrictions { + /** + * @deprecated use @List allowedCarrierInfoList + */ android.hardware.radio.sim.Carrier[] allowedCarriers; + /** + * @deprecated use @List excludedCarrierInfoList + */ android.hardware.radio.sim.Carrier[] excludedCarriers; boolean allowedCarriersPrioritized; android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status; + android.hardware.radio.sim.CarrierInfo[] allowedCarrierInfoList = {}; + android.hardware.radio.sim.CarrierInfo[] excludedCarrierInfoList = {}; @Backing(type="int") @VintfStability enum CarrierRestrictionStatus { UNKNOWN = 0, diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl new file mode 100644 index 0000000000..b29a4a76bd --- /dev/null +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.radio.sim; +/* @hide */ +@JavaDerive(toString=true) @VintfStability +parcelable Plmn { + String mcc; + String mnc; +} diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 5a5e8ac11d..8cfe417c26 100644 --- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -37,4 +37,11 @@ package android.hardware.radio.sim; enum SimLockMultiSimPolicy { NO_MULTISIM_POLICY, ONE_VALID_SIM_MUST_BE_PRESENT, + APPLY_TO_ALL_SLOTS, + APPLY_TO_ONLY_SLOT_1, + VALID_SIM_MUST_PRESENT_ON_SLOT_1, + ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS, + ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS, + ALL_SIMS_MUST_BE_VALID, + SLOT_POLICY_OTHER, } diff --git a/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl new file mode 100644 index 0000000000..a8904978ac --- /dev/null +++ b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.sim; + +import android.hardware.radio.sim.Plmn; + +/** @hide */ +@VintfStability +@JavaDerive(toString=true) +parcelable CarrierInfo { + /** + * MCC (Mobile Country Code) of Carrier. Wild char is either '*' or '?'. + */ + String mcc; + + /** + * MNC (Mobile Network Code) of the Carrier. Wild char is either '*' or '?'. + */ + String mnc; + /** + * Service Provider Name(SPN) of the SIM card of the Carrier. + */ + @nullable + String spn; + /** + * GID1 value of the SIM card of the Carrier. + */ + @nullable + String gid1; + /** + * GID2 value of the SIM card of the Carrier. + */ + @nullable + String gid2; + + /** + * IMSI (International Mobile Subscriber Identity) prefix. Wild char is '*'. + */ + @nullable + String imsiPrefix; + /** + * Equivalent HPLMN of the SIM card of the Carrier. + */ + @nullable + List ephlmn; + /** + * ICCID (Integrated Circuit Card Identification) of the SIM card. + */ + @nullable + String iccid; + /** + * IMPI (IMS Private Identity) of the SIM card of the Carrier. + */ + @nullable + String impi; +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl index d5e0c43f82..0002d5a9f4 100644 --- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl +++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl @@ -17,6 +17,7 @@ package android.hardware.radio.sim; import android.hardware.radio.sim.Carrier; +import android.hardware.radio.sim.CarrierInfo; /** @hide */ @VintfStability @@ -40,12 +41,14 @@ parcelable CarrierRestrictions { } /** * Allowed carriers + * @deprecated use @List allowedCarrierInfoList */ Carrier[] allowedCarriers; /** * Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc, * excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1 * is ABCD, all carriers with the same mcc/mnc are allowed. + * @deprecated use @List excludedCarrierInfoList */ Carrier[] excludedCarriers; /** @@ -59,4 +62,14 @@ parcelable CarrierRestrictions { boolean allowedCarriersPrioritized; /** Current restriction status as defined in CarrierRestrictionStatus enum */ CarrierRestrictionStatus status; -} + + /** Allowed carriers. */ + CarrierInfo[] allowedCarrierInfoList = {}; + + /** + * Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc, + * excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1 + * is ABCD, all carriers with the same mcc/mnc are allowed. + */ + CarrierInfo[] excludedCarrierInfoList = {}; +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/sim/Plmn.aidl b/radio/aidl/android/hardware/radio/sim/Plmn.aidl new file mode 100644 index 0000000000..fd82692d45 --- /dev/null +++ b/radio/aidl/android/hardware/radio/sim/Plmn.aidl @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.radio.sim; + +/** @hide */ +@VintfStability +@JavaDerive(toString=true) +parcelable Plmn { + /** + * MCC (Mobile Country Code) of the PLMN + */ + String mcc; + /** + * MNC (Mobile Network Code) of the PLMN + */ + String mnc; +} \ No newline at end of file diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl index 18f97f798f..89d85a9a76 100644 --- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -21,14 +21,56 @@ package android.hardware.radio.sim; @Backing(type="int") @JavaDerive(toString=true) enum SimLockMultiSimPolicy { + /** * Indicates that configuration applies to each slot independently. */ NO_MULTISIM_POLICY, + /** * Indicates that any SIM card can be used as far as one valid card is present in the device. * For the modem, a SIM card is valid when its content (i.e. MCC, MNC, GID, SPN) matches the * carrier restriction configuration. */ ONE_VALID_SIM_MUST_BE_PRESENT, + + /** + * Indicates that the SIM lock policy applies uniformly to all sim slots. + */ + APPLY_TO_ALL_SLOTS, + + /** + * The SIM lock configuration applies exclusively to sim slot 1, leaving + * all other sim slots unlocked irrespective of the SIM card in slot 1 + */ + APPLY_TO_ONLY_SLOT_1, + + /** + * Valid sim cards must be present on sim slot1 in order + * to use other sim slots. + */ + VALID_SIM_MUST_PRESENT_ON_SLOT_1, + + /** + * Valid sim card must be present on slot1 and it must be in full service + * in order to use other sim slots. + */ + ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS, + + /** + * Valid sim card be present on any slot and it must be in full service + * in order to use other sim slots. + */ + ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS, + + /** + * Valid sim cards must be present on all slots. If any SIM cards become + * invalid then device would set other SIM cards as invalid as well. + */ + ALL_SIMS_MUST_BE_VALID, + + /** + * In case there is no match policy listed above. + */ + SLOT_POLICY_OTHER } -- GitLab From 33343fd5486cc914262c4ebb99ab4237e7b41b83 Mon Sep 17 00:00:00 2001 From: Gil Cukierman Date: Tue, 12 Dec 2023 17:02:00 +0000 Subject: [PATCH 348/376] Specify that isCellularIdentifierTransparencyEnabled is false by default The VTS test and setCellularIdentifierTransparencyEnabled were specified as false in previous commits. This comment was missed. Bug: 315974744 Change-Id: I20c3198e7e787478732ea4084780af32837b6059 Test: atest VtsHalRadioTargetTest --- radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl index e2df8dd361..5f26195076 100644 --- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl +++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl @@ -649,8 +649,8 @@ oneway interface IRadioNetwork { /** * Get whether pre-auth cellular identifier in-the-clear transparency is enabled. If * IRadioNetworkInterface.setCellularIdentifierTransparencyEnabled has been called, this should - * return the value of the `enabled` parameter of the last successful call. If it hasn't been - * called this should return the default value of true. + * return the value of the `enabled` parameter of the last successful call and false if + * IRadioNetworkInterface.setCellularIdentifierTransparencyEnabled has not been called yet. * * @param serial Serial number of request * -- GitLab From bc79ff19e85d414abc2875d707f271ccb266ee1e Mon Sep 17 00:00:00 2001 From: jiabin Date: Mon, 11 Dec 2023 19:10:05 +0000 Subject: [PATCH 349/376] AHAL: add API to notify the HAL module about disconnecting device. When external device is about to disconnect, the audio framework will notify the HAL module about the coming device disconnection so that the HAL module could abort any active read/write operations on drivers to avoid problems with the HW interfaces. Bug: 279824103 Test: atest VtsHalAudioCoreModuleTargetTest Change-Id: I9f960b8ae5df11a764e70bd63f98c0f8b8386c34 --- .../android/hardware/audio/core/IModule.aidl | 1 + .../android/hardware/audio/core/IModule.aidl | 36 +++++++++++++++---- audio/aidl/default/Module.cpp | 27 ++++++++++++++ audio/aidl/default/include/core-impl/Module.h | 3 ++ audio/aidl/vts/TestUtils.h | 29 +++++++++++++++ .../vts/VtsHalAudioCoreModuleTargetTest.cpp | 22 ++++++++++++ 6 files changed, 111 insertions(+), 7 deletions(-) diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl index e14e9c0f71..07a85f8fd8 100644 --- a/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl +++ b/audio/aidl/aidl_api/android.hardware.audio.core/current/android/hardware/audio/core/IModule.aidl @@ -74,6 +74,7 @@ interface IModule { boolean supportsVariableLatency(); int getAAudioMixerBurstCount(); int getAAudioHardwareBurstMinUsec(); + void prepareToDisconnectExternalDevice(int portId); const int DEFAULT_AAUDIO_MIXER_BURST_COUNT = 2; const int DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US = 1000; @VintfStability diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl index e736c32e98..2d4d283be2 100644 --- a/audio/aidl/android/hardware/audio/core/IModule.aidl +++ b/audio/aidl/android/hardware/audio/core/IModule.aidl @@ -206,8 +206,10 @@ interface IModule { * after successful connection of an external device. * * Handling of a disconnect is done in a reverse order: - * 1. Reset port configuration using the 'resetAudioPortConfig' method. - * 2. Release the connected device port by calling the 'disconnectExternalDevice' + * 1. Notify the HAL module to prepare for device disconnection using + * 'prepareToDisconnectExternalDevice' method. + * 2. Reset port configuration using the 'resetAudioPortConfig' method. + * 3. Release the connected device port by calling the 'disconnectExternalDevice' * method. This also removes the audio routes associated with this * device port. * @@ -234,11 +236,15 @@ interface IModule { * instance previously instantiated using the 'connectExternalDevice' * method. * - * The framework will call this method before closing streams and resetting - * patches. This call can be used by the HAL module to prepare itself to - * device disconnection. If the HAL module indicates an error after the first - * call, the framework will call this method once again after closing associated - * streams and patches. + * On AIDL HAL v1, the framework will call this method before closing streams + * and resetting patches. This call can be used by the HAL module to prepare + * itself to device disconnection. If the HAL module indicates an error after + * the first call, the framework will call this method once again after closing + * associated streams and patches. + * + * On AIDL HAL v2 and later, the framework will call 'prepareToDisconnectExternalDevice' + * method to notify the HAL module to prepare itself for device disconnection. The + * framework will only call this method after closing associated streams and patches. * * @throws EX_ILLEGAL_ARGUMENT In the following cases: * - If the port can not be found by the ID. @@ -912,4 +918,20 @@ interface IModule { * @throw EX_UNSUPPORTED_OPERATION If the module does not support aaudio MMAP. */ int getAAudioHardwareBurstMinUsec(); + + /** + * Notify the HAL module to prepare for disconnecting an external device. + * + * This method is used to inform the HAL module that 'disconnectExternalDevice' will be + * called soon. The HAL module can rely on this method to abort active data operations + * early. The 'portId' must be of a connected device Port instance previously instantiated + * using 'connectExternalDevice' method. 'disconnectExternalDevice' method will be called + * soon after this method with the same 'portId'. + * + * @param portId The ID of the audio port that is about to disconnect + * @throws EX_ILLEGAL_ARGUMENT In the following cases: + * - If the port can not be found by the ID. + * - If this is not a connected device port. + */ + void prepareToDisconnectExternalDevice(int portId); } diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp index 66c2169952..d0e8745d78 100644 --- a/audio/aidl/default/Module.cpp +++ b/audio/aidl/default/Module.cpp @@ -762,6 +762,28 @@ ndk::ScopedAStatus Module::disconnectExternalDevice(int32_t in_portId) { return ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus Module::prepareToDisconnectExternalDevice(int32_t in_portId) { + auto& ports = getConfig().ports; + auto portIt = findById(ports, in_portId); + if (portIt == ports.end()) { + LOG(ERROR) << __func__ << ": port id " << in_portId << " not found"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + if (portIt->ext.getTag() != AudioPortExt::Tag::device) { + LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a device port"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + auto connectedPortsIt = mConnectedDevicePorts.find(in_portId); + if (connectedPortsIt == mConnectedDevicePorts.end()) { + LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a connected device port"; + return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); + } + + onPrepareToDisconnectExternalDevice(*portIt); + + return ndk::ScopedAStatus::ok(); +} + ndk::ScopedAStatus Module::getAudioPatches(std::vector* _aidl_return) { *_aidl_return = getConfig().patches; LOG(DEBUG) << __func__ << ": returning " << _aidl_return->size() << " patches"; @@ -1541,6 +1563,11 @@ void Module::onExternalDeviceConnectionChanged( LOG(DEBUG) << __func__ << ": do nothing and return"; } +void Module::onPrepareToDisconnectExternalDevice( + const ::aidl::android::media::audio::common::AudioPort& audioPort __unused) { + LOG(DEBUG) << __func__ << ": do nothing and return"; +} + ndk::ScopedAStatus Module::onMasterMuteChanged(bool mute __unused) { LOG(VERBOSE) << __func__ << ": do nothing and return ok"; return ndk::ScopedAStatus::ok(); diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h index caf43f1761..572b5979cc 100644 --- a/audio/aidl/default/include/core-impl/Module.h +++ b/audio/aidl/default/include/core-impl/Module.h @@ -70,6 +70,7 @@ class Module : public BnModule { const ::aidl::android::media::audio::common::AudioPort& in_templateIdAndAdditionalData, ::aidl::android::media::audio::common::AudioPort* _aidl_return) override; ndk::ScopedAStatus disconnectExternalDevice(int32_t in_portId) override; + ndk::ScopedAStatus prepareToDisconnectExternalDevice(int32_t in_portId) override; ndk::ScopedAStatus getAudioPatches(std::vector* _aidl_return) override; ndk::ScopedAStatus getAudioPort( int32_t in_portId, @@ -195,6 +196,8 @@ class Module : public BnModule { const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks); virtual void onExternalDeviceConnectionChanged( const ::aidl::android::media::audio::common::AudioPort& audioPort, bool connected); + virtual void onPrepareToDisconnectExternalDevice( + const ::aidl::android::media::audio::common::AudioPort& audioPort); virtual ndk::ScopedAStatus onMasterMuteChanged(bool mute); virtual ndk::ScopedAStatus onMasterVolumeChanged(float volume); virtual std::vector<::aidl::android::media::audio::common::MicrophoneInfo> getMicrophoneInfos(); diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h index e9f3251c6b..515b8a2a2f 100644 --- a/audio/aidl/vts/TestUtils.h +++ b/audio/aidl/vts/TestUtils.h @@ -69,6 +69,23 @@ inline ::testing::AssertionResult assertResult(const char* exp_expr, const char* << "\n but is has completed with: " << status; } +inline ::testing::AssertionResult assertIsOkOrUnknownTransaction( + const char* expr, const ::ndk::ScopedAStatus& status) { + if (status.getStatus() == STATUS_UNKNOWN_TRANSACTION) { + return ::testing::AssertionSuccess(); + } + return assertIsOk(expr, status); +} + +inline ::testing::AssertionResult assertResultOrUnknownTransaction( + const char* exp_expr, const char* act_expr, int32_t expected, + const ::ndk::ScopedAStatus& status) { + if (status.getStatus() == STATUS_UNKNOWN_TRANSACTION) { + return ::testing::AssertionSuccess(); + } + return assertResult(exp_expr, act_expr, expected, status); +} + } // namespace detail } // namespace android::hardware::audio::common::testing @@ -93,3 +110,15 @@ inline ::testing::AssertionResult assertResult(const char* exp_expr, const char* GTEST_SKIP() << "Skip data path for offload"; \ } \ }) + +// Test that the transaction status 'isOk' if it is a known transaction +#define EXPECT_IS_OK_OR_UNKNOWN_TRANSACTION(ret) \ + EXPECT_PRED_FORMAT1( \ + ::android::hardware::audio::common::testing::detail::assertIsOkOrUnknownTransaction, \ + ret) + +// Test that the transaction status is as expected if it is a known transaction +#define EXPECT_STATUS_OR_UNKNOWN_TRANSACTION(expected, ret) \ + EXPECT_PRED_FORMAT2( \ + ::android::hardware::audio::common::testing::detail::assertResultOrUnknownTransaction, \ + expected, ret) diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp index 697aae9a30..f91795bc13 100644 --- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp @@ -573,6 +573,8 @@ class WithDevicePortConnectedState { WithDevicePortConnectedState& operator=(const WithDevicePortConnectedState&) = delete; ~WithDevicePortConnectedState() { if (mModule != nullptr) { + EXPECT_IS_OK_OR_UNKNOWN_TRANSACTION(mModule->prepareToDisconnectExternalDevice(getId())) + << "when preparing to disconnect device port ID " << getId(); EXPECT_IS_OK(mModule->disconnectExternalDevice(getId())) << "when disconnecting device port ID " << getId(); } @@ -1753,6 +1755,9 @@ TEST_P(AudioCoreModule, TryConnectMissingDevice) { ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort); EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString(); if (status.isOk()) { + EXPECT_IS_OK_OR_UNKNOWN_TRANSACTION( + module->prepareToDisconnectExternalDevice(connectedPort.id)) + << "when preparing to disconnect device port ID " << connectedPort.id; EXPECT_IS_OK(module->disconnectExternalDevice(connectedPort.id)) << "when disconnecting device port ID " << connectedPort.id; } @@ -1782,6 +1787,9 @@ TEST_P(AudioCoreModule, ConnectDisconnectExternalDeviceInvalidPorts) { invalidPort.id = portId; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->connectExternalDevice(invalidPort, &ignored)) << "port ID " << portId << ", when setting CONNECTED state"; + EXPECT_STATUS_OR_UNKNOWN_TRANSACTION(EX_ILLEGAL_ARGUMENT, + module->prepareToDisconnectExternalDevice(portId)) + << "port ID " << portId << ", when preparing to disconnect"; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->disconnectExternalDevice(portId)) << "port ID " << portId << ", when setting DISCONNECTED state"; } @@ -1792,6 +1800,9 @@ TEST_P(AudioCoreModule, ConnectDisconnectExternalDeviceInvalidPorts) { if (port.ext.getTag() != AudioPortExt::Tag::device) { EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->connectExternalDevice(port, &ignored)) << "non-device port ID " << port.id << " when setting CONNECTED state"; + EXPECT_STATUS_OR_UNKNOWN_TRANSACTION(EX_ILLEGAL_ARGUMENT, + module->prepareToDisconnectExternalDevice(port.id)) + << "non-device port ID " << port.id << " when preparing to disconnect"; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->disconnectExternalDevice(port.id)) << "non-device port ID " << port.id << " when setting DISCONNECTED state"; } else { @@ -1800,6 +1811,10 @@ TEST_P(AudioCoreModule, ConnectDisconnectExternalDeviceInvalidPorts) { EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->connectExternalDevice(port, &ignored)) << "for a permanently attached device port ID " << port.id << " when setting CONNECTED state"; + EXPECT_STATUS_OR_UNKNOWN_TRANSACTION( + EX_ILLEGAL_ARGUMENT, module->prepareToDisconnectExternalDevice(port.id)) + << "for a permanently attached device port ID " << port.id + << " when preparing to disconnect"; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->disconnectExternalDevice(port.id)) << "for a permanently attached device port ID " << port.id << " when setting DISCONNECTED state"; @@ -1817,6 +1832,9 @@ TEST_P(AudioCoreModule, ConnectDisconnectExternalDeviceTwice) { GTEST_SKIP() << "No external devices in the module."; } for (const auto& port : ports) { + EXPECT_STATUS_OR_UNKNOWN_TRANSACTION(EX_ILLEGAL_ARGUMENT, + module->prepareToDisconnectExternalDevice(port.id)) + << "when preparing to disconnect already disconnected device port ID " << port.id; EXPECT_STATUS(EX_ILLEGAL_ARGUMENT, module->disconnectExternalDevice(port.id)) << "when disconnecting already disconnected device port ID " << port.id; AudioPort portWithData = GenerateUniqueDeviceAddress(port); @@ -1851,6 +1869,10 @@ TEST_P(AudioCoreModule, DisconnectExternalDeviceNonResetPortConfig) { // Our test assumes that 'getAudioPort' returns at least one profile, and it // is not a dynamic profile. ASSERT_NO_FATAL_FAILURE(config.SetUp(module.get())); + EXPECT_IS_OK_OR_UNKNOWN_TRANSACTION( + module->prepareToDisconnectExternalDevice(portConnected.getId())) + << "when preparing to disconnect device port ID " << port.id + << " with active configuration " << config.getId(); EXPECT_STATUS(EX_ILLEGAL_STATE, module->disconnectExternalDevice(portConnected.getId())) << "when trying to disconnect device port ID " << port.id << " with active configuration " << config.getId(); -- GitLab From 3990382e47de260883cd05e935bfdbde9d12c2fd Mon Sep 17 00:00:00 2001 From: maheshkkv Date: Tue, 28 Nov 2023 15:31:53 -0800 Subject: [PATCH 350/376] Add TWT support for vendor HAL Bug: 296108122 Test: m Change-Id: I897d405567a23e3c30ca46dce49c52dc939b508c --- .../android/hardware/wifi/IWifiStaIface.aidl | 7 + .../wifi/IWifiStaIfaceEventCallback.aidl | 27 +++ .../hardware/wifi/TwtCapabilities.aidl | 45 ++++ .../android/hardware/wifi/TwtRequest.aidl | 42 ++++ .../android/hardware/wifi/TwtSession.aidl | 54 +++++ .../hardware/wifi/TwtSessionStats.aidl | 43 ++++ .../android/hardware/wifi/IWifiStaIface.aidl | 111 +++++++++ .../wifi/IWifiStaIfaceEventCallback.aidl | 102 ++++++++ .../hardware/wifi/TwtCapabilities.aidl | 56 +++++ .../android/hardware/wifi/TwtRequest.aidl | 44 ++++ .../android/hardware/wifi/TwtSession.aidl | 92 +++++++ .../hardware/wifi/TwtSessionStats.aidl | 53 ++++ wifi/aidl/default/aidl_struct_util.cpp | 126 ++++++++++ wifi/aidl/default/aidl_struct_util.h | 12 + wifi/aidl/default/wifi_legacy_hal.cpp | 167 +++++++++++++ wifi/aidl/default/wifi_legacy_hal.h | 49 +++- wifi/aidl/default/wifi_legacy_hal_stubs.cpp | 7 + wifi/aidl/default/wifi_sta_iface.cpp | 226 ++++++++++++++++++ wifi/aidl/default/wifi_sta_iface.h | 16 ++ 19 files changed, 1273 insertions(+), 6 deletions(-) create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl create mode 100644 wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl create mode 100644 wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl create mode 100644 wifi/aidl/android/hardware/wifi/TwtRequest.aidl create mode 100644 wifi/aidl/android/hardware/wifi/TwtSession.aidl create mode 100644 wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl index f8384130b2..e7c3444d84 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl @@ -62,6 +62,13 @@ interface IWifiStaIface { void stopSendingKeepAlivePackets(in int cmdId); void setDtimMultiplier(in int multiplier); android.hardware.wifi.CachedScanData getCachedScanData(); + android.hardware.wifi.TwtCapabilities twtGetCapabilities(); + void twtSessionSetup(in int cmdId, in android.hardware.wifi.TwtRequest twtRequest); + void twtSessionUpdate(in int cmdId, in int sessionId, in android.hardware.wifi.TwtRequest twtRequest); + void twtSessionSuspend(in int cmdId, in int sessionId); + void twtSessionResume(in int cmdId, in int sessionId); + void twtSessionTeardown(in int cmdId, in int sessionId); + void twtSessionGetStats(in int cmdId, in int sessionId); @Backing(type="int") @VintfStability enum FeatureSetMask { APF = (1 << 0) /* 1 */, diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl index 48b85b0fcf..629ca3d922 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl @@ -38,4 +38,31 @@ interface IWifiStaIfaceEventCallback { oneway void onBackgroundScanFailure(in int cmdId); oneway void onBackgroundScanResults(in int cmdId, in android.hardware.wifi.StaScanData[] scanDatas); oneway void onRssiThresholdBreached(in int cmdId, in byte[6] currBssid, in int currRssi); + oneway void onTwtFailure(in int cmdId, in android.hardware.wifi.IWifiStaIfaceEventCallback.TwtErrorCode error); + oneway void onTwtSessionCreate(in int cmdId, in android.hardware.wifi.TwtSession twtSession); + oneway void onTwtSessionUpdate(in int cmdId, in android.hardware.wifi.TwtSession twtSession); + oneway void onTwtSessionTeardown(in int cmdId, in int twtSessionId, in android.hardware.wifi.IWifiStaIfaceEventCallback.TwtTeardownReasonCode reasonCode); + oneway void onTwtSessionStats(in int cmdId, in int twtSessionId, in android.hardware.wifi.TwtSessionStats twtSessionStats); + oneway void onTwtSessionSuspend(in int cmdId, in int twtSessionId); + oneway void onTwtSessionResume(in int cmdId, in int twtSessionId); + @Backing(type="byte") @VintfStability + enum TwtErrorCode { + FAILURE_UNKNOWN, + ALREADY_RESUMED, + ALREADY_SUSPENDED, + INVALID_PARAMS, + MAX_SESSION_REACHED, + NOT_AVAILABLE, + NOT_SUPPORTED, + PEER_NOT_SUPPORTED, + PEER_REJECTED, + TIMEOUT, + } + @Backing(type="byte") @VintfStability + enum TwtTeardownReasonCode { + UNKNOWN, + LOCALLY_REQUESTED, + INTERNALLY_INITIATED, + PEER_INITIATED, + } } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl new file mode 100644 index 0000000000..d8e73fb4b7 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable TwtCapabilities { + boolean isTwtRequesterSupported; + boolean isTwtResponderSupported; + boolean isBroadcastTwtSupported; + boolean isFlexibleTwtScheduleSupported; + int minWakeDurationMicros; + int maxWakeDurationMicros; + int minWakeIntervalMicros; + int maxWakeIntervalMicros; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl new file mode 100644 index 0000000000..3051b943a3 --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable TwtRequest { + int mloLinkId; + int minWakeDurationMicros; + int maxWakeDurationMicros; + int minWakeIntervalMicros; + int maxWakeIntervalMicros; +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl new file mode 100644 index 0000000000..92c2533e2c --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable TwtSession { + int sessionId; + int mloLinkId; + int wakeDurationMicros; + int wakeIntervalMicros; + android.hardware.wifi.TwtSession.TwtNegotiationType negotiationType; + boolean isTriggerEnabled; + boolean isAnnounced; + boolean isImplicit; + boolean isProtected; + boolean isUpdatable; + boolean isSuspendable; + boolean isResponderPmModeEnabled; + @Backing(type="byte") @VintfStability + enum TwtNegotiationType { + INDIVIDUAL = 0, + BROADCAST = 1, + } +} diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl new file mode 100644 index 0000000000..528444a84b --- /dev/null +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi; +@VintfStability +parcelable TwtSessionStats { + int avgTxPktCount; + int avgRxPktCount; + int avgTxPktSize; + int avgRxPktSize; + int avgEospDurationMicros; + int eospCount; +} diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl index 3c8b55fa03..2ec95c5540 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl @@ -25,6 +25,8 @@ import android.hardware.wifi.StaLinkLayerStats; import android.hardware.wifi.StaRoamingCapabilities; import android.hardware.wifi.StaRoamingConfig; import android.hardware.wifi.StaRoamingState; +import android.hardware.wifi.TwtCapabilities; +import android.hardware.wifi.TwtRequest; import android.hardware.wifi.WifiBand; import android.hardware.wifi.WifiDebugRxPacketFateReport; import android.hardware.wifi.WifiDebugTxPacketFateReport; @@ -569,4 +571,113 @@ interface IWifiStaIface { * |WifiStatusCode.ERROR_UNKNOWN| */ CachedScanData getCachedScanData(); + + /** + * Get Target Wake Time (TWT) local device capabilities for the station interface. + * + * @return Instance of |TwtCapabilities|. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_NOT_AVAILABLE|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + TwtCapabilities twtGetCapabilities(); + + /** + * Setup a Target Wake Time (TWT) session. + * + * Supported only if |TwtCapabilities.isTwtRequesterSupported| is set. Results in asynchronous + * callback |IWifiStaIfaceEventCallback.onTwtSessionCreate| on success or + * |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param twtRequest TWT Request parameters. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionSetup(in int cmdId, in TwtRequest twtRequest); + + /** + * Update a Target Wake Time (TWT) session. + * + * Supported only if the TWT session can be updated. See |TwtSession.isUpdatable|. Results in + * asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionUpdate| on success or + * |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param sessionId TWT session id. + * @param twtRequest TWT Request parameters. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionUpdate(in int cmdId, in int sessionId, in TwtRequest twtRequest); + + /** + * Suspend a Target Wake Time (TWT) session until a resume is called. + * + * Supported only if the TWT session supports suspend and resume. See + * |TwtSession.isSuspendable|. Results in asynchronous callback + * |IWifiStaIfaceEventCallback.onTwtSessionSuspend| on success or + * |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param sessionId TWT session id. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionSuspend(in int cmdId, in int sessionId); + + /** + * Resume a Target Wake Time (TWT) session which is suspended. + * + * Supported only if the TWT session supports suspend and resume. See + * |TwtSession.isSuspendable|. Results in asynchronous callback + * |IWifiStaIfaceEventCallback.onTwtSessionResume| on success or + * |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param sessionId TWT session id. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionResume(in int cmdId, in int sessionId); + + /** + * Teardown a Target Wake Time (TWT) session. + * + * Results in asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionTeardown| on + * success or |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param sessionId TWT session id. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionTeardown(in int cmdId, in int sessionId); + + /** + * Get stats for a Target Wake Time (TWT) session. + * + * Results in asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionStats| on success + * or |IWifiStaIfaceEventCallback.onTwtFailure| on failure. + * + * @param cmdId Command Id to use for this invocation. The value 0 is reserved. + * @param sessionId TWT session id. + * @throws ServiceSpecificException with one of the following values: + * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|, + * |WifiStatusCode.ERROR_NOT_SUPPORTED|, + * |WifiStatusCode.ERROR_UNKNOWN| + */ + void twtSessionGetStats(in int cmdId, in int sessionId); } diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl index 93a255f9b4..dda7c771f5 100644 --- a/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl +++ b/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl @@ -18,6 +18,8 @@ package android.hardware.wifi; import android.hardware.wifi.StaScanData; import android.hardware.wifi.StaScanResult; +import android.hardware.wifi.TwtSession; +import android.hardware.wifi.TwtSessionStats; @VintfStability oneway interface IWifiStaIfaceEventCallback { @@ -61,4 +63,104 @@ oneway interface IWifiStaIfaceEventCallback { * @param currRssi RSSI of the currently connected access point. */ void onRssiThresholdBreached(in int cmdId, in byte[6] currBssid, in int currRssi); + + @VintfStability + @Backing(type="byte") + enum TwtErrorCode { + /** Unknown failure */ + FAILURE_UNKNOWN, + /** TWT session is already resumed */ + ALREADY_RESUMED, + /** TWT session is already suspended */ + ALREADY_SUSPENDED, + /** Invalid parameters */ + INVALID_PARAMS, + /** Maximum number of sessions reached */ + MAX_SESSION_REACHED, + /** Requested operation is not available */ + NOT_AVAILABLE, + /** Requested operation is not supported */ + NOT_SUPPORTED, + /** Requested operation is not supported by the peer */ + PEER_NOT_SUPPORTED, + /** Requested operation is rejected by the peer */ + PEER_REJECTED, + /** Requested operation is timed out */ + TIMEOUT, + } + + @VintfStability + @Backing(type="byte") + enum TwtTeardownReasonCode { + /** Unknown reason */ + UNKNOWN, + /** Teardown requested by the framework */ + LOCALLY_REQUESTED, + /** Teardown initiated internally by the firmware or driver */ + INTERNALLY_INITIATED, + /** Teardown initiated by the peer */ + PEER_INITIATED, + } + + /** + * Called to indicate a TWT failure. If there is no command associated with this failure cmdId + * will be 0. + * + * @param cmdId Id used to identify the command. The value 0 indicates no associated command. + * @param error error code. + */ + void onTwtFailure(in int cmdId, in TwtErrorCode error); + + /** + * Called when a Target Wake Time session is created. See |IWifiStaIface.twtSessionSetup|. + * + * @param cmdId Id used to identify the command. + * @param twtSession TWT session. + */ + void onTwtSessionCreate(in int cmdId, in TwtSession twtSession); + + /** + * Called when a Target Wake Time session is updated. See |IWifiStaIface.twtSessionUpdate|. + * + * @param cmdId Id used to identify the command. + * @param twtSession TWT session. + */ + void onTwtSessionUpdate(in int cmdId, in TwtSession twtSession); + + /** + * Called when the Target Wake Time session is torndown. + * See |IWifiStaIface.twtSessionTeardown|. + * + * @param cmdId Id used to identify the command. The value 0 indicates no associated command. + * @param twtSessionId TWT session id. + * @param reasonCode reason code for the TWT teardown. + */ + void onTwtSessionTeardown( + in int cmdId, in int twtSessionId, in TwtTeardownReasonCode reasonCode); + + /** + * Called when TWT session stats available. See |IWifiStaIface.twtSessionGetStats|. + * + * @param cmdId Id used to identify the command. + * @param twtSessionId TWT session id. + * @param twtSessionStats TWT session stats. + */ + void onTwtSessionStats(in int cmdId, in int twtSessionId, in TwtSessionStats twtSessionStats); + + /** + * Called when the Target Wake Time session is suspended. + * See |IWifiStaIface.twtSessionSuspend|. + * + * @param cmdId Id used to identify the command. The value 0 indicates no associated command. + * @param twtSessionId TWT session id. + */ + void onTwtSessionSuspend(in int cmdId, in int twtSessionId); + + /** + * Called when the Target Wake Time session is resumed. See |IWifiStaIface.twtSessionResume|. + * + * @param cmdId Id used to identify the command. The value 0 indicates no associated command. + * @param twtSessionId TWT session id. + */ + void onTwtSessionResume(in int cmdId, in int twtSessionId); } diff --git a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl new file mode 100644 index 0000000000..9007d0e5be --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Target Wake Time (TWT) Capabilities supported. + */ +@VintfStability +parcelable TwtCapabilities { + /** + * Whether the TWT requester mode supported. + */ + boolean isTwtRequesterSupported; + /** + * Whether the TWT responder mode supported. + */ + boolean isTwtResponderSupported; + /** + * Whether the Broadcast TWT mode (TWT scheduling STA) supported. + */ + boolean isBroadcastTwtSupported; + /** + * Whether supports Flexible TWT schedules. + */ + boolean isFlexibleTwtScheduleSupported; + /** + * Minimum TWT wake duration in microseconds. + */ + int minWakeDurationMicros; + /** + * Maximum TWT wake duration in microseconds. + */ + int maxWakeDurationMicros; + /** + * Minimum TWT wake interval in microseconds. + */ + int minWakeIntervalMicros; + /** + * Maximum TWT wake interval in microseconds. + */ + int maxWakeIntervalMicros; +} diff --git a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl new file mode 100644 index 0000000000..5191713f57 --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Target Wake Time (TWT) Request + */ +@VintfStability +parcelable TwtRequest { + /** + * MLO Link id in case TWT is requesting for MLO connection. Otherwise -1. + */ + int mloLinkId; + /** + * Minimum TWT wake duration in microseconds. + */ + int minWakeDurationMicros; + /** + * Maximum TWT wake duration in microseconds. + */ + int maxWakeDurationMicros; + /** + * Minimum TWT wake interval in microseconds. + */ + int minWakeIntervalMicros; + /** + * Maximum TWT wake interval in microseconds. + */ + int maxWakeIntervalMicros; +} diff --git a/wifi/aidl/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/android/hardware/wifi/TwtSession.aidl new file mode 100644 index 0000000000..5a7ddb1a0b --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/TwtSession.aidl @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Target Wake Time (TWT) Session + */ +@VintfStability +parcelable TwtSession { + @VintfStability + @Backing(type="byte") + enum TwtNegotiationType { + INDIVIDUAL = 0, + BROADCAST = 1, + } + + /** + * An unique identifier for the session. + */ + int sessionId; + + /** + * MLO Link id in case of MLO connection. Otherwise -1. + */ + int mloLinkId; + + /** + * TWT service period in microseconds. + */ + int wakeDurationMicros; + + /** + * Time interval in microseconds between two successive TWT service periods. + */ + int wakeIntervalMicros; + + /** + * TWT negotiation type. + */ + TwtNegotiationType negotiationType; + + /** + * Whether the TWT session is trigger enabled or non-trigger enabled. + */ + boolean isTriggerEnabled; + + /** + * Whether the TWT session is announced or unannounced. + */ + boolean isAnnounced; + + /** + * Whether the TWT session is implicit or explicit. + */ + boolean isImplicit; + + /** + * Whether the TWT session is protected or not. + */ + boolean isProtected; + + /** + * Whether the TWT session can be updated. + */ + boolean isUpdatable; + + /** + * Whether the TWT session can be suspended and then resumed. + */ + boolean isSuspendable; + + /** + * Whether AP (TWT responder) intends to go to doze state outside of TWT Service Periods. + * + * Refer IEEE 802.11 spec, Section 10.47.7 (TWT Sleep Setup). + */ + boolean isResponderPmModeEnabled; +} diff --git a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl new file mode 100644 index 0000000000..e2e2d12b7e --- /dev/null +++ b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi; + +/** + * Target Wake Time (TWT) Session Stats + */ +@VintfStability +parcelable TwtSessionStats { + /** + * Average number of Tx packets in each wake duration. + */ + int avgTxPktCount; + + /** + * Average number of Rx packets in each wake duration. + */ + int avgRxPktCount; + + /** + * Average bytes per Tx packets in each wake duration. + */ + int avgTxPktSize; + + /** + * Average bytes per Rx packets in each wake duration. + */ + int avgRxPktSize; + + /** + * Average End of Service period in microseconds. + */ + int avgEospDurationMicros; + + /** + * Count of early terminations. + */ + int eospCount; +} diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index d2bfef6620..89212381ca 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -3574,6 +3574,132 @@ WifiRatePreamble convertScanResultFlagsToPreambleType(int flags) { return WifiRatePreamble::OFDM; } +bool convertTwtCapabilitiesToAidl(legacy_hal::wifi_twt_capabilities legacy_twt_capabs, + TwtCapabilities* aidl_twt_capabs) { + if (!aidl_twt_capabs) { + return false; + } + aidl_twt_capabs->isTwtRequesterSupported = legacy_twt_capabs.is_twt_requester_supported; + aidl_twt_capabs->isTwtResponderSupported = legacy_twt_capabs.is_twt_responder_supported; + aidl_twt_capabs->isBroadcastTwtSupported = legacy_twt_capabs.is_flexible_twt_supported; + if (legacy_twt_capabs.min_wake_duration_micros > legacy_twt_capabs.max_wake_duration_micros) { + return false; + } + aidl_twt_capabs->minWakeDurationMicros = legacy_twt_capabs.min_wake_duration_micros; + aidl_twt_capabs->maxWakeDurationMicros = legacy_twt_capabs.max_wake_duration_micros; + if (legacy_twt_capabs.min_wake_interval_micros > legacy_twt_capabs.max_wake_interval_micros) { + return false; + } + aidl_twt_capabs->minWakeIntervalMicros = legacy_twt_capabs.min_wake_interval_micros; + aidl_twt_capabs->maxWakeIntervalMicros = legacy_twt_capabs.max_wake_interval_micros; + return true; +} + +bool convertAidlTwtRequestToLegacy(const TwtRequest aidl_twt_request, + legacy_hal::wifi_twt_request* legacy_twt_request) { + if (legacy_twt_request == nullptr) { + return false; + } + legacy_twt_request->mlo_link_id = aidl_twt_request.mloLinkId; + if (aidl_twt_request.minWakeDurationMicros > aidl_twt_request.maxWakeDurationMicros) { + return false; + } + legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationMicros; + legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationMicros; + if (aidl_twt_request.minWakeIntervalMicros > aidl_twt_request.maxWakeIntervalMicros) { + return false; + } + legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalMicros; + legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalMicros; + return true; +} + +IWifiStaIfaceEventCallback::TwtErrorCode convertLegacyHalTwtErrorCodeToAidl( + legacy_hal::wifi_twt_error_code legacy_error_code) { + switch (legacy_error_code) { + case WIFI_TWT_ERROR_CODE_TIMEOUT: + return IWifiStaIfaceEventCallback::TwtErrorCode::TIMEOUT; + case WIFI_TWT_ERROR_CODE_PEER_REJECTED: + return IWifiStaIfaceEventCallback::TwtErrorCode::PEER_REJECTED; + case WIFI_TWT_ERROR_CODE_PEER_NOT_SUPPORTED: + return IWifiStaIfaceEventCallback::TwtErrorCode::PEER_NOT_SUPPORTED; + case WIFI_TWT_ERROR_CODE_NOT_SUPPORTED: + return IWifiStaIfaceEventCallback::TwtErrorCode::NOT_SUPPORTED; + case WIFI_TWT_ERROR_CODE_NOT_AVAILABLE: + return IWifiStaIfaceEventCallback::TwtErrorCode::NOT_AVAILABLE; + case WIFI_TWT_ERROR_CODE_MAX_SESSION_REACHED: + return IWifiStaIfaceEventCallback::TwtErrorCode::MAX_SESSION_REACHED; + case WIFI_TWT_ERROR_CODE_INVALID_PARAMS: + return IWifiStaIfaceEventCallback::TwtErrorCode::INVALID_PARAMS; + case WIFI_TWT_ERROR_CODE_ALREADY_SUSPENDED: + return IWifiStaIfaceEventCallback::TwtErrorCode::ALREADY_SUSPENDED; + case WIFI_TWT_ERROR_CODE_ALREADY_RESUMED: + return IWifiStaIfaceEventCallback::TwtErrorCode::ALREADY_RESUMED; + default: + return IWifiStaIfaceEventCallback::TwtErrorCode::FAILURE_UNKNOWN; + } +} + +IWifiStaIfaceEventCallback::TwtTeardownReasonCode convertLegacyHalTwtReasonCodeToAidl( + legacy_hal::wifi_twt_teardown_reason_code legacy_reason_code) { + switch (legacy_reason_code) { + case WIFI_TWT_TEARDOWN_REASON_CODE_LOCALLY_REQUESTED: + return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::LOCALLY_REQUESTED; + case WIFI_TWT_TEARDOWN_REASON_CODE_INTERNALLY_INITIATED: + return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::INTERNALLY_INITIATED; + case WIFI_TWT_TEARDOWN_REASON_CODE_PEER_INITIATED: + return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::PEER_INITIATED; + default: + return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::UNKNOWN; + } +} + +bool convertLegacyHalTwtSessionToAidl(legacy_hal::wifi_twt_session twt_session, + TwtSession* aidl_twt_session) { + if (aidl_twt_session == nullptr) { + return false; + } + + aidl_twt_session->sessionId = twt_session.session_id; + aidl_twt_session->mloLinkId = twt_session.mlo_link_id; + aidl_twt_session->wakeDurationMicros = twt_session.wake_duration_micros; + aidl_twt_session->wakeIntervalMicros = twt_session.wake_interval_micros; + switch (twt_session.negotiation_type) { + case WIFI_TWT_NEGO_TYPE_INDIVIDUAL: + aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::INDIVIDUAL; + break; + case WIFI_TWT_NEGO_TYPE_BROADCAST: + aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::BROADCAST; + break; + default: + return false; + } + aidl_twt_session->isTriggerEnabled = twt_session.is_trigger_enabled; + aidl_twt_session->isAnnounced = twt_session.is_announced; + aidl_twt_session->isImplicit = twt_session.is_implicit; + aidl_twt_session->isProtected = twt_session.is_protected; + aidl_twt_session->isUpdatable = twt_session.is_updatable; + aidl_twt_session->isSuspendable = twt_session.is_suspendable; + aidl_twt_session->isResponderPmModeEnabled = twt_session.is_responder_pm_mode_enabled; + return true; +} + +bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats twt_stats, + TwtSessionStats* aidl_twt_stats) { + if (aidl_twt_stats == nullptr) { + return false; + } + + aidl_twt_stats->avgTxPktCount = twt_stats.avg_pkt_num_tx; + aidl_twt_stats->avgRxPktCount = twt_stats.avg_pkt_num_rx; + aidl_twt_stats->avgTxPktSize = twt_stats.avg_tx_pkt_size; + aidl_twt_stats->avgRxPktSize = twt_stats.avg_rx_pkt_size; + aidl_twt_stats->avgEospDurationMicros = twt_stats.avg_eosp_dur_us; + aidl_twt_stats->eospCount = twt_stats.eosp_count; + + return true; +} + } // namespace aidl_struct_util } // namespace wifi } // namespace hardware diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h index 1942b5f484..708936354a 100644 --- a/wifi/aidl/default/aidl_struct_util.h +++ b/wifi/aidl/default/aidl_struct_util.h @@ -218,6 +218,18 @@ bool convertCachedScanReportToAidl(const legacy_hal::WifiCachedScanReport& repor bool convertCachedScanResultToAidl(const legacy_hal::wifi_cached_scan_result& legacy_scan_result, uint64_t ts_us, CachedScanResult* aidl_scan_result); WifiRatePreamble convertScanResultFlagsToPreambleType(int flags); +bool convertTwtCapabilitiesToAidl(const legacy_hal::wifi_twt_capabilities legacy_twt_capabs, + TwtCapabilities* aidl_twt_capabs); +bool convertAidlTwtRequestToLegacy(const TwtRequest aidl_twt_request, + legacy_hal::wifi_twt_request* legacy_twt_request); +IWifiStaIfaceEventCallback::TwtErrorCode convertLegacyHalTwtErrorCodeToAidl( + legacy_hal::wifi_twt_error_code legacy_error_code); +IWifiStaIfaceEventCallback::TwtTeardownReasonCode convertLegacyHalTwtReasonCodeToAidl( + legacy_hal::wifi_twt_teardown_reason_code legacy_reason_code); +bool convertLegacyHalTwtSessionToAidl(legacy_hal::wifi_twt_session twt_session, + TwtSession* aidl_twt_session); +bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats twt_stats, + TwtSessionStats* aidl_twt_stats); } // namespace aidl_struct_util } // namespace wifi } // namespace hardware diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp index 2e80183436..55d6f59314 100644 --- a/wifi/aidl/default/wifi_legacy_hal.cpp +++ b/wifi/aidl/default/wifi_legacy_hal.cpp @@ -457,6 +457,76 @@ void onSyncCachedScanResults(wifi_cached_scan_report* cache_report) { } } +// Callback to be invoked for TWT failure +std::function + on_twt_failure_internal_callback; +void onAsyncTwtError(wifi_request_id id, wifi_twt_error_code error_code) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_failure_internal_callback) { + on_twt_failure_internal_callback(id, error_code); + } +} + +// Callback to be invoked for TWT session creation +std::function + on_twt_session_create_internal_callback; +void onAsyncTwtSessionCreate(wifi_request_id id, wifi_twt_session twt_session) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_create_internal_callback) { + on_twt_session_create_internal_callback(id, twt_session); + } +} + +// Callback to be invoked for TWT session update +std::function + on_twt_session_update_internal_callback; +void onAsyncTwtSessionUpdate(wifi_request_id id, wifi_twt_session twt_session) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_update_internal_callback) { + on_twt_session_update_internal_callback(id, twt_session); + } +} + +// Callback to be invoked for TWT session teardown +std::function + on_twt_session_teardown_internal_callback; +void onAsyncTwtSessionTeardown(wifi_request_id id, int twt_session_id, + wifi_twt_teardown_reason_code reason_code) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_teardown_internal_callback) { + on_twt_session_teardown_internal_callback(id, twt_session_id, reason_code); + } +} + +// Callback to be invoked for TWT session get stats +std::function + on_twt_session_stats_internal_callback; +void onAsyncTwtSessionStats(wifi_request_id id, int twt_session_id, wifi_twt_session_stats stats) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_stats_internal_callback) { + on_twt_session_stats_internal_callback(id, twt_session_id, stats); + } +} + +// Callback to be invoked for TWT session suspend +std::function on_twt_session_suspend_internal_callback; +void onAsyncTwtSessionSuspend(wifi_request_id id, int twt_session_id) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_suspend_internal_callback) { + on_twt_session_suspend_internal_callback(id, twt_session_id); + } +} + +// Callback to be invoked for TWT session resume +std::function on_twt_session_resume_internal_callback; +void onAsyncTwtSessionResume(wifi_request_id id, int twt_session_id) { + const auto lock = aidl_sync_util::acquireGlobalLock(); + if (on_twt_session_resume_internal_callback) { + on_twt_session_resume_internal_callback(id, twt_session_id); + } +} + // End of the free-standing "C" style callbacks. WifiLegacyHal::WifiLegacyHal(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool, @@ -1789,6 +1859,103 @@ wifi_error WifiLegacyHal::setVoipMode(const std::string& iface_name, wifi_voip_m return global_func_table_.wifi_set_voip_mode(getIfaceHandle(iface_name), mode); } +std::pair WifiLegacyHal::twtGetCapabilities( + const std::string& ifaceName) { + wifi_twt_capabilities capabs = {}; + wifi_error status = + global_func_table_.wifi_twt_get_capabilities(getIfaceHandle(ifaceName), &capabs); + return {capabs, status}; +} + +wifi_error WifiLegacyHal::twtSessionSetup( + const std::string& ifaceName, uint32_t cmdId, const wifi_twt_request& request, + const on_twt_failure& on_twt_failure_user_callback, + const on_twt_session_create& on_twt_session_create_user_callback, + const on_twt_session_update& on_twt_session_update_user_callback, + const on_twt_session_teardown& on_twt_session_teardown_user_callback, + const on_twt_session_stats& on_twt_session_stats_user_callback, + const on_twt_session_suspend& on_twt_session_suspend_user_callback, + const on_twt_session_resume& on_twt_session_resume_user_callback) { + if (on_twt_failure_internal_callback || on_twt_session_create_internal_callback || + on_twt_session_update_internal_callback || on_twt_session_teardown_internal_callback || + on_twt_session_stats_internal_callback) { + return WIFI_ERROR_NOT_AVAILABLE; + } + + on_twt_failure_internal_callback = [on_twt_failure_user_callback]( + wifi_request_id id, wifi_twt_error_code error_code) { + on_twt_failure_user_callback(id, error_code); + }; + + on_twt_session_create_internal_callback = [on_twt_session_create_user_callback]( + wifi_request_id id, + wifi_twt_session twt_session) { + on_twt_session_create_user_callback(id, twt_session); + }; + + on_twt_session_update_internal_callback = [on_twt_session_update_user_callback]( + wifi_request_id id, + wifi_twt_session twt_session) { + on_twt_session_update_user_callback(id, twt_session); + }; + + on_twt_session_teardown_internal_callback = [on_twt_session_teardown_user_callback]( + wifi_request_id id, int session_id, + wifi_twt_teardown_reason_code reason_code) { + on_twt_session_teardown_user_callback(id, session_id, reason_code); + }; + + on_twt_session_stats_internal_callback = [on_twt_session_stats_user_callback]( + wifi_request_id id, int session_id, + wifi_twt_session_stats stats) { + on_twt_session_stats_user_callback(id, session_id, stats); + }; + + on_twt_session_suspend_internal_callback = [on_twt_session_suspend_user_callback]( + wifi_request_id id, int session_id) { + on_twt_session_suspend_user_callback(id, session_id); + }; + + on_twt_session_resume_internal_callback = [on_twt_session_resume_user_callback]( + wifi_request_id id, int session_id) { + on_twt_session_resume_user_callback(id, session_id); + }; + + return global_func_table_.wifi_twt_session_setup( + cmdId, getIfaceHandle(ifaceName), request, + {onAsyncTwtError, onAsyncTwtSessionCreate, onAsyncTwtSessionUpdate, + onAsyncTwtSessionTeardown, onAsyncTwtSessionStats, onAsyncTwtSessionSuspend, + onAsyncTwtSessionResume}); +} + +wifi_error WifiLegacyHal::twtSessionUpdate(const std::string& ifaceName, uint32_t cmdId, + uint32_t sessionId, const wifi_twt_request& request) { + return global_func_table_.wifi_twt_session_update(cmdId, getIfaceHandle(ifaceName), sessionId, + request); +} + +wifi_error WifiLegacyHal::twtSessionSuspend(const std::string& ifaceName, uint32_t cmdId, + uint32_t sessionId) { + return global_func_table_.wifi_twt_session_suspend(cmdId, getIfaceHandle(ifaceName), sessionId); +} + +wifi_error WifiLegacyHal::twtSessionResume(const std::string& ifaceName, uint32_t cmdId, + uint32_t sessionId) { + return global_func_table_.wifi_twt_session_resume(cmdId, getIfaceHandle(ifaceName), sessionId); +} + +wifi_error WifiLegacyHal::twtSessionTeardown(const std::string& ifaceName, uint32_t cmdId, + uint32_t sessionId) { + return global_func_table_.wifi_twt_session_teardown(cmdId, getIfaceHandle(ifaceName), + sessionId); +} + +wifi_error WifiLegacyHal::twtSessionGetStats(const std::string& ifaceName, uint32_t cmdId, + uint32_t sessionId) { + return global_func_table_.wifi_twt_session_get_stats(cmdId, getIfaceHandle(ifaceName), + sessionId); +} + wifi_error WifiLegacyHal::twtRegisterHandler(const std::string& iface_name, const TwtCallbackHandlers& user_callbacks) { on_twt_event_setup_response_callback = user_callbacks.on_setup_response; diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h index 17509df3ec..121d1b5ed8 100644 --- a/wifi/aidl/default/wifi_legacy_hal.h +++ b/wifi/aidl/default/wifi_legacy_hal.h @@ -376,6 +376,13 @@ using ::wifi_scan_cmd_params; using ::WIFI_SCAN_FLAG_INTERRUPTED; using ::wifi_scan_result; using ::WIFI_SUCCESS; +using ::wifi_twt_capabilities; +using ::wifi_twt_error_code; +using ::wifi_twt_events; +using ::wifi_twt_request; +using ::wifi_twt_session; +using ::wifi_twt_session_stats; +using ::wifi_twt_teardown_reason_code; using ::wifi_tx_packet_fate; using ::wifi_tx_report; using ::wifi_usable_channel; @@ -555,6 +562,16 @@ struct CachedScanResultsCallbfackHandlers { std::function on_cached_scan_results; }; +using on_twt_failure = std::function; +using on_twt_session_create = std::function; +using on_twt_session_update = std::function; +using on_twt_session_teardown = std::function; +using on_twt_session_stats = + std::function; +using on_twt_session_suspend = std::function; +using on_twt_session_resume = std::function; + /** * Class that encapsulates all legacy HAL interactions. * This class manages the lifetime of the event loop thread used by legacy HAL. @@ -761,19 +778,39 @@ class WifiLegacyHal { wifi_error setVoipMode(const std::string& iface_name, wifi_voip_mode mode); + // TWT functions + std::pair twtGetCapabilities(const std::string& ifaceName); + wifi_error twtSessionSetup(const std::string& ifaceName, uint32_t cmdId, + const wifi_twt_request& request, + const on_twt_failure& on_twt_failure_user_callback, + const on_twt_session_create& on_twt_session_create_user_callback, + const on_twt_session_update& on_twt_session_update_user_callback, + const on_twt_session_teardown& on_twt_session_teardown_user_callback, + const on_twt_session_stats& on_twt_session_stats_user_callback, + const on_twt_session_suspend& on_twt_session_suspend_user_callback, + const on_twt_session_resume& on_twt_session_resume_user_callback); + wifi_error twtSessionUpdate(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId, + const wifi_twt_request& request); + wifi_error twtSessionSuspend(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId); + wifi_error twtSessionResume(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId); + wifi_error twtSessionTeardown(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId); + wifi_error twtSessionGetStats(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId); + + // Note: Following TWT functions are deprecated + // Deprecated wifi_error twtRegisterHandler(const std::string& iface_name, const TwtCallbackHandlers& handler); - + // Deprecated by twtGetCapabilities std::pair twtGetCapability(const std::string& iface_name); - + // Deprecated by twtSessionSetup wifi_error twtSetupRequest(const std::string& iface_name, const TwtSetupRequest& msg); - + // Deprecated by twtSessionTeardown wifi_error twtTearDownRequest(const std::string& iface_name, const TwtTeardownRequest& msg); - + // Deprecated by twtSessionSuspend and twtSessionResume wifi_error twtInfoFrameRequest(const std::string& iface_name, const TwtInfoFrameRequest& msg); - + // Deprecated by twtSessionGetStats std::pair twtGetStats(const std::string& iface_name, uint8_t configId); - + // Deprecated wifi_error twtClearStats(const std::string& iface_name, uint8_t configId); wifi_error setScanMode(const std::string& iface_name, bool enable); diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp index 3d59c658a1..3e4afd0427 100644 --- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp +++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp @@ -181,6 +181,13 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) { populateStubFor(&hal_fn->wifi_get_supported_iface_concurrency_matrix); populateStubFor(&hal_fn->wifi_get_rtt_capabilities_v3); populateStubFor(&hal_fn->wifi_rtt_range_request_v3); + populateStubFor(&hal_fn->wifi_twt_get_capabilities); + populateStubFor(&hal_fn->wifi_twt_session_setup); + populateStubFor(&hal_fn->wifi_twt_session_update); + populateStubFor(&hal_fn->wifi_twt_session_suspend); + populateStubFor(&hal_fn->wifi_twt_session_resume); + populateStubFor(&hal_fn->wifi_twt_session_teardown); + populateStubFor(&hal_fn->wifi_twt_session_get_stats); return true; } diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp index 0ae428f179..f0509dc19e 100644 --- a/wifi/aidl/default/wifi_sta_iface.cpp +++ b/wifi/aidl/default/wifi_sta_iface.cpp @@ -224,6 +224,44 @@ ndk::ScopedAStatus WifiStaIface::getCachedScanData(CachedScanData* _aidl_return) &WifiStaIface::getCachedScanDataInternal, _aidl_return); } +ndk::ScopedAStatus WifiStaIface::twtGetCapabilities(TwtCapabilities* _aidl_return) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtGetCapabilitiesInternal, _aidl_return); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionSetup(int32_t in_cmdId, + const TwtRequest& in_twtRequest) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionSetupInternal, in_cmdId, in_twtRequest); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionUpdate(int32_t in_cmdId, int32_t in_sessionId, + const TwtRequest& in_twtRequest) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionUpdateInternal, in_cmdId, in_sessionId, + in_twtRequest); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionSuspend(int32_t in_cmdId, int32_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionSuspendInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionResume(int32_t in_cmdId, int32_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionResumeInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionTeardown(int32_t in_cmdId, int32_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionTeardownInternal, in_cmdId, in_sessionId); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionGetStats(int32_t in_cmdId, int32_t in_sessionId) { + return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID, + &WifiStaIface::twtSessionGetStatsInternal, in_cmdId, in_sessionId); +} + std::pair WifiStaIface::getNameInternal() { return {ifname_, ndk::ScopedAStatus::ok()}; } @@ -560,6 +598,194 @@ std::pair WifiStaIface::getCachedScanDataInt return {aidl_scan_data, ndk::ScopedAStatus::ok()}; } +std::pair WifiStaIface::twtGetCapabilitiesInternal() { + legacy_hal::wifi_twt_capabilities legacyHaltwtCapabilities; + legacy_hal::wifi_error legacy_status; + std::tie(legacyHaltwtCapabilities, legacy_status) = + legacy_hal_.lock()->twtGetCapabilities(ifname_); + if (legacy_status != legacy_hal::WIFI_SUCCESS) { + return {TwtCapabilities{}, createWifiStatusFromLegacyError(legacy_status)}; + } + TwtCapabilities aidlTwtCapabilities; + if (!aidl_struct_util::convertTwtCapabilitiesToAidl(legacyHaltwtCapabilities, + &aidlTwtCapabilities)) { + return {TwtCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)}; + } + return {aidlTwtCapabilities, ndk::ScopedAStatus::ok()}; +} + +ndk::ScopedAStatus WifiStaIface::twtSessionSetupInternal(int32_t cmdId, + const TwtRequest& aidlTwtRequest) { + legacy_hal::wifi_twt_request legacyHalTwtRequest; + if (!aidl_struct_util::convertAidlTwtRequestToLegacy(aidlTwtRequest, &legacyHalTwtRequest)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + std::weak_ptr weak_ptr_this = weak_ptr_this_; + + // onTwtFailure callback + const auto& on_twt_failure = [weak_ptr_this](legacy_hal::wifi_request_id id, + legacy_hal::wifi_twt_error_code error_code) { + const auto shared_ptr_this = weak_ptr_this.lock(); + IWifiStaIfaceEventCallback::TwtErrorCode aidl_error_code = + aidl_struct_util::convertLegacyHalTwtErrorCodeToAidl(error_code); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtFailure(id, aidl_error_code).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtFailure callback"; + } + } + }; + // onTwtSessionCreate callback + const auto& on_twt_session_create = [weak_ptr_this](legacy_hal::wifi_request_id id, + legacy_hal::wifi_twt_session twt_session) { + const auto shared_ptr_this = weak_ptr_this.lock(); + TwtSession aidl_twt_session; + if (!aidl_struct_util::convertLegacyHalTwtSessionToAidl(twt_session, &aidl_twt_session)) { + LOG(ERROR) << "convertLegacyHalTwtSessionToAidl failed"; + return; + } + + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionCreate(id, aidl_twt_session).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionCreate callback"; + } + } + }; + // onTwtSessionUpdate callback + const auto& on_twt_session_update = [weak_ptr_this](legacy_hal::wifi_request_id id, + legacy_hal::wifi_twt_session twt_session) { + const auto shared_ptr_this = weak_ptr_this.lock(); + TwtSession aidl_twt_session; + if (!aidl_struct_util::convertLegacyHalTwtSessionToAidl(twt_session, &aidl_twt_session)) { + LOG(ERROR) << "convertLegacyHalTwtSessionToAidl failed"; + return; + } + + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionUpdate(id, aidl_twt_session).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionUpdate callback"; + } + } + }; + // onTwtSessionTeardown callback + const auto& on_twt_session_teardown = + [weak_ptr_this](legacy_hal::wifi_request_id id, int session_id, + legacy_hal::wifi_twt_teardown_reason_code reason_code) { + const auto shared_ptr_this = weak_ptr_this.lock(); + IWifiStaIfaceEventCallback::TwtTeardownReasonCode aidl_reason_code = + aidl_struct_util::convertLegacyHalTwtReasonCodeToAidl(reason_code); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionTeardown(id, session_id, aidl_reason_code).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionTeardown callback"; + } + } + }; + // onTwtSessionStats callback + const auto& on_twt_session_stats = [weak_ptr_this](legacy_hal::wifi_request_id id, + int session_id, + legacy_hal::wifi_twt_session_stats stats) { + const auto shared_ptr_this = weak_ptr_this.lock(); + TwtSessionStats aidl_session_stats; + if (!aidl_struct_util::convertLegacyHalTwtSessionStatsToAidl(stats, &aidl_session_stats)) { + LOG(ERROR) << "convertLegacyHalTwtSessionStatsToAidl failed"; + return; + } + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionStats(id, session_id, aidl_session_stats).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionStats callback"; + } + } + }; + // onTwtSessionSuspend callback + const auto& on_twt_session_suspend = [weak_ptr_this](legacy_hal::wifi_request_id id, + int session_id) { + const auto shared_ptr_this = weak_ptr_this.lock(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionSuspend(id, session_id).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionSuspend callback"; + } + } + }; + // onTwtSessionResume callback + const auto& on_twt_session_resume = [weak_ptr_this](legacy_hal::wifi_request_id id, + int session_id) { + const auto shared_ptr_this = weak_ptr_this.lock(); + if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) { + LOG(ERROR) << "Callback invoked on an invalid object"; + return; + } + for (const auto& callback : shared_ptr_this->getEventCallbacks()) { + if (!callback->onTwtSessionResume(id, session_id).isOk()) { + LOG(ERROR) << "Failed to invoke onTwtSessionResume callback"; + } + } + }; + + legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->twtSessionSetup( + ifname_, cmdId, legacyHalTwtRequest, on_twt_failure, on_twt_session_create, + on_twt_session_update, on_twt_session_teardown, on_twt_session_stats, + on_twt_session_suspend, on_twt_session_resume); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionUpdateInternal(int32_t cmdId, int32_t sessionId, + const TwtRequest& aidlTwtRequest) { + legacy_hal::wifi_twt_request legacyHalTwtRequest; + if (!aidl_struct_util::convertAidlTwtRequestToLegacy(aidlTwtRequest, &legacyHalTwtRequest)) { + return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS); + } + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->twtSessionUpdate(ifname_, cmdId, sessionId, legacyHalTwtRequest); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionSuspendInternal(int32_t cmdId, int32_t sessionId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->twtSessionSuspend(ifname_, cmdId, sessionId); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionResumeInternal(int32_t cmdId, int32_t sessionId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->twtSessionResume(ifname_, cmdId, sessionId); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionTeardownInternal(int32_t cmdId, int32_t sessionId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->twtSessionTeardown(ifname_, cmdId, sessionId); + return createWifiStatusFromLegacyError(legacy_status); +} + +ndk::ScopedAStatus WifiStaIface::twtSessionGetStatsInternal(int32_t cmdId, int32_t sessionId) { + legacy_hal::wifi_error legacy_status = + legacy_hal_.lock()->twtSessionGetStats(ifname_, cmdId, sessionId); + return createWifiStatusFromLegacyError(legacy_status); +} + } // namespace wifi } // namespace hardware } // namespace android diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h index fe05c21483..eb8f745475 100644 --- a/wifi/aidl/default/wifi_sta_iface.h +++ b/wifi/aidl/default/wifi_sta_iface.h @@ -91,6 +91,14 @@ class WifiStaIface : public BnWifiStaIface { ndk::ScopedAStatus setScanMode(bool in_enable) override; ndk::ScopedAStatus setDtimMultiplier(int32_t in_multiplier) override; ndk::ScopedAStatus getCachedScanData(CachedScanData* _aidl_return) override; + ndk::ScopedAStatus twtGetCapabilities(TwtCapabilities* _aidl_return) override; + ndk::ScopedAStatus twtSessionSetup(int in_cmdId, const TwtRequest& in_twtRequest) override; + ndk::ScopedAStatus twtSessionUpdate(int in_cmdId, int32_t in_sessionId, + const TwtRequest& in_twtRequest) override; + ndk::ScopedAStatus twtSessionSuspend(int in_cmdId, int32_t in_sessionId) override; + ndk::ScopedAStatus twtSessionResume(int in_cmdId, int32_t in_sessionId) override; + ndk::ScopedAStatus twtSessionTeardown(int in_cmdId, int32_t in_sessionId) override; + ndk::ScopedAStatus twtSessionGetStats(int in_cmdId, int32_t in_sessionId) override; private: // Corresponding worker functions for the AIDL methods. @@ -132,6 +140,14 @@ class WifiStaIface : public BnWifiStaIface { ndk::ScopedAStatus setScanModeInternal(bool enable); ndk::ScopedAStatus setDtimMultiplierInternal(const int multiplier); std::pair getCachedScanDataInternal(); + std::pair twtGetCapabilitiesInternal(); + ndk::ScopedAStatus twtSessionSetupInternal(int cmdId, const TwtRequest& twtRequest); + ndk::ScopedAStatus twtSessionUpdateInternal(int cmdId, int32_t sessionId, + const TwtRequest& twtRequest); + ndk::ScopedAStatus twtSessionSuspendInternal(int cmdId, int32_t sessionId); + ndk::ScopedAStatus twtSessionResumeInternal(int cmdId, int32_t sessionId); + ndk::ScopedAStatus twtSessionTeardownInternal(int cmdId, int32_t sessionId); + ndk::ScopedAStatus twtSessionGetStatsInternal(int cmdId, int32_t sessionId); void setWeakPtr(std::weak_ptr ptr); -- GitLab From c535f588adf88e920a68b137a6aeebd3b8ec2e09 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Fri, 1 Dec 2023 20:59:11 +0000 Subject: [PATCH 351/376] Add HAL API for configuring MSCS in supplicant. Bug: 300870302 Test: m Change-Id: Ib316ab2511293c674c21ab1838391febd3b58318 --- .../wifi/supplicant/ISupplicantStaIface.aidl | 2 + .../hardware/wifi/supplicant/MscsParams.aidl | 52 +++++++++++++++ .../wifi/supplicant/ISupplicantStaIface.aidl | 25 +++++++ .../hardware/wifi/supplicant/MscsParams.aidl | 66 +++++++++++++++++++ 4 files changed, 145 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 1f3aa482c4..917668e9ab 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -101,5 +101,7 @@ interface ISupplicantStaIface { android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults(); android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData); android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds); + void configureMscs(in android.hardware.wifi.supplicant.MscsParams params); + void disableMscs(); const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl new file mode 100644 index 0000000000..aeed4080de --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.wifi.supplicant; +@VintfStability +parcelable MscsParams { + byte upBitmap; + byte upLimit; + int streamTimeoutUs; + byte frameClassifierMask; + @Backing(type="int") @VintfStability + enum FrameClassifierFields { + IP_VERSION = (1 << 0) /* 1 */, + SRC_IP_ADDR = (1 << 1) /* 2 */, + DST_IP_ADDR = (1 << 2) /* 4 */, + SRC_PORT = (1 << 3) /* 8 */, + DST_PORT = (1 << 4) /* 16 */, + DSCP = (1 << 5) /* 32 */, + PROTOCOL_NEXT_HDR = (1 << 6) /* 64 */, + FLOW_LABEL = (1 << 7) /* 128 */, + } +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index d7b4e62bc4..fb1673efc3 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -29,6 +29,7 @@ import android.hardware.wifi.supplicant.ISupplicantStaNetwork; import android.hardware.wifi.supplicant.IfaceType; import android.hardware.wifi.supplicant.KeyMgmtMask; import android.hardware.wifi.supplicant.MloLinksInfo; +import android.hardware.wifi.supplicant.MscsParams; import android.hardware.wifi.supplicant.QosPolicyScsData; import android.hardware.wifi.supplicant.QosPolicyScsRequestStatus; import android.hardware.wifi.supplicant.QosPolicyStatus; @@ -852,4 +853,28 @@ interface ISupplicantStaIface { * being processed. Supplicant will only handle one request at a time. */ QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds); + + /** + * Enable Mirrored Stream Classification Service (MSCS) and configure using + * the provided configuration values. + * + * If MSCS has already been enabled/configured, this will overwrite the + * existing configuration. + * + * @param params |MscsParams| object containing the configuration. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID| if the configuration is invalid. + * |SupplicantStatusCode.FAILURE_UNKNOWN| if the configuration could not be set. + */ + void configureMscs(in MscsParams params); + + /** + * Disable Mirrored Stream Classification Service (MSCS). + * + * If MSCS is enabled/configured, this will send a remove request to the AP. + * + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_UNKNOWN| + */ + void disableMscs(); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl new file mode 100644 index 0000000000..b1731ac429 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.wifi.supplicant; + +/** + * Mirrored Stream Classification Service (MSCS) parameters. + * Refer to section 3.1 of the Wi-Fi QoS Management Specification v3.0. + */ +@VintfStability +parcelable MscsParams { + /** + * Bitmap indicating which User Priorities should be classified using MSCS. + * The least significant bit corresponds to UP 0, and the most significant + * bit to UP 7. Setting a bit to 1 indicates that UP should be used. + */ + byte upBitmap; + + /** + * Maximum user priority that can be assigned using the MSCS service. + * Value must be between 0 and 7 (inclusive). + */ + byte upLimit; + + /** + * Stream timeout in μs. Must be equivalent to 60 sec or less. + */ + int streamTimeoutUs; + + /** + * Bitmask of available fields for a Type 4 TCLAS frame classifier. + * See Figures 9-309 and 9-310 in the IEEE Std 802.11-2020 Standard. + */ + @VintfStability + @Backing(type="int") + enum FrameClassifierFields { + IP_VERSION = 1 << 0, + SRC_IP_ADDR = 1 << 1, + DST_IP_ADDR = 1 << 2, + SRC_PORT = 1 << 3, + DST_PORT = 1 << 4, + DSCP = 1 << 5, + /** Indicates Protocol if using IPv4, or Next Header if using IPv6. */ + PROTOCOL_NEXT_HDR = 1 << 6, + /** Only applicable if using IPv6. */ + FLOW_LABEL = 1 << 7, + } + + /** + * Bitmask of |FrameClassifierFields| for a Type 4 TCLAS frame classifier. + */ + byte frameClassifierMask; +} -- GitLab From 420b31dddf7dacdb67d7435f8d6e7b55a802ad20 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 7 Nov 2023 16:15:35 +0000 Subject: [PATCH 352/376] Added SEAT_AIRBAGS_DEPLOYED to HAL Bug: 309620475 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I90db503d61c70cb2ab2581d3327a09b3225ac62c --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../java/EnumForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 44 +++++++++++++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/VehicleAirbagLocation.aidl | 43 +++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/VehicleAirbagLocation.aidl | 55 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 22 ++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 13 files changed, 180 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index ef38432f5a..668dde07f0 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -169,6 +169,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 22f3e647db..1aca16a659 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -169,6 +169,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index acadf7d28c..85b14744c6 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -161,6 +161,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index dfdb85b723..bd033a0574 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -161,6 +161,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index 3c2cfa2eb2..ea8f42fea8 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -53,6 +53,7 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.HW_CUSTOM_INPUT, List.of(CustomInputType.class)), Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_STATE, List.of(VehicleLightState.class)), Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)), + Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, List.of(VehicleAirbagLocation.class)), Map.entry(VehicleProperty.SEAT_OCCUPANCY, List.of(VehicleSeatOccupancyState.class)), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, List.of(WindshieldWipersState.class)), Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, List.of(WindshieldWipersSwitch.class)), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 26bda22b66..95ef58697e 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -61,6 +61,7 @@ using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; +using ::aidl::android::hardware::automotive::vehicle::VehicleAirbagLocation; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq; using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig; @@ -247,6 +248,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["VehicleAutonomousState"] = std::make_unique>(); + mConstantParsersByType["VehicleAirbagLocation"] = + std::make_unique>(); mConstantParsersByType["EmergencyLaneKeepAssistState"] = std::make_unique>(); mConstantParsersByType["CruiseControlType"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 88541d8f7b..744d1727c4 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1327,6 +1327,50 @@ } ] }, + { + "property": "VehicleProperty::SEAT_AIRBAGS_DEPLOYED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT", + "supportedEnumValues": [ + "VehicleAirbagLocation::FRONT", + "VehicleAirbagLocation::KNEE", + "VehicleAirbagLocation::LEFT_SIDE", + "VehicleAirbagLocation::RIGHT_SIDE", + "VehicleAirbagLocation::CURTAIN" + ] + }, + { + "areaId": "Constants::SEAT_1_RIGHT", + "supportedEnumValues": [ + "VehicleAirbagLocation::FRONT", + "VehicleAirbagLocation::KNEE", + "VehicleAirbagLocation::LEFT_SIDE", + "VehicleAirbagLocation::RIGHT_SIDE", + "VehicleAirbagLocation::CURTAIN" + ] + }, + { + "areaId": "Constants::SEAT_2_LEFT", + "supportedEnumValues": [ + "VehicleAirbagLocation::FRONT", + "VehicleAirbagLocation::CURTAIN" + ] + }, + { + "areaId": "Constants::SEAT_2_RIGHT", + "supportedEnumValues": [ + "VehicleAirbagLocation::FRONT", + "VehicleAirbagLocation::CURTAIN" + ] + } + ] + }, { "property": "VehicleProperty::SEAT_OCCUPANCY", "defaultValue": { diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 42cd993267..53be82f341 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl new file mode 100644 index 0000000000..9b966d7f94 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum VehicleAirbagLocation { + OTHER = 0x01, + FRONT = 0x02, + KNEE = 0x04, + LEFT_SIDE = 0x08, + RIGHT_SIDE = 0x10, + CURTAIN = 0x20, +} 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 84df77472c..388f2d683d 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 @@ -167,6 +167,7 @@ enum VehicleProperty { SEAT_FOOTWELL_LIGHTS_SWITCH = (((0x0B9C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518812 */, SEAT_EASY_ACCESS_ENABLED = (((0x0B9D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421661 */, SEAT_AIRBAG_ENABLED = (((0x0B9E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421662 */, + SEAT_AIRBAGS_DEPLOYED = (((0x0BA5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518821 */, SEAT_CUSHION_SIDE_SUPPORT_POS = (((0x0B9F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518815 */, SEAT_CUSHION_SIDE_SUPPORT_MOVE = (((0x0BA0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518816 */, SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518817 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl new file mode 100644 index 0000000000..e4c43f7992 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the various airbag locations per seat. + */ +@VintfStability +@Backing(type="int") +enum VehicleAirbagLocation { + /** + * This state is used as an alternative to any VehicleAirbagLocation value that is not defined + * in the platform. Ideally, implementations of VehicleProperty::SEAT_AIRBAGS_DEPLOYED should + * not use this state. The framework can use this field to remain backwards compatible if + * VehicleAirbagLocation is extended to include additional states. + */ + OTHER = 0x01, + /** + * Front airbags. This enum is for the airbags that protect the seated person from the front, + * particularly the seated person's torso. + */ + FRONT = 0x02, + /** + * Knee airbags. This enum is for the airbags that protect the seated person's knees. + */ + KNEE = 0x04, + /** + * Left side airbags. This enum is for the side airbags that protect the left side of the seated + * person. + */ + LEFT_SIDE = 0x08, + /** + * Right side airbags. This enum is for the side airbags that protect the right side of the + * seated person. + */ + RIGHT_SIDE = 0x10, + /** + * Curtain airbags. This enum is for the airbags lined above the windows of the vehicle. + */ + CURTAIN = 0x20, +} 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 1827c8923f..7aa400ce05 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2675,6 +2675,28 @@ enum VehicleProperty { */ SEAT_AIRBAG_ENABLED = 0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, + /** + * Seat airbags deployed + * + * Bit flag property to relay information on which airbags have been deployed in the vehicle at + * each seat, vs which ones are currently still armed. If SEAT_AIRBAG_ENABLED is set to false at + * a particular areaId, this property should return status code UNAVAILABLE at that areaId. + * + * Enums apply to each seat, not the global vehicle. For example, VehicleAirbagsLocation#CURTAIN + * at the driver seat areaId represents whether the driver side curtain airbag has been + * deployed. Multiple bit flags can be set to indicate that multiple different airbags have been + * deployed for the seat. + * + * For each seat area ID, the VehicleAreaConfig#supportedEnumValues array must be defined unless + * all states of VehicleAirbagLocation are supported (including OTHER, which is not + * recommended). + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum VehicleAirbagLocation + */ + SEAT_AIRBAGS_DEPLOYED = + 0x0BA5 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, /** * Represents property for seat’s hipside (bottom cushion’s side) support position. * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index c216e76ca7..ddec65285c 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -945,6 +945,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationCurrentL VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagsDeployedConfig) { + verifyProperty(VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 7717aa80acf1a5611db00aff7b783a4b7fd6b54f Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 7 Nov 2023 21:05:46 +0000 Subject: [PATCH 353/376] Added SEAT_BELT_PRETENSIONER_DEPLOYED to HAL Bug: 309666683 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I79ca3e68c18fb961e83d1bd67f794256fe806f55 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../config/DefaultProperties.json | 25 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 18 +++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 54 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 668dde07f0..c581b53c64 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -175,6 +175,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ}, {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyAccess::READ}, {VehicleProperty::WINDOW_POS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::WINDOW_MOVE, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 1aca16a659..88e4dc3cb0 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -175,6 +175,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::WINDOW_POS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::WINDOW_MOVE, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 85b14744c6..6a83a317b9 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -167,6 +167,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index bd033a0574..4dd24c379b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -167,6 +167,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 744d1727c4..acfa53ad9a 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1371,6 +1371,31 @@ } ] }, + { + "property": "VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": "Constants::SEAT_1_LEFT" + }, + { + "areaId": "Constants::SEAT_1_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_LEFT" + }, + { + "areaId": "Constants::SEAT_2_RIGHT" + }, + { + "areaId": "Constants::SEAT_2_CENTER" + } + ] + }, { "property": "VehicleProperty::SEAT_OCCUPANCY", "defaultValue": { 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 388f2d683d..560c414364 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 @@ -173,6 +173,7 @@ enum VehicleProperty { SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518817 */, SEAT_LUMBAR_VERTICAL_MOVE = (((0x0BA2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518818 */, SEAT_WALK_IN_POS = (((0x0BA3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518819 */, + SEAT_BELT_PRETENSIONER_DEPLOYED = (((0x0BA6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421670 */, SEAT_OCCUPANCY = (((0x0BB0 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518832 */, WINDOW_POS = (((0x0BC0 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964416 */, WINDOW_MOVE = (((0x0BC1 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964417 */, 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 7aa400ce05..e8f5f372f2 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -2825,6 +2825,24 @@ enum VehicleProperty { */ SEAT_WALK_IN_POS = 0x0BA3 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32, + /** + * Seat belt pretensioner deployed. + * + * Property to relay information on whether the seat belt pretensioner has been deployed for a + * particular seat due to a collision. This is different from the regular seat belt tightening + * system that continuously adds tension to the seat belts so that they fit snugly around the + * person sitting in the seat, nor is it the seat belt retractor system that locks the seat belt + * in place during sudden brakes or when the user jerks the seat belt. + * + * If this property is dependant on the state of other properties, and those properties are + * currently in the state that doesn't support this property, this should return + * StatusCode#NOT_AVAILABLE + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + */ + SEAT_BELT_PRETENSIONER_DEPLOYED = + 0x0BA6 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN, /** * Seat Occupancy * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index ddec65285c..3649ccf151 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -951,6 +951,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagsDeployedConfig) { VehicleArea::SEAT, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatBeltPretensionerDeployedConfig) { + verifyProperty(VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From d816e0433c8c5803522396d111e413095db16904 Mon Sep 17 00:00:00 2001 From: shrikar Date: Wed, 8 Nov 2023 20:12:55 +0000 Subject: [PATCH 354/376] Added IMPACT_DETECTED to HAL Bug: 309826888 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I79c72bed8dcd96632cf9c7b6ff71c04198625467 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../java/EnumForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 21 +++++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../vehicle/ImpactSensorLocation.aidl | 44 ++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../vehicle/ImpactSensorLocation.aidl | 57 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 16 ++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 13 files changed, 154 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index c581b53c64..df8ebd6b9e 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -71,6 +71,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::TIRE_PRESSURE, VehiclePropertyAccess::READ}, {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess::READ}, {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ}, {VehicleProperty::GEAR_SELECTION, VehiclePropertyAccess::READ}, {VehicleProperty::CURRENT_GEAR, VehiclePropertyAccess::READ}, {VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 88e4dc3cb0..a464a3a661 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -71,6 +71,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::TIRE_PRESSURE, VehiclePropertyChangeMode::CONTINUOUS}, {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::IMPACT_DETECTED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::GEAR_SELECTION, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CURRENT_GEAR, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 6a83a317b9..cd366f237b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -63,6 +63,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.IMPACT_DETECTED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 4dd24c379b..ef52fb1eb8 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -63,6 +63,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyChangeMode.CONTINUOUS), Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.IMPACT_DETECTED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index ea8f42fea8..48428b69b7 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -37,6 +37,7 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.INFO_DRIVER_SEAT, List.of(VehicleAreaSeat.class)), Map.entry(VehicleProperty.INFO_MULTI_EV_PORT_LOCATIONS, List.of(PortLocationType.class)), Map.entry(VehicleProperty.ENGINE_OIL_LEVEL, List.of(VehicleOilLevel.class)), + Map.entry(VehicleProperty.IMPACT_DETECTED, List.of(ImpactSensorLocation.class)), Map.entry(VehicleProperty.GEAR_SELECTION, List.of(VehicleGear.class)), Map.entry(VehicleProperty.CURRENT_GEAR, List.of(VehicleGear.class)), Map.entry(VehicleProperty.TURN_SIGNAL_STATE, List.of(VehicleTurnSignal.class)), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 95ef58697e..3b1fd70253 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -55,6 +55,7 @@ using ::aidl::android::hardware::automotive::vehicle::FuelType; using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType; using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionDriverState; using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionWarning; +using ::aidl::android::hardware::automotive::vehicle::ImpactSensorLocation; using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand; using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; @@ -250,6 +251,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["VehicleAirbagLocation"] = std::make_unique>(); + mConstantParsersByType["ImpactSensorLocation"] = + std::make_unique>(); mConstantParsersByType["EmergencyLaneKeepAssistState"] = std::make_unique>(); mConstantParsersByType["CruiseControlType"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index acfa53ad9a..b96e363e05 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -2571,6 +2571,27 @@ ] } }, + { + "property": "VehicleProperty::IMPACT_DETECTED", + "defaultValue": { + "int32Values": [ + 0 + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ImpactSensorLocation::FRONT", + "ImpactSensorLocation::FRONT_LEFT_DOOR_SIDE", + "ImpactSensorLocation::FRONT_RIGHT_DOOR_SIDE", + "ImpactSensorLocation::REAR_LEFT_DOOR_SIDE", + "ImpactSensorLocation::REAR_RIGHT_DOOR_SIDE", + "ImpactSensorLocation::REAR" + ] + } + ] + }, { "property": "VehicleProperty::DOOR_LOCK", "areas": [ diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 53be82f341..7db5542a8b 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl new file mode 100644 index 0000000000..6b75d8cd51 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ImpactSensorLocation { + OTHER = 0x01, + FRONT = 0x02, + FRONT_LEFT_DOOR_SIDE = 0x04, + FRONT_RIGHT_DOOR_SIDE = 0x08, + REAR_LEFT_DOOR_SIDE = 0x10, + REAR_RIGHT_DOOR_SIDE = 0x20, + REAR = 0x40, +} 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 560c414364..348e294ed0 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 @@ -69,6 +69,7 @@ enum VehicleProperty { TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000) /* 392168201 */, CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000) /* 392168202 */, ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310624 */, + IMPACT_DETECTED = (((0x0330 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289407792 */, GEAR_SELECTION = (((0x0400 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408000 */, CURRENT_GEAR = (((0x0401 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408001 */, PARKING_BRAKE_ON = (((0x0402 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310850 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl new file mode 100644 index 0000000000..0fc1a50a83 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the various impact sensor locations on the car. + */ +@VintfStability +@Backing(type="int") +enum ImpactSensorLocation { + /** + * Other impact sensor location. Ideally this should never be used. + */ + OTHER = 0x01, + /** + * Frontal impact sensor. Used for the sensor that detects head-on impact. + */ + FRONT = 0x02, + /** + * Front-left door side impact sensor. Used for the sensor that detects collisions from the + * side, in particular on the front-left door. + */ + FRONT_LEFT_DOOR_SIDE = 0x04, + /** + * Front-right door side impact sensor. Used for the sensor that detects collisions from the + * side, in particular on the front-right door. + */ + FRONT_RIGHT_DOOR_SIDE = 0x08, + /** + * Rear-left door side impact sensor. Used for the sensor that detects collisions from the + * side, in particular on the rear-left door. + */ + REAR_LEFT_DOOR_SIDE = 0x10, + /** + * Rear-right door side impact sensor. Used for the sensor that detects collisions from the + * side, in particular on the rear-right door. + */ + REAR_RIGHT_DOOR_SIDE = 0x20, + /** + * Rear impact sensor. Used for the sensor that detects collisions from the rear. + */ + REAR = 0x40, +} 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 e8f5f372f2..33227ccc7a 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -483,6 +483,22 @@ enum VehicleProperty { */ ENGINE_IDLE_AUTO_STOP_ENABLED = 0x0320 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Impact detected. + * + * Bit flag property to relay information on whether an impact has occurred on a particular side + * of the vehicle as described through the ImpactSensorLocation enum. As a bit flag property, + * this property can be set to multiple ORed together values of the enum when necessary. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all bit flags of ImpactSensorLocation are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum ImpactSensorLocation + */ + IMPACT_DETECTED = + 0x0330 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, /** * Currently selected gear * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 3649ccf151..79766d84d1 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -957,6 +957,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatBeltPretensionerDeployedConf VehicleArea::SEAT, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyImpactDetectedConfig) { + verifyProperty(VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From a492e7d598fe6c3d94b2581df487570c447d3ad2 Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 9 Nov 2023 00:27:54 +0000 Subject: [PATCH 355/376] Added EV_BATTERY_AVERAGE_TEMPERATURE to HAL Bug: 309861157 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I3ddf1d71969b233516cf6e617a4f9328e256ea7f --- .../generated_lib/cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../default_config/config/DefaultProperties.json | 10 ++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 13 +++++++++++++ .../vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 34 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index df8ebd6b9e..59f7cc02ac 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -68,6 +68,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess::READ}, {VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess::READ}, {VehicleProperty::RANGE_REMAINING, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ}, {VehicleProperty::TIRE_PRESSURE, VehiclePropertyAccess::READ}, {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess::READ}, {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess::READ_WRITE}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index a464a3a661..cb2d42e49b 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -68,6 +68,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode::CONTINUOUS}, {VehicleProperty::RANGE_REMAINING, VehiclePropertyChangeMode::CONTINUOUS}, + {VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyChangeMode::CONTINUOUS}, {VehicleProperty::TIRE_PRESSURE, VehiclePropertyChangeMode::CONTINUOUS}, {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index cd366f237b..efc83d64b1 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -60,6 +60,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess.READ_WRITE), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index ef52fb1eb8..37f6fbfa33 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -60,6 +60,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode.CONTINUOUS), Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyChangeMode.CONTINUOUS), + Map.entry(VehicleProperty.EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyChangeMode.CONTINUOUS), Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyChangeMode.CONTINUOUS), Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index b96e363e05..283433122f 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -1628,6 +1628,16 @@ "maxSampleRate": 2.0, "minSampleRate": 1.0 }, + { + "property": "VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE", + "defaultValue": { + "floatValues": [ + 25.0 + ] + }, + "maxSampleRate": 2.0, + "minSampleRate": 1.0 + }, { "property": "VehicleProperty::TIRE_PRESSURE", "defaultValue": { 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 348e294ed0..e48fae97b9 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 @@ -66,6 +66,7 @@ enum VehicleProperty { EV_CHARGE_PORT_CONNECTED = (((0x030B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310603 */, EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = (((0x030C + 0x10000000) + 0x01000000) + 0x00600000) /* 291504908 */, RANGE_REMAINING = (((0x0308 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504904 */, + EV_BATTERY_AVERAGE_TEMPERATURE = (((0x030E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291504910 */, TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000) /* 392168201 */, CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000) /* 392168202 */, ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310624 */, 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 33227ccc7a..7508568486 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -426,6 +426,19 @@ enum VehicleProperty { */ RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000 + 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT + /** + * EV battery average temperature + * + * Exposes the temperature of the battery in an EV. If multiple batteries exist in the EV, or + * multiple temperature sensors exist, this property should be set to the mean or a meaningful + * weighted average that best represents the overall temperature of the battery system. + * + * @change_mode VehiclePropertyChangeMode.CONTINUOUS + * @access VehiclePropertyAccess.READ + * @unit VehicleUnit:CELSIUS + */ + EV_BATTERY_AVERAGE_TEMPERATURE = + 0x030E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT, /** * Tire pressure * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 79766d84d1..2c36f792f8 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -963,6 +963,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyImpactDetectedConfig) { VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBatteryAverageTemperatureConfig) { + verifyProperty(VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 45df34b6151d35dd94c32401484c400c34bc2598 Mon Sep 17 00:00:00 2001 From: shrikar Date: Fri, 10 Nov 2023 21:14:17 +0000 Subject: [PATCH 356/376] Added LOW_SPEED_COLLISION_WARNING_ENABLED to HAL Bug: 310252857 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: Ie2072d9cc0c8af83caf2f6e5590d5d1bd6c4e4aa --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 ++- .../java/ChangeModeForVehicleProperty.java | 3 ++- .../config/DefaultProperties.json | 8 ++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 25 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 46 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 59f7cc02ac..9865bfff70 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -286,6 +286,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ}, + {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index cb2d42e49b..8858bc3c56 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -286,6 +286,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index efc83d64b1..d22c433ff2 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -277,7 +277,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 37f6fbfa33..35630a848a 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -277,7 +277,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 283433122f..ad39c98509 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4091,6 +4091,14 @@ ] } ] + }, + { + "property": "VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } } ] } 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 e48fae97b9..0435d2df0b 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 @@ -284,4 +284,5 @@ enum VehicleProperty { DRIVER_DISTRACTION_STATE = (((0x101E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411102 */, DRIVER_DISTRACTION_WARNING_ENABLED = (((0x101F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313951 */, DRIVER_DISTRACTION_WARNING = (((0x1020 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411104 */, + LOW_SPEED_COLLISION_WARNING_ENABLED = (((0x1021 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313953 */, } 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 7508568486..4fa3829e58 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5358,6 +5358,31 @@ enum VehicleProperty { DRIVER_DISTRACTION_WARNING = 0x1020 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Enable or disable Low Speed Collision Warning. + * + * Set true to enable low speed collision warning and false to disable low speed collision + * warning. When low speed collision warning is enabled, the ADAS system in the vehicle should + * warn the driver of potential collisions at low speeds. This property is different from the + * pre-existing FORWARD_COLLISION_WARNING_ENABLED, which should apply to higher speed + * applications only. If the vehicle doesn't have a separate collision detection system for low + * speed environments, this property should not be implemented. + * + * In general, LOW_SPEED_COLLISION_WARNING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * high, that information must be conveyed through the ErrorState values in the + * LOW_SPEED_COLLISION_WARNING_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + LOW_SPEED_COLLISION_WARNING_ENABLED = + 0x1021 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 2c36f792f8..f1d0901cab 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -969,6 +969,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBatteryAverageTemperatureConfi VehicleArea::GLOBAL, VehiclePropertyType::FLOAT); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningEnabledConfig) { + verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 858c4e1791bdd192bb9a28cfd1c3b63925844e41 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 14 Nov 2023 17:33:11 +0000 Subject: [PATCH 357/376] Added LOW_SPEED_COLLISION_WARNING_STATE to HAL Bug: 310955303 Test: atest VtsHalAutomotiveVehicle_TargetTest FakeVehicleHardwareTest Change-Id: I30980af5af1d6b954d6a4166be4df6ac92235388 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 +- .../java/ChangeModeForVehicleProperty.java | 3 +- .../java/EnumForVehicleProperty.java | 3 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 21 +++++++ .../hardware/src/FakeVehicleHardware.cpp | 7 +++ .../hardware/test/FakeVehicleHardwareTest.cpp | 62 +++++++++++++++++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../LowSpeedCollisionWarningState.aidl | 40 ++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../LowSpeedCollisionWarningState.aidl | 44 +++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 22 +++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 15 files changed, 215 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 9865bfff70..3c4e3a913d 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -287,6 +287,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 8858bc3c56..e9f7c9701c 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -287,6 +287,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index d22c433ff2..42c98a9888 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -278,7 +278,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE) + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 35630a848a..3479715bea 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -278,7 +278,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index 48428b69b7..80fd556096 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -100,7 +100,8 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)), - Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)) + Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)), + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, List.of(LowSpeedCollisionWarningState.class, ErrorState.class)) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 3b1fd70253..2b99d7ad8e 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -61,6 +61,7 @@ using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState; using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState; using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization; +using ::aidl::android::hardware::automotive::vehicle::LowSpeedCollisionWarningState; using ::aidl::android::hardware::automotive::vehicle::RawPropValues; using ::aidl::android::hardware::automotive::vehicle::VehicleAirbagLocation; using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport; @@ -288,6 +289,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["LaneCenteringAssistState"] = std::make_unique>(); + mConstantParsersByType["LowSpeedCollisionWarningState"] = + std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES mConstantParsersByType["TestVendorProperty"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index ad39c98509..bcd69b9d2d 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4099,6 +4099,27 @@ 1 ] } + }, + { + "property": "VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "LowSpeedCollisionWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_DISABLED", + "LowSpeedCollisionWarningState::NO_WARNING", + "LowSpeedCollisionWarningState::WARNING" + ] + } + ] } ] } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 7b62b2db64..8df0451bde 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -225,6 +225,13 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING), }, }, + // LSCW + { + toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED), + { + toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE), + }, + }, }; } // namespace diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index 3b6f717fd2..e1506c7d7e 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -1592,6 +1592,61 @@ std::vector setSpecialValueTestCases() { }, }, }, + SetSpecialValueTestCase{ + .name = "set_low_speed_collision_warning_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_low_speed_collision_warning_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + LOW_SPEED_COLLISION_WARNING_STATE), + .value.int32Values = {1}, + }, + }, + }, SetSpecialValueTestCase{ .name = "set_shutdown_request", .valuesToSet = @@ -2149,6 +2204,13 @@ TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) { toInt(VehicleProperty::HANDS_ON_DETECTION_WARNING), }, }, + // LSCW + { + toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED), + { + toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE), + }, + }, }; // First subscribe to all the properties that we will change. diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 7db5542a8b..1e83c8ae16 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl new file mode 100644 index 0000000000..6f6338b2fd --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum LowSpeedCollisionWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING = 2, +} 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 0435d2df0b..3f0375d643 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 @@ -285,4 +285,5 @@ enum VehicleProperty { DRIVER_DISTRACTION_WARNING_ENABLED = (((0x101F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313951 */, DRIVER_DISTRACTION_WARNING = (((0x1020 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411104 */, LOW_SPEED_COLLISION_WARNING_ENABLED = (((0x1021 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313953 */, + LOW_SPEED_COLLISION_WARNING_STATE = (((0x1022 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411106 */, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl new file mode 100644 index 0000000000..028a2d9e40 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Low Speed Collision Warning State. + */ +@VintfStability +@Backing(type="int") +enum LowSpeedCollisionWarningState { + + /** + * This state is used as an alternative to any LowSpeedCollisionWarningState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#LOW_SPEED_COLLISION_WARNING_STATE should not use this state. The framework + * can use this field to remain backwards compatible if LowSpeedCollisionWarningState is + * extended to include additional states. + */ + OTHER = 0, + /** + * Low Speed Collision Warning is enabled and monitoring for potential collision, but no + * potential collision is detected. + */ + NO_WARNING = 1, + /** + * Low Speed Collision Warning is enabled, detects a potential collision, and is actively + * warning the user. + */ + WARNING = 2, +} 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 4fa3829e58..46422ce1f5 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5383,6 +5383,28 @@ enum VehicleProperty { LOW_SPEED_COLLISION_WARNING_ENABLED = 0x1021 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Low Speed Collision Warning state. + * + * Returns the current state of Low Speed Collision Warning. This property must always return a + * valid state defined in LowSpeedCollisionWarningState or ErrorState. It must not surface + * errors through StatusCode and must use the supported error states instead. This property is + * different from the pre-existing FORWARD_COLLISION_WARNING_STATE, which should apply to higher + * speed applications only. If the vehicle doesn't have a separate collision detection system + * for low speed environments, this property should not be implemented. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both LowSpeedCollisionWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum LowSpeedCollisionWarningState + * @data_enum ErrorState + */ + LOW_SPEED_COLLISION_WARNING_STATE = + 0x1022 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index f1d0901cab..e193a9fa6d 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -975,6 +975,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningEnabledC VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningStateConfig) { + verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 84866f7c35955a734ef05e5f9044d63c34b02e52 Mon Sep 17 00:00:00 2001 From: shrikar Date: Mon, 27 Nov 2023 00:30:59 +0000 Subject: [PATCH 358/376] Added VALET_MODE_ENABLED to HAL Bug: 313324764 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I2365ac050978ade0d441ff96bf9160bd2b6651e4 --- .../generated_lib/cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../default_config/config/DefaultProperties.json | 8 ++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 16 ++++++++++++++++ .../src/VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 35 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 3c4e3a913d..4a0845c697 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -122,6 +122,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyAccess::READ}, {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::VALET_MODE_ENABLED, 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 e9f7c9701c..ea51deafb9 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -122,6 +122,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::VALET_MODE_ENABLED, 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 42c98a9888..00a5c7d389 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -114,6 +114,7 @@ public final class AccessForVehicleProperty { 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.VALET_MODE_ENABLED, 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 3479715bea..075d9f99bc 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -114,6 +114,7 @@ public final class ChangeModeForVehicleProperty { 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.VALET_MODE_ENABLED, 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/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index bcd69b9d2d..5ae94f2938 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -3210,6 +3210,14 @@ } ] }, + { + "property": "VehicleProperty::VALET_MODE_ENABLED", + "defaultValue": { + "int32Values": [ + 0 + ] + } + }, { "property": "VehicleProperty::OBD2_LIVE_FRAME", "configArray": [ 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 3f0375d643..518150bb89 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 @@ -120,6 +120,7 @@ enum VehicleProperty { AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409538 */, DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */, PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */, + VALET_MODE_ENABLED = (((0x0A05 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312389 */, 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 46422ce1f5..dd9ad37b65 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -1534,6 +1534,22 @@ enum VehicleProperty { */ PER_DISPLAY_BRIGHTNESS = 0x0A04 + 0x10000000 + 0x01000000 + 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC + /** + * Valet mode enabled + * + * This property allows the user to enable/disable valet mode in their vehicle. Valet mode is + * a privacy and security setting that prevents an untrusted driver to access more private areas + * in the vehicle, such as the glove box or the trunk(s). + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + VALET_MODE_ENABLED = + 0x0A05 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, /** * Property to feed H/W input events to android * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index e193a9fa6d..9b8575ac03 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -981,6 +981,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningStateCon VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyValetModeEnabledConfig) { + verifyProperty(VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 33a3369d18f7c9f10228a782c1610ccabb1f6e73 Mon Sep 17 00:00:00 2001 From: shrikar Date: Thu, 30 Nov 2023 01:38:01 +0000 Subject: [PATCH 359/376] Added ELECTRONIC_STABILITY_CONTROL_ENABLED to HAL Bug: 313435670 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I7d9bdc5bfccc3037a29d7d9b72c705797cc53064 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../config/DefaultProperties.json | 8 +++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 21 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 8 files changed, 40 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 4a0845c697..6b94277b0f 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -85,6 +85,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::ABS_ACTIVE, VehiclePropertyAccess::READ}, {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess::READ}, {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index ea51deafb9..94cf4e8c73 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -85,6 +85,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::ABS_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 00a5c7d389..0232eba11a 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -77,6 +77,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 075d9f99bc..d4ef724057 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -77,6 +77,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 5ae94f2938..3dcdb9d3f3 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4128,6 +4128,14 @@ ] } ] + }, + { + "property": "VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } } ] } 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 518150bb89..827aa3ec5f 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 @@ -83,6 +83,7 @@ enum VehicleProperty { ABS_ACTIVE = (((0x040A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310858 */, TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310859 */, EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408013 */, + ELECTRONIC_STABILITY_CONTROL_ENABLED = (((0x040E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310862 */, HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517120 */, HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517121 */, HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614274 */, 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 dd9ad37b65..19537ac4c6 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -687,6 +687,27 @@ enum VehicleProperty { */ EV_STOPPING_MODE = 0x040D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Enable or disable Electronic Stability Control (ESC). + * + * Set true to enable ESC and false to disable ESC. When ESC is enabled, a system in the vehicle + * should be controlling the tires during instances with high risk of skidding to actively + * prevent the same from happening. + * + * In general, ELECTRONIC_STABILITY_CONTROL_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * high, that information must be conveyed through the ErrorState values in the + * ELECTRONIC_STABILITY_CONTROL_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + ELECTRONIC_STABILITY_CONTROL_ENABLED = + 0x040E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, /** * HVAC Properties * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 9b8575ac03..5929a3911e 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -987,6 +987,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyValetModeEnabledConfig) { VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlEnabledConfig) { + verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From a45d1cfdc94faebf3b89121bc7ea37a01864f545 Mon Sep 17 00:00:00 2001 From: shrikar Date: Mon, 27 Nov 2023 17:40:46 +0000 Subject: [PATCH 360/376] Added ELECTRONIC_STABILITY_CONTROL_STATE to HAL Bug: 313455695 Test: atest VtsHalAutomotiveVehicle_TargetTest FakeVehicleHardwareTest Change-Id: I8d8d7d749f530a7c738c8a9dfd712496d118715a --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 1 + .../java/ChangeModeForVehicleProperty.java | 1 + .../java/EnumForVehicleProperty.java | 1 + .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 21 +++++++ .../hardware/src/FakeVehicleHardware.cpp | 7 +++ .../hardware/test/FakeVehicleHardwareTest.cpp | 62 +++++++++++++++++++ .../utils/common/include/VehicleHalTypes.h | 1 + .../ElectronicStabilityControlState.aidl | 40 ++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../ElectronicStabilityControlState.aidl | 43 +++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 18 ++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 15 files changed, 207 insertions(+) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 6b94277b0f..2d9af05b8a 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -86,6 +86,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess::READ}, {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 94cf4e8c73..1faa382209 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -86,6 +86,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::EV_STOPPING_MODE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 0232eba11a..ff48e4cbdd 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -78,6 +78,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index d4ef724057..1f2c2fa199 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -78,6 +78,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode.ON_CHANGE), diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index 80fd556096..b2ee4c0126 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -43,6 +43,7 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.TURN_SIGNAL_STATE, List.of(VehicleTurnSignal.class)), Map.entry(VehicleProperty.IGNITION_STATE, List.of(VehicleIgnitionState.class)), Map.entry(VehicleProperty.EV_STOPPING_MODE, List.of(EvStoppingMode.class)), + Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, List.of(ElectronicStabilityControlState.class, ErrorState.class)), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, List.of(VehicleHvacFanDirection.class)), Map.entry(VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS, List.of(VehicleUnit.class)), Map.entry(VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, List.of(VehicleHvacFanDirection.class)), diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 2b99d7ad8e..371acbeda1 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -45,6 +45,7 @@ using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState; using ::aidl::android::hardware::automotive::vehicle::DriverDistractionWarning; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState; using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning; +using ::aidl::android::hardware::automotive::vehicle::ElectronicStabilityControlState; using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState; using ::aidl::android::hardware::automotive::vehicle::ErrorState; using ::aidl::android::hardware::automotive::vehicle::EvConnectorType; @@ -291,6 +292,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["LowSpeedCollisionWarningState"] = std::make_unique>(); + mConstantParsersByType["ElectronicStabilityControlState"] = + std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES mConstantParsersByType["TestVendorProperty"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 3dcdb9d3f3..3c32587b6e 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4136,6 +4136,27 @@ 1 ] } + }, + { + "property": "VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE", + "defaultValue": { + "int32Values": [ + "ElectronicStabilityControlState::ENABLED" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_SPEED_LOW", + "ErrorState::NOT_AVAILABLE_DISABLED", + "ElectronicStabilityControlState::ENABLED", + "ElectronicStabilityControlState::ACTIVATED" + ] + } + ] } ] } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 8df0451bde..0c1e4b9e85 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -232,6 +232,13 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE), }, }, + // ESC + { + toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED), + { + toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE), + }, + }, }; } // namespace diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp index e1506c7d7e..6d2efd5b5c 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp @@ -1647,6 +1647,61 @@ std::vector setSpecialValueTestCases() { }, }, }, + SetSpecialValueTestCase{ + .name = "set_electronic_stability_control_enabled_false", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_ENABLED), + .value.int32Values = {0}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_ENABLED), + .value.int32Values = {0}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_STATE), + .value.int32Values = {toInt( + ErrorState::NOT_AVAILABLE_DISABLED)}, + }, + }, + }, + SetSpecialValueTestCase{ + .name = "set_electronic_stability_control_enabled_true", + .valuesToSet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_ENABLED), + .value.int32Values = {1}, + }, + }, + .expectedValuesToGet = + { + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_ENABLED), + .value.int32Values = {1}, + }, + VehiclePropValue{ + .prop = toInt( + VehicleProperty:: + ELECTRONIC_STABILITY_CONTROL_STATE), + .value.int32Values = {1}, + }, + }, + }, SetSpecialValueTestCase{ .name = "set_shutdown_request", .valuesToSet = @@ -2211,6 +2266,13 @@ TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) { toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE), }, }, + // ESC + { + toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED), + { + toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE), + }, + }, }; // First subscribe to all the properties that we will change. diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 1e83c8ae16..8e990fc415 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl new file mode 100644 index 0000000000..b061a25ecf --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum ElectronicStabilityControlState { + OTHER = 0, + ENABLED = 1, + ACTIVATED = 2, +} 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 827aa3ec5f..79b6efb611 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 @@ -84,6 +84,7 @@ enum VehicleProperty { TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310859 */, EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408013 */, ELECTRONIC_STABILITY_CONTROL_ENABLED = (((0x040E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310862 */, + ELECTRONIC_STABILITY_CONTROL_STATE = (((0x040F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408015 */, HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517120 */, HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517121 */, HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614274 */, diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl new file mode 100644 index 0000000000..006bbf2e70 --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Electronic Stability Control (ESC). + */ +@VintfStability +@Backing(type="int") +enum ElectronicStabilityControlState { + + /** + * This state is used as an alternative to any ElectronicStabilityControlState value that is not + * defined in the platform. Ideally, implementations of + * VehicleProperty#ELECTRONIC_STABILITY_CONTROL_STATE should not use this state. The framework + * can use this field to remain backwards compatible if ElectronicStabilityControlState is + * extended to include additional states. + */ + OTHER = 0, + /** + * ESC is enabled and monitoring safety, but is not actively controlling the tires to prevent + * the car from skidding. + */ + ENABLED = 1, + /** + * ESC is enabled and is actively controlling the tires to prevent the car from skidding. + */ + ACTIVATED = 2, +} 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 19537ac4c6..752770b44e 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -708,6 +708,24 @@ enum VehicleProperty { */ ELECTRONIC_STABILITY_CONTROL_ENABLED = 0x040E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Electronic Stability Control (ESC) state. + * + * Returns the current state of ESC. This property must always return a valid state defined in + * ElectronicStabilityControlState or ErrorState. It must not surface errors through StatusCode + * and must use the supported error states instead. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both ElectronicStabilityControlState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum ElectronicStabilityControlState + * @data_enum ErrorState + */ + ELECTRONIC_STABILITY_CONTROL_STATE = + 0x040F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, /** * HVAC Properties * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 5929a3911e..51c17db8de 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -993,6 +993,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlEnable VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlStateConfig) { + verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM, + VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 7fde8f50843e69171f2382a1fd3336121802ad9c Mon Sep 17 00:00:00 2001 From: shrikar Date: Mon, 27 Nov 2023 22:47:53 +0000 Subject: [PATCH 361/376] Added CROSS_TRAFFIC_MONITORING_ENABLED to HAL Bug: 313466942 Test: atest VtsHalAutomotiveVehicle_TargetTest Change-Id: I8d65d4ab577254a60859ed2f65e0317829ff70b2 --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 ++- .../java/ChangeModeForVehicleProperty.java | 3 ++- .../config/DefaultProperties.json | 8 +++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../automotive/vehicle/VehicleProperty.aidl | 22 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 8 files changed, 43 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 2d9af05b8a..1ef592590d 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -291,6 +291,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ}, + {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 1faa382209..8218d85296 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -291,6 +291,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index ff48e4cbdd..b571e8049e 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -282,7 +282,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), - Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ) + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 1f2c2fa199..50e31d0c9c 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -282,7 +282,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index 3c32587b6e..ee325ff9ae 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4157,6 +4157,14 @@ ] } ] + }, + { + "property": "VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED", + "defaultValue": { + "int32Values": [ + 1 + ] + } } ] } 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 79b6efb611..0afd002432 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 @@ -289,4 +289,5 @@ enum VehicleProperty { DRIVER_DISTRACTION_WARNING = (((0x1020 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411104 */, LOW_SPEED_COLLISION_WARNING_ENABLED = (((0x1021 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313953 */, LOW_SPEED_COLLISION_WARNING_STATE = (((0x1022 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411106 */, + CROSS_TRAFFIC_MONITORING_ENABLED = (((0x1023 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313955 */, } 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 752770b44e..aa23ac6fb6 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5460,6 +5460,28 @@ enum VehicleProperty { LOW_SPEED_COLLISION_WARNING_STATE = 0x1022 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /** + * Enable or disable Cross Traffic Monitoring. + * + * Set true to enable Cross Traffic Monitoring and false to disable Cross Traffic Monitoring. + * When Cross Traffic Monitoring is enabled, the ADAS system in the vehicle should be turned on + * and monitoring for potential sideways collisions. + * + * In general, CROSS_TRAFFIC_MONITORING_ENABLED should always return true or false. If the + * feature is not available due to some temporary state, such as the vehicle speed being too + * high, that information must be conveyed through the ErrorState values in the + * CROSS_TRAFFIC_MONITORING_STATE property. + * + * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to + * implement it as VehiclePropertyAccess.READ only. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ_WRITE + * @access VehiclePropertyAccess.READ + */ + CROSS_TRAFFIC_MONITORING_ENABLED = + 0x1023 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 51c17db8de..7191f9de45 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -999,6 +999,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlStateC VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringEnabledConfig) { + verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, + VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 813ba7c57132e3e28769e20ce77ec2af0628c288 Mon Sep 17 00:00:00 2001 From: shrikar Date: Tue, 28 Nov 2023 18:35:34 +0000 Subject: [PATCH 362/376] Added CROSS_TRAFFIC_MONITORING_WARNING_STATE to HAL Bug: 313664286 Test: atest VtsHalAutomotiveVehicle_TargetTest FakeVehicleHardwareTest Change-Id: I49c6ff1a583a9d2e8504700a4c95de0c69bee21a --- .../cpp/AccessForVehicleProperty.h | 1 + .../cpp/ChangeModeForVehicleProperty.h | 1 + .../java/AccessForVehicleProperty.java | 3 +- .../java/ChangeModeForVehicleProperty.java | 3 +- .../java/EnumForVehicleProperty.java | 3 +- .../JsonConfigLoader/src/JsonConfigLoader.cpp | 3 + .../config/DefaultProperties.json | 26 +++++++ .../hardware/src/FakeVehicleHardware.cpp | 7 ++ .../utils/common/include/VehicleHalTypes.h | 1 + .../CrossTrafficMonitoringWarningState.aidl | 45 ++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 1 + .../CrossTrafficMonitoringWarningState.aidl | 71 +++++++++++++++++++ .../automotive/vehicle/VehicleProperty.aidl | 19 +++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++ 14 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl create mode 100644 automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 1ef592590d..ba44e074b5 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -292,6 +292,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ}, {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE}, + {VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess::READ}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 8218d85296..a720f2d122 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -292,6 +292,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE}, + {VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE}, }; } // namespace vehicle diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index b571e8049e..be849f59ee 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -283,7 +283,8 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ), - Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE) + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE), + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess.READ) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 50e31d0c9c..780eaa3261 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -283,7 +283,8 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE), - Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE) + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE), + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE) ); } diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java index b2ee4c0126..b4f24a6e85 100644 --- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java @@ -102,7 +102,8 @@ public final class EnumForVehicleProperty { Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)), Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)), - Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, List.of(LowSpeedCollisionWarningState.class, ErrorState.class)) + Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, List.of(LowSpeedCollisionWarningState.class, ErrorState.class)), + Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, List.of(CrossTrafficMonitoringWarningState.class, ErrorState.class)) ); } diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp index 371acbeda1..146da69bd2 100644 --- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp +++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp @@ -38,6 +38,7 @@ using ::aidl::android::hardware::automotive::vehicle::AccessForVehicleProperty; using ::aidl::android::hardware::automotive::vehicle::AutomaticEmergencyBrakingState; using ::aidl::android::hardware::automotive::vehicle::BlindSpotWarningState; using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty; +using ::aidl::android::hardware::automotive::vehicle::CrossTrafficMonitoringWarningState; using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand; using ::aidl::android::hardware::automotive::vehicle::CruiseControlState; using ::aidl::android::hardware::automotive::vehicle::CruiseControlType; @@ -294,6 +295,8 @@ JsonValueParser::JsonValueParser() { std::make_unique>(); mConstantParsersByType["ElectronicStabilityControlState"] = std::make_unique>(); + mConstantParsersByType["CrossTrafficMonitoringWarningState"] = + std::make_unique>(); mConstantParsersByType["Constants"] = std::make_unique(); #ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES mConstantParsersByType["TestVendorProperty"] = diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index ee325ff9ae..3d026b45af 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -4165,6 +4165,32 @@ 1 ] } + }, + { + "property": "VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE", + "defaultValue": { + "int32Values": [ + "CrossTrafficMonitoringWarningState::NO_WARNING" + ] + }, + "areas": [ + { + "areaId": 0, + "supportedEnumValues": [ + "ErrorState::NOT_AVAILABLE_SAFETY", + "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY", + "ErrorState::NOT_AVAILABLE_SPEED_HIGH", + "ErrorState::NOT_AVAILABLE_DISABLED", + "CrossTrafficMonitoringWarningState::NO_WARNING", + "CrossTrafficMonitoringWarningState::WARNING_FRONT_LEFT", + "CrossTrafficMonitoringWarningState::WARNING_FRONT_RIGHT", + "CrossTrafficMonitoringWarningState::WARNING_FRONT_BOTH", + "CrossTrafficMonitoringWarningState::WARNING_REAR_LEFT", + "CrossTrafficMonitoringWarningState::WARNING_REAR_RIGHT", + "CrossTrafficMonitoringWarningState::WARNING_REAR_BOTH" + ] + } + ] } ] } diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index 0c1e4b9e85..dc1e1e4e19 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -239,6 +239,13 @@ const std::unordered_map> mAdasEnabledPropToAdasPr toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE), }, }, + // CTMW + { + toInt(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED), + { + toInt(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE), + }, + }, }; } // namespace diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h index 8e990fc415..bbd88dab48 100644 --- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h +++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl new file mode 100644 index 0000000000..90e2d8dfb8 --- /dev/null +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.automotive.vehicle; +@Backing(type="int") @VintfStability +enum CrossTrafficMonitoringWarningState { + OTHER = 0, + NO_WARNING = 1, + WARNING_FRONT_LEFT = 2, + WARNING_FRONT_RIGHT = 3, + WARNING_FRONT_BOTH = 4, + WARNING_REAR_LEFT = 5, + WARNING_REAR_RIGHT = 6, + WARNING_REAR_BOTH = 7, +} 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 0afd002432..b6bfb0452c 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 @@ -290,4 +290,5 @@ enum VehicleProperty { LOW_SPEED_COLLISION_WARNING_ENABLED = (((0x1021 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313953 */, LOW_SPEED_COLLISION_WARNING_STATE = (((0x1022 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411106 */, CROSS_TRAFFIC_MONITORING_ENABLED = (((0x1023 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313955 */, + CROSS_TRAFFIC_MONITORING_WARNING_STATE = (((0x1024 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411108 */, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl new file mode 100644 index 0000000000..05be65d5cb --- /dev/null +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.automotive.vehicle; + +/** + * Used to enumerate the state of Cross Traffic Monitoring Warning system. + */ +@VintfStability +@Backing(type="int") +enum CrossTrafficMonitoringWarningState { + + /** + * This state is used as an alternative to any CrossTrafficMonitoringWarningState value that is + * not defined in the platform. Ideally, implementations of + * VehicleProperty#CROSS_TRAFFIC_MONITORING_WARNING_STATE should not use this state. The + * framework can use this field to remain backwards compatible if + * CrossTrafficMonitoringWarningState is extended to include additional states. + */ + OTHER = 0, + /** + * Cross Traffic Monitoring Warning is enabled and monitoring safety, but no potential collision + * is detected. + */ + NO_WARNING = 1, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from the driver's left side in front of the vehicle. + */ + WARNING_FRONT_LEFT = 2, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from the driver's right side in front of the vehicle. + */ + WARNING_FRONT_RIGHT = 3, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from both the driver's left side and the driver's right side in front + * of the vehicle. + */ + WARNING_FRONT_BOTH = 4, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from the driver's left side behind the vehicle. + */ + WARNING_REAR_LEFT = 5, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from the driver's right side behind the vehicle. + */ + WARNING_REAR_RIGHT = 6, + /** + * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming + * moving objects coming from the driver's left side and the driver's right side behind the + * vehicle. + */ + WARNING_REAR_BOTH = 7, +} 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 aa23ac6fb6..ecabe8c3b6 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -5482,6 +5482,25 @@ enum VehicleProperty { CROSS_TRAFFIC_MONITORING_ENABLED = 0x1023 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN, + /** + * Cross Traffic Monitoring warning state. + * + * Returns the current state of Cross Traffic Monitoring Warning. This property must always + * return a valid state defined in CrossTrafficMonitoringWarningState or ErrorState. It must not + * surface errors through StatusCode and must use the supported error states instead. + * + * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined + * unless all states of both CrossTrafficMonitoringWarningState (including OTHER, which is not + * recommended) and ErrorState are supported. + * + * @change_mode VehiclePropertyChangeMode.ON_CHANGE + * @access VehiclePropertyAccess.READ + * @data_enum CrossTrafficMonitoringWarningState + * @data_enum ErrorState + */ + CROSS_TRAFFIC_MONITORING_WARNING_STATE = + 0x1024 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + /*************************************************************************** * End of ADAS Properties **************************************************************************/ diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 7191f9de45..ba36f298f4 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -1005,6 +1005,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringEnabledCon VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringWarningStateConfig) { + verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE, + VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32); +} + bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) { auto result = mVhalClient->getPropConfigs({propertyId}); return result.ok(); -- GitLab From 5e119598fa65287c1186000501823d5ea080112e Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Thu, 30 Nov 2023 17:43:22 -0800 Subject: [PATCH 363/376] Change temp approximations to be accurate We need to use a more accurate ratio of celsius to fahrenheit along with better min/max temperature conversions so if a client sets the value using standard conversion or using this table, they will produce the same result. Also, we need to round to the closest increment instead of truncating. Bug: 305274504 Bug: 313720524 Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest FakeVehicleHardwareTest Change-Id: Ia4d53e1a904fb2b40f5ec428ab548895c8f307ed --- .../impl/default_config/config/DefaultProperties.json | 8 ++++---- .../impl/fake_impl/hardware/src/FakeVehicleHardware.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json index d3bb60c7ae..2f4da62764 100644 --- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json +++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json @@ -2368,9 +2368,9 @@ 160, 280, 5, - 600, - 840, - 10 + 608, + 824, + 9 ] }, { @@ -2380,7 +2380,7 @@ 66.19999694824219, "VehicleUnit::FAHRENHEIT", 19.0, - 66.0 + 66.2 ] } }, diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp index acee9b327b..dcc1e38ff0 100644 --- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp +++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp @@ -434,7 +434,7 @@ int FakeVehicleHardware::getHvacTempNumIncrements(int requestedTemp, int minTemp int increment) { requestedTemp = std::max(requestedTemp, minTemp); requestedTemp = std::min(requestedTemp, maxTemp); - int numIncrements = (requestedTemp - minTemp) / increment; + int numIncrements = std::round((requestedTemp - minTemp) / static_cast(increment)); return numIncrements; } -- GitLab From e11bda9789b5d80cf5f34e1a5de1fd5aca8638d8 Mon Sep 17 00:00:00 2001 From: Manali Bhutiyani Date: Tue, 12 Dec 2023 21:23:36 +0000 Subject: [PATCH 364/376] [aidl] add hwc batching capability This CL adds the new aidl/apis for HWC command batching feature. Bug: 290685621 Test: atest VtsHalGraphicsComposer3_TargetTest atest PerInstance/GraphicsComposerAidlBatchedCommandTest Change-Id: Ibccc2cb30954f5d054f8e45e59a0b831fd15a304 --- .../hardware/graphics/composer3/Capability.aidl | 1 + .../hardware/graphics/composer3/Capability.aidl | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl index f02f8aaa77..ee004d6ef2 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl @@ -45,4 +45,5 @@ enum Capability { BOOT_DISPLAY_CONFIG = 5, HDR_OUTPUT_CONVERSION_CONFIG = 6, REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7, + LAYER_LIFECYCLE_BATCH_COMMAND = 8, } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl index 4638610955..1dfc074e73 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl @@ -86,4 +86,14 @@ enum Capability { * @see IComposerCallback.onRefreshRateChangedDebug */ REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7, + + /** + * Specifies that the device HAL supports the batching of layer creation and destruction + * for better performance. + * + * @see IComposerClient.executeCommands + * @see LayerCommand.layerLifecycleBatchCommandType + * @see LayerCommand.newBufferSlotCount + */ + LAYER_LIFECYCLE_BATCH_COMMAND = 8, } -- GitLab From 1eb2ecfe4a34d5d411dfab1516e4e3ce2200a0fd Mon Sep 17 00:00:00 2001 From: ramindani Date: Thu, 7 Dec 2023 11:16:21 -0800 Subject: [PATCH 365/376] [HWC3] AIDL change to add refreshPeriodNanos to RefreshRateChangedDebugData Test: atest VtsHalGraphicsComposer3_TargetTest and device boots BUG: 314527560 Change-Id: Iaf961ae6ad118c5cd99b07ec133023297dac7040 --- .../composer3/RefreshRateChangedDebugData.aidl | 1 + .../composer3/RefreshRateChangedDebugData.aidl | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl index 2b9801a4aa..e9305e152c 100644 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl +++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl @@ -36,4 +36,5 @@ package android.hardware.graphics.composer3; parcelable RefreshRateChangedDebugData { long display; int vsyncPeriodNanos; + int refreshPeriodNanos; } diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl index c1f78d6f5e..11c0112dfd 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl @@ -27,4 +27,15 @@ parcelable RefreshRateChangedDebugData { * The display vsync period in nanoseconds. */ int vsyncPeriodNanos; + + /** + * The refresh period of the display in nanoseconds. + * On VRR (Variable Refresh Rate) displays, refreshPeriodNanos can be different from the + * vsyncPeriodNanos because not every vsync cycle of the display is a refresh cycle. + * This should be set to the current refresh period. + * On non-VRR displays this value should be equal to vsyncPeriodNanos + * + * @see vsyncPeriodNanos + */ + int refreshPeriodNanos; } -- GitLab From a2a6deaf5036e081f48379b6573db4465538b5ac Mon Sep 17 00:00:00 2001 From: ramindani Date: Mon, 11 Dec 2023 13:42:36 -0800 Subject: [PATCH 366/376] [Composer3-VTS] Test Composer3-V3 for refreshPeriodNanos and vsyncPeriodNanos Test: atest VtsHalGraphicsComposer3_TargetTest BUG: 314527560 Change-Id: If45c0d8c4b61b8c46c1e4336fe261d11414535e5 --- .../composer/aidl/vts/VtsComposerClient.cpp | 3 +- .../composer/aidl/vts/VtsComposerClient.h | 8 ++- .../VtsHalGraphicsComposer3_TargetTest.cpp | 49 ++++++++++++------- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp index 11b995e2e2..ac08cd151f 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.cpp +++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp @@ -517,7 +517,8 @@ std::pair> VtsComposerClient::getDisplays void VtsComposerClient::addDisplayConfigs(VtsDisplay* vtsDisplay, const std::vector& configs) { for (const auto& config : configs) { - vtsDisplay->addDisplayConfig(config.configId, {config.vsyncPeriod, config.configGroup}); + vtsDisplay->addDisplayConfig(config.configId, + {config.vsyncPeriod, config.configGroup, config.vrrConfig}); } } diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h index b45c71f80b..292bc407f8 100644 --- a/graphics/composer/aidl/vts/VtsComposerClient.h +++ b/graphics/composer/aidl/vts/VtsComposerClient.h @@ -253,10 +253,14 @@ class VtsDisplay { int32_t getDisplayHeight() const { return mDisplayHeight; } struct DisplayConfig { - DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_) - : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {} + DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_, + std::optional vrrConfig_ = {}) + : vsyncPeriod(vsyncPeriod_), + configGroup(configGroup_), + vrrConfig(std::move(vrrConfig_)) {} int32_t vsyncPeriod; int32_t configGroup; + std::optional vrrConfig; }; void addDisplayConfig(int32_t config, DisplayConfig displayConfig) { diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp index c135298560..7fcf2e4cec 100644 --- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp @@ -2664,26 +2664,40 @@ TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebug_Ena return; } - const auto displayId = getPrimaryDisplayId(); - EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); - // Enable the callback - ASSERT_TRUE(mComposerClient - ->setRefreshRateChangedCallbackDebugEnabled(displayId, - /*enabled*/ true) - .isOk()); - std::this_thread::sleep_for(100ms); + for (VtsDisplay& display : mDisplays) { + const auto displayId = display.getDisplayId(); + EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk()); + // Enable the callback + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ true) + .isOk()); + std::this_thread::sleep_for(100ms); - const auto displayFilter = [displayId](auto refreshRateChangedDebugData) { - return displayId == refreshRateChangedDebugData.display; - }; + const auto [status, configId] = mComposerClient->getActiveConfig(display.getDisplayId()); + EXPECT_TRUE(status.isOk()); - // Check that we immediately got a callback - EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)); + const auto displayFilter = [&](auto refreshRateChangedDebugData) { + bool nonVrrRateMatching = true; + if (std::optional vrrConfigOpt = + display.getDisplayConfig(configId).vrrConfig; + getInterfaceVersion() >= 3 && !vrrConfigOpt) { + nonVrrRateMatching = refreshRateChangedDebugData.refreshPeriodNanos == + refreshRateChangedDebugData.vsyncPeriodNanos; + } + const bool isDisplaySame = + display.getDisplayId() == refreshRateChangedDebugData.display; + return nonVrrRateMatching && isDisplaySame; + }; - ASSERT_TRUE(mComposerClient - ->setRefreshRateChangedCallbackDebugEnabled(displayId, - /*enabled*/ false) - .isOk()); + // Check that we immediately got a callback + EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter)); + + ASSERT_TRUE(mComposerClient + ->setRefreshRateChangedCallbackDebugEnabled(displayId, + /*enabled*/ false) + .isOk()); + } } TEST_P(GraphicsComposerAidlCommandV2Test, @@ -2938,7 +2952,6 @@ INSTANTIATE_TEST_SUITE_P( PerInstance, GraphicsComposerAidlCommandV2Test, testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)), ::android::PrintInstanceNameToString); - } // namespace aidl::android::hardware::graphics::composer3::vts int main(int argc, char** argv) { -- GitLab From c9782c2e581cfbf985768028a1897729373a5fa8 Mon Sep 17 00:00:00 2001 From: Maxim Pleshivenkov Date: Tue, 12 Dec 2023 23:33:36 +0000 Subject: [PATCH 367/376] Update VehicleApPowerStateShutdownParam Add Emergency Shutdown to VehicleApPowerStateShutdownParam Bug: 316026370 Change-Id: Ieb250e0d84314a9926fb87ebdb4aa92c247778e0 Test: manual build --- .../automotive/vehicle/VehicleApPowerStateShutdownParam.aidl | 1 + .../automotive/vehicle/VehicleApPowerStateShutdownParam.aidl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index 3fde1c7869..8b345b2bd1 100644 --- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl +++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -40,4 +40,5 @@ enum VehicleApPowerStateShutdownParam { SLEEP_IMMEDIATELY = 4, HIBERNATE_IMMEDIATELY = 5, CAN_HIBERNATE = 6, + EMERGENCY_SHUTDOWN = 7, } diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl index a863d1423d..923d42aef1 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl @@ -45,4 +45,8 @@ enum VehicleApPowerStateShutdownParam { * AP can enter hibernation (suspend to disk) instead of shutting down completely. */ CAN_HIBERNATE = 6, + /** + * AP must shutdown (gracefully) without a delay. + */ + EMERGENCY_SHUTDOWN = 7, } -- GitLab From 544b24ba945e4a0456f917294cc55e69e2dd6966 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Tue, 5 Dec 2023 00:13:53 -0800 Subject: [PATCH 368/376] Add ULTRASONICS_SENSOR_POSITION to HAL layer. Bug: 292141998 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I97d2576179bc7e668f6036c911235dc1dcd67dcb --- .../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 | 24 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 7 files changed, 35 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 6b94277b0f..4f24b9c893 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -198,6 +198,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ}, + {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 94cf4e8c73..cd53977591 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -198,6 +198,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 0232eba11a..04781312f1 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -190,6 +190,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index d4ef724057..2745d4277e 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -190,6 +190,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, 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 827aa3ec5f..89c1061811 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 @@ -196,6 +196,7 @@ enum VehicleProperty { GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */, VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */, LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, + ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, 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 19537ac4c6..9e8e67642b 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3309,6 +3309,30 @@ enum VehicleProperty { */ LOCATION_CHARACTERIZATION = 0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32, + + /** + * Static data for the position of each ultrasonic sensor installed on the vehicle. + * + * Each individual sensor is identified by its unique VehicleAreaConfig#areaId and returns the + * sensor's position formatted as [x, y, z] where: + * + * int32Values[0] = x, the position of the sensor along the x-axis relative to the origin of + * the Android Automotive sensor coordinate frame in millimeters + * int32Values[1] = y, the position of the sensor along the y-axis relative to the origin of + * the Android Automotive sensor coordinate frame in millimeters. + * int32Values[2] = z, the position of the sensor along the z-axis relative to the origin of + * the Android Automotive sensor coordinate frame in millimeters. + * + * If the data is aggregated by another ECU, then OEMs have the option of reporting the same + * reading across all included sensors or reporting a virtual representation of all the included + * sensors as if they were one sensor. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + ULTRASONICS_SENSOR_POSITION = 0x0C20 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + + VehiclePropertyType.INT32_VEC, + /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 5929a3911e..efbeb8ef68 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -548,6 +548,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLocationCharacterizationConfig) VehicleArea::GLOBAL, VehiclePropertyType::INT32); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorPositionConfig) { + verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 9e226e509938bd8a7afdd7cefaed25176a338e50 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Wed, 6 Dec 2023 00:23:18 -0800 Subject: [PATCH 369/376] Add ULTRASONICS_SENSOR_ORIENTATION to HAL layer. Bug: 292141998 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I5b40cb5ce27a0d4e2b2b67c0a94b47aafa3ebd5c --- .../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 | 31 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++ 7 files changed, 42 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 4f24b9c893..ab471fb6d7 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -199,6 +199,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE}, {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ}, + {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index cd53977591..d499451e0a 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -199,6 +199,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 04781312f1..f0de5ac2c9 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -191,6 +191,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE), Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 2745d4277e..bcaa3b1f76 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -191,6 +191,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, 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 89c1061811..27e56e63a1 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 @@ -197,6 +197,7 @@ enum VehicleProperty { VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */, LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */, + ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, 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 9e8e67642b..c3dd7ddd42 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3333,6 +3333,37 @@ enum VehicleProperty { ULTRASONICS_SENSOR_POSITION = 0x0C20 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + VehiclePropertyType.INT32_VEC, + /** + * Static data for the orientation of each ultrasonic sensor installed on the vehicle. + * + * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's + * orientation formatted as [qw, qx, qy, qz] where: + * + * int32Values[0] = qw, the quaternion coefficient w within the quaterinion (w + xi + yj + + * zk) describing the rotation of the sensor relative to the Android + * Automotive sensor coordinate frame. + * int32Values[1] = qx, the quaternion coefficient x within the quaterinion (w + xi + yj + + * zk) describing the rotation of the sensor relative to the Android + * Automotive sensor coordinate frame. + * int32Values[2] = qy, the quaternion coefficient y within the quaterinion (w + xi + yj + + * zk) describing the rotation of the sensor relative to the Android + * Automotive sensor coordinate frame. + * int32Values[3] = qz, the quaternion coefficient z within the quaterinion (w + xi + yj + + * zk) describing the rotation of the sensor relative to the Android + * Automotive sensor coordinate frame. + * + * This assumes each sensor uses the same axes conventions as Android Automotive. + * + * If the data is aggregated by another ECU, then OEMs have the option of reporting the same + * reading across all included sensors or reporting a virtual representation of all the included + * sensors as if they were one sensor. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + ULTRASONICS_SENSOR_ORIENTATION = 0x0C21 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + + VehiclePropertyType.INT32_VEC, + /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index efbeb8ef68..7fe3904d9e 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -554,6 +554,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorPositionConfig) VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConfig) { + verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 727aa3f29d9e8893edf31fc81d2965ee7405208e Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Wed, 6 Dec 2023 01:13:29 -0800 Subject: [PATCH 370/376] Add ULTRASONICS_SENSOR_FIELD_OF_VIEW to HAL layer. Bug: 292141998 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I2e8b35317ab7ecc952de1e8680ebfc8eac2a020f --- .../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 | 23 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 +++++ 7 files changed, 34 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index ab471fb6d7..ae66bb41cd 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -200,6 +200,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ}, + {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index d499451e0a..34eac65e8d 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -200,6 +200,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index f0de5ac2c9..a8b2e1e849 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -192,6 +192,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index bcaa3b1f76..988b6984f0 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -192,6 +192,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, 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 27e56e63a1..cea4cbfcdf 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 @@ -198,6 +198,7 @@ enum VehicleProperty { LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */, ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */, ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */, + ULTRASONICS_SENSOR_FIELD_OF_VIEW = (((0x0C22 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916130 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, 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 c3dd7ddd42..19cbba4177 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3364,6 +3364,29 @@ enum VehicleProperty { ULTRASONICS_SENSOR_ORIENTATION = 0x0C21 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + VehiclePropertyType.INT32_VEC, + /** + * Static data for the field of view of each ultrasonic sensor in degrees. + * + * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's + * field of view formatted as [horizontal, vertical] where: + * + * int32Values[0] = horizontal, the horizontal field of view for the specified ultrasonic + * sensor in degrees. + * int32Values[1] = vertical, the vertical field of view for the associated specified + * ultrasonic sensor in degrees. + * + * This assumes each sensor uses the same axes conventions as Android Automotive. + * + * If the data is aggregated by another ECU, then OEMs have the option of reporting the same + * reading across all included sensors or reporting a virtual representation of all the included + * sensors as if they were one sensor. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + ULTRASONICS_SENSOR_FIELD_OF_VIEW = 0x0C22 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + + VehiclePropertyType.INT32_VEC, + /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 7fe3904d9e..1ee1d7fb85 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -560,6 +560,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConf VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConfig) { + verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 968bf44f6681a44398a1eb4fa8bce75f3adf121c Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Wed, 6 Dec 2023 01:21:51 -0800 Subject: [PATCH 371/376] Add ULTRASONICS_SENSOR_DETECTION_RANGE to HAL layer. Bug: 292141998 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: I52808bc26422691d2b80e5f45f31a82a44fdfbc4 --- .../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 | 21 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 6 ++++++ 7 files changed, 32 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index ae66bb41cd..6d28ba6215 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -201,6 +201,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ}, + {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 34eac65e8d..0782add7ce 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -201,6 +201,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index a8b2e1e849..3c42f41919 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -193,6 +193,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index 988b6984f0..f13a8b725b 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -193,6 +193,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, 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 cea4cbfcdf..cb01af7f9a 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 @@ -199,6 +199,7 @@ enum VehicleProperty { ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */, ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */, ULTRASONICS_SENSOR_FIELD_OF_VIEW = (((0x0C22 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916130 */, + ULTRASONICS_SENSOR_DETECTION_RANGE = (((0x0C23 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916131 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, 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 19cbba4177..886ce955fd 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3387,6 +3387,27 @@ enum VehicleProperty { ULTRASONICS_SENSOR_FIELD_OF_VIEW = 0x0C22 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + VehiclePropertyType.INT32_VEC, + /** + * Static data for the detection range of each ultrasonic sensor in millimeters. + * + * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's + * detection range formatted as [minimum, maximum] where: + * + * int32Values[0] = minimum, the minimum range detectable by the ultrasonic sensor in + * millimeters. + * int32Values[1] = maximum, the maximum range detectable by the ultrasonic sensor in + * millimeters. + * + * If the data is aggregated by another ECU, then OEMs have the option of reporting the same + * reading across all included sensors or reporting a virtual representation of all the included + * sensors as if they were one sensor. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + ULTRASONICS_SENSOR_DETECTION_RANGE = 0x0C23 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + + VehiclePropertyType.INT32_VEC, + /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 1ee1d7fb85..68bdebebf7 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -566,6 +566,12 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConf VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorDetectionRangeConfig) { + verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ, + VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM, + VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From df05df56bae7c075fcc5325326e5a9d00e83b781 Mon Sep 17 00:00:00 2001 From: Eva Chen Date: Wed, 6 Dec 2023 01:42:55 -0800 Subject: [PATCH 372/376] Add ULTRASONICS_SENSOR_SUPPORTED_RANGES to HAL layer. Bug: 292141998 Test: atest VtsHalAutomotiveVehicle_TargetTest Test: atest CtsCarTestCases:CarPropertyManagerTest Test: atest CtsCarTestCases:VehiclePropertyIdsTest Change-Id: Id648eeba8590c93d19dbdc5cc9b84fab67f30db4 --- .../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 | 46 +++++++++++++++++++ .../VtsHalAutomotiveVehicle_TargetTest.cpp | 7 +++ 7 files changed, 58 insertions(+) diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h index 6d28ba6215..36fc459f47 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h @@ -202,6 +202,7 @@ std::unordered_map AccessForVehiclePrope {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ}, {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ}, + {VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ}, diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h index 0782add7ce..0e05cff5fc 100644 --- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h +++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h @@ -202,6 +202,7 @@ std::unordered_map ChangeModeForVehi {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode::STATIC}, + {VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode::STATIC}, {VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE}, {VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE}, diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java index 3c42f41919..f274612f32 100644 --- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java @@ -194,6 +194,7 @@ public final class AccessForVehicleProperty { Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess.READ), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ), diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java index f13a8b725b..24860f52d6 100644 --- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java +++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java @@ -194,6 +194,7 @@ public final class ChangeModeForVehicleProperty { Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode.STATIC), + Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode.STATIC), Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE), Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, 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 cb01af7f9a..1f69a52400 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 @@ -200,6 +200,7 @@ enum VehicleProperty { ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */, ULTRASONICS_SENSOR_FIELD_OF_VIEW = (((0x0C22 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916130 */, ULTRASONICS_SENSOR_DETECTION_RANGE = (((0x0C23 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916131 */, + ULTRASONICS_SENSOR_SUPPORTED_RANGES = (((0x0C24 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916132 */, OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */, OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */, OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */, 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 886ce955fd..83fde0e4c0 100644 --- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl +++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl @@ -3408,6 +3408,52 @@ enum VehicleProperty { ULTRASONICS_SENSOR_DETECTION_RANGE = 0x0C23 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + VehiclePropertyType.INT32_VEC, + /** + * Static data for the supported ranges of each ultrasonic sensor in millimeters. + * + * For ultrasonic sensors that only support readings within a specific range. For example, if + * an ultrasonic sensor detects an object at 700mm, but can only report that an object has been + * detected between 500mm and 1000mm. + * + * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's + * supported ranges formatted as [range_min_1, range_max_1, range_min_2, range_max_2, ...] + * where: + * + * int32Values[0] = range_min_1, the minimum of one supported range by the specified sensor + * in millimeters, inclusive. + * int32Values[1] = range_max_1, the maximum of one supported range by the specified sensor + * in millimeters, inclusive. + * int32Values[2] = range_min_2, the minimum of another supported range by the specified + * sensor in millimeters, inclusive. + * int32Values[3] = range_max_2, the maximum of another supported range by the specified + sensor in millimeters, inclusive. + * + * Example: + * - Ultrasonic sensor supports the following ranges: + * - 150mm to 499mm + * - 500mm to 999mm + * - 1000mm to 1500mm + * - The associated supported ranges should be formatted as: + * - int32Values[0] = 150 + * - int32Values[1] = 499 + * - int32Values[2] = 500 + * - int32Values[3] = 999 + * - int32Values[4] = 1000 + * - int32Values[5] = 1500 + * + * If this property is not defined, all the values within the ULTRASONICS_SENSOR_DETECTION_RANGE + * for the specified sensor are assumed to be supported. + * + * If the data is aggregated by another ECU, then OEMs have the option of reporting the same + * reading across all included sensors or reporting a virtual representation of all the included + * sensors as if they were one sensor. + * + * @change_mode VehiclePropertyChangeMode.STATIC + * @access VehiclePropertyAccess.READ + */ + ULTRASONICS_SENSOR_SUPPORTED_RANGES = 0x0C24 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR + + VehiclePropertyType.INT32_VEC, + /** * OBD2 Live Sensor Data * diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp index 68bdebebf7..ab2e4e7b74 100644 --- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp +++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp @@ -572,6 +572,13 @@ TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorDetectionRangeC VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC); } +TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorSupportedRangesConfig) { + verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, + VehiclePropertyAccess::READ, VehiclePropertyChangeMode::STATIC, + VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR, + VehiclePropertyType::INT32_VEC); +} + TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) { verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE, -- GitLab From 7fbbc9fde8a08a43343716028a145e6e44ac110e Mon Sep 17 00:00:00 2001 From: Vinay Gannevaram Date: Wed, 13 Dec 2023 17:01:43 +0530 Subject: [PATCH 373/376] P2P: Add OuiKeyedData for P2P connect and group event callbacks. Bug: 296069900 Test: m Change-Id: I80853c7d5f4ab2969676e8bca235d0f7bd7e8de2 --- .../wifi/supplicant/P2pGroupStartedEventParams.aidl | 1 + .../supplicant/P2pPeerClientDisconnectedEventParams.aidl | 1 + .../wifi/supplicant/P2pPeerClientJoinedEventParams.aidl | 1 + .../P2pProvisionDiscoveryCompletedEventParams.aidl | 1 + .../wifi/supplicant/P2pGroupStartedEventParams.aidl | 7 +++++++ .../supplicant/P2pPeerClientDisconnectedEventParams.aidl | 8 ++++++++ .../wifi/supplicant/P2pPeerClientJoinedEventParams.aidl | 8 ++++++++ .../P2pProvisionDiscoveryCompletedEventParams.aidl | 6 ++++++ 8 files changed, 33 insertions(+) diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl index 5465a86b13..e19ae4460d 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl @@ -45,4 +45,5 @@ parcelable P2pGroupStartedEventParams { byte[6] goInterfaceAddress; boolean isP2pClientEapolIpAddressInfoPresent; android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo p2pClientIpInfo; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl index 90e9f5e3eb..5c7c393b4b 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl @@ -37,4 +37,5 @@ parcelable P2pPeerClientDisconnectedEventParams { String groupInterfaceName; byte[6] clientInterfaceAddress; byte[6] clientDeviceAddress; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl index 800f5b3593..40c8ff6d8a 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl @@ -38,4 +38,5 @@ parcelable P2pPeerClientJoinedEventParams { byte[6] clientInterfaceAddress; byte[6] clientDeviceAddress; int clientIpAddress; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl index 587c7c670c..0ff06536b3 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl @@ -40,4 +40,5 @@ parcelable P2pProvisionDiscoveryCompletedEventParams { android.hardware.wifi.supplicant.WpsConfigMethods configMethods; String generatedPin; String groupInterfaceName; + @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl index 96f1e16793..9db7a1eeda 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; import android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo; /** @@ -63,4 +64,10 @@ parcelable P2pGroupStartedEventParams { * The value is undefined if isP2pClientEapolIpAddressInfoPresent is false. */ P2pClientEapolIpAddressInfo p2pClientIpInfo; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl index 936efd1fa6..6e3350f621 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl @@ -16,6 +16,8 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; + /** * Parameters passed as a part of P2P peer client disconnected event. */ @@ -29,4 +31,10 @@ parcelable P2pPeerClientDisconnectedEventParams { /** P2P device interface MAC address of the client that disconnected. */ byte[6] clientDeviceAddress; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl index 7eae2e5a7f..4f46d705a0 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl @@ -16,6 +16,8 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; + /** * Parameters passed as a part of P2P peer client joined event. */ @@ -39,4 +41,10 @@ parcelable P2pPeerClientJoinedEventParams { * The value is set to zero if the IP address is not allocated via EAPOL exchange. */ int clientIpAddress; + + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl index 7fa7f226ac..b559216611 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl @@ -16,6 +16,7 @@ package android.hardware.wifi.supplicant; +import android.hardware.wifi.common.OuiKeyedData; import android.hardware.wifi.supplicant.P2pProvDiscStatusCode; import android.hardware.wifi.supplicant.WpsConfigMethods; @@ -45,4 +46,9 @@ parcelable P2pProvisionDiscoveryCompletedEventParams { * Refer to WFA Wi-Fi_Direct_Specification_v1.9 section 3.2.1 for more details. */ String groupInterfaceName; + /** + * Optional vendor-specific parameters. Null value indicates + * that no vendor data is provided. + */ + @nullable OuiKeyedData[] vendorData; } -- GitLab From adfd557903a03ee7535d8bdb5af821e626f72c93 Mon Sep 17 00:00:00 2001 From: Matthew Sedam Date: Tue, 21 Nov 2023 05:53:00 -0800 Subject: [PATCH 374/376] Add HAL support for CHRE reliable messages The original author of this change was Victor Berchet . Bug: 312417087 Test: atest VtsAidlHalContextHubTargetTest Test: Presubmits Change-Id: Iedc4ac99b1ae08e15fdce66e94f5c01d4f64de20 --- .../hardware/contexthub/ContextHubInfo.aidl | 1 + .../contexthub/ContextHubMessage.aidl | 2 + .../hardware/contexthub/ErrorCode.aidl | 42 ++++++++++++++++ .../hardware/contexthub/IContextHub.aidl | 1 + .../contexthub/IContextHubCallback.aidl | 1 + .../contexthub/MessageDeliveryStatus.aidl | 39 +++++++++++++++ .../hardware/contexthub/ContextHubInfo.aidl | 11 ++++- .../contexthub/ContextHubMessage.aidl | 31 ++++++++++++ .../hardware/contexthub/ErrorCode.aidl | 49 +++++++++++++++++++ .../hardware/contexthub/IContextHub.aidl | 16 ++++++ .../contexthub/IContextHubCallback.aidl | 14 ++++++ .../contexthub/MessageDeliveryStatus.aidl | 32 ++++++++++++ contexthub/aidl/default/ContextHub.cpp | 37 +++++++------- .../include/contexthub-impl/ContextHub.h | 3 ++ .../vts/VtsAidlHalContextHubTargetTest.cpp | 34 +++++++++++++ 15 files changed, 294 insertions(+), 19 deletions(-) create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl create mode 100644 contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl create mode 100644 contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl index e5735566e7..c99169eb6f 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl @@ -45,4 +45,5 @@ parcelable ContextHubInfo { byte chreApiMinorVersion; char chrePatchVersion; String[] supportedPermissions; + boolean supportsReliableMessages; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl index e38c251928..a6951a8f16 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl @@ -39,4 +39,6 @@ parcelable ContextHubMessage { int messageType; byte[] messageBody; String[] permissions; + boolean isReliable; + int messageSequenceNumber; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl new file mode 100644 index 0000000000..8924658357 --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@Backing(type="byte") @VintfStability +enum ErrorCode { + OK = 0, + TRANSIENT_ERROR, + PERMANENT_ERROR, + PERMISSION_DENIED, + DESTINATION_NOT_FOUND, +} diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl index de8d752695..7341e0ec75 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl @@ -48,5 +48,6 @@ interface IContextHub { long[] getPreloadedNanoappIds(in int contextHubId); void onNanSessionStateChanged(in android.hardware.contexthub.NanSessionStateUpdate update); void setTestMode(in boolean enable); + void sendMessageDeliveryStatusToHub(in int contextHubId, in android.hardware.contexthub.MessageDeliveryStatus messageDeliveryStatus); const int EX_CONTEXT_HUB_UNSPECIFIED = (-1) /* -1 */; } diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl index 4e99082ea8..70f69c608b 100644 --- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl @@ -39,6 +39,7 @@ interface IContextHubCallback { void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt); void handleTransactionResult(in int transactionId, in boolean success); void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request); + void handleMessageDeliveryStatus(in char hostEndpointId, in android.hardware.contexthub.MessageDeliveryStatus messageDeliveryStatus); byte[16] getUuid(); String getName(); const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000; diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl new file mode 100644 index 0000000000..40dac13f1c --- /dev/null +++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.contexthub; +@VintfStability +parcelable MessageDeliveryStatus { + int messageSequenceNumber; + android.hardware.contexthub.ErrorCode errorCode; +} diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl index c0fa702f0b..42dba1053d 100644 --- a/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl +++ b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl @@ -33,7 +33,9 @@ parcelable ContextHubInfo { /** Peak MIPs this platform can deliver */ float peakMips; - /** The maximum length in bytes of the message that can be sent to the Context Hub. */ + /** + * The maximum length in bytes of a message sent to the Context Hub. + */ int maxSupportedMessageLengthBytes; /** @@ -61,4 +63,11 @@ parcelable ContextHubInfo { * are granted in order to communicate with them. */ String[] supportedPermissions; + + /** + * True if the Context Hub supports reliable messages. False otherwise, in which case + * ContextHubMessage.isReliable must always be set to false. See + * ContextHubMessage.isReliable for more information. + */ + boolean supportsReliableMessages; } diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl index 95d478e6c2..3cd20caa0d 100644 --- a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl +++ b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl @@ -50,4 +50,35 @@ parcelable ContextHubMessage { * of the permissions that the sending nanoapp is using. */ String[] permissions; + + /** + * Whether the message is reliable. + * + * For reliable messages, the receiver is expected to acknowledge the reception of + * the message by sending a message delivery status back to the sender. Acknowledgment of + * the message must be returned within 1 second. + * + * For reliable messages sent by the host, the Context Hub invokes + * IContextHubCallback#handleMessageDeliveryStatus to report the status. + * + * For reliable messages sent by the Context Hub, the host calls + * IContextHub#sendMessageDeliveryStatusToHub to report the status. + */ + boolean isReliable; + + /** + * The sequence number for a reliable message. For less than 2^32 messages, each message sent + * from a Context Hub will have a unique sequence number generated by the Context Hub, and the + * sequence numbers are guaranteed to not be reused for unacknowledged messages. For messages + * sent to the Context Hub, sequence numbers are only guaranteed to be unique within the scope + * of a given hostEndPoint. The sequence number may be reused if more than 2^32 messages are + * sent, due to the size limit of int. + * + * The sequence number is used only for reliable messages. There is no guarantee of strict + * ordering of messages. The recipient may receive messages with gaps between the sequence + * numbers. This is not an indication of a missed message. + * + * See isReliable for more information. + */ + int messageSequenceNumber; } diff --git a/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl b/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl new file mode 100644 index 0000000000..22e7ea1bb3 --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.contexthub; + +@VintfStability +@Backing(type="byte") +enum ErrorCode { + /** + * No Error. + */ + OK = 0, + + /** + * A generic transient error. The sender may retry the + * operation, but there is no guarantee of success. + */ + TRANSIENT_ERROR, + + /** + * A generic permanent error. The sender should not retry the operation. + */ + PERMANENT_ERROR, + + /** + * The request failed because the sender does not have necessary permissions. + * The sender should not retry the operation. + */ + PERMISSION_DENIED, + + /** + * The request failed because the destination was not found. + * The sender should not retry the operation. + */ + DESTINATION_NOT_FOUND, +} diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl index 9683d2d7e4..d8de0c1d0a 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl @@ -20,6 +20,7 @@ import android.hardware.contexthub.ContextHubInfo; import android.hardware.contexthub.ContextHubMessage; import android.hardware.contexthub.HostEndpointInfo; import android.hardware.contexthub.IContextHubCallback; +import android.hardware.contexthub.MessageDeliveryStatus; import android.hardware.contexthub.NanSessionStateUpdate; import android.hardware.contexthub.NanoappBinary; import android.hardware.contexthub.NanoappInfo; @@ -235,6 +236,21 @@ interface IContextHub { */ void setTestMode(in boolean enable); + /** + * Sends a message delivery status to the Context Hub in response to receiving a + * ContextHubMessage with isReliable=true. Each reliable message should have a + * messageDeliveryStatus response. This method sends the message delivery status + * back to the Context Hub. + * + * @param contextHubId The identifier of the Context Hub. + * @param messageDeliveryStatus The status to be sent. + * + * @throws EX_UNSUPPORTED_OPERATION if ContextHubInfo.supportsReliableMessages is false for + * this hub. + */ + void sendMessageDeliveryStatusToHub( + in int contextHubId, in MessageDeliveryStatus messageDeliveryStatus); + /** * Error codes that are used as service specific errors with the AIDL return * value EX_SERVICE_SPECIFIC. diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl index ebfc4d8c9f..1aa07768f8 100644 --- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl +++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl @@ -18,6 +18,7 @@ package android.hardware.contexthub; import android.hardware.contexthub.AsyncEventType; import android.hardware.contexthub.ContextHubMessage; +import android.hardware.contexthub.MessageDeliveryStatus; import android.hardware.contexthub.NanSessionRequest; import android.hardware.contexthub.NanoappInfo; @@ -90,6 +91,19 @@ interface IContextHubCallback { */ void handleNanSessionRequest(in NanSessionRequest request); + /** + * This callback is passed by the Contexthub service to the HAL + * implementation to allow the HAL to send the response for a reliable message. + * The response is the message delivery status of a recently sent message. See + * sendMessageDeliveryStatusToHub() for more details. + * + * @param hostEndPointId The ID of the host endpoint associated with this message delivery + * status. + * @param messageDeliveryStatus The status to be sent. + */ + void handleMessageDeliveryStatus( + in char hostEndpointId, in MessageDeliveryStatus messageDeliveryStatus); + /** * This callback is passed to the HAL implementation to allow the HAL to request a UUID that * uniquely identifies a client. diff --git a/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl b/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl new file mode 100644 index 0000000000..ae425b322b --- /dev/null +++ b/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.contexthub; + +import android.hardware.contexthub.ErrorCode; + +@VintfStability +parcelable MessageDeliveryStatus { + /** + * The messageSequenceNumber of the ContextHubMessage to which this status applies. + */ + int messageSequenceNumber; + + /** + * The error code associated with this status. + */ + ErrorCode errorCode; +} diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp index 5272957f07..bd483d7101 100644 --- a/contexthub/aidl/default/ContextHub.cpp +++ b/contexthub/aidl/default/ContextHub.cpp @@ -16,10 +16,7 @@ #include "contexthub-impl/ContextHub.h" -namespace aidl { -namespace android { -namespace hardware { -namespace contexthub { +namespace aidl::android::hardware::contexthub { using ::ndk::ScopedAStatus; @@ -34,10 +31,11 @@ ScopedAStatus ContextHub::getContextHubs(std::vector* out_contex hub.chrePlatformId = UINT64_C(0x476f6f6754000000); hub.chreApiMajorVersion = 1; hub.chreApiMinorVersion = 6; + hub.supportsReliableMessages = false; out_contextHubInfos->push_back(hub); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } // We don't expose any nanoapps for the default impl, therefore all nanoapp-related APIs fail. @@ -63,14 +61,14 @@ ScopedAStatus ContextHub::enableNanoapp(int32_t /* in_contextHubId */, int64_t / } ScopedAStatus ContextHub::onSettingChanged(Setting /* in_setting */, bool /*in_enabled */) { - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) { if (in_contextHubId == kMockHubId && mCallback != nullptr) { std::vector nanoapps; mCallback->handleNanoappInfo(nanoapps); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } else { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } @@ -85,18 +83,18 @@ ScopedAStatus ContextHub::getPreloadedNanoappIds(int32_t /* in_contextHubId */, for (uint64_t i = 0; i < 10; ++i) { out_preloadedNanoappIds->push_back(i); } - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ScopedAStatus ContextHub::onNanSessionStateChanged(const NanSessionStateUpdate& /*in_update*/) { - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId, const std::shared_ptr& in_cb) { if (in_contextHubId == kMockHubId) { mCallback = in_cb; - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } else { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } @@ -108,20 +106,20 @@ ScopedAStatus ContextHub::sendMessageToHub(int32_t in_contextHubId, // Return true here to indicate that the HAL has accepted the message. // Successful delivery of the message to a nanoapp should be handled at // a higher level protocol. - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } else { return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } } ScopedAStatus ContextHub::setTestMode(bool /* enable */) { - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) { mConnectedHostEndpoints.insert(in_info.hostEndpointId); - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) { @@ -129,10 +127,13 @@ ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) mConnectedHostEndpoints.erase(in_hostEndpointId); } - return ndk::ScopedAStatus::ok(); + return ScopedAStatus::ok(); } -} // namespace contexthub -} // namespace hardware -} // namespace android -} // namespace aidl +ScopedAStatus ContextHub::sendMessageDeliveryStatusToHub( + int32_t /* in_contextHubId */, + const MessageDeliveryStatus& /* in_messageDeliveryStatus */) { + return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); +} + +} // namespace aidl::android::hardware::contexthub diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h index 7a2cfd1702..72e8b3b66e 100644 --- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h +++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h @@ -49,6 +49,9 @@ class ContextHub : public BnContextHub { ::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override; ::ndk::ScopedAStatus onNanSessionStateChanged(const NanSessionStateUpdate& in_update) override; + ::ndk::ScopedAStatus sendMessageDeliveryStatusToHub( + int32_t in_contextHubId, + const MessageDeliveryStatus& in_messageDeliveryStatus) override; private: static constexpr uint32_t kMockHubId = 0; diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp index 76b25b688e..fd55b80fde 100644 --- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp +++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp @@ -36,9 +36,11 @@ using ::android::binder::Status; using ::android::hardware::contexthub::AsyncEventType; using ::android::hardware::contexthub::ContextHubInfo; using ::android::hardware::contexthub::ContextHubMessage; +using ::android::hardware::contexthub::ErrorCode; using ::android::hardware::contexthub::HostEndpointInfo; using ::android::hardware::contexthub::IContextHub; using ::android::hardware::contexthub::IContextHubCallbackDefault; +using ::android::hardware::contexthub::MessageDeliveryStatus; using ::android::hardware::contexthub::NanoappBinary; using ::android::hardware::contexthub::NanoappInfo; using ::android::hardware::contexthub::NanoappRpcService; @@ -132,6 +134,12 @@ class EmptyContextHubCallback : public android::hardware::contexthub::BnContextH return Status::ok(); } + Status handleMessageDeliveryStatus( + char16_t /* hostEndPointId */, + const MessageDeliveryStatus& /* messageDeliveryStatus */) override { + return Status::ok(); + } + Status getUuid(std::array* out_uuid) override { *out_uuid = kUuid; return Status::ok(); @@ -172,6 +180,12 @@ class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCall return Status::ok(); } + Status handleMessageDeliveryStatus( + char16_t /* hostEndPointId */, + const MessageDeliveryStatus& /* messageDeliveryStatus */) override { + return Status::ok(); + } + Status getUuid(std::array* out_uuid) override { *out_uuid = kUuid; return Status::ok(); @@ -248,6 +262,12 @@ class TransactionResultCallback : public android::hardware::contexthub::BnContex return Status::ok(); } + Status handleMessageDeliveryStatus( + char16_t /* hostEndPointId */, + const MessageDeliveryStatus& /* messageDeliveryStatus */) override { + return Status::ok(); + } + Status getUuid(std::array* out_uuid) override { *out_uuid = kUuid; return Status::ok(); @@ -431,6 +451,20 @@ TEST_P(ContextHubAidl, TestNanSessionStateChange) { } } +TEST_P(ContextHubAidl, TestSendMessageDeliveryStatusToHub) { + MessageDeliveryStatus messageDeliveryStatus; + messageDeliveryStatus.messageSequenceNumber = 123; + messageDeliveryStatus.errorCode = ErrorCode::OK; + + Status status = contextHub->sendMessageDeliveryStatusToHub(getHubId(), messageDeliveryStatus); + if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION || + status.transactionError() == android::UNKNOWN_TRANSACTION) { + GTEST_SKIP() << "Not supported -> old API; or not implemented"; + } else { + EXPECT_TRUE(status.isOk()); + } +} + std::string PrintGeneratedTest(const testing::TestParamInfo& info) { return std::string("CONTEXT_HUB_ID_") + std::to_string(std::get<1>(info.param)); } -- GitLab From aba14a2412b07e3d3255d9076410f22da95a367f Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 13 Dec 2023 13:11:22 -0800 Subject: [PATCH 375/376] Fix HD tune test in bcradio VTS Bug: 315206962 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Icfdc9af0a18896d6b60900015c9e2063774dff7d --- .../aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 79d3e60e8d..2668a97c4f 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -750,7 +750,7 @@ TEST_P(BroadcastRadioHalTest, HdTune) { ProgramInfo infoCb = mCallback->getCurrentProgramInfo(); LOG(DEBUG) << "Current program info: " << infoCb.toString(); // it should tune exactly to what was requested - EXPECT_EQ(infoCb.selector, hdSel); + EXPECT_EQ(infoCb.selector.primaryId, hdSel.primaryId); EXPECT_EQ(infoCb.physicallyTunedTo, physicallyTunedToExpected); } -- GitLab From af860de0fc50c6bea421cc9822c498f501ecd479 Mon Sep 17 00:00:00 2001 From: Les Lee Date: Thu, 7 Dec 2023 04:45:03 +0000 Subject: [PATCH 376/376] vts: Add vts to test setVoipMode Bug: 295885471 Test: atest -c VtsHalWifiChipTargetTest Change-Id: I976f80006aeb88bde2ae34ca4f9be72cea727d9e --- wifi/aidl/vts/functional/Android.bp | 18 +++++++---- .../vts/functional/wifi_chip_aidl_test.cpp | 30 +++++++++++++++++++ wifi/hostapd/aidl/vts/functional/Android.bp | 3 +- .../supplicant/aidl/vts/functional/Android.bp | 9 ++++-- 4 files changed, 50 insertions(+), 10 deletions(-) diff --git a/wifi/aidl/vts/functional/Android.bp b/wifi/aidl/vts/functional/Android.bp index 1277182493..6896110610 100644 --- a/wifi/aidl/vts/functional/Android.bp +++ b/wifi/aidl/vts/functional/Android.bp @@ -39,7 +39,8 @@ cc_test { ], static_libs: [ "VtsHalWifiTargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], test_suites: [ @@ -64,7 +65,8 @@ cc_test { ], static_libs: [ "VtsHalWifiTargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], test_suites: [ @@ -89,7 +91,8 @@ cc_test { ], static_libs: [ "VtsHalWifiTargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], test_suites: [ @@ -114,7 +117,8 @@ cc_test { ], static_libs: [ "VtsHalWifiTargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], test_suites: [ @@ -139,7 +143,8 @@ cc_test { ], static_libs: [ "VtsHalWifiTargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], test_suites: [ @@ -163,7 +168,8 @@ cc_library_static { "libnativehelper", ], static_libs: [ - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system-iface", ], } diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp index 740f8332b7..a1b9ce1654 100644 --- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp +++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp @@ -872,6 +872,36 @@ TEST_P(WifiChipAidlTest, CreateBridgedApIfaceAndremoveIfaceInstanceFromBridgedAp EXPECT_EQ(instances_after_remove.size(), 1); } +/* + * SetVoipMode_off + * Tests the setVoipMode() API with VoIP mode OFF. + */ +TEST_P(WifiChipAidlTest, SetVoipMode_off) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_VOIP_MODE)) { + auto status = wifi_chip_->setVoipMode(IWifiChip::VoipMode::OFF); + EXPECT_TRUE(status.isOk()); + } else { + GTEST_SKIP() << "setVoipMode() is not supported by vendor."; + } +} + +/* + * SetVoipMode_voice + * Tests the setVoipMode() API with VoIP mode VOICE. + */ +TEST_P(WifiChipAidlTest, SetVoipMode_voice) { + configureChipForConcurrencyType(IfaceConcurrencyType::STA); + int32_t features = getChipFeatureSet(wifi_chip_); + if (features & static_cast(IWifiChip::FeatureSetMask::SET_VOIP_MODE)) { + auto status = wifi_chip_->setVoipMode(IWifiChip::VoipMode::VOICE); + EXPECT_TRUE(status.isOk()); + } else { + GTEST_SKIP() << "setVoipMode() is not supported by vendor."; + } +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipAidlTest); INSTANTIATE_TEST_SUITE_P(WifiTest, WifiChipAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)), diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp index ff35056076..87eee824a0 100644 --- a/wifi/hostapd/aidl/vts/functional/Android.bp +++ b/wifi/hostapd/aidl/vts/functional/Android.bp @@ -36,7 +36,8 @@ cc_test { "android.hardware.wifi@1.4", "android.hardware.wifi@1.5", "android.hardware.wifi@1.6", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "libwifi-system", "libwifi-system-iface", "VtsHalWifiTargetTestUtil", diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp index b2356a0c12..96c13e701f 100644 --- a/wifi/supplicant/aidl/vts/functional/Android.bp +++ b/wifi/supplicant/aidl/vts/functional/Android.bp @@ -51,7 +51,8 @@ cc_test { "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "VtsHalWifiTargetTestUtil", ], test_suites: [ @@ -88,7 +89,8 @@ cc_test { "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "VtsHalWifiTargetTestUtil", ], test_suites: [ @@ -125,7 +127,8 @@ cc_test { "VtsHalWifiV1_0TargetTestUtil", "VtsHalWifiV1_5TargetTestUtil", "VtsHalWifiSupplicantV1_0TargetTestUtil", - "android.hardware.wifi-V1-ndk", + "android.hardware.wifi.common-V1-ndk", + "android.hardware.wifi-V2-ndk", "VtsHalWifiTargetTestUtil", ], test_suites: [ -- GitLab