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

Commit 77479f42 authored by Sihua Ma's avatar Sihua Ma
Browse files

Restore squashing permission for size test parcel

This helps remove the noises in the error messages

Bug: 245950570
Test: Manual
Change-Id: Ibdf0d494598b86c1348b1e6fbbfa5f308b9377bf
parent b060f8a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -132,7 +132,8 @@ public abstract class RemoteViewsService extends Service {
            RemoteViews.RemoteCollectionItems items = new RemoteViews.RemoteCollectionItems
                    .Builder().build();
            Parcel capSizeTestParcel = Parcel.obtain();
            capSizeTestParcel.allowSquashing();
            // restore allowSquashing to reduce the noise in error messages
            boolean prevAllowSquashing = capSizeTestParcel.allowSquashing();

            try {
                RemoteViews.RemoteCollectionItems.Builder itemsBuilder =
@@ -154,6 +155,7 @@ public abstract class RemoteViewsService extends Service {

                items = itemsBuilder.build();
            } finally {
                capSizeTestParcel.restoreAllowSquashing(prevAllowSquashing);
                // Recycle the parcel
                capSizeTestParcel.recycle();
            }