diff options
author | Dan Egnor <egnor@google.com> | 2009-11-25 13:04:19 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-25 13:04:19 -0800 |
commit | 86ef717e2660dbc914dcf68295fbf9943c45bc44 (patch) | |
tree | c5fa8d52f0d09920ac2e62e2a6d9bff1bb770751 /tests | |
parent | f6a1dab030095ad1ed58d387ff21a112bca5b610 (diff) | |
parent | 99cee0318bdceb6e996bbe9a3e0f961d622e0365 (diff) | |
download | frameworks_base-86ef717e2660dbc914dcf68295fbf9943c45bc44.zip frameworks_base-86ef717e2660dbc914dcf68295fbf9943c45bc44.tar.gz frameworks_base-86ef717e2660dbc914dcf68295fbf9943c45bc44.tar.bz2 |
am 99cee031: Merge change Ieb7a7d57 into eclair-mr2
Merge commit '99cee0318bdceb6e996bbe9a3e0f961d622e0365' into eclair-mr2-plus-aosp
* commit '99cee0318bdceb6e996bbe9a3e0f961d622e0365':
Change the DropBoxManager API slightly (this is public, but not yet released) --
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AndroidTests/src/com/android/unit_tests/DropBoxTest.java | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/DropBoxTest.java b/tests/AndroidTests/src/com/android/unit_tests/DropBoxTest.java index a0d096e..305788d 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/DropBoxTest.java +++ b/tests/AndroidTests/src/com/android/unit_tests/DropBoxTest.java @@ -20,7 +20,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.DropBoxManager; -import android.os.ParcelFileDescriptor; import android.os.ServiceManager; import android.os.StatFs; import android.provider.Settings; @@ -126,22 +125,11 @@ public class DropBoxTest extends AndroidTestCase { DropBoxManager dropbox = (DropBoxManager) getContext().getSystemService( Context.DROPBOX_SERVICE); - int mode = ParcelFileDescriptor.MODE_READ_ONLY; - ParcelFileDescriptor pfd0 = ParcelFileDescriptor.open(f0, mode); - ParcelFileDescriptor pfd1 = ParcelFileDescriptor.open(f1, mode); - ParcelFileDescriptor pfd2 = ParcelFileDescriptor.open(f2, mode); - ParcelFileDescriptor pfd3 = ParcelFileDescriptor.open(f3, mode); - - dropbox.addFile("DropBoxTest", pfd0, DropBoxManager.IS_TEXT); - dropbox.addFile("DropBoxTest", pfd1, DropBoxManager.IS_TEXT | DropBoxManager.IS_GZIPPED); - dropbox.addFile("DropBoxTest", pfd2, 0); - dropbox.addFile("DropBoxTest", pfd3, DropBoxManager.IS_GZIPPED); - - pfd0.close(); - pfd1.close(); - pfd2.close(); - pfd3.close(); + dropbox.addFile("DropBoxTest", f0, DropBoxManager.IS_TEXT); + dropbox.addFile("DropBoxTest", f1, DropBoxManager.IS_TEXT | DropBoxManager.IS_GZIPPED); + dropbox.addFile("DropBoxTest", f2, 0); + dropbox.addFile("DropBoxTest", f3, DropBoxManager.IS_GZIPPED); DropBoxManager.Entry e0 = dropbox.getNextEntry("DropBoxTest", before); DropBoxManager.Entry e1 = dropbox.getNextEntry("DropBoxTest", e0.getTimeMillis()); @@ -506,9 +494,7 @@ public class DropBoxTest extends AndroidTestCase { os.write(bytes); os.close(); - ParcelFileDescriptor fd = ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY); - dropbox.addFile(tag, fd, 0); - fd.close(); + dropbox.addFile(tag, f, 0); } private int getEntrySize(DropBoxManager.Entry e) throws Exception { |