diff options
author | 2014-02-17 03:35:58 -0800 | |
---|---|---|
committer | 2014-02-17 03:35:58 -0800 | |
commit | daf28b45a4367b6877e895e8e8e43c6df1187074 (patch) | |
tree | 41048913ed2cd3c48ede7eb73dd6b0b9382c3adc /java/src/com/android/inputmethod/dictionarypack/DictionaryDownloadProgressBar.java | |
parent | 8a045cd6c3c25aaf419697a8510ee996b77f6bcb (diff) | |
parent | d91cd9919e309e72f912f5cb135792351d7081ac (diff) | |
download | latinime-daf28b45a4367b6877e895e8e8e43c6df1187074.tar.gz latinime-daf28b45a4367b6877e895e8e8e43c6df1187074.tar.xz latinime-daf28b45a4367b6877e895e8e8e43c6df1187074.zip |
am d91cd991: Merge "Catch exceptions we can\'t do anything about."
* commit 'd91cd9919e309e72f912f5cb135792351d7081ac':
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; |