Merge "Fix NullPointerException in BatteryUsageStats" into sc-dev am: 8017f4ed5e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14179252

Change-Id: I86d79adb20c4747763bcf6fc8158cd42088d5651
This commit is contained in:
Dmitri Plotnikov
2021-04-14 19:15:18 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 7 deletions

View File

@@ -6951,9 +6951,9 @@ public class BatteryStatsImpl extends BatteryStats {
/**
* Returns the names of custom power components.
*/
public @Nullable String[] getCustomPowerComponentNames() {
public @NonNull String[] getCustomPowerComponentNames() {
if (mGlobalMeasuredEnergyStats == null) {
return null;
return new String[0];
}
final String[] names = mGlobalMeasuredEnergyStats.getCustomBucketNames();
for (int i = 0; i < names.length; i++) {