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

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

Merge "Wean Statsd off BatteryStats: Network Power"

parents ced516b8 0b028b1d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ message WakeupAlarmOccurred {
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message MobileRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;
@@ -593,7 +593,7 @@ message MobileRadioPowerStateChanged {
 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
 *
 * Logged from:
 *   frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
 *   frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
 */
message WifiRadioPowerStateChanged {
    repeated AttributionNode attribution_node = 1;
+0 −4
Original line number Diff line number Diff line
@@ -5047,8 +5047,6 @@ public class BatteryStatsImpl extends BatteryStats {
                    + Integer.toHexString(mHistoryCur.states));
            addHistoryRecordLocked(elapsedRealtime, uptime);
            mMobileRadioPowerState = powerState;
            StatsLog.write_non_chained(StatsLog.MOBILE_RADIO_POWER_STATE_CHANGED, uid, null,
                    powerState);
            if (active) {
                mMobileRadioActiveTimer.startRunningLocked(elapsedRealtime);
                mMobileRadioActivePerAppTimer.startRunningLocked(elapsedRealtime);
@@ -5801,8 +5799,6 @@ public class BatteryStatsImpl extends BatteryStats {
                    + Integer.toHexString(mHistoryCur.states));
            addHistoryRecordLocked(elapsedRealtime, uptime);
            mWifiRadioPowerState = powerState;
            StatsLog.write_non_chained(StatsLog.WIFI_RADIO_POWER_STATE_CHANGED, uid, null,
                    powerState);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ import android.util.Log;
import android.util.Slog;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
import android.util.StatsLog;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
@@ -512,6 +513,8 @@ public class NetworkManagementService extends INetworkManagementService.Stub
                    getBatteryStats().noteMobileRadioPowerState(powerState, tsNanos, uid);
                } catch (RemoteException e) {
                }
                StatsLog.write_non_chained(StatsLog.MOBILE_RADIO_POWER_STATE_CHANGED, uid, null,
                        powerState);
            }
        }

@@ -522,6 +525,8 @@ public class NetworkManagementService extends INetworkManagementService.Stub
                    getBatteryStats().noteWifiRadioPowerState(powerState, tsNanos, uid);
                } catch (RemoteException e) {
                }
                StatsLog.write_non_chained(StatsLog.WIFI_RADIO_POWER_STATE_CHANGED, uid, null,
                        powerState);
            }
        }