Treat major upgrades as a special case
Major upgrades are compatible, but shouldn't be allowed since they require some manual extra steps.
This commit is contained in:
@@ -100,7 +100,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
||||
viewHolder.mButton2.setEnabled(false);
|
||||
} else {
|
||||
// Allow one active download
|
||||
boolean enabled = !mDownloadController.hasActiveDownloads();
|
||||
boolean enabled = !mDownloadController.hasActiveDownloads() && Utils.canInstall(update);
|
||||
int persistentStatus = update.getPersistentStatus();
|
||||
if (persistentStatus == UpdateStatus.Persistent.INCOMPLETE) {
|
||||
setButtonAction(viewHolder.mButton1, Action.RESUME, downloadId, enabled);
|
||||
|
@@ -73,13 +73,13 @@ public class Utils {
|
||||
Log.d(TAG, update.getName() + " has type " + update.getType());
|
||||
return false;
|
||||
}
|
||||
if (!update.getVersion().equalsIgnoreCase(SystemProperties.get("ro.cm.build.version"))) {
|
||||
Log.d(TAG, update.getName() + " has version " + update.getVersion());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean canInstall(Update update) {
|
||||
return update.getVersion().equalsIgnoreCase(SystemProperties.get("ro.cm.build.version"));
|
||||
}
|
||||
|
||||
public static List<UpdateDownload> parseJson(File file, boolean compatibleOnly)
|
||||
throws IOException, JSONException {
|
||||
List<UpdateDownload> updates = new ArrayList<>();
|
||||
|
Reference in New Issue
Block a user