summaryrefslogtreecommitdiff
path: root/core/java/android/widget/RemoteViews.java
diff options
context:
space:
mode:
authorAnthony Chen <ajchen@google.com>2017-07-05 11:22:25 -0700
committerAnthony Chen <ajchen@google.com>2017-07-05 21:12:41 +0000
commitea202f6646d435ed0b45d1b1dcfdf0959a09f2f2 (patch)
tree42ec138ea7be72c60f421be40b3e8958d7c8b6f7 /core/java/android/widget/RemoteViews.java
parente80ea58d604cb09eae1af5b8876bbb182dca2171 (diff)
Fix bug where RemoteViews addView is backwards.
The index on where to add a child view was not being saved when writing to a Parcel. This causes the index to default to 0 and resulted in views always being added as the first view. Now, persist this value to the Parcel and restore it. Test: booted up on Nexus 6P, created notification with RemoteView, added two views and verified views added in correct order. Bug: 63177271 Change-Id: I94384e348b8a5168efe0601f382cdd2db6791fdb
Diffstat (limited to 'core/java/android/widget/RemoteViews.java')
-rw-r--r--core/java/android/widget/RemoteViews.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index d2b9018e7abd..7761dcafab0a 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -1578,12 +1578,14 @@ public class RemoteViews implements Parcelable, Filter {
ViewGroupActionAdd(Parcel parcel, BitmapCache bitmapCache, ApplicationInfo info,
int depth) {
viewId = parcel.readInt();
+ mIndex = parcel.readInt();
mNestedViews = new RemoteViews(parcel, bitmapCache, info, depth);
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(VIEW_GROUP_ACTION_ADD_TAG);
dest.writeInt(viewId);
+ dest.writeInt(mIndex);
mNestedViews.writeToParcel(dest, flags);
}