diff --git a/interfaces/health/aidl_api/vendor.lineage.health/1/.hash b/interfaces/health/aidl_api/vendor.lineage.health/1/.hash index 79798d87..fea0a22f 100644 --- a/interfaces/health/aidl_api/vendor.lineage.health/1/.hash +++ b/interfaces/health/aidl_api/vendor.lineage.health/1/.hash @@ -1 +1 @@ -33fe8d162b07b2c4b66feccb70a5e45628e9e241 +1fdc8ed3c63df6d1444b17cd4d1ba6e6833c7337 diff --git a/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingControlSupportedMode.aidl b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingControlSupportedMode.aidl index b19e2cda..3d7dfe22 100644 --- a/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingControlSupportedMode.aidl +++ b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingControlSupportedMode.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 The LineageOS Project + * Copyright (C) 2022-2025 The LineageOS Project * * SPDX-License-Identifier: Apache-2.0 */ @@ -24,7 +24,8 @@ package vendor.lineage.health; @Backing(type="int") @VintfStability enum ChargingControlSupportedMode { - TOGGLE = 1, - BYPASS = 2, - DEADLINE = 4, + TOGGLE = (1 << 0) /* 1 */, + BYPASS = (1 << 1) /* 2 */, + DEADLINE = (1 << 2) /* 4 */, + LIMIT = (1 << 3) /* 8 */, } diff --git a/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingLimitInfo.aidl b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingLimitInfo.aidl new file mode 100644 index 00000000..63d95682 --- /dev/null +++ b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/ChargingLimitInfo.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023-2025 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ +/////////////////////////////////////////////////////////////////////////////// +// 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 -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 vendor.lineage.health; +@JavaDerive(toString=true) @VintfStability +parcelable ChargingLimitInfo { + int max; + int min; +} diff --git a/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/IChargingControl.aidl b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/IChargingControl.aidl index 4ea51abd..3c124a32 100644 --- a/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/IChargingControl.aidl +++ b/interfaces/health/aidl_api/vendor.lineage.health/1/vendor/lineage/health/IChargingControl.aidl @@ -28,4 +28,7 @@ interface IChargingControl { void setChargingEnabled(in boolean enabled); void setChargingDeadline(in long deadline); int getSupportedMode(); + long getChargingDeadline(); + vendor.lineage.health.ChargingLimitInfo getChargingLimit(); + void setChargingLimit(in vendor.lineage.health.ChargingLimitInfo limit); } diff --git a/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingControlSupportedMode.aidl b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingControlSupportedMode.aidl index b19e2cda..3d7dfe22 100644 --- a/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingControlSupportedMode.aidl +++ b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingControlSupportedMode.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 The LineageOS Project + * Copyright (C) 2022-2025 The LineageOS Project * * SPDX-License-Identifier: Apache-2.0 */ @@ -24,7 +24,8 @@ package vendor.lineage.health; @Backing(type="int") @VintfStability enum ChargingControlSupportedMode { - TOGGLE = 1, - BYPASS = 2, - DEADLINE = 4, + TOGGLE = (1 << 0) /* 1 */, + BYPASS = (1 << 1) /* 2 */, + DEADLINE = (1 << 2) /* 4 */, + LIMIT = (1 << 3) /* 8 */, } diff --git a/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingLimitInfo.aidl b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingLimitInfo.aidl new file mode 100644 index 00000000..63d95682 --- /dev/null +++ b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/ChargingLimitInfo.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023-2025 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ +/////////////////////////////////////////////////////////////////////////////// +// 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 -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 vendor.lineage.health; +@JavaDerive(toString=true) @VintfStability +parcelable ChargingLimitInfo { + int max; + int min; +} diff --git a/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/IChargingControl.aidl b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/IChargingControl.aidl index 4ea51abd..3c124a32 100644 --- a/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/IChargingControl.aidl +++ b/interfaces/health/aidl_api/vendor.lineage.health/current/vendor/lineage/health/IChargingControl.aidl @@ -28,4 +28,7 @@ interface IChargingControl { void setChargingEnabled(in boolean enabled); void setChargingDeadline(in long deadline); int getSupportedMode(); + long getChargingDeadline(); + vendor.lineage.health.ChargingLimitInfo getChargingLimit(); + void setChargingLimit(in vendor.lineage.health.ChargingLimitInfo limit); } diff --git a/interfaces/health/vendor/lineage/health/ChargingControlSupportedMode.aidl b/interfaces/health/vendor/lineage/health/ChargingControlSupportedMode.aidl index a1c8136d..0b8b56fc 100644 --- a/interfaces/health/vendor/lineage/health/ChargingControlSupportedMode.aidl +++ b/interfaces/health/vendor/lineage/health/ChargingControlSupportedMode.aidl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 The LineageOS Project + * Copyright (C) 2022-2025 The LineageOS Project * * SPDX-License-Identifier: Apache-2.0 */ @@ -22,4 +22,9 @@ enum ChargingControlSupportedMode { * The device supports control charging by specifying the deadline */ DEADLINE = 1 << 2, + + /** + * The device supports control charging by specifying the limit + */ + LIMIT = 1 << 3, } diff --git a/interfaces/health/vendor/lineage/health/ChargingLimitInfo.aidl b/interfaces/health/vendor/lineage/health/ChargingLimitInfo.aidl new file mode 100644 index 00000000..d40c34d0 --- /dev/null +++ b/interfaces/health/vendor/lineage/health/ChargingLimitInfo.aidl @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2023-2025 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package vendor.lineage.health; + +@JavaDerive(toString=true) @VintfStability +parcelable ChargingLimitInfo { + int max; + int min; +} diff --git a/interfaces/health/vendor/lineage/health/IChargingControl.aidl b/interfaces/health/vendor/lineage/health/IChargingControl.aidl index 5b012834..669a3de6 100644 --- a/interfaces/health/vendor/lineage/health/IChargingControl.aidl +++ b/interfaces/health/vendor/lineage/health/IChargingControl.aidl @@ -6,6 +6,8 @@ package vendor.lineage.health; +import vendor.lineage.health.ChargingLimitInfo; + @VintfStability interface IChargingControl { /** @@ -48,4 +50,38 @@ interface IChargingControl { * @return a bitmask of ChargingControlSupportedMode. */ int getSupportedMode(); + + /** + * Get the charging control deadline, if deadline mode is supported. + * + * @return the deadline in seconds. + * If error: + * - Return exception with code EX_ILLEGAL_STATE + * if the value can't be determined from the driver. + * - Return service specific error with code STATUS_UNKNOWN + * for other errors. + */ + long getChargingDeadline(); + + /** + * Get the charging control limit, if limit mode is supported. + * + * @return the charging control limit. + * If error: + * - Return exception with code EX_ILLEGAL_STATE + * if the value can't be determined from the driver. + * - Return service specific error with code STATUS_UNKNOWN + * for other errors. + */ + ChargingLimitInfo getChargingLimit(); + + /** + * Set the charging control limit, if limit mode is supported. + * + * @return nothing if successful. + * If error: + * - Return service specific error with code STATUS_UNKNOWN + * for other errors. + */ + void setChargingLimit(in ChargingLimitInfo limit); }