Add support for null tag names from apps.

For Wakelocks and syncs there is no requirement that an app actually
supply a tag/name.  Jobs will always have system-supplied tags.

Bug: 26276001
Change-Id: Ie3b8e48a395de1506a2f15d5b9c9eab726bc6d0a
This commit is contained in:
Joe Onorato
2016-04-12 17:06:47 -07:00
parent cb6903deac
commit 388fc336b3

View File

@@ -1745,6 +1745,9 @@ public class BatteryStatsImpl extends BatteryStats {
}
public void add(String name, T obj) {
if (name == null) {
name = "";
}
mMap.put(name, obj);
if (OVERFLOW_NAME.equals(name)) {
mCurOverflow = obj;
@@ -1776,6 +1779,9 @@ public class BatteryStatsImpl extends BatteryStats {
}
public T startObject(String name) {
if (name == null) {
name = "";
}
T obj = mMap.get(name);
if (obj != null) {
return obj;
@@ -1825,6 +1831,9 @@ public class BatteryStatsImpl extends BatteryStats {
}
public T stopObject(String name) {
if (name == null) {
name = "";
}
T obj = mMap.get(name);
if (obj != null) {
return obj;