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

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

Merge "Remove flag...

Merge "Remove flag com.android.server.power.optimization.extended_battery_history_continuous_collection_enabled" into main
parents 5a0f7ba8 aa4b416e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -6964,9 +6964,7 @@ public abstract class BatteryStats {
        }

        public HistoryPrinter(TimeZone timeZone, int flags) {
            this(com.android.server.power.optimization.Flags
                    .extendedBatteryHistoryContinuousCollectionEnabled()
                    ? FORMAT_VERSION : FORMAT_LEGACY, timeZone, flags);
            this(FORMAT_VERSION, timeZone, flags);
        }

        private HistoryPrinter(int formatVersion, TimeZone timeZone, int flags) {
+0 −2
Original line number Diff line number Diff line
@@ -471,8 +471,6 @@ public final class BatteryStatsService extends IBatteryStats.Stub
                Flags.extendedBatteryHistoryCompressionEnabled());
        mStats.saveBatteryUsageStatsOnNewSession(mBatteryUsageStatsProvider, mPowerStatsStore,
                true);
        mStats.resetBatteryHistoryOnNewSession(
                !Flags.extendedBatteryHistoryContinuousCollectionEnabled());

        MultiStatePowerAttributor attributor = (MultiStatePowerAttributor) mPowerAttributor;

+2 −11
Original line number Diff line number Diff line
@@ -627,7 +627,6 @@ public class BatteryStatsImpl extends BatteryStats {
    }
    private boolean mSaveBatteryUsageStatsOnNewSession;
    private boolean mResetBatteryHistoryOnNewSession;
    private boolean mAccumulateBatteryUsageStats;
    private BatteryUsageStatsProvider mBatteryUsageStatsProvider;
    private PowerStatsStore mPowerStatsStore;
@@ -11702,13 +11701,6 @@ public class BatteryStatsImpl extends BatteryStats {
        mAccumulateBatteryUsageStats = accumulateBatteryUsageStats;
    }
    /**
     * Enables or disables battery history reset at the beginning of a battery stats session.
     */
    public void resetBatteryHistoryOnNewSession(boolean enabled) {
        mResetBatteryHistoryOnNewSession = enabled;
    }
    /**
     * Enables or disables battery history file compression.
     */
@@ -11908,9 +11900,8 @@ public class BatteryStatsImpl extends BatteryStats {
        initDischarge(elapsedRealtimeUs);
        if ((resetReason != RESET_REASON_FULL_CHARGE
                && resetReason != RESET_REASON_PLUGGED_IN_FOR_LONG_DURATION)
                || mResetBatteryHistoryOnNewSession) {
        if (resetReason != RESET_REASON_FULL_CHARGE
                && resetReason != RESET_REASON_PLUGGED_IN_FOR_LONG_DURATION) {
            mHistory.reset();
        }
+1 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.util.SparseArray;
import com.android.internal.os.Clock;
import com.android.internal.os.MonotonicClock;
import com.android.internal.util.ArrayUtils;
import com.android.server.power.optimization.Flags;
import com.android.server.power.stats.BatteryStatsImpl.BatteryStatsSession;

import java.io.PrintWriter;
@@ -282,9 +281,7 @@ public class BatteryUsageStatsProvider {
        if ((query.getFlags()
                & BatteryUsageStatsQuery.FLAG_BATTERY_USAGE_STATS_INCLUDE_HISTORY) != 0) {
            batteryUsageStatsBuilder.setBatteryHistory(session.getHistory().copy(),
                    Flags.extendedBatteryHistoryContinuousCollectionEnabled()
                            ? query.getPreferredHistoryDurationMs()
                            : Long.MAX_VALUE);
                    query.getPreferredHistoryDurationMs());
        }

        mPowerAttributor.estimatePowerConsumption(batteryUsageStatsBuilder, session.getHistory(),
+0 −10
Original line number Diff line number Diff line
@@ -39,16 +39,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "extended_battery_history_continuous_collection_enabled"
    namespace: "backstage_power"
    description: "Disable automatic reset of battery stats history on full charge"
    bug: "381940953"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "extended_battery_history_compression_enabled"
    namespace: "backstage_power"
Loading