Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f86271db authored by Yifan Hong's avatar Yifan Hong
Browse files

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
cbfb15e0.

Bug: 63702641
Test: boots
Change-Id: Id6596b04daaa19ae97d783c7a8bc111a43725334
parent 9aec6164
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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",
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.hardware.health@2.0;

import @1.0::HealthInfo;

/**
 * IHealthInfoCallback is the callback interface to
 * {@link IHealthInfoBus.registerCallback}.
+0 −37
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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 health {
namespace V2_0 {

using V1_0::BatteryStatus;
using V1_0::HealthInfo;

// Test environment for graphics.composer
class HealthHidlEnvironment : public VtsHalHidlTargetTestEnvBase {