mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
health: fix vts setChargingPolicy failing
Bug: 274308314 Test: m android.hardware.health-update-api Change-Id: I0f1a41d86d6998f061a29a51b9d1cf43a47949c2 Signed-off-by: Jack Wu <wjack@google.com>
This commit is contained in:
@@ -257,7 +257,7 @@ TEST_P(HealthAidl, setChargingPolicy) {
|
||||
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 @@ TEST_P(HealthAidl, setChargingPolicy) {
|
||||
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, "") {
|
||||
|
||||
Reference in New Issue
Block a user