Fix failed tests since presubmit is ignored in ag/15802168 am: 27efa546cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15809054

Change-Id: I5b0e17f5862f295da35456f691dfcdc32587bcdc
This commit is contained in:
ykhung
2021-09-11 18:13:37 +00:00
committed by Automerger Merge Worker
3 changed files with 66 additions and 11 deletions

View File

@@ -113,7 +113,9 @@ public class BatteryDiffEntry {
/** Gets the app icon {@link Drawable} for this entry. */
public Drawable getAppIcon() {
loadLabelAndIcon();
return mAppIcon.getConstantState().newDrawable();
return mAppIcon != null && mAppIcon.getConstantState() != null
? mAppIcon.getConstantState().newDrawable()
: null;
}
/** Gets the app icon id for this entry. */