Loading core/java/android/os/BatteryStats.java +1 −218 Original line number Diff line number Diff line Loading @@ -1049,130 +1049,6 @@ public abstract class BatteryStats { */ public abstract void getDeferredJobsLineLocked(StringBuilder sb, int which); /** * Returns the battery consumption (in microcoulombs) of bluetooth for this uid, * derived from {@link android.hardware.power.stats.EnergyConsumerType#BLUETOOTH} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's bluetooth usage * when in the specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the uid's cpu usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#CPU} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's cpu usage when in the * specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the uid's GNSS usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#GNSS} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getGnssEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's radio usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#MOBILE_RADIO} * bucket provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's radio usage when in the * specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the screen while on and uid active, * derived from {@link android.hardware.power.stats.EnergyConsumerType#DISPLAY} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenOnEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of wifi for this uid, * derived from {@link android.hardware.power.stats.EnergyConsumerType#WIFI} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getWifiEnergyConsumptionUC(); /** * 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 getWifiEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of UID's camera usage, derived from * on-device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCameraEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) used by this uid for each * {@link android.hardware.power.stats.EnergyConsumer.ordinal} of (custom) energy consumer * type {@link android.hardware.power.stats.EnergyConsumerType#OTHER}). * * @return charge (in microcoulombs) consumed since last reset for each (custom) energy * consumer of type OTHER, indexed by their ordinal. Returns null if no energy * reporting is supported. * * {@hide} */ public abstract @Nullable long[] getCustomEnergyConsumerBatteryConsumptionUC(); public static abstract class Sensor { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Loading Loading @@ -2912,7 +2788,7 @@ public abstract class BatteryStats { * * {@hide} */ public static final long POWER_DATA_UNAVAILABLE = -1L; // public static final long POWER_DATA_UNAVAILABLE = -1L; /** * Returned value if duration data is unavailable. Loading @@ -2921,99 +2797,6 @@ public abstract class BatteryStats { */ public static final long DURATION_UNAVAILABLE = -1L; /** * Returns the battery consumption (in microcoulombs) of bluetooth, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the cpu, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the GNSS, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getGnssEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the radio, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the phone calls, derived from on device * power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getPhoneEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the screen while on, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenOnEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the screen in doze, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenDozeEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of wifi, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getWifiEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of camera, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCameraEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) that each * {@link android.hardware.power.stats.EnergyConsumer.ordinal} of (custom) energy consumer * type {@link android.hardware.power.stats.EnergyConsumerType#OTHER}) consumed. * * @return charge (in microcoulombs) used by each (custom) energy consumer of type OTHER, * indexed by their ordinal. Returns null if no energy reporting is supported. * * {@hide} */ public abstract @Nullable long[] getCustomEnergyConsumerBatteryConsumptionUC(); /** * Returns the names of all {@link android.hardware.power.stats.EnergyConsumer}'s * of (custom) energy consumer type Loading core/java/com/android/internal/power/EnergyConsumerStats.java +4 −5 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.internal.power; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -48,6 +45,8 @@ import java.util.Arrays; public class EnergyConsumerStats { private static final String TAG = "MeasuredEnergyStats"; private static final long POWER_DATA_UNAVAILABLE = -1; // Note: {@link BatteryStats#VERSION} MUST be updated if standard // power bucket integers are modified/added/removed. public static final int POWER_BUCKET_UNKNOWN = -1; Loading Loading @@ -464,7 +463,7 @@ public class EnergyConsumerStats { /** * Return accumulated charge (in microcouloumb) for a standard power bucket since last reset. * Returns {@link android.os.BatteryStats#POWER_DATA_UNAVAILABLE} if this data is unavailable. * Returns {@link POWER_DATA_UNAVAILABLE} if this data is unavailable. * @throws IllegalArgumentException if no such {@link StandardPowerBucket}. */ public long getAccumulatedStandardBucketCharge(@StandardPowerBucket int bucket) { Loading @@ -476,7 +475,7 @@ public class EnergyConsumerStats { * Returns the accumulated charge (in microcouloumb) for the standard power bucket and * the specified state since last reset. * * Returns {@link android.os.BatteryStats#POWER_DATA_UNAVAILABLE} if this data is unavailable. * Returns {@link POWER_DATA_UNAVAILABLE} if this data is unavailable. */ public long getAccumulatedStandardBucketCharge(@StandardPowerBucket int bucket, int state) { if (!mConfig.isSupportedMultiStateBucket(bucket)) { Loading core/tests/coretests/src/com/android/internal/power/EnergyConsumerStatsTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.internal.power; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import static com.android.internal.power.EnergyConsumerStats.NUMBER_STANDARD_POWER_BUCKETS; import static com.android.internal.power.EnergyConsumerStats.POWER_BUCKET_BLUETOOTH; import static com.android.internal.power.EnergyConsumerStats.POWER_BUCKET_CPU; Loading Loading @@ -49,6 +47,8 @@ import java.util.Arrays; */ @SmallTest public class EnergyConsumerStatsTest { private static final long POWER_DATA_UNAVAILABLE = -1; @Rule public final RavenwoodRule mRavenwood = new RavenwoodRule(); Loading services/core/java/com/android/server/am/BatteryStatsService.java +4 −19 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; import static android.net.NetworkCapabilities.TRANSPORT_WIFI; import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK; import static android.os.BatteryConsumer.POWER_COMPONENT_BASE; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR; Loading Loading @@ -2753,8 +2752,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub final NetworkStatsManager networkStatsManager = mContext.getSystemService( NetworkStatsManager.class); mHandler.post(() -> { mStats.updateWifiState(info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime, networkStatsManager); mStats.updateWifiState(info, elapsedRealtime, uptime, networkStatsManager); }); } } Loading @@ -2774,8 +2772,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub final long uptime = SystemClock.uptimeMillis(); mHandler.post(() -> { synchronized (mStats) { mStats.updateBluetoothStateLocked( info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime); mStats.updateBluetoothStateLocked(info, elapsedRealtime, uptime); } }); } Loading @@ -2797,8 +2794,8 @@ public final class BatteryStatsService extends IBatteryStats.Stub final NetworkStatsManager networkStatsManager = mContext.getSystemService( NetworkStatsManager.class); mHandler.post(() -> { mStats.noteModemControllerActivity(info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime, networkStatsManager); mStats.noteModemControllerActivity(info, elapsedRealtime, uptime, networkStatsManager); }); } } Loading Loading @@ -2998,15 +2995,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub mPowerStatsStore.dumpTableOfContents(new IndentingPrintWriter(pw, " ")); } private void dumpMeasuredEnergyStats(PrintWriter pw) { // Wait for the completion of pending works if there is any awaitCompletion(); syncStats("dump", BatteryExternalStatsWorker.UPDATE_ALL); synchronized (mStats) { mStats.dumpEnergyConsumerStatsLocked(pw); } } private void dumpPowerProfile(PrintWriter pw) { synchronized (mStats) { mStats.dumpPowerProfileLocked(pw); Loading Loading @@ -3211,9 +3199,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub } else if ("--cpu".equals(arg)) { dumpCpuStats(pw); return; } else if ("--measured-energy".equals(arg)) { dumpMeasuredEnergyStats(pw); return; } else if ("--power-profile".equals(arg)) { dumpPowerProfile(pw); return; Loading services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java +30 −123 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/os/BatteryStats.java +1 −218 Original line number Diff line number Diff line Loading @@ -1049,130 +1049,6 @@ public abstract class BatteryStats { */ public abstract void getDeferredJobsLineLocked(StringBuilder sb, int which); /** * Returns the battery consumption (in microcoulombs) of bluetooth for this uid, * derived from {@link android.hardware.power.stats.EnergyConsumerType#BLUETOOTH} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's bluetooth usage * when in the specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the uid's cpu usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#CPU} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's cpu usage when in the * specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the uid's GNSS usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#GNSS} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getGnssEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's radio usage, derived from * derived from {@link android.hardware.power.stats.EnergyConsumerType#MOBILE_RADIO} * bucket provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the uid's radio usage when in the * specified process state. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of the screen while on and uid active, * derived from {@link android.hardware.power.stats.EnergyConsumerType#DISPLAY} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenOnEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of wifi for this uid, * derived from {@link android.hardware.power.stats.EnergyConsumerType#WIFI} bucket * provided by the PowerStats service. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getWifiEnergyConsumptionUC(); /** * 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 getWifiEnergyConsumptionUC( @BatteryConsumer.ProcessState int processState); /** * Returns the battery consumption (in microcoulombs) of UID's camera usage, derived from * on-device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCameraEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) used by this uid for each * {@link android.hardware.power.stats.EnergyConsumer.ordinal} of (custom) energy consumer * type {@link android.hardware.power.stats.EnergyConsumerType#OTHER}). * * @return charge (in microcoulombs) consumed since last reset for each (custom) energy * consumer of type OTHER, indexed by their ordinal. Returns null if no energy * reporting is supported. * * {@hide} */ public abstract @Nullable long[] getCustomEnergyConsumerBatteryConsumptionUC(); public static abstract class Sensor { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Loading Loading @@ -2912,7 +2788,7 @@ public abstract class BatteryStats { * * {@hide} */ public static final long POWER_DATA_UNAVAILABLE = -1L; // public static final long POWER_DATA_UNAVAILABLE = -1L; /** * Returned value if duration data is unavailable. Loading @@ -2921,99 +2797,6 @@ public abstract class BatteryStats { */ public static final long DURATION_UNAVAILABLE = -1L; /** * Returns the battery consumption (in microcoulombs) of bluetooth, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getBluetoothEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the cpu, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCpuEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the GNSS, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getGnssEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the radio, derived from on device power * measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getMobileRadioEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the phone calls, derived from on device * power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getPhoneEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the screen while on, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenOnEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of the screen in doze, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getScreenDozeEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of wifi, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getWifiEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) of camera, derived from on * device power measurement data. * Will return {@link #POWER_DATA_UNAVAILABLE} if data is unavailable. * * {@hide} */ public abstract long getCameraEnergyConsumptionUC(); /** * Returns the battery consumption (in microcoulombs) that each * {@link android.hardware.power.stats.EnergyConsumer.ordinal} of (custom) energy consumer * type {@link android.hardware.power.stats.EnergyConsumerType#OTHER}) consumed. * * @return charge (in microcoulombs) used by each (custom) energy consumer of type OTHER, * indexed by their ordinal. Returns null if no energy reporting is supported. * * {@hide} */ public abstract @Nullable long[] getCustomEnergyConsumerBatteryConsumptionUC(); /** * Returns the names of all {@link android.hardware.power.stats.EnergyConsumer}'s * of (custom) energy consumer type Loading
core/java/com/android/internal/power/EnergyConsumerStats.java +4 −5 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.internal.power; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; Loading Loading @@ -48,6 +45,8 @@ import java.util.Arrays; public class EnergyConsumerStats { private static final String TAG = "MeasuredEnergyStats"; private static final long POWER_DATA_UNAVAILABLE = -1; // Note: {@link BatteryStats#VERSION} MUST be updated if standard // power bucket integers are modified/added/removed. public static final int POWER_BUCKET_UNKNOWN = -1; Loading Loading @@ -464,7 +463,7 @@ public class EnergyConsumerStats { /** * Return accumulated charge (in microcouloumb) for a standard power bucket since last reset. * Returns {@link android.os.BatteryStats#POWER_DATA_UNAVAILABLE} if this data is unavailable. * Returns {@link POWER_DATA_UNAVAILABLE} if this data is unavailable. * @throws IllegalArgumentException if no such {@link StandardPowerBucket}. */ public long getAccumulatedStandardBucketCharge(@StandardPowerBucket int bucket) { Loading @@ -476,7 +475,7 @@ public class EnergyConsumerStats { * Returns the accumulated charge (in microcouloumb) for the standard power bucket and * the specified state since last reset. * * Returns {@link android.os.BatteryStats#POWER_DATA_UNAVAILABLE} if this data is unavailable. * Returns {@link POWER_DATA_UNAVAILABLE} if this data is unavailable. */ public long getAccumulatedStandardBucketCharge(@StandardPowerBucket int bucket, int state) { if (!mConfig.isSupportedMultiStateBucket(bucket)) { Loading
core/tests/coretests/src/com/android/internal/power/EnergyConsumerStatsTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.internal.power; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import static com.android.internal.power.EnergyConsumerStats.NUMBER_STANDARD_POWER_BUCKETS; import static com.android.internal.power.EnergyConsumerStats.POWER_BUCKET_BLUETOOTH; import static com.android.internal.power.EnergyConsumerStats.POWER_BUCKET_CPU; Loading Loading @@ -49,6 +47,8 @@ import java.util.Arrays; */ @SmallTest public class EnergyConsumerStatsTest { private static final long POWER_DATA_UNAVAILABLE = -1; @Rule public final RavenwoodRule mRavenwood = new RavenwoodRule(); Loading
services/core/java/com/android/server/am/BatteryStatsService.java +4 −19 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; import static android.net.NetworkCapabilities.TRANSPORT_WIFI; import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK; import static android.os.BatteryConsumer.POWER_COMPONENT_BASE; import static android.os.BatteryStats.POWER_DATA_UNAVAILABLE; import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR; Loading Loading @@ -2753,8 +2752,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub final NetworkStatsManager networkStatsManager = mContext.getSystemService( NetworkStatsManager.class); mHandler.post(() -> { mStats.updateWifiState(info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime, networkStatsManager); mStats.updateWifiState(info, elapsedRealtime, uptime, networkStatsManager); }); } } Loading @@ -2774,8 +2772,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub final long uptime = SystemClock.uptimeMillis(); mHandler.post(() -> { synchronized (mStats) { mStats.updateBluetoothStateLocked( info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime); mStats.updateBluetoothStateLocked(info, elapsedRealtime, uptime); } }); } Loading @@ -2797,8 +2794,8 @@ public final class BatteryStatsService extends IBatteryStats.Stub final NetworkStatsManager networkStatsManager = mContext.getSystemService( NetworkStatsManager.class); mHandler.post(() -> { mStats.noteModemControllerActivity(info, POWER_DATA_UNAVAILABLE, elapsedRealtime, uptime, networkStatsManager); mStats.noteModemControllerActivity(info, elapsedRealtime, uptime, networkStatsManager); }); } } Loading Loading @@ -2998,15 +2995,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub mPowerStatsStore.dumpTableOfContents(new IndentingPrintWriter(pw, " ")); } private void dumpMeasuredEnergyStats(PrintWriter pw) { // Wait for the completion of pending works if there is any awaitCompletion(); syncStats("dump", BatteryExternalStatsWorker.UPDATE_ALL); synchronized (mStats) { mStats.dumpEnergyConsumerStatsLocked(pw); } } private void dumpPowerProfile(PrintWriter pw) { synchronized (mStats) { mStats.dumpPowerProfileLocked(pw); Loading Loading @@ -3211,9 +3199,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub } else if ("--cpu".equals(arg)) { dumpCpuStats(pw); return; } else if ("--measured-energy".equals(arg)) { dumpMeasuredEnergyStats(pw); return; } else if ("--power-profile".equals(arg)) { dumpPowerProfile(pw); return; Loading
services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java +30 −123 File changed.Preview size limit exceeded, changes collapsed. Show changes