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

Commit 224126d7 authored by Stevie Kideckel's avatar Stevie Kideckel Committed by Automerger Merge Worker
Browse files

Merge "Copy caches when initializing RemoteViews" into sc-v2-dev am: 45cf23a6 am: 81bd66a5

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

Change-Id: I91e713a1c8e363f27199f2903d45f254101dec8a
parents 26e401ec 81bd66a5
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -3696,18 +3696,21 @@ public class RemoteViews implements Parcelable, Filter {
    }

    private void initializeFrom(@NonNull RemoteViews src, @Nullable RemoteViews hierarchyRoot) {
        if (hierarchyRoot == null) {
            mBitmapCache = src.mBitmapCache;
            mApplicationInfoCache = src.mApplicationInfoCache;
        } else {
            mBitmapCache = hierarchyRoot.mBitmapCache;
            mApplicationInfoCache = hierarchyRoot.mApplicationInfoCache;
        }
        if (hierarchyRoot == null || src.mIsRoot) {
            // If there's no provided root, or if src was itself a root, then this RemoteViews is
            // the root of the new hierarchy.
            mIsRoot = true;
            mBitmapCache = new BitmapCache();
            mApplicationInfoCache = new ApplicationInfoCache();
            hierarchyRoot = this;
        } else {
            // Otherwise, we're a descendant in the hierarchy.
            mIsRoot = false;
            mBitmapCache = hierarchyRoot.mBitmapCache;
            mApplicationInfoCache = hierarchyRoot.mApplicationInfoCache;
        }
        mApplication = src.mApplication;
        mLayoutId = src.mLayoutId;