and more fixes

* fix content length reading
* use float overflow. Expensive, double is used instead
* fix invalid cast after click the mission body
* use a list for maximum attemps (downloads)
* minor clean up (DownloadManager.java)
* dont pass SharedPreferences instace to DownloadManager
* use a switch instead of checkbox for cross_network_downloads
* notify media scanner after deleting a finished download
This commit is contained in:
kapodamy 2018-11-24 00:14:37 -03:00
parent d647555e3a
commit f3d4d4747a
12 changed files with 111 additions and 52 deletions

View file

@ -306,7 +306,12 @@ public class DownloadManagerService extends Service {
private void handlePreferenceChange(SharedPreferences prefs, String key) {
if (key.equals(getString(R.string.downloads_max_retry))) {
mManager.updateMaximumAttempts(prefs.getInt(key, 3));
mManager.mPrefMaxRetry = Integer.parseInt(
prefs.getString(key, getString(R.string.default_max_retry))
);
mManager.updateMaximumAttempts();
} else if (key.equals(getString(R.string.cross_network_downloads))) {
mManager.mPrefCrossNetwork = prefs.getBoolean(key, false);
}
}