From 9ebb4d74a0c5233fe712e0ccabc183410ae3bc42 Mon Sep 17 00:00:00 2001 From: Romain Hunault Date: Thu, 16 Aug 2018 11:29:48 +0200 Subject: [PATCH] Change displayed version value --- src/org/lineageos/updater/UpdatesActivity.java | 2 +- src/org/lineageos/updater/UpdatesDbHelper.java | 6 ++++++ src/org/lineageos/updater/UpdatesListAdapter.java | 7 ++++++- src/org/lineageos/updater/misc/BuildInfoUtils.java | 4 ++++ src/org/lineageos/updater/misc/Constants.java | 1 + src/org/lineageos/updater/misc/Utils.java | 1 + src/org/lineageos/updater/model/UpdateBase.java | 11 +++++++++++ src/org/lineageos/updater/model/UpdateBaseInfo.java | 2 ++ 8 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java index 3585c3ce..5e90ef20 100644 --- a/src/org/lineageos/updater/UpdatesActivity.java +++ b/src/org/lineageos/updater/UpdatesActivity.java @@ -134,7 +134,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 71a20758..96102f54 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 = @@ -96,6 +98,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()); } @@ -159,6 +162,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, }; @@ -180,6 +184,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 3db2d781..5ecefa12 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -265,7 +265,12 @@ public class UpdatesListAdapter extends RecyclerView.Adapter