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

Commit b646c557 authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Make RemoteViews.DrawInstructions immutable.

Bug: 322866502
Test: atest RemoteViewsTest
Change-Id: Ieed879a99a371d2ed26c9a9564d0614372e3dd85
parent 2afe1f8d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -59407,7 +59407,6 @@ package android.widget {
  }
  @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions {
    method @FlaggedApi("android.appwidget.flags.draw_data_parcel") public void appendInstructions(@NonNull byte[]);
  }
  @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions.Builder {
+0 −8
Original line number Diff line number Diff line
@@ -7596,14 +7596,6 @@ public class RemoteViews implements Parcelable, Filter {
            }
        }

        /**
         * Append additional instructions to this {@link DrawInstructions} object.
         */
        @FlaggedApi(FLAG_DRAW_DATA_PARCEL)
        public void appendInstructions(@NonNull final byte[] instructions) {
            mInstructions.add(instructions);
        }

        /**
         * Builder class for {@link DrawInstructions} objects.
         */
+2 −7
Original line number Diff line number Diff line
@@ -450,13 +450,8 @@ public class RemoteViewsTest {
    }

    private RemoteViews.DrawInstructions getDrawInstructions() {
        final byte[] first = new byte[] {'f', 'i', 'r', 's', 't'};
        final byte[] second = new byte[] {'s', 'e', 'c', 'o', 'n', 'd'};
        final RemoteViews.DrawInstructions drawInstructions =
                new RemoteViews.DrawInstructions.Builder(
                        Collections.singletonList(first)).build();
        drawInstructions.appendInstructions(second);
        return drawInstructions;
        final byte[] bytes = new byte[] {'h', 'e', 'l', 'l', 'o'};
        return new RemoteViews.DrawInstructions.Builder(Collections.singletonList(bytes)).build();
    }

    private RemoteViews createViewChained(int depth, String... texts) {