diff options
author | 2014-02-17 11:33:39 +0000 | |
---|---|---|
committer | 2014-02-17 11:33:39 +0000 | |
commit | d91cd9919e309e72f912f5cb135792351d7081ac (patch) | |
tree | 03920279cc36856ad5db0e18ed134e2cbb356abb /java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java | |
parent | da0edf86c412194483ac84b9a0961573f8377583 (diff) | |
parent | a149731a6764f259b7d15e05a2f557a3bdd23aab (diff) | |
download | latinime-d91cd9919e309e72f912f5cb135792351d7081ac.tar.gz latinime-d91cd9919e309e72f912f5cb135792351d7081ac.tar.xz latinime-d91cd9919e309e72f912f5cb135792351d7081ac.zip |
Merge "Catch exceptions we can't do anything about."
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java')
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java index 384ee3e07..2623eff56 100644 --- a/java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java +++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java @@ -107,26 +107,22 @@ public class DictionaryDownloadProgressBar extends ProgressBar { private class UpdaterThread extends Thread { private final static int REPORT_PERIOD = 150; // how often to report progress, in ms - final DownloadManager mDownloadManager; + final DownloadManagerWrapper mDownloadManagerWrapper; final int mId; public UpdaterThread(final Context context, final int id) { super(); - mDownloadManager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); + mDownloadManagerWrapper = new DownloadManagerWrapper(context); mId = id; } @Override public void run() { try { - // It's almost impossible that mDownloadManager is null (it would mean it has been - // disabled between pressing the 'install' button and displaying the progress - // bar), but just in case. - if (null == mDownloadManager) return; final UpdateHelper updateHelper = new UpdateHelper(); final Query query = new Query().setFilterById(mId); int lastProgress = 0; setIndeterminate(true); while (!isInterrupted()) { - final Cursor cursor = mDownloadManager.query(query); + final Cursor cursor = mDownloadManagerWrapper.query(query); if (null == cursor) { // Can't contact DownloadManager: this should never happen. return; |