From f86271dbcd7781a51d8b6b21ffbb76ed8ab1fbb6 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 6 Nov 2017 12:52:20 -0800 Subject: [PATCH] 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 --- health/2.0/Android.bp | 1 - health/2.0/IHealthInfoCallback.hal | 2 + health/2.0/types.hal | 37 ------------------- .../functional/VtsHalHealthV2_0TargetTest.cpp | 3 +- 4 files changed, 4 insertions(+), 39 deletions(-) diff --git a/health/2.0/Android.bp b/health/2.0/Android.bp index 8281a84e5b..97265eca6f 100644 --- a/health/2.0/Android.bp +++ b/health/2.0/Android.bp @@ -82,7 +82,6 @@ genrule { ":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 15352ee4b1..8e17bb96bc 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 0d17f9fe05..8c6d88f314 100644 --- a/health/2.0/types.hal +++ b/health/2.0/types.hal @@ -26,40 +26,3 @@ enum Result : @1.0::Result { 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 a19a4a4154..9b86873465 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 @@ -35,6 +35,7 @@ namespace health { namespace V2_0 { using V1_0::BatteryStatus; +using V1_0::HealthInfo; // Test environment for graphics.composer class HealthHidlEnvironment : public VtsHalHidlTargetTestEnvBase {