Remove unknwon files that are in the downloads dir

The files are supposed to be downloaded in a privileged location
that the user can't access. If the user wipes the data of the
application, the updates downloaded are not removed. Perform a
one-time cleanup so that our downloads dir doesn't grow without
control.
This commit is contained in:
Gabriele M
2017-07-08 01:09:22 +02:00
parent 6534932b20
commit efa829358d
4 changed files with 51 additions and 0 deletions

View File

@@ -79,6 +79,8 @@ public class UpdaterController implements UpdaterControllerInt {
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Updater");
mWakeLock.setReferenceCounted(false);
Utils.cleanupDownloadsDir(context);
for (UpdateDownload update : mUpdatesDbHelper.getUpdates()) {
addUpdate(update, false);
}