health HAL: update description + naming

Update some undefined behavior + variable naming

Bug: 371322457
Test: th
Change-Id: Ic13b275d84b1fef52923afb906ecbff7eee39bfe
This commit is contained in:
Daniel Zheng
2024-12-04 14:22:12 -08:00
parent 8127b300da
commit b4f5c0fc8e
4 changed files with 7 additions and 4 deletions

View File

@@ -60,6 +60,6 @@ parcelable HealthInfo {
android.hardware.health.BatteryChargingState chargingState;
android.hardware.health.BatteryChargingPolicy chargingPolicy;
@nullable android.hardware.health.BatteryHealthData batteryHealthData;
@nullable android.hardware.health.HingeInfo[] foldInfos;
@nullable android.hardware.health.HingeInfo[] hingeInfos;
const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = (-1) /* -1 */;
}

View File

@@ -151,5 +151,5 @@ parcelable HealthInfo {
/**
* Information about foldable hinge health. Will be an empty vector if no hinges present
*/
@nullable HingeInfo[] foldInfos;
@nullable HingeInfo[] hingeInfos;
}

View File

@@ -27,7 +27,9 @@ parcelable HingeInfo {
/**
* returns count of times a given hinge has been folded.
*
* opening fully counts as 1 fold and closing fully counts as another
* opening fully counts as 1 fold and closing fully counts as another.
* The hinge has to engage in its full range of motion to be considered
* a fold. Partial folds must not be counted.
*/
int numTimesFolded;
/**

View File

@@ -368,7 +368,8 @@ TEST_P(HealthAidl, getHingeInfo) {
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
for (auto& hinge : value) {
ASSERT_TRUE(hinge.expectedHingeLifespan > 0);
ASSERT_TRUE(hinge.expectedHingeLifespan >= 0);
ASSERT_TRUE(hinge.numTimesFolded >= 0);
}
}