diff options
author | Fred Quintana <fredq@google.com> | 2009-08-05 21:06:45 -0700 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2009-08-06 15:59:28 -0700 |
commit | 8851e163fc5bc17d139bf29cd2ec2f3926d342bc (patch) | |
tree | 785b0e3dfd8a3aef9b72d5ea7134a968995e8e92 /core/java/android/content/ContentProviderOperation.java | |
parent | be26ac5835aecd3a2ac7c6245467d9d1345c1b88 (diff) | |
download | frameworks_base-8851e163fc5bc17d139bf29cd2ec2f3926d342bc.zip frameworks_base-8851e163fc5bc17d139bf29cd2ec2f3926d342bc.tar.gz frameworks_base-8851e163fc5bc17d139bf29cd2ec2f3926d342bc.tar.bz2 |
- add several common kinds and beef up some others
- change the ContentProviderOperation selection backref store the backref as a long instead of as a string
Diffstat (limited to 'core/java/android/content/ContentProviderOperation.java')
-rw-r--r-- | core/java/android/content/ContentProviderOperation.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/content/ContentProviderOperation.java b/core/java/android/content/ContentProviderOperation.java index c0db01a..70ea5d0 100644 --- a/core/java/android/content/ContentProviderOperation.java +++ b/core/java/android/content/ContentProviderOperation.java @@ -301,7 +301,8 @@ public class ContentProviderOperation implements Parcelable { : mSelectionArgsBackReferences.entrySet()) { final Integer selectionArgIndex = selectionArgBackRef.getKey(); final int backRefIndex = selectionArgBackRef.getValue(); - newArgs[selectionArgIndex] = backRefToValue(backRefs, numBackRefs, backRefIndex); + newArgs[selectionArgIndex] = + String.valueOf(backRefToValue(backRefs, numBackRefs, backRefIndex)); } return newArgs; } @@ -315,18 +316,18 @@ public class ContentProviderOperation implements Parcelable { * the numBackRefs * @return the string representation of the requested back reference. */ - private static String backRefToValue(ContentProviderResult[] backRefs, int numBackRefs, + private static long backRefToValue(ContentProviderResult[] backRefs, int numBackRefs, Integer backRefIndex) { if (backRefIndex >= numBackRefs) { throw new ArrayIndexOutOfBoundsException("asked for back ref " + backRefIndex + " but there are only " + numBackRefs + " back refs"); } ContentProviderResult backRef = backRefs[backRefIndex]; - String backRefValue; + long backRefValue; if (backRef.uri != null) { - backRefValue = backRef.uri.getLastPathSegment(); + backRefValue = ContentUris.parseId(backRef.uri); } else { - backRefValue = String.valueOf(backRef.count); + backRefValue = backRef.count; } return backRefValue; } |