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

Commit ea68502f authored by Benjamin Schwartz's avatar Benjamin Schwartz
Browse files

Create Power Stats AIDL interface

Bug: 162472196
Test: m
Change-Id: I225135c24cc713da085ff7238c1b0695e8ab93ed
parent b779b00e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -362,9 +362,8 @@
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="hidl" optional="true">
        <name>android.hardware.power.stats</name>
        <version>1.0</version>
    <hal format="aidl" optional="true">
        <name>android.hardware.powerstats</name>
        <interface>
            <name>IPowerStats</name>
            <instance>default</instance>
+35 −0
Original line number Diff line number Diff line
// Copyright (C) 2020 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.powerstats",
    vendor_available: true,
    srcs: [
        "android/hardware/powerstats/*.aidl",
    ],
    stability: "vintf",
    backend: {
        java: {
            platform_apis: true,
        },
        ndk: {
            vndk: {
                enabled: true,
            },
        },
        cpp: {
            enabled: false,
        },
    },
}
+24 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files 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.powerstats;
@VintfStability
parcelable EnergyData {
  int railIndex;
  long timestampMs;
  long energyUWs;
}
+31 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files 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.powerstats;
@VintfStability
interface IPowerStats {
  android.hardware.powerstats.EnergyData[] getEnergyData(in int[] railIndices);
  android.hardware.powerstats.PowerEntityInfo[] getPowerEntityInfo();
  android.hardware.powerstats.PowerEntityStateSpace[] getPowerEntityStateInfo(in int[] powerEntityIds);
  android.hardware.powerstats.PowerEntityStateResidencyResult[] getPowerEntityStateResidencyData(in int[] powerEntityIds);
  android.hardware.powerstats.RailInfo[] getRailInfo();
  const int SUCCESS = 0;
  const int NOT_SUPPORTED = 1;
  const int INVALID_INPUT = 2;
  const int FILESYSTEM_ERROR = 3;
  const int INSUFFICIENT_RESOURCES = 4;
}
+24 −0
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files 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.powerstats;
@VintfStability
parcelable PowerEntityInfo {
  int powerEntityId;
  String powerEntityName;
  android.hardware.powerstats.PowerEntityType type;
}
Loading