Allow to resume updates fully downloaded

Resuming an update fully downloaded will simply trigger an update
verification. This is useful for imported downloads since it allows
exporting them.
This commit is contained in:
Gabriele M
2017-07-19 22:12:00 +02:00
parent 1659fe26b9
commit ec269b6fb1

View File

@@ -285,7 +285,8 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
mActivity.getString(R.string.action_description_resume));
button.setEnabled(enabled);
UpdateDownload update = mUpdaterController.getUpdate(downloadId);
final boolean canInstall = Utils.canInstall(update);
final boolean canInstall = Utils.canInstall(update) ||
update.getFile().length() == update.getFileSize();
clickListener = !enabled ? null : new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -489,7 +490,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
private void exportUpdate(UpdateDownload update) {
try {
File dest = new File(Utils.getExportPath(), update.getName());
File dest = new File(Utils.getExportPath(mActivity), update.getName());
if (dest.exists()) {
dest = Utils.appendSequentialNumber(dest);
}