diff options
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 2 | ||||
| -rw-r--r-- | core/tests/coretests/src/android/widget/RemoteViewsTest.java | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 0a5c14e3a08b..222a7b38c966 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -9216,6 +9216,7 @@ public class RemoteViews implements Parcelable, Filter { public static RemoteResponse fromFillInIntent(@NonNull Intent fillIntent) { RemoteResponse response = new RemoteResponse(); response.mFillIntent = fillIntent; + fillIntent.collectExtraIntentKeys(); return response; } @@ -9224,6 +9225,7 @@ public class RemoteViews implements Parcelable, Filter { RemoteResponse response = new RemoteResponse(); response.mPendingIntent = pendingIntent; response.mFillIntent = intent; + intent.collectExtraIntentKeys(); return response; } diff --git a/core/tests/coretests/src/android/widget/RemoteViewsTest.java b/core/tests/coretests/src/android/widget/RemoteViewsTest.java index 8b0d3158e9e7..9110898e18c9 100644 --- a/core/tests/coretests/src/android/widget/RemoteViewsTest.java +++ b/core/tests/coretests/src/android/widget/RemoteViewsTest.java @@ -22,6 +22,7 @@ import static com.android.internal.R.id.pending_intent_tag; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; @@ -1065,6 +1066,22 @@ public class RemoteViewsTest { assertEquals(b1Memory + b2Memory, rv.estimateTotalBitmapMemoryUsage()); } + @Test + public void remoteResponse_FillInIntentNestedIntentKeysCollected() { + Intent fillInIntent = new Intent(); + fillInIntent.putExtra("extraIntent", new Intent()); + RemoteViews.RemoteResponse.fromFillInIntent(fillInIntent); + assertNotEquals(0, fillInIntent.getExtendedFlags() + & Intent.EXTENDED_FLAG_NESTED_INTENT_KEYS_COLLECTED); + + fillInIntent = new Intent(); + fillInIntent.putExtra("extraIntent", new Intent()); + RemoteViews rv = new RemoteViews(mPackage, R.layout.remote_views_test); + rv.setOnClickFillInIntent(R.id.view, fillInIntent); + assertNotEquals(0, fillInIntent.getExtendedFlags() + & Intent.EXTENDED_FLAG_NESTED_INTENT_KEYS_COLLECTED); + } + private static LayoutInflater.Factory2 createLayoutInflaterFactory(String viewTypeToReplace, View replacementView) { return new LayoutInflater.Factory2() { |