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

Commit 53ba2566 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix failing cts tests"

parents 402534a3 2c4b946f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.powerstats;

import android.annotation.Nullable;
import android.content.Context;
import android.os.Binder;
import android.os.Environment;
@@ -48,8 +49,11 @@ public class PowerStatsService extends SystemService {

    private Context mContext;
    private IPowerStatsHALWrapper mPowerStatsHALWrapper;
    @Nullable
    private PowerStatsLogger mPowerStatsLogger;
    @Nullable
    private BatteryTrigger mBatteryTrigger;
    @Nullable
    private TimerTrigger mTimerTrigger;

    @VisibleForTesting
@@ -88,10 +92,14 @@ public class PowerStatsService extends SystemService {
            if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;

            if (args.length > 0 && "--proto".equals(args[0])) {
                if (mPowerStatsLogger == null) {
                    Log.e(TAG, "PowerStats HAL is not initialized.  No data available.");
                } else {
                    mPowerStatsLogger.writeToFile(fd);
                }
            }
        }
    }

    @Override
    public void onBootPhase(int phase) {