summaryrefslogtreecommitdiffstats
path: root/core/tests/coretests/src/android/app
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-09-29 17:03:32 -0700
committerSteve Howard <showard@google.com>2010-09-29 17:34:40 -0700
commit3e8c1d3a467bab889de7f92379be1f43d9c2d81e (patch)
tree14e845226e29aa69b4f980e9dc10ff1c0755fffe /core/tests/coretests/src/android/app
parent71e2486209856d33d027389be2bd4924a03c4f86 (diff)
downloadframeworks_base-3e8c1d3a467bab889de7f92379be1f43d9c2d81e.zip
frameworks_base-3e8c1d3a467bab889de7f92379be1f43d9c2d81e.tar.gz
frameworks_base-3e8c1d3a467bab889de7f92379be1f43d9c2d81e.tar.bz2
Have download manager give more details when downloads are paused
This change introduces more detailed reporting of why downloads are paused in the download manager. First, it adds new, more detailed status constants in android.provider.Downloads for when a download is paused, in place of the old catch-all STATUS_RUNNING_PAUSED. I've eliminated some dead code there as well to ease the change. Second, in the public API, it changes COLUMN_ERROR_CODE to COLUMN_REASON, which now reports useful info for STATUS_PAUSED in addition to STATUS_FAILED. It adds some new PAUSED_* constants for reason values when a download is paused, and adds code to generate these values appropriately. Change-Id: Ie617d1c2c59357375e19466086923ace5e2fb122
Diffstat (limited to 'core/tests/coretests/src/android/app')
-rw-r--r--core/tests/coretests/src/android/app/DownloadManagerIntegrationTest.java8
-rw-r--r--core/tests/coretests/src/android/app/DownloadManagerStressTest.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/core/tests/coretests/src/android/app/DownloadManagerIntegrationTest.java b/core/tests/coretests/src/android/app/DownloadManagerIntegrationTest.java
index 38f336e..27eea4d 100644
--- a/core/tests/coretests/src/android/app/DownloadManagerIntegrationTest.java
+++ b/core/tests/coretests/src/android/app/DownloadManagerIntegrationTest.java
@@ -120,7 +120,7 @@ public class DownloadManagerIntegrationTest extends DownloadManagerBaseTest {
Cursor cursor = getCursor(dlRequest);
try {
- verifyInt(cursor, DownloadManager.COLUMN_ERROR_CODE, error);
+ verifyInt(cursor, DownloadManager.COLUMN_REASON, error);
} finally {
cursor.close();
}
@@ -183,7 +183,7 @@ public class DownloadManagerIntegrationTest extends DownloadManagerBaseTest {
Cursor cursor = getCursor(dlRequest);
try {
verifyInt(cursor, DownloadManager.COLUMN_STATUS, DownloadManager.STATUS_FAILED);
- verifyInt(cursor, DownloadManager.COLUMN_ERROR_CODE,
+ verifyInt(cursor, DownloadManager.COLUMN_REASON,
DownloadManager.ERROR_CANNOT_RESUME);
} finally {
cursor.close();
@@ -269,7 +269,7 @@ public class DownloadManagerIntegrationTest extends DownloadManagerBaseTest {
try {
verifyInt(cursor, DownloadManager.COLUMN_STATUS, DownloadManager.STATUS_FAILED);
- verifyInt(cursor, DownloadManager.COLUMN_ERROR_CODE,
+ verifyInt(cursor, DownloadManager.COLUMN_REASON,
DownloadManager.ERROR_FILE_ERROR);
} finally {
cursor.close();
@@ -476,7 +476,7 @@ public class DownloadManagerIntegrationTest extends DownloadManagerBaseTest {
// For the last download we should have failed b/c there is not enough space left in cache
Cursor cursor = getCursor(dlRequest);
try {
- verifyInt(cursor, DownloadManager.COLUMN_ERROR_CODE,
+ verifyInt(cursor, DownloadManager.COLUMN_REASON,
DownloadManager.ERROR_INSUFFICIENT_SPACE);
} finally {
cursor.close();
diff --git a/core/tests/coretests/src/android/app/DownloadManagerStressTest.java b/core/tests/coretests/src/android/app/DownloadManagerStressTest.java
index 4ff0295..ddf138f 100644
--- a/core/tests/coretests/src/android/app/DownloadManagerStressTest.java
+++ b/core/tests/coretests/src/android/app/DownloadManagerStressTest.java
@@ -145,7 +145,7 @@ public class DownloadManagerStressTest extends DownloadManagerBaseTest {
cursor = getCursor(dlRequest);
verifyInt(cursor, DownloadManager.COLUMN_STATUS, DownloadManager.STATUS_FAILED);
- verifyInt(cursor, DownloadManager.COLUMN_ERROR_CODE,
+ verifyInt(cursor, DownloadManager.COLUMN_REASON,
DownloadManager.ERROR_INSUFFICIENT_SPACE);
} finally {
if (cursor != null) {