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

Commit d6cfe1ed authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Attribution of WiFi power per process state

Bug: 191921016
Bug: 182845426
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I7dada3593dba59a8a0731e463bd18e67db7cd608
parent 2cebd2b9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ public abstract class BatteryConsumer {
    private static final int[] SUPPORTED_POWER_COMPONENTS_PER_PROCESS_STATE = {
            POWER_COMPONENT_CPU,
            POWER_COMPONENT_MOBILE_RADIO,
            POWER_COMPONENT_WIFI,
    };

    static final int COLUMN_INDEX_BATTERY_CONSUMER_TYPE = 0;
+17 −0
Original line number Diff line number Diff line
@@ -460,6 +460,12 @@ public abstract class BatteryStats implements Parcelable {
         */
        public abstract long getCountLocked(int which);

        /**
         * Returns the count accumulated by this Counter for the specified process state.
         * If the counter does not support per-procstate tracking, returns 0.
         */
        public abstract long getCountForProcessState(@BatteryConsumer.ProcessState int procState);

        /**
         * Temporary for debugging.
         */
@@ -1095,6 +1101,17 @@ public abstract class BatteryStats implements Parcelable {
         */
        public abstract long getWifiMeasuredBatteryConsumptionUC();

        /**
         * Returns the battery consumption (in microcoulombs) of the uid's wifi usage when in the
         * specified process state.
         * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable.
         *
         * {@hide}
         */
        public abstract long getWifiMeasuredBatteryConsumptionUC(
                @BatteryConsumer.ProcessState int processState);


        /**
         * Returns the battery consumption (in microcoulombs) used by this uid for each
         * {@link android.hardware.power.stats.EnergyConsumer.ordinal} of (custom) energy consumer
Loading