diff --git a/src/org/lineageos/updater/UpdatesDbHelper.java b/src/org/lineageos/updater/UpdatesDbHelper.java index a7b793e9..047bd0c7 100644 --- a/src/org/lineageos/updater/UpdatesDbHelper.java +++ b/src/org/lineageos/updater/UpdatesDbHelper.java @@ -37,7 +37,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { public static final String COLUMN_NAME_PATH = "path"; public static final String COLUMN_NAME_NAME = "name"; public static final String COLUMN_NAME_DOWNLOAD_ID = "download_id"; - public static final String COLUMN_NAME_DOWNLOAD_URL = "download_url"; public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_VERSION = "version"; @@ -51,7 +50,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_PATH + " TEXT," + UpdateEntry.COLUMN_NAME_NAME + " TEXT," + UpdateEntry.COLUMN_NAME_DOWNLOAD_ID + " TEXT NOT NULL UNIQUE," + - UpdateEntry.COLUMN_NAME_DOWNLOAD_URL + " TEXT," + UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + @@ -84,7 +82,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_PATH, update.getFile().getAbsolutePath()); values.put(UpdateEntry.COLUMN_NAME_NAME, update.getName()); values.put(UpdateEntry.COLUMN_NAME_DOWNLOAD_ID, update.getDownloadId()); - values.put(UpdateEntry.COLUMN_NAME_DOWNLOAD_URL, update.getDownloadUrl()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); @@ -99,7 +96,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_PATH, update.getFile().getAbsolutePath()); values.put(UpdateEntry.COLUMN_NAME_NAME, update.getName()); values.put(UpdateEntry.COLUMN_NAME_DOWNLOAD_ID, update.getDownloadId()); - values.put(UpdateEntry.COLUMN_NAME_DOWNLOAD_URL, update.getDownloadUrl()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); @@ -165,7 +161,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_PATH, UpdateEntry.COLUMN_NAME_NAME, UpdateEntry.COLUMN_NAME_DOWNLOAD_ID, - UpdateEntry.COLUMN_NAME_DOWNLOAD_URL, UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_VERSION, @@ -185,8 +180,6 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { update.setName(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_DOWNLOAD_ID); update.setDownloadId(cursor.getString(index)); - index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_DOWNLOAD_URL); - update.setDownloadUrl(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_TIMESTAMP); update.setTimestamp(cursor.getLong(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_TYPE); diff --git a/src/org/lineageos/updater/controller/UpdaterController.java b/src/org/lineageos/updater/controller/UpdaterController.java index 19029181..fa145931 100644 --- a/src/org/lineageos/updater/controller/UpdaterController.java +++ b/src/org/lineageos/updater/controller/UpdaterController.java @@ -320,6 +320,7 @@ public class UpdaterController implements UpdaterControllerInt { Log.d(TAG, "Download (" + update.getDownloadId() + ") already added"); UpdateDownload updateAdded = mDownloads.get(update.getDownloadId()).mUpdate; updateAdded.setAvailableOnline(availableOnline && updateAdded.getAvailableOnline()); + updateAdded.setDownloadUrl(update.getDownloadUrl()); return false; } if (!fixUpdateStatus(update) && !availableOnline) {