Skip to content

Commit

Permalink
interfaces: add google_battery AIDL interface
Browse files Browse the repository at this point in the history
Change-Id: I960c96c2abe7b472972095ce30c00a030fd7b7b3
  • Loading branch information
anayw2001 authored and basamaryan committed Aug 10, 2023
1 parent a2aa550 commit 501fe49
Show file tree
Hide file tree
Showing 23 changed files with 586 additions and 0 deletions.
30 changes: 30 additions & 0 deletions interfaces/google_battery/Android.bp
@@ -0,0 +1,30 @@
aidl_interface {
name: "vendor.google.google_battery",

srcs: [
"vendor/google/google_battery/*.aidl",
],

stability: "vintf",
owner: "google",

backend: {
cpp: {
enabled: false,
},
java: {
enabled: true,
platform_apis: true,
},
ndk: {
enabled: false,
},
},
versions_with_info: [
{
version: "1",
imports: [],
},
],

}
@@ -0,0 +1 @@
54f883291e33c1f57833025a120210142cf2368c
@@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum BatteryHealthStatus {
UNKNOWN = -1,
NOMINAL = 0,
MARGINAL = 1,
NEEDS_REPLACEMENT = 2,
FAILED = 3,
}
@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@VintfStability
parcelable ChargingStage {
String stage;
int deadlineSecs;
}
@@ -0,0 +1,36 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum ChargingStatus {
UNKNOWN = -1,
HEALTH_COLD = 10,
HEALTH_HOT = 11,
SYSTEM_THERMAL = 20,
SYSTEM_LOAD = 21,
ADAPTER_AUTH = 30,
ADAPTER_POWER = 31,
ADAPTER_QUALITY = 32,
DEFENDER_TEMP = 40,
DEFENDER_DWELL = 41,
DEFENDER_TRICKLE = 42,
DEFENDER_DOCK = 43,
NOT_CHARGING = 100,
CHARGING = 200,
}
@@ -0,0 +1,29 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum ChargingType {
UNKNOWN = -1,
NONE = 0,
FAULT = 1,
JEITA = 2,
LONG_LIFE = 3,
ADAPTIVE = 4,
NORMAL = 5,
}
@@ -0,0 +1,26 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum DockDefendStatus {
OVERRIDE_DISABLED = -2,
SETTINGS_DISABLED = -1,
ENABLED = 0,
TRIGGERED = 1,
}
@@ -0,0 +1,33 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum Feature {
ADAPTIVE_CHARGING = 0,
TEMP_DEFEND = 1,
TRICKLE_DEFEND = 2,
DWELL_DEFEND = 3,
DREAM_DEFEND = 4,
DC_CHARGING = 5,
AGE_ADJUSTED_CHARGE_RATE = 6,
DOCK_DEFEND = 7,
BATTERY_HEALTH_INDEX = 8,
CHARGING_SPEED_INDICATOR = 9,
FEATURE_MAX = 10,
}
@@ -0,0 +1,40 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@VintfStability
interface IGoogleBattery {
void setEnable(in vendor.google.google_battery.Feature feature, in boolean enabled);
void setChargingDeadline(in int seconds);
vendor.google.google_battery.ChargingStage getChargingStageAndDeadline();
void setHealthAlwaysOn(in int soc);
int getProperty(in vendor.google.google_battery.Feature feature, in int property);
void setProperty(in vendor.google.google_battery.Feature feature, in int property, in int value);
void clearBatteryDefender();
int getAdapterId();
int getAdapterType();
int getChargingSpeed();
vendor.google.google_battery.ChargingStatus getChargingStatus();
vendor.google.google_battery.ChargingType getChargingType();
int getHealthCapacityIndex();
int getHealthImpedanceIndex();
int getHealthIndex();
vendor.google.google_battery.BatteryHealthStatus getHealthStatus();
vendor.google.google_battery.DockDefendStatus getDockDefendStatus();
const int RESULT_IO_ERROR = 1;
}
@@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum BatteryHealthStatus {
UNKNOWN = -1,
NOMINAL = 0,
MARGINAL = 1,
NEEDS_REPLACEMENT = 2,
FAILED = 3,
}
@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@VintfStability
parcelable ChargingStage {
String stage;
int deadlineSecs;
}
@@ -0,0 +1,36 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum ChargingStatus {
UNKNOWN = -1,
HEALTH_COLD = 10,
HEALTH_HOT = 11,
SYSTEM_THERMAL = 20,
SYSTEM_LOAD = 21,
ADAPTER_AUTH = 30,
ADAPTER_POWER = 31,
ADAPTER_QUALITY = 32,
DEFENDER_TEMP = 40,
DEFENDER_DWELL = 41,
DEFENDER_TRICKLE = 42,
DEFENDER_DOCK = 43,
NOT_CHARGING = 100,
CHARGING = 200,
}
@@ -0,0 +1,29 @@
///////////////////////////////////////////////////////////////////////////////
// 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 vendor.google.google_battery;
@Backing(type="int") @VintfStability
enum ChargingType {
UNKNOWN = -1,
NONE = 0,
FAULT = 1,
JEITA = 2,
LONG_LIFE = 3,
ADAPTIVE = 4,
NORMAL = 5,
}

0 comments on commit 501fe49

Please sign in to comment.