summaryrefslogtreecommitdiffstats
path: root/tests/public_api_access
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-07-28 17:51:02 -0700
committerSteve Howard <showard@google.com>2010-07-28 18:39:35 -0700
commit9da9df3d6e84a3c4b04dd22d277e0e6d8f7f1ccb (patch)
tree49499d63a55ae22d33d7a63b62aced57fef39b1a /tests/public_api_access
parent0d4f9f105c3a31475a36e9a1edfa868c66ff455f (diff)
downloadandroid_packages_providers_DownloadProvider-9da9df3d6e84a3c4b04dd22d277e0e6d8f7f1ccb.zip
android_packages_providers_DownloadProvider-9da9df3d6e84a3c4b04dd22d277e0e6d8f7f1ccb.tar.gz
android_packages_providers_DownloadProvider-9da9df3d6e84a3c4b04dd22d277e0e6d8f7f1ccb.tar.bz2
Make all public API downloads visible.
This change makes all downloads through the public API visible by default. It removes the API that had allowed applications to control notifications while the download runs. This has been replaced with a hidden API, since such behavior is needed by SystemUpdater and Market (for self-updates). Additionally, the behavior is now protected by a new permission. I'm making this permission signatureOrSystem, and changing the non-purgeable permission to the same (it should've been that, I just didn't know). I'm also adding string descriptions to appease the translation folks. Change-Id: I192e8b19ff9b0e425257cef0db081c3d75996ea5
Diffstat (limited to 'tests/public_api_access')
-rw-r--r--tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java b/tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java
index aca5791..4b2ae09 100644
--- a/tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java
+++ b/tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java
@@ -53,7 +53,7 @@ public class PublicApiAccessTest extends AndroidTestCase {
@Override
protected void tearDown() throws Exception {
if (mContentResolver != null) {
- mContentResolver.delete(Downloads.CONTENT_URI, null, null);
+ mContentResolver.delete(Downloads.CONTENT_URI, null, null);
}
super.tearDown();
}
@@ -61,7 +61,7 @@ public class PublicApiAccessTest extends AndroidTestCase {
public void testMinimalValidWrite() {
mContentResolver.insert(Downloads.Impl.CONTENT_URI, buildValidValues());
}
-
+
public void testMaximalValidWrite() {
ContentValues values = buildValidValues();
values.put(Downloads.Impl.COLUMN_TITLE, "foo");
@@ -76,18 +76,19 @@ public class PublicApiAccessTest extends AndroidTestCase {
private ContentValues buildValidValues() {
ContentValues values = new ContentValues();
values.put(Downloads.Impl.COLUMN_URI, "foo");
- values.put(Downloads.Impl.COLUMN_DESTINATION,
+ values.put(Downloads.Impl.COLUMN_DESTINATION,
Downloads.Impl.DESTINATION_CACHE_PARTITION_PURGEABLE);
+ values.put(Downloads.Impl.COLUMN_VISIBILITY, Downloads.Impl.VISIBILITY_VISIBLE);
values.put(Downloads.Impl.COLUMN_IS_PUBLIC_API, true);
return values;
}
-
+
public void testNoPublicApi() {
ContentValues values = buildValidValues();
values.remove(Downloads.Impl.COLUMN_IS_PUBLIC_API);
testInvalidValues(values);
}
-
+
public void testInvalidDestination() {
ContentValues values = buildValidValues();
values.put(Downloads.Impl.COLUMN_DESTINATION, Downloads.Impl.DESTINATION_EXTERNAL);
@@ -95,14 +96,20 @@ public class PublicApiAccessTest extends AndroidTestCase {
values.put(Downloads.Impl.COLUMN_DESTINATION, Downloads.Impl.DESTINATION_CACHE_PARTITION);
testInvalidValues(values);
}
-
+
public void testInvalidVisibility() {
ContentValues values = buildValidValues();
- values.put(Downloads.Impl.COLUMN_VISIBILITY,
+ values.put(Downloads.Impl.COLUMN_VISIBILITY,
Downloads.Impl.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
testInvalidValues(values);
+
+ values.put(Downloads.Impl.COLUMN_VISIBILITY, Downloads.Impl.VISIBILITY_HIDDEN);
+ testInvalidValues(values);
+
+ values.remove(Downloads.Impl.COLUMN_VISIBILITY);
+ testInvalidValues(values);
}
-
+
public void testDisallowedColumns() {
for (String column : DISALLOWED_COLUMNS) {
ContentValues values = buildValidValues();
@@ -110,7 +117,7 @@ public class PublicApiAccessTest extends AndroidTestCase {
testInvalidValues(values);
}
}
-
+
public void testFileUriWithoutExternalPermission() {
ContentValues values = buildValidValues();
values.put(Downloads.Impl.COLUMN_DESTINATION, Downloads.Impl.DESTINATION_FILE_URI);