From acff20bda404f59ffba6035b18956d6aff7afcd8 Mon Sep 17 00:00:00 2001 From: Jeff Hamilton Date: Wed, 28 Oct 2009 14:14:54 -0500 Subject: [PATCH] Copy the selection args when creating a CPO since callers often reuse the passed in array. Bug: 2221947 Change-Id: I3b7d5cbef61777d76ca7fc0d7c91c44553e609a9 --- core/java/android/content/ContentProviderOperation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/ContentProviderOperation.java b/core/java/android/content/ContentProviderOperation.java index 60b406d36467b..0467516b4b846 100644 --- a/core/java/android/content/ContentProviderOperation.java +++ b/core/java/android/content/ContentProviderOperation.java @@ -545,7 +545,8 @@ public class ContentProviderOperation implements Parcelable { "only updates, deletes, and asserts can have selections"); } mSelection = selection; - mSelectionArgs = selectionArgs; + mSelectionArgs = new String[selectionArgs.length]; + System.arraycopy(selectionArgs, 0, mSelectionArgs, 0, selectionArgs.length); return this; }