Merge "health: fix vts setChargingPolicy failing" am: 5d07cebba1 am: 6680f3242b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2499312
Change-Id: Ia191f55d40fc4f4d66155248031b11c4780734ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 69d4789..783ce11 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -257,7 +257,7 @@
BatteryChargingPolicy value;
/* set ChargingPolicy*/
- status = health->setChargingPolicy(static_cast<BatteryChargingPolicy>(2)); // LONG_LIFE
+ status = health->setChargingPolicy(BatteryChargingPolicy::LONG_LIFE);
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
@@ -265,7 +265,9 @@
status = health->getChargingPolicy(&value);
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
- ASSERT_THAT(static_cast<int>(value), Eq(2));
+ // the result of getChargingPolicy will be one of default(1), ADAPTIVE_AON(2)
+ // ADAPTIVE_AC(3) or LONG_LIFE(4). default(1) means NOT_SUPPORT
+ ASSERT_THAT(static_cast<int>(value), AnyOf(Eq(1), Eq(4)));
}
MATCHER(IsValidHealthData, "") {