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

Commit 3fc6aca9 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android (Google) Code Review
Browse files

Merge "BatteryStatsNoteTest: Fix GPS related tests."

parents b29abdc3 efa0fe6b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -678,7 +678,8 @@ public class BatteryStatsImpl extends BatteryStats {
    StopwatchTimer mCameraOnTimer;
    int mGpsSignalQualityBin = -1;
    final StopwatchTimer[] mGpsSignalQualityTimer =
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    protected final StopwatchTimer[] mGpsSignalQualityTimer =
        new StopwatchTimer[GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS];
    int mPhoneSignalStrengthBin = -1;
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.os.Handler;
import android.os.Looper;
import android.util.SparseIntArray;

import com.android.internal.location.gnssmetrics.GnssMetrics;
import java.util.ArrayList;
import java.util.concurrent.Future;

@@ -40,6 +41,11 @@ public class MockBatteryStatsImpl extends BatteryStatsImpl {
        mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase);
        setExternalStatsSyncLocked(new DummyExternalStatsSync());

        for (int i=0; i< GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS; i++) {
            mGpsSignalQualityTimer[i] = new StopwatchTimer(clocks, null, -1000-i, null,
                mOnBatteryTimeBase);
        }

        // A no-op handler.
        mHandler = new Handler(Looper.getMainLooper()) {};
    }