Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26dd5cd0 authored by Sihua Ma's avatar Sihua Ma
Browse files

Fix NullPointerException when collecting bitmap sizes

Fix: 380232637
Test: Manual
Flag: android.appwidget.flags.remote_adapter_conversion
Change-Id: Ie9765b8906b7db6d285f97d0762b3d2845879241
parent 95b8b7e6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -9333,7 +9333,11 @@ public class RemoteViews implements Parcelable, Filter {
        Set<Integer> bitmapIdSet = getBitmapIdsUsedByActions(new HashSet<>());
        int result = 0;
        for (int bitmapId: bitmapIdSet) {
            result += mBitmapCache.getBitmapForId(bitmapId).getAllocationByteCount();
            Bitmap currentBitmap = mBitmapCache.getBitmapForId(bitmapId);
            if (currentBitmap == null) {
                continue;
            }
            result += currentBitmap.getAllocationByteCount();
        }

        return result;