summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-01-21 10:05:59 -0500
committerLeon Scroggins <scroggo@google.com>2010-01-21 12:48:51 -0500
commit4cf7de0e445d302b45338fd46ecaa0b52d664eee (patch)
tree0074080c22b596f69f0e5265e1c3848ace2155bc /src
parent9be173303990c4cb24ce2d244a44e9af2fc32d4e (diff)
downloadpackages_apps_Browser-4cf7de0e445d302b45338fd46ecaa0b52d664eee.zip
packages_apps_Browser-4cf7de0e445d302b45338fd46ecaa0b52d664eee.tar.gz
packages_apps_Browser-4cf7de0e445d302b45338fd46ecaa0b52d664eee.tar.bz2
Remove the option to clear all downloads.
Clearing all downloads would remove completed downloads from the list, while leaving them on the SD card, and there would not necessarily be a way to delete them using the phone.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/BrowserDownloadPage.java59
1 files changed, 1 insertions, 58 deletions
diff --git a/src/com/android/browser/BrowserDownloadPage.java b/src/com/android/browser/BrowserDownloadPage.java
index 3483c30..a2b144b 100644
--- a/src/com/android/browser/BrowserDownloadPage.java
+++ b/src/com/android/browser/BrowserDownloadPage.java
@@ -122,9 +122,6 @@ public class BrowserDownloadPage extends ExpandableListActivity {
public boolean onPrepareOptionsMenu(Menu menu) {
boolean showCancel = getCancelableCount() > 0;
menu.findItem(R.id.download_menu_cancel_all).setEnabled(showCancel);
-
- boolean showClear = getClearableCount() > 0;
- menu.findItem(R.id.download_menu_clear_all).setEnabled(showClear);
return super.onPrepareOptionsMenu(menu);
}
@@ -134,10 +131,6 @@ public class BrowserDownloadPage extends ExpandableListActivity {
case R.id.download_menu_cancel_all:
promptCancelAll();
return true;
-
- case R.id.download_menu_clear_all:
- promptClearList();
- return true;
}
return false;
}
@@ -300,25 +293,6 @@ public class BrowserDownloadPage extends ExpandableListActivity {
}
/**
- * Prompt the user if they would like to clear the download history
- */
- private void promptClearList() {
- new AlertDialog.Builder(this)
- .setTitle(R.string.download_clear_dlg_title)
- .setIcon(R.drawable.ssl_icon)
- .setMessage(R.string.download_clear_dlg_msg)
- .setPositiveButton(R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int whichButton) {
- clearAllDownloads();
- }
- })
- .setNegativeButton(R.string.cancel, null)
- .show();
- }
-
- /**
* Return the number of items in the list that can be canceled.
* @return count
*/
@@ -416,38 +390,7 @@ public class BrowserDownloadPage extends ExpandableListActivity {
}
return count;
}
-
- /**
- * Clear all stopped downloads, ie canceled (though should not be
- * there), error and success download items.
- */
- private void clearAllDownloads() {
- if (mDownloadCursor.moveToFirst()) {
- StringBuilder where = new StringBuilder();
- boolean firstTime = true;
- while (!mDownloadCursor.isAfterLast()) {
- int status = mDownloadCursor.getInt(mStatusColumnId);
- if (Downloads.Impl.isStatusCompleted(status)) {
- if (firstTime) {
- firstTime = false;
- } else {
- where.append(" OR ");
- }
- where.append("( ");
- where.append(Downloads.Impl._ID);
- where.append(" = '");
- where.append(mDownloadCursor.getLong(mIdColumnId));
- where.append("' )");
- }
- mDownloadCursor.moveToNext();
- }
- if (!firstTime) {
- getContentResolver().delete(Downloads.Impl.CONTENT_URI,
- where.toString(), null);
- }
- }
- }
-
+
/**
* Open the content where the download db cursor currently is
*/