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

Commit 49ea13ae authored by Zhanghao Wen's avatar Zhanghao Wen Committed by Android (Google) Code Review
Browse files

Merge "Add an additional bit for the GPS signal level"

parents cdd9a875 547fad8d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1966,7 +1966,7 @@ public abstract class BatteryStats {
        // Values for NUM_GPS_SIGNAL_QUALITY_LEVELS
        public static final int STATE2_GPS_SIGNAL_QUALITY_SHIFT = 7;
        public static final int STATE2_GPS_SIGNAL_QUALITY_MASK =
            0x1 << STATE2_GPS_SIGNAL_QUALITY_SHIFT;
                0x3 << STATE2_GPS_SIGNAL_QUALITY_SHIFT;

        public static final int STATE2_POWER_SAVE_FLAG = 1<<31;
        public static final int STATE2_VIDEO_ON_FLAG = 1<<30;
@@ -3028,7 +3028,7 @@ public abstract class BatteryStats {
                "cellular_high_tx_power", "Chtp"),
        new BitDescription(HistoryItem.STATE2_GPS_SIGNAL_QUALITY_MASK,
            HistoryItem.STATE2_GPS_SIGNAL_QUALITY_SHIFT, "gps_signal_quality", "Gss",
            new String[] { "poor", "good"}, new String[] { "poor", "good"})
            new String[] { "poor", "good", "none"}, new String[] { "poor", "good", "none"})
    };

    public static final String[] HISTORY_EVENT_NAMES = new String[] {
+2 −1
Original line number Diff line number Diff line
@@ -1542,7 +1542,7 @@ public class BatteryStatsHistory {

        State2 change int: if C in the first token is set,
        31              23              15               7             0
        █M|L|K|J|I|H|H|G█F|E|D|C| | | | █ | | | | | | ||B|B|B|A|A|A|A█
        █M|L|K|J|I|H|H|G█F|E|D|C| | | | █ | | | | | | |N█N|B|B|B|A|A|A|A█

        A: 4 bits indicating the wifi supplicant state: {@link BatteryStats#WIFI_SUPPL_STATE_NAMES}.
        B: 3 bits indicating the wifi signal strength: 0, 1, 2, 3, 4.
@@ -1557,6 +1557,7 @@ public class BatteryStatsHistory {
        K: wifi was running.
        L: video was playing.
        M: power save mode was on.
        N: 2 bits indicating the gps signal strength: poor, good, none.

        Wakelock/wakereason struct: if D in the first token is set,
        Event struct: if E in the first token is set,
+3 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,7 @@ public class BatteryStatsImpl extends BatteryStats {
    private static final int USB_DATA_CONNECTED = 2;
    int mUsbDataState = USB_DATA_UNKNOWN;
    private static final int GPS_SIGNAL_QUALITY_NONE = 2;
    int mGpsSignalQualityBin = -1;
    final StopwatchTimer[] mGpsSignalQualityTimer =
        new StopwatchTimer[GnssSignalQuality.NUM_GNSS_SIGNAL_QUALITY_LEVELS];
@@ -5222,6 +5223,8 @@ public class BatteryStatsImpl extends BatteryStats {
        if (mGpsNesting == 0) {
            mHistory.recordStateStopEvent(elapsedRealtimeMs, uptimeMs,
                    HistoryItem.STATE_GPS_ON_FLAG);
            mHistory.recordGpsSignalQualityEvent(elapsedRealtimeMs, uptimeMs,
                    GPS_SIGNAL_QUALITY_NONE);
            stopAllGpsSignalQualityTimersLocked(-1, elapsedRealtimeMs);
            mGpsSignalQualityBin = -1;
        }