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:
@@ -44,6 +44,10 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(final Context context, Intent intent) {
|
public void onReceive(final Context context, Intent intent) {
|
||||||
|
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||||
|
Utils.cleanupDownloadsDir(context);
|
||||||
|
}
|
||||||
|
|
||||||
final SharedPreferences preferences =
|
final SharedPreferences preferences =
|
||||||
PreferenceManager.getDefaultSharedPreferences(context);
|
PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
if (!preferences.getBoolean(Constants.PREF_AUTO_UPDATES_CHECK, true)) {
|
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())) {
|
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||||
// Set a repeating alarm on boot to check for new updates once per day
|
// Set a repeating alarm on boot to check for new updates once per day
|
||||||
scheduleRepeatingUpdatesCheck(context);
|
scheduleRepeatingUpdatesCheck(context);
|
||||||
|
|
||||||
Utils.cleanupDownloadsDir(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long lastCheck = preferences.getLong(Constants.PREF_LAST_UPDATE_CHECK, -1);
|
long lastCheck = preferences.getLong(Constants.PREF_LAST_UPDATE_CHECK, -1);
|
||||||
|
Reference in New Issue
Block a user