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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user