Always cleanup the download directory

This shouldn't really be necessary since the cleanup is needed after
the application data has been wiped, which by default has the
automatic updates check enabled.
This commit is contained in:
Gabriele M
2017-07-17 00:30:14 +02:00
parent c3515644b6
commit 75befd1738

View File

@@ -44,6 +44,10 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
Utils.cleanupDownloadsDir(context);
}
final SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(context);
if (!preferences.getBoolean(Constants.PREF_AUTO_UPDATES_CHECK, true)) {
@@ -53,8 +57,6 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
// Set a repeating alarm on boot to check for new updates once per day
scheduleRepeatingUpdatesCheck(context);
Utils.cleanupDownloadsDir(context);
}
long lastCheck = preferences.getLong(Constants.PREF_LAST_UPDATE_CHECK, -1);