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

Commit e5ae75b0 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz Committed by Android Build Coastguard Worker
Browse files

Log and skip noteEvent calls with null name

Bug: 194733136
Test: builds + boots
Change-Id: I909a4656d3d3aa502466d96ffa804573de258587
(cherry picked from commit 84fcc896)
parent 3b5c0c54
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -841,6 +841,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub

    public void noteEvent(final int code, final String name, final int uid) {
        enforceCallingPermission();
        if (name == null) {
            // TODO(b/194733136): Replace with an IllegalArgumentException throw.
            Slog.wtfStack(TAG, "noteEvent called with null name. code = " + code);
            return;
        }

        synchronized (mLock) {
            final long elapsedRealtime = SystemClock.elapsedRealtime();
            final long uptime = SystemClock.uptimeMillis();