summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDan Egnor <egnor@google.com>2009-11-25 13:11:59 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-25 13:11:59 -0800
commitf3ab5c6b32e682e94e6909ef427e1ac7381f0490 (patch)
tree1d75f6ada7b879476b2b6f17a9157ea210a01186 /tests
parentd107146ca174adc51721b2e654e9d29d7478234b (diff)
parent86ef717e2660dbc914dcf68295fbf9943c45bc44 (diff)
downloadframeworks_base-f3ab5c6b32e682e94e6909ef427e1ac7381f0490.zip
frameworks_base-f3ab5c6b32e682e94e6909ef427e1ac7381f0490.tar.gz
frameworks_base-f3ab5c6b32e682e94e6909ef427e1ac7381f0490.tar.bz2
am 86ef717e: am 99cee031: Merge change Ieb7a7d57 into eclair-mr2
Merge commit '86ef717e2660dbc914dcf68295fbf9943c45bc44' * commit '86ef717e2660dbc914dcf68295fbf9943c45bc44': 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.java24
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 {