Loading src/org/lineageos/updater/UpdatesDbHelper.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_VERSION = "version"; 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"; public static final String COLUMN_NAME_SIZE = "size"; } } Loading @@ -53,6 +54,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_DISPLAY_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_SIZE + " INTEGER)"; UpdateEntry.COLUMN_NAME_SIZE + " INTEGER)"; private static final String SQL_DELETE_ENTRIES = private static final String SQL_DELETE_ENTRIES = Loading Loading @@ -84,6 +86,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); 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()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insert(UpdateEntry.TABLE_NAME, null, values); return db.insert(UpdateEntry.TABLE_NAME, null, values); } } Loading @@ -97,6 +100,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); 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()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insertWithOnConflict(UpdateEntry.TABLE_NAME, null, values, conflictAlgorithm); return db.insertWithOnConflict(UpdateEntry.TABLE_NAME, null, values, conflictAlgorithm); } } Loading Loading @@ -161,6 +165,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_VERSION, UpdateEntry.COLUMN_NAME_VERSION, UpdateEntry.COLUMN_NAME_DISPLAY_VERSION, UpdateEntry.COLUMN_NAME_STATUS, UpdateEntry.COLUMN_NAME_STATUS, UpdateEntry.COLUMN_NAME_SIZE, UpdateEntry.COLUMN_NAME_SIZE, }; }; Loading @@ -182,6 +187,8 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { update.setType(cursor.getString(index)); update.setType(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_VERSION); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_VERSION); update.setVersion(cursor.getString(index)); 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); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_STATUS); update.setPersistentStatus(cursor.getInt(index)); update.setPersistentStatus(cursor.getInt(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_SIZE); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_SIZE); Loading src/org/lineageos/updater/UpdatesListAdapter.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -247,7 +247,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. String buildDate = StringGenerator.getDateLocalizedUTC(mActivity, String buildDate = StringGenerator.getDateLocalizedUTC(mActivity, DateFormat.LONG, update.getTimestamp()); DateFormat.LONG, update.getTimestamp()); String buildVersion = mActivity.getString(R.string.list_build_version, String buildVersion = mActivity.getString(R.string.list_build_version, update.getVersion()); update.getDisplayVersion()); viewHolder.mBuildDate.setText(buildDate); viewHolder.mBuildDate.setText(buildDate); viewHolder.mBuildVersion.setText(buildVersion); viewHolder.mBuildVersion.setText(buildVersion); viewHolder.mBuildVersion.setCompoundDrawables(null, null, null, null); viewHolder.mBuildVersion.setCompoundDrawables(null, null, null, null); Loading src/org/lineageos/updater/misc/Utils.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,7 @@ public class Utils { update.setFileSize(object.getLong("size")); update.setFileSize(object.getLong("size")); update.setDownloadUrl(object.getString("url")); update.setDownloadUrl(object.getString("url")); update.setVersion(object.getString("version")); update.setVersion(object.getString("version")); update.setDisplayVersion(object.getString("display_version")); return update; return update; } } Loading src/org/lineageos/updater/model/UpdateBase.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ public class UpdateBase implements UpdateBaseInfo { private long mTimestamp; private long mTimestamp; private String mType; private String mType; private String mVersion; private String mVersion; private String mDisplayVersion; private long mFileSize; private long mFileSize; public UpdateBase() { public UpdateBase() { Loading @@ -35,6 +36,7 @@ public class UpdateBase implements UpdateBaseInfo { mTimestamp = update.getTimestamp(); mTimestamp = update.getTimestamp(); mType = update.getType(); mType = update.getType(); mVersion = update.getVersion(); mVersion = update.getVersion(); mDisplayVersion = update.getDisplayVersion(); mFileSize = update.getFileSize(); mFileSize = update.getFileSize(); } } Loading Loading @@ -83,6 +85,15 @@ public class UpdateBase implements UpdateBaseInfo { mVersion = version; mVersion = version; } } @Override public String getDisplayVersion() { return mDisplayVersion; } public void setDisplayVersion(String displayVersion) { mDisplayVersion = displayVersion; } @Override @Override public String getDownloadUrl() { public String getDownloadUrl() { return mDownloadUrl; return mDownloadUrl; Loading src/org/lineageos/updater/model/UpdateBaseInfo.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,8 @@ public interface UpdateBaseInfo { String getVersion(); String getVersion(); String getDisplayVersion(); String getDownloadUrl(); String getDownloadUrl(); long getFileSize(); long getFileSize(); Loading Loading
src/org/lineageos/updater/UpdatesDbHelper.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TIMESTAMP = "timestamp"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_TYPE = "type"; public static final String COLUMN_NAME_VERSION = "version"; 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"; public static final String COLUMN_NAME_SIZE = "size"; } } Loading @@ -53,6 +54,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TIMESTAMP + " INTEGER," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_TYPE + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_DISPLAY_VERSION + " TEXT," + UpdateEntry.COLUMN_NAME_SIZE + " INTEGER)"; UpdateEntry.COLUMN_NAME_SIZE + " INTEGER)"; private static final String SQL_DELETE_ENTRIES = private static final String SQL_DELETE_ENTRIES = Loading Loading @@ -84,6 +86,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); 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()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insert(UpdateEntry.TABLE_NAME, null, values); return db.insert(UpdateEntry.TABLE_NAME, null, values); } } Loading @@ -97,6 +100,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TIMESTAMP, update.getTimestamp()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_TYPE, update.getType()); values.put(UpdateEntry.COLUMN_NAME_VERSION, update.getVersion()); 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()); values.put(UpdateEntry.COLUMN_NAME_SIZE, update.getFileSize()); return db.insertWithOnConflict(UpdateEntry.TABLE_NAME, null, values, conflictAlgorithm); return db.insertWithOnConflict(UpdateEntry.TABLE_NAME, null, values, conflictAlgorithm); } } Loading Loading @@ -161,6 +165,7 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TIMESTAMP, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_TYPE, UpdateEntry.COLUMN_NAME_VERSION, UpdateEntry.COLUMN_NAME_VERSION, UpdateEntry.COLUMN_NAME_DISPLAY_VERSION, UpdateEntry.COLUMN_NAME_STATUS, UpdateEntry.COLUMN_NAME_STATUS, UpdateEntry.COLUMN_NAME_SIZE, UpdateEntry.COLUMN_NAME_SIZE, }; }; Loading @@ -182,6 +187,8 @@ public class UpdatesDbHelper extends SQLiteOpenHelper { update.setType(cursor.getString(index)); update.setType(cursor.getString(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_VERSION); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_VERSION); update.setVersion(cursor.getString(index)); 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); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_STATUS); update.setPersistentStatus(cursor.getInt(index)); update.setPersistentStatus(cursor.getInt(index)); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_SIZE); index = cursor.getColumnIndex(UpdateEntry.COLUMN_NAME_SIZE); Loading
src/org/lineageos/updater/UpdatesListAdapter.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -247,7 +247,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. String buildDate = StringGenerator.getDateLocalizedUTC(mActivity, String buildDate = StringGenerator.getDateLocalizedUTC(mActivity, DateFormat.LONG, update.getTimestamp()); DateFormat.LONG, update.getTimestamp()); String buildVersion = mActivity.getString(R.string.list_build_version, String buildVersion = mActivity.getString(R.string.list_build_version, update.getVersion()); update.getDisplayVersion()); viewHolder.mBuildDate.setText(buildDate); viewHolder.mBuildDate.setText(buildDate); viewHolder.mBuildVersion.setText(buildVersion); viewHolder.mBuildVersion.setText(buildVersion); viewHolder.mBuildVersion.setCompoundDrawables(null, null, null, null); viewHolder.mBuildVersion.setCompoundDrawables(null, null, null, null); Loading
src/org/lineageos/updater/misc/Utils.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,7 @@ public class Utils { update.setFileSize(object.getLong("size")); update.setFileSize(object.getLong("size")); update.setDownloadUrl(object.getString("url")); update.setDownloadUrl(object.getString("url")); update.setVersion(object.getString("version")); update.setVersion(object.getString("version")); update.setDisplayVersion(object.getString("display_version")); return update; return update; } } Loading
src/org/lineageos/updater/model/UpdateBase.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ public class UpdateBase implements UpdateBaseInfo { private long mTimestamp; private long mTimestamp; private String mType; private String mType; private String mVersion; private String mVersion; private String mDisplayVersion; private long mFileSize; private long mFileSize; public UpdateBase() { public UpdateBase() { Loading @@ -35,6 +36,7 @@ public class UpdateBase implements UpdateBaseInfo { mTimestamp = update.getTimestamp(); mTimestamp = update.getTimestamp(); mType = update.getType(); mType = update.getType(); mVersion = update.getVersion(); mVersion = update.getVersion(); mDisplayVersion = update.getDisplayVersion(); mFileSize = update.getFileSize(); mFileSize = update.getFileSize(); } } Loading Loading @@ -83,6 +85,15 @@ public class UpdateBase implements UpdateBaseInfo { mVersion = version; mVersion = version; } } @Override public String getDisplayVersion() { return mDisplayVersion; } public void setDisplayVersion(String displayVersion) { mDisplayVersion = displayVersion; } @Override @Override public String getDownloadUrl() { public String getDownloadUrl() { return mDownloadUrl; return mDownloadUrl; Loading
src/org/lineageos/updater/model/UpdateBaseInfo.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,8 @@ public interface UpdateBaseInfo { String getVersion(); String getVersion(); String getDisplayVersion(); String getDownloadUrl(); String getDownloadUrl(); long getFileSize(); long getFileSize(); Loading