Health HAL: add hinge info

Add a hingeinfo field to the Health HAL that returns information related to a
foldable's hinge health + rated life expectancy.

Ignore-AOSP-First: deprecated_ota_test compilation
Bug: 371322457
Test: th
Change-Id: I23688be268afcc542fa4bc90af37933e9c1c36e7
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 45a1e40..c47ddca 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -360,6 +360,19 @@
 }
 
 /*
+ * Tests the values returned by getHingeInfo() from interface IHealth.
+ */
+TEST_P(HealthAidl, getHingeInfo) {
+    std::vector<HingeInfo> value;
+    auto status = health->getHingeInfo(&value);
+    ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+    if (!status.isOk()) return;
+    for (auto& hinge : value) {
+        ASSERT_TRUE(hinge.expectedHingeLifespan > 0);
+    }
+}
+
+/*
  * Tests the values returned by getDiskStats() from interface IHealth.
  */
 TEST_P(HealthAidl, getDiskStats) {