Merge "Log and skip noteEvent calls with null name" into sc-dev

This commit is contained in:
Michael Wachenschwanz
2021-07-29 21:50:46 +00:00
committed by Android (Google) Code Review

View File

@@ -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();