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);
|
viewHolder.mButton2.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
// Allow one active download
|
// Allow one active download
|
||||||
boolean enabled = !mDownloadController.hasActiveDownloads();
|
boolean enabled = !mDownloadController.hasActiveDownloads() && Utils.canInstall(update);
|
||||||
int persistentStatus = update.getPersistentStatus();
|
int persistentStatus = update.getPersistentStatus();
|
||||||
if (persistentStatus == UpdateStatus.Persistent.INCOMPLETE) {
|
if (persistentStatus == UpdateStatus.Persistent.INCOMPLETE) {
|
||||||
setButtonAction(viewHolder.mButton1, Action.RESUME, downloadId, enabled);
|
setButtonAction(viewHolder.mButton1, Action.RESUME, downloadId, enabled);
|
||||||
|
@@ -73,13 +73,13 @@ public class Utils {
|
|||||||
Log.d(TAG, update.getName() + " has type " + update.getType());
|
Log.d(TAG, update.getName() + " has type " + update.getType());
|
||||||
return false;
|
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;
|
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)
|
public static List<UpdateDownload> parseJson(File file, boolean compatibleOnly)
|
||||||
throws IOException, JSONException {
|
throws IOException, JSONException {
|
||||||
List<UpdateDownload> updates = new ArrayList<>();
|
List<UpdateDownload> updates = new ArrayList<>();
|
||||||
|
Reference in New Issue
Block a user