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

Commit b3c34322 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge changes If9acd8ae,I82eacfca into main

* changes:
  Encapsulate PowerStats layout inside corresponding PowerStatsLayouts
  Encapsulate PowerStatsProcessors in a separate package
parents 8c528366 c78e20bc
Loading
Loading
Loading
Loading
+23 −182
Original line number Diff line number Diff line
@@ -123,31 +123,16 @@ import com.android.server.Watchdog;
import com.android.server.net.BaseNetworkObserver;
import com.android.server.pm.UserManagerInternal;
import com.android.server.power.optimization.Flags;
import com.android.server.power.stats.AggregatedPowerStatsConfig;
import com.android.server.power.stats.AmbientDisplayPowerStatsProcessor;
import com.android.server.power.stats.AudioPowerStatsProcessor;
import com.android.server.power.stats.BatteryExternalStatsWorker;
import com.android.server.power.stats.BatteryStatsDumpHelperImpl;
import com.android.server.power.stats.BatteryStatsImpl;
import com.android.server.power.stats.BatteryUsageStatsProvider;
import com.android.server.power.stats.BluetoothPowerStatsProcessor;
import com.android.server.power.stats.CameraPowerStatsProcessor;
import com.android.server.power.stats.CpuPowerStatsProcessor;
import com.android.server.power.stats.CustomEnergyConsumerPowerStatsProcessor;
import com.android.server.power.stats.FlashlightPowerStatsProcessor;
import com.android.server.power.stats.GnssPowerStatsProcessor;
import com.android.server.power.stats.MobileRadioPowerStatsProcessor;
import com.android.server.power.stats.PhoneCallPowerStatsProcessor;
import com.android.server.power.stats.PowerStatsAggregator;
import com.android.server.power.stats.PowerStatsExporter;
import com.android.server.power.stats.PowerAttributor;
import com.android.server.power.stats.PowerStatsScheduler;
import com.android.server.power.stats.PowerStatsStore;
import com.android.server.power.stats.PowerStatsUidResolver;
import com.android.server.power.stats.ScreenPowerStatsProcessor;
import com.android.server.power.stats.SensorPowerStatsProcessor;
import com.android.server.power.stats.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
import com.android.server.power.stats.VideoPowerStatsProcessor;
import com.android.server.power.stats.WifiPowerStatsProcessor;
import com.android.server.power.stats.processor.MultiStatePowerAttributor;
import com.android.server.power.stats.wakeups.CpuWakeupStats;

import java.io.File;
@@ -207,7 +192,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
    private final AtomicFile mConfigFile;
    private final BatteryStats.BatteryStatsDumpHelper mDumpHelper;
    private final PowerStatsUidResolver mPowerStatsUidResolver = new PowerStatsUidResolver();
    private final AggregatedPowerStatsConfig mAggregatedPowerStatsConfig;
    private final PowerAttributor mPowerAttributor;

    private volatile boolean mMonitorEnabled = true;

@@ -445,14 +430,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub
            mStats.startTrackingSystemServerCpuTime();
        }

        mAggregatedPowerStatsConfig = createAggregatedPowerStatsConfig();
        mPowerStatsStore = new PowerStatsStore(systemDir, mHandler, mAggregatedPowerStatsConfig);
        mPowerStatsStore = new PowerStatsStore(systemDir, mHandler);
        mPowerAttributor = new MultiStatePowerAttributor(mContext, mPowerStatsStore, mPowerProfile,
                mCpuScalingPolicies, mPowerStatsUidResolver);
        mPowerStatsScheduler = createPowerStatsScheduler(mContext);
        PowerStatsExporter powerStatsExporter =
                new PowerStatsExporter(mPowerStatsStore,
                        new PowerStatsAggregator(mAggregatedPowerStatsConfig, mStats.getHistory()));
        mBatteryUsageStatsProvider = new BatteryUsageStatsProvider(context,
                powerStatsExporter, mPowerProfile, mCpuScalingPolicies,
                mPowerAttributor, mPowerProfile, mCpuScalingPolicies,
                mPowerStatsStore, Clock.SYSTEM_CLOCK);
        mStats.saveBatteryUsageStatsOnReset(mBatteryUsageStatsProvider, mPowerStatsStore);
        mDumpHelper = new BatteryStatsDumpHelperImpl(mBatteryUsageStatsProvider);
@@ -472,154 +455,11 @@ public final class BatteryStatsService extends IBatteryStats.Stub
                            onAlarmListener, aHandler);
                };
        return new PowerStatsScheduler(mStats::schedulePowerStatsSampleCollection,
                new PowerStatsAggregator(mAggregatedPowerStatsConfig,
                        mStats.getHistory()), aggregatedPowerStatsSpanDuration,
                mStats.getHistory(), mPowerAttributor, aggregatedPowerStatsSpanDuration,
                powerStatsAggregationPeriod, mPowerStatsStore, alarmScheduler, Clock.SYSTEM_CLOCK,
                mMonotonicClock, () -> mStats.getHistory().getStartTime(), mHandler);
    }

    private AggregatedPowerStatsConfig createAggregatedPowerStatsConfig() {
        AggregatedPowerStatsConfig config = new AggregatedPowerStatsConfig();
        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_CPU)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new CpuPowerStatsProcessor(mPowerProfile, mCpuScalingPolicies));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_SCREEN)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .setProcessorSupplier(
                        () -> new ScreenPowerStatsProcessor(mPowerProfile));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY,
                        BatteryConsumer.POWER_COMPONENT_SCREEN)
                .setProcessorSupplier(AmbientDisplayPowerStatsProcessor::new);

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new MobileRadioPowerStatsProcessor(mPowerProfile));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_PHONE,
                        BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO)
                .setProcessorSupplier(PhoneCallPowerStatsProcessor::new);

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_WIFI)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new WifiPowerStatsProcessor(mPowerProfile));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new BluetoothPowerStatsProcessor(mPowerProfile));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_AUDIO)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new AudioPowerStatsProcessor(mPowerProfile, mPowerStatsUidResolver));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_VIDEO)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new VideoPowerStatsProcessor(mPowerProfile, mPowerStatsUidResolver));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new FlashlightPowerStatsProcessor(mPowerProfile,
                                mPowerStatsUidResolver));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_CAMERA)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new CameraPowerStatsProcessor(mPowerProfile, mPowerStatsUidResolver));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_GNSS)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(
                        () -> new GnssPowerStatsProcessor(mPowerProfile, mPowerStatsUidResolver));

        config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_SENSORS)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
                .setProcessorSupplier(() -> new SensorPowerStatsProcessor(
                        () -> mContext.getSystemService(SensorManager.class)));

        config.trackCustomPowerComponents(CustomEnergyConsumerPowerStatsProcessor::new)
                .trackDeviceStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN)
                .trackUidStates(
                        AggregatedPowerStatsConfig.STATE_POWER,
                        AggregatedPowerStatsConfig.STATE_SCREEN,
                        AggregatedPowerStatsConfig.STATE_PROCESS_STATE);
        return config;
    }

    private void setPowerStatsThrottlePeriods(BatteryStatsImpl.BatteryStatsConfig.Builder builder,
            String configString) {
        if (configString == null) {
@@ -664,83 +504,84 @@ public final class BatteryStatsService extends IBatteryStats.Stub
    }

    public void systemServicesReady() {
        MultiStatePowerAttributor attributor = (MultiStatePowerAttributor) mPowerAttributor;
        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_CPU,
                Flags.streamlinedBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_CPU,
                Flags.streamlinedBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_SCREEN,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_SCREEN,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO,
                Flags.streamlinedConnectivityBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO,
                Flags.streamlinedConnectivityBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_PHONE,
                Flags.streamlinedConnectivityBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_WIFI,
                Flags.streamlinedConnectivityBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_WIFI,
                Flags.streamlinedConnectivityBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_BLUETOOTH,
                Flags.streamlinedConnectivityBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_BLUETOOTH,
                Flags.streamlinedConnectivityBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_AUDIO,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_AUDIO,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_VIDEO,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_VIDEO,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_FLASHLIGHT,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_GNSS,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_GNSS,
                Flags.streamlinedMiscBatteryStats());

        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_SENSORS,
                Flags.streamlinedMiscBatteryStats());

        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_CAMERA,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_CAMERA,
                Flags.streamlinedMiscBatteryStats());

        // By convention POWER_COMPONENT_ANY represents custom Energy Consumers
        mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_ANY,
                Flags.streamlinedMiscBatteryStats());
        mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
        attributor.setPowerComponentSupported(
                BatteryConsumer.POWER_COMPONENT_ANY,
                Flags.streamlinedMiscBatteryStats());

+3 −3
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ import static android.os.BatteryStats.Uid.NUM_WIFI_BATCHED_SCAN_BINS;
import static android.os.BatteryStatsManager.NUM_WIFI_STATES;
import static android.os.BatteryStatsManager.NUM_WIFI_SUPPL_STATES;
import static com.android.server.power.stats.MobileRadioPowerStatsCollector.mapRadioAccessNetworkTypeToRadioAccessTechnology;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -149,6 +147,7 @@ import com.android.modules.utils.TypedXmlSerializer;
import com.android.server.LocalServices;
import com.android.server.power.optimization.Flags;
import com.android.server.power.stats.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
import com.android.server.power.stats.format.MobileRadioPowerStatsLayout;
import libcore.util.EmptyArray;
@@ -13191,7 +13190,8 @@ public class BatteryStatsImpl extends BatteryStats {
                final int freq = deltaInfo.getSpecificInfoFrequencyRange(index);
                // Map RadioAccessNetworkType to course grain RadioAccessTechnology.
                final int ratBucket = mapRadioAccessNetworkTypeToRadioAccessTechnology(rat);
                final int ratBucket = MobileRadioPowerStatsLayout
                        .mapRadioAccessNetworkTypeToRadioAccessTechnology(rat);
                final RadioAccessTechnologyBatteryStats ratStats = getRatBatteryStatsLocked(
                        ratBucket);
+40 −36

File changed.

Preview size limit exceeded, changes collapsed.

+17 −1
Original line number Diff line number Diff line
@@ -19,8 +19,11 @@ package com.android.server.power.stats;
import android.os.BatteryUsageStats;
import android.util.IndentingPrintWriter;

import com.android.modules.utils.TypedXmlPullParser;
import com.android.modules.utils.TypedXmlSerializer;

import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;

class BatteryUsageStatsSection extends PowerStatsSpan.Section {
@@ -38,7 +41,7 @@ class BatteryUsageStatsSection extends PowerStatsSpan.Section {
    }

    @Override
    void write(TypedXmlSerializer serializer) throws IOException {
    public void write(TypedXmlSerializer serializer) throws IOException {
        mBatteryUsageStats.writeXml(serializer);
    }

@@ -46,4 +49,17 @@ class BatteryUsageStatsSection extends PowerStatsSpan.Section {
    public void dump(IndentingPrintWriter ipw) {
        mBatteryUsageStats.dump(ipw, "");
    }

    static class Reader implements PowerStatsSpan.SectionReader {
        @Override
        public String getType() {
            return TYPE;
        }

        @Override
        public PowerStatsSpan.Section read(String sectionType, TypedXmlPullParser parser)
                throws IOException, XmlPullParserException {
            return new BatteryUsageStatsSection(BatteryUsageStats.createFromXml(parser));
        }
    }
}
+7 −12
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.util.SparseArray;

import com.android.internal.os.Clock;
import com.android.internal.os.PowerStats;
import com.android.server.power.stats.format.BluetoothPowerStatsLayout;

import java.util.Arrays;
import java.util.List;
@@ -43,7 +44,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {

    private static final long ENERGY_UNSPECIFIED = -1;

    interface BluetoothStatsRetriever {
    public interface BluetoothStatsRetriever {
        interface Callback {
            void onBluetoothScanTime(int uid, long scanTimeMs);
        }
@@ -54,7 +55,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {
                BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback callback);
    }

    interface Injector {
    public interface Injector {
        Handler getHandler();
        Clock getClock();
        PowerStatsUidResolver getUidResolver();
@@ -67,7 +68,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {

    private final Injector mInjector;

    private BluetoothPowerStatsLayout mLayout;
    private com.android.server.power.stats.format.BluetoothPowerStatsLayout mLayout;
    private boolean mIsInitialized;
    private PowerStats mPowerStats;
    private long[] mDeviceStats;
@@ -93,7 +94,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {

    private final SparseArray<UidStats> mUidStats = new SparseArray<>();

    BluetoothPowerStatsCollector(Injector injector) {
    public BluetoothPowerStatsCollector(Injector injector) {
        super(injector.getHandler(),  injector.getPowerStatsCollectionThrottlePeriod(
                        BatteryConsumer.powerComponentIdToString(
                                BatteryConsumer.POWER_COMPONENT_BLUETOOTH)),
@@ -130,13 +131,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {
        mLastConsumedEnergyUws = new long[mEnergyConsumerIds.length];
        Arrays.fill(mLastConsumedEnergyUws, ENERGY_UNSPECIFIED);

        mLayout = new BluetoothPowerStatsLayout();
        mLayout.addDeviceBluetoothControllerActivity();
        mLayout.addDeviceSectionEnergyConsumers(mEnergyConsumerIds.length);
        mLayout.addDeviceSectionUsageDuration();
        mLayout.addDeviceSectionPowerEstimate();
        mLayout.addUidTrafficStats();
        mLayout.addUidSectionPowerEstimate();
        mLayout = new BluetoothPowerStatsLayout(mEnergyConsumerIds.length);

        PersistableBundle extras = new PersistableBundle();
        mLayout.toExtras(extras);
@@ -152,7 +147,7 @@ public class BluetoothPowerStatsCollector extends PowerStatsCollector {
    }

    @Override
    protected PowerStats collectStats() {
    public PowerStats collectStats() {
        if (!ensureInitialized()) {
            return null;
        }
Loading