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

Commit efa0fe6b authored by Narayan Kamath's avatar Narayan Kamath
Browse files

BatteryStatsNoteTest: Fix GPS related tests.

Bug: N/A
Test: BatteryStatsTests
Change-Id: Icadf17a3839d96559f824e45babdbf794a92456c
parent 738471a9
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()) {};
    }