summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-05-12 01:03:52 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-12 01:03:52 +0000
commit0c14c52e2634869e71058ff285f25108d0b6ed80 (patch)
tree17efbfdf7029d2d63d910c0f81f6a409a4636567
parentc81bca1550f2c6379df4fb43e9a7d2b1cdbe679d (diff)
parentb4f96631f81fa8db554093b51810c43e6c43526b (diff)
downloadinterfaces-android14-gsi.tar.gz
Snap for 10113759 from eda0e07ccb8502a2247a036c4ede3e41d64f3ac9 to udc-release am: b4f96631f8android14-gsi
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/hardware/interfaces/+/23186871 Change-Id: Ib602d0cdf1c63bb4069043aee8a0837331dda240 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp9
-rw-r--r--cameraservice/vts/functional/VtsAidlCameraServiceTargetTest.cpp9
2 files changed, 12 insertions, 6 deletions
diff --git a/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp b/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp
index 402d291..454c3f1 100644
--- a/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp
+++ b/automotive/powerpolicy/aidl/vts/VtsAidlPowerPolicyTargetTest.cpp
@@ -21,6 +21,7 @@
#include <aidl/android/frameworks/automotive/powerpolicy/CarPowerPolicyFilter.h>
#include <aidl/android/frameworks/automotive/powerpolicy/ICarPowerPolicyServer.h>
#include <aidl/android/frameworks/automotive/powerpolicy/PowerComponent.h>
+#include <android-base/stringprintf.h>
#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
#include <android/binder_status.h>
@@ -40,6 +41,7 @@ using ::android::ProcessState;
using ::android::status_t;
using ::android::String16;
using ::android::UNKNOWN_ERROR;
+using ::android::base::StringPrintf;
using ::ndk::ScopedAStatus;
using ::ndk::SpAIBinder;
@@ -76,9 +78,12 @@ TEST_P(PowerPolicyAidlTest, TestGetCurrentPowerPolicy) {
TEST_P(PowerPolicyAidlTest, TestGetPowerComponentState) {
bool state;
for (const auto componentId : ndk::enum_range<PowerComponent>()) {
+ if (componentId >= PowerComponent::MINIMUM_CUSTOM_COMPONENT_VALUE) {
+ continue;
+ }
ScopedAStatus status = powerPolicyServer->getPowerComponentState(componentId, &state);
-
- ASSERT_TRUE(status.isOk());
+ std::string errMsg = StringPrintf("Getting state of component(%d) fails", componentId);
+ ASSERT_TRUE(status.isOk()) << errMsg;
}
}
diff --git a/cameraservice/vts/functional/VtsAidlCameraServiceTargetTest.cpp b/cameraservice/vts/functional/VtsAidlCameraServiceTargetTest.cpp
index 35e7ce2..9b5eab9 100644
--- a/cameraservice/vts/functional/VtsAidlCameraServiceTargetTest.cpp
+++ b/cameraservice/vts/functional/VtsAidlCameraServiceTargetTest.cpp
@@ -106,12 +106,12 @@ class CameraServiceListener : public BnCameraServiceListener {
EXPECT_NE(mCameraStatuses.find(in_cameraId), mCameraStatuses.end());
EXPECT_EQ(mCameraStatuses[in_cameraId], CameraDeviceStatus::STATUS_PRESENT);
- if (in_status == CameraDeviceStatus::STATUS_NOT_PRESENT) {
- auto res = mUnavailablePhysicalCameras[in_cameraId].emplace(in_physicalCameraId);
- EXPECT_TRUE(res.second);
- } else {
+ if (in_status == CameraDeviceStatus::STATUS_PRESENT) {
auto res = mUnavailablePhysicalCameras[in_cameraId].erase(in_physicalCameraId);
EXPECT_EQ(res, 1);
+ } else {
+ auto res = mUnavailablePhysicalCameras[in_cameraId].emplace(in_physicalCameraId);
+ EXPECT_TRUE(res.second);
}
return ndk::ScopedAStatus::ok();
}
@@ -368,6 +368,7 @@ class VtsAidlCameraServiceTargetTest : public ::testing::TestWithParam<std::stri
ndk::ScopedAStatus ret = mCameraService->addListener(listener, &cameraStatuses);
EXPECT_TRUE(ret.isOk());
+ listener->initializeStatuses(cameraStatuses);
for (const auto& it : cameraStatuses) {
CameraMetadata rawMetadata;