Health@2.0: IHealthInfoCallback uses 1.0 HealthInfo.
BatteryService does not use these fields for posting
sticky intents.
This is a partial revert of commit
cbfb15e0b89d8247ce2ef2a21ee5f691f1c73be5.
Bug: 63702641
Test: boots
Change-Id: Id6596b04daaa19ae97d783c7a8bc111a43725334
diff --git a/health/2.0/Android.bp b/health/2.0/Android.bp
index 8281a84..97265ec 100644
--- a/health/2.0/Android.bp
+++ b/health/2.0/Android.bp
@@ -82,7 +82,6 @@
":android.hardware.health@2.0_hal",
],
out: [
- "android/hardware/health/V2_0/HealthInfo.java",
"android/hardware/health/V2_0/Result.java",
"android/hardware/health/V2_0/IHealth.java",
"android/hardware/health/V2_0/IHealthInfoCallback.java",
diff --git a/health/2.0/IHealthInfoCallback.hal b/health/2.0/IHealthInfoCallback.hal
index 15352ee..8e17bb9 100644
--- a/health/2.0/IHealthInfoCallback.hal
+++ b/health/2.0/IHealthInfoCallback.hal
@@ -16,6 +16,8 @@
package android.hardware.health@2.0;
+import @1.0::HealthInfo;
+
/**
* IHealthInfoCallback is the callback interface to
* {@link IHealthInfoBus.registerCallback}.
diff --git a/health/2.0/types.hal b/health/2.0/types.hal
index 0d17f9f..8c6d88f 100644
--- a/health/2.0/types.hal
+++ b/health/2.0/types.hal
@@ -26,40 +26,3 @@
NOT_FOUND,
CALLBACK_DIED,
};
-
-struct HealthInfo {
- /**
- * Legacy information from 1.0 HAL.
- *
- * If a value is not available, it must be set to 0, UNKNOWN, or empty
- * string.
- */
- @1.0::HealthInfo legacy;
-
- /**
- * Average battery current in microamperes. Positive
- * values indicate net current entering the battery from a charge source,
- * negative values indicate net current discharging from the battery.
- * The time period over which the average is computed may depend on the
- * fuel gauge hardware and its configuration.
- *
- * If this value is not available, it must be set to 0.
- */
- int32_t batteryCurrentAverage;
-
- /**
- * Remaining battery capacity percentage of total capacity
- * (with no fractional part). This value must be in the range 0-100
- * (inclusive).
- *
- * If this value is not available, it must be set to 0.
- */
- int32_t batteryCapacity;
-
- /**
- * Battery remaining energy in nanowatt-hours.
- *
- * If this value is not available, it must be set to 0.
- */
- int64_t energyCounter;
-};
\ No newline at end of file
diff --git a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
index a19a4a4..9b86873 100644
--- a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
+++ b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "mHealthhidl_hal_test"
+#define LOG_TAG "health_hidl_hal_test"
#include <mutex>
@@ -35,6 +35,7 @@
namespace V2_0 {
using V1_0::BatteryStatus;
+using V1_0::HealthInfo;
// Test environment for graphics.composer
class HealthHidlEnvironment : public VtsHalHidlTargetTestEnvBase {