Include a version number for DrawInstructions.
Bug: 286130467
Test: manual
Change-Id: I683da2af657b0a5734e8b6aef7ffa0e22db92433
diff --git a/core/api/current.txt b/core/api/current.txt
index 12737a6..c124bc8 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -60104,6 +60104,7 @@
}
@FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions {
+ method @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static long getSupportedVersion();
}
@FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions.Builder {
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 5bf1b5b..d353e48 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -7565,6 +7565,8 @@
@FlaggedApi(FLAG_DRAW_DATA_PARCEL)
public static final class DrawInstructions {
+ private static final long VERSION = 1L;
+
@NonNull
final List<byte[]> mInstructions;
@@ -7599,6 +7601,7 @@
}
return new DrawInstructions(instructions);
}
+
private static void writeToParcel(@Nullable final DrawInstructions drawInstructions,
@NonNull final Parcel dest, final int flags) {
if (drawInstructions == null) {
@@ -7614,6 +7617,14 @@
}
/**
+ * Version number of {@link DrawInstructions} currently supported.
+ */
+ @FlaggedApi(FLAG_DRAW_DATA_PARCEL)
+ public static long getSupportedVersion() {
+ return VERSION;
+ }
+
+ /**
* Builder class for {@link DrawInstructions} objects.
*/
@FlaggedApi(FLAG_DRAW_DATA_PARCEL)