Merge "Include a version number for DrawInstructions." into main
diff --git a/core/api/current.txt b/core/api/current.txt
index 4af2c52..2e1f1bb 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -60249,6 +60249,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 6e1131f..13dc4ef 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -7573,6 +7573,8 @@
@FlaggedApi(FLAG_DRAW_DATA_PARCEL)
public static final class DrawInstructions {
+ private static final long VERSION = 1L;
+
@NonNull
final List<byte[]> mInstructions;
@@ -7607,6 +7609,7 @@
}
return new DrawInstructions(instructions);
}
+
private static void writeToParcel(@Nullable final DrawInstructions drawInstructions,
@NonNull final Parcel dest, final int flags) {
if (drawInstructions == null) {
@@ -7622,6 +7625,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)