diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java index efea969827bbf087bfb73186ae83f575ad68fb01..b9161d090ebc10ad4d43b64b909f722d0ef5e9bb 100644 --- a/src/org/lineageos/updater/UpdatesActivity.java +++ b/src/org/lineageos/updater/UpdatesActivity.java @@ -116,7 +116,7 @@ public class UpdatesActivity extends UpdatesListActivity { TextView headerTitle = (TextView) findViewById(R.id.header_title); headerTitle.setText(getString(R.string.header_title_text, - BuildInfoUtils.getBuildVersion())); + BuildInfoUtils.getDisplayVersion())); updateLastCheckedString(); diff --git a/src/org/lineageos/updater/UpdatesDbHelper.java b/src/org/lineageos/updater/UpdatesDbHelper.java index 7ec5736fdbd5cce472af9f23a331dd5c3dc712c1..01e6fc2674b66215fb0a461ae5700b17410b59d6 100644 --- a/src/org/lineageos/updater/UpdatesDbHelper.java +++ b/src/org/lineageos/updater/UpdatesDbHelper.java @@ -41,6 +41,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_VERSION = "version"; + public static final String COLUMN_NAME_DISPLAY_VERSION = "display_version"; public static final String COLUMN_NAME_SIZE = "size"; } @@ -53,6 +54,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + + UpdateEntry.COLUMN_NAME_DISPLAY_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_SIZE + " INTEGER)"; private static final String SQL_DELETE_ENTRIES = @@ -84,6 +86,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); + values.put(UpdateEntry.COLUMN_NAME_DISPLAY_VERSION, update.getDisplayVersion()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insert(UpdateEntry.TABLE_NAME, null, values); } @@ -97,6 +100,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); + values.put(UpdateEntry.COLUMN_NAME_DISPLAY_VERSION, update.getDisplayVersion()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insertWithOnConflict(UpdateEntry.TABLE_NAME, null, values, conflictAlgorithm); } @@ -161,6 +165,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_VERSION, + UpdateEntry.COLUMN_NAME_DISPLAY_VERSION, UpdateEntry.COLUMN_NAME_STATUS, UpdateEntry.COLUMN_NAME_SIZE, }; @@ -182,6 +187,8 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { update.setType(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_VERSION); update.setVersion(cursor.getString(index)); + index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_DISPLAY_VERSION); + update.setDisplayVersion(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_STATUS); update.setPersistentStatus(cursor.getInt(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_SIZE); diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index a1aa9442756e498f5155cd175b806560dc22e86c..0df51d989701d0dd7b402293499764eb90bd90fb 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -249,7 +249,13 @@ public class UpdatesListAdapter extends RecyclerView.Adapter