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

Commit 713d22e0 authored by Steven Moreland's avatar Steven Moreland Committed by Gerrit Code Review
Browse files

Merge changes from topic "health-aidl"

* changes:
  health: Add to compatibility matrix.
  health: separate_platform_variant = false
  health: Convert of health HAL to AIDL
parents 8bfd9906 21a22cec
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -276,6 +276,15 @@
            <instance>default</instance>
        </interface>
    </hal>
    <!-- TODO(b/177269435): require health AIDL HAL and deprecate HIDL HAL -->
    <hal format="aidl" optional="true">
        <name>android.hardware.health</name>
        <version>1</version>
        <interface>
            <name>IHealth</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.health.storage</name>
        <version>1</version>

health/aidl/Android.bp

0 → 100644
+63 −0
Original line number Diff line number Diff line
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

aidl_interface {
    name: "android.hardware.health",
    vendor_available: true,
    srcs: ["android/hardware/health/*.aidl"],
    stability: "vintf",
    backend: {
        cpp: {
            enabled: false,
        },
        java: {
            enabled: true,
            sdk_version: "module_current",
        },
        ndk: {
            separate_platform_variant: false,
            vndk: {
                enabled: true,
            },
        },
    },
}

cc_library {
    name: "android.hardware.health-translate-ndk",
    vendor_available: true,
    srcs: ["android/hardware/health/translate-ndk.cpp"],
    shared_libs: [
        "libbinder_ndk",
        "libhidlbase",
        "android.hardware.health-V1-ndk",
        "android.hardware.health@2.0",
        "android.hardware.health@2.1",
    ],
    export_include_dirs: ["include"],
    export_shared_lib_headers: [
        "android.hardware.health@2.0",
        "android.hardware.health@2.1",
    ],
}

java_library {
    name: "android.hardware.health-translate-java",
    srcs: ["android/hardware/health/Translate.java"],
    libs: [
        "android.hardware.health-V1-java",
        "android.hardware.health-V2.0-java",
        "android.hardware.health-V2.1-java",
    ],
}
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.health;
@Backing(type="int") @VintfStability
enum BatteryCapacityLevel {
  UNSUPPORTED = -1,
  UNKNOWN = 0,
  CRITICAL = 1,
  LOW = 2,
  NORMAL = 3,
  HIGH = 4,
  FULL = 5,
}
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.health;
@Backing(type="int") @VintfStability
enum BatteryHealth {
  UNKNOWN = 1,
  GOOD = 2,
  OVERHEAT = 3,
  DEAD = 4,
  OVER_VOLTAGE = 5,
  UNSPECIFIED_FAILURE = 6,
  COLD = 7,
}
+42 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.health;
@Backing(type="int") @VintfStability
enum BatteryStatus {
  UNKNOWN = 1,
  CHARGING = 2,
  DISCHARGING = 3,
  NOT_CHARGING = 4,
  FULL = 5,
}
Loading