Skip to content

Commit fbfe6d9

Browse files
committed
Fixing DownloadManager Test app.
The skip notification version of waitForDownloadOrTimeout wasn't actually skipping the DownloadManager notification check. Change-Id: Iee42d9c67e63c9dc45ef5aad8ada7d34c31eeb60
1 parent 9f443fb commit fbfe6d9

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerBaseTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,10 @@ protected void setAirplaneModeOn(boolean enable) throws Exception {
491491
*
492492
* @param id The download id to query on (wait for)
493493
*/
494-
private void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutException,
494+
protected void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutException,
495495
InterruptedException {
496-
waitForDownloadOrTimeout(id, WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
496+
doWaitForDownloadsOrTimeout(new Query().setFilterById(id),
497+
WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
497498
}
498499

499500
/**
@@ -505,8 +506,7 @@ private void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutEx
505506
*/
506507
protected void waitForDownloadOrTimeout(long id) throws TimeoutException,
507508
InterruptedException {
508-
waitForDownloadOrTimeout_skipNotification(id);
509-
waitForReceiverNotifications(1);
509+
waitForDownloadOrTimeout(id, WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
510510
}
511511

512512
/**
@@ -813,4 +813,4 @@ protected Cursor getCursor(long id) throws Exception {
813813
}
814814
return cursor;
815815
}
816-
}
816+
}

core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public void verifyFileDownloadSucceeded() throws Exception {
208208

209209
// Wait until the download finishes; don't wait for a notification b/c
210210
// the download may well have been completed before the last reboot.
211-
waitForDownloadOrTimeout(dlRequest);
211+
waitForDownloadOrTimeout_skipNotification(dlRequest);
212212

213213
Log.i(LOG_TAG, "Verifying download information...");
214214
// Verify specific info about the file (size, name, etc)...

0 commit comments

Comments
 (0)