aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-08-16 12:59:54 -0700
committerYorke Lee <yorkelee@google.com>2013-08-16 13:04:32 -0700
commit40edceb15f39cbcfdcff749433b60b9f01ad47ca (patch)
tree7b48a41feadc4fd8fea813c272e0594231cbc8ec
parentcd026e956b76275bd6505aaaca5369f058eb66f4 (diff)
downloadContactsProvider-40edceb15f39cbcfdcff749433b60b9f01ad47ca.tar.gz
Set UNKNOWN_LENGTH for assetFileDescriptor
This is needed so that ContentResolver.openFileDescriptor doesn't throw an exception because it can't handle non-unknown file lengths Bug: 9864852 Change-Id: I4daeec09bf9f332000eafc3edb1f7ef6046f5048
-rw-r--r--src/com/android/providers/contacts/ContactsProvider2.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 5cdbb198..af31da11 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -7939,10 +7939,8 @@ public class ContactsProvider2 extends AbstractContactsProvider
stream.flush();
final byte[] byteData = stream.toByteArray();
-
return makeAssetFileDescriptor(
- ParcelFileDescriptor.fromData(byteData, CONTACT_MEMORY_FILE_NAME),
- byteData.length);
+ ParcelFileDescriptor.fromData(byteData, CONTACT_MEMORY_FILE_NAME));
} catch (IOException e) {
Log.w(TAG, "Problem writing stream into an ParcelFileDescriptor: " + e.toString());
return null;