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

Commit 80e620bc authored by Pinyao Ting's avatar Pinyao Ting Committed by Android (Google) Code Review
Browse files

Merge "Various Fixes in RemoteViews.DrawInstructions" into main

parents f4a5566f ab0fca88
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -4299,7 +4299,7 @@ public class RemoteViews implements Parcelable, Filter {
        }

        if (mode == MODE_NORMAL) {
            mApplication = ApplicationInfo.CREATOR.createFromParcel(parcel);
            mApplication = parcel.readTypedObject(ApplicationInfo.CREATOR);
            mIdealSize = parcel.readInt() == 0 ? null : SizeF.CREATOR.createFromParcel(parcel);
            mLayoutId = parcel.readInt();
            mViewId = parcel.readInt();
@@ -6805,7 +6805,7 @@ public class RemoteViews implements Parcelable, Filter {
                mBitmapCache.writeBitmapsToParcel(dest, flags);
                mCollectionCache.writeToParcel(dest, flags, intentsToIgnore);
            }
            mApplication.writeToParcel(dest, flags);
            dest.writeTypedObject(mApplication, flags);
            if (mIsRoot || mIdealSize == null) {
                dest.writeInt(0);
            } else {
@@ -6893,7 +6893,8 @@ public class RemoteViews implements Parcelable, Filter {
     * @hide
     */
    public boolean hasSameAppInfo(ApplicationInfo info) {
        return mApplication.packageName.equals(info.packageName) && mApplication.uid == info.uid;
        return mApplication == null || mApplication.packageName.equals(info.packageName)
                && mApplication.uid == info.uid;
    }

    /**
@@ -7672,8 +7673,7 @@ public class RemoteViews implements Parcelable, Filter {
            byte[] instruction;
            final List<byte[]> instructions = new ArrayList<>(size);
            for (int i = 0; i < size; i++) {
                instruction = new byte[in.readInt()];
                in.readByteArray(instruction);
                instruction = in.readBlob();
                instructions.add(instruction);
            }
            return new DrawInstructions(instructions);
@@ -7688,8 +7688,7 @@ public class RemoteViews implements Parcelable, Filter {
            final List<byte[]> instructions = drawInstructions.mInstructions;
            dest.writeInt(instructions.size());
            for (byte[] instruction : instructions) {
                dest.writeInt(instruction.length);
                dest.writeByteArray(instruction);
                dest.writeBlob(instruction);
            }
        }