diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f01e7779057d55c3e2f9d091c60879e100af9deb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,7 @@
+stages:
+ - update-from-upstream
+
+include:
+ - project: 'e/templates'
+ ref: master
+ file: '/gitlab-ci/.gitlab-ci-import-updates-from-upstream.yml'
diff --git a/res/menu/menu_toolbar.xml b/res/menu/menu_toolbar.xml
index 8b9117ce197f1a1c95bdb823a76a6f7948ac3160..09df5e68712800ec4e13d2b52e84347dd0c68c81 100644
--- a/res/menu/menu_toolbar.xml
+++ b/res/menu/menu_toolbar.xml
@@ -12,6 +12,6 @@
app:showAsAction="never" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index bfb26276cc9dc6f0a8f03472153d508f1d20cebd..7dcb92a9f9dd3cf7d8472057b5fca3d0a5674a90 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -32,7 +32,8 @@
{type} - Build type
{incr} - Incremental version
-->
- https://download.lineageos.org/api/v1/{device}/{type}/{incr}
+ https://ota.ecloud.global/api/v1/{device}/{type}/{incr}
+ https://test.ota.ecloud.global/api/v1/{device}/{type}/{incr}
Verification failed
Verifying update
@@ -75,7 +76,7 @@
Copy URL
Export update
Show changelog
- https://download.lineageos.org/%1$s/changes
+ https://gitlab.e.foundation/e/os/releases/-/releases/v%1$s-s
Prioritize update process
Update recovery
It is impossible to disable Lineage Recovery updates on this device.
@@ -157,4 +158,16 @@
Did you know?
LineageOS updates are full installation packages. That means you can always install only the latest update, even if you skipped some in between!
Thanks for the info!
+
+
+
+
+ /e/OS %1$s
+ /e/OS %1$s - %2$s
+
+
+ Show release notes
+
+
+ /e/OS updates are full installation packages. That means you can always install only the latest update, even if you skipped some in between!
diff --git a/src/org/lineageos/updater/UpdaterReceiver.java b/src/org/lineageos/updater/UpdaterReceiver.java
index 1fb2c5a04fec93f6938e5c000b246c8dcfc3403d..081b8d976d7ec62718fc327b1c1b6c2ac5a3cb5b 100644
--- a/src/org/lineageos/updater/UpdaterReceiver.java
+++ b/src/org/lineageos/updater/UpdaterReceiver.java
@@ -60,7 +60,7 @@ public class UpdaterReceiver extends BroadcastReceiver {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
String buildDate = StringGenerator.getDateLocalizedUTC(context,
DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0));
- String buildInfo = context.getString(R.string.list_build_version_date,
+ String buildInfo = context.getString(R.string.list_build_version_date_e,
BuildInfoUtils.getBuildVersion(), buildDate);
Intent notificationIntent = new Intent(context, UpdatesActivity.class);
diff --git a/src/org/lineageos/updater/UpdatesActivity.java b/src/org/lineageos/updater/UpdatesActivity.java
index 9c56f0bb7707e05a07912f99b62ccfef414e6d4e..4e916a27089be1317759aa1236aeab7e8b38812d 100644
--- a/src/org/lineageos/updater/UpdatesActivity.java
+++ b/src/org/lineageos/updater/UpdatesActivity.java
@@ -151,7 +151,7 @@ public class UpdatesActivity extends UpdatesListActivity {
TextView headerTitle = findViewById(R.id.header_title);
headerTitle.setText(getString(R.string.header_title_text,
- BuildInfoUtils.getBuildVersion()));
+ BuildInfoUtils.getDisplayVersion()));
updateLastCheckedString();
@@ -330,7 +330,7 @@ public class UpdatesActivity extends UpdatesListActivity {
preferences.edit().putLong(Constants.PREF_LAST_UPDATE_CHECK, millis).apply();
updateLastCheckedString();
if (json.exists() && Utils.isUpdateCheckEnabled(this) &&
- Utils.checkForNewUpdates(json, jsonNew)) {
+ Utils.checkForNewUpdates(jsonNew)) {
UpdatesCheckReceiver.updateRepeatingUpdatesCheck(this);
}
// In case we set a one-shot check because of a previous failure
@@ -491,7 +491,7 @@ public class UpdatesActivity extends UpdatesListActivity {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
autoCheckInterval.setSelection(Utils.getUpdateCheckSetting(this));
- autoDelete.setChecked(prefs.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false));
+ autoDelete.setChecked(prefs.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, true));
dataWarning.setChecked(prefs.getBoolean(Constants.PREF_MOBILE_DATA_WARNING, true));
abPerfMode.setChecked(prefs.getBoolean(Constants.PREF_AB_PERF_MODE, false));
diff --git a/src/org/lineageos/updater/UpdatesCheckReceiver.java b/src/org/lineageos/updater/UpdatesCheckReceiver.java
index 7fa9cd5cd8fd9ab73b5592d6a73475cae93e9b0e..9cb3d755b4678ff64658e502c2bc81ae00d6ab84 100644
--- a/src/org/lineageos/updater/UpdatesCheckReceiver.java
+++ b/src/org/lineageos/updater/UpdatesCheckReceiver.java
@@ -90,7 +90,7 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
@Override
public void onSuccess() {
try {
- if (json.exists() && Utils.checkForNewUpdates(json, jsonNew)) {
+ if (json.exists() && Utils.checkForNewUpdates(jsonNew)) {
showNotification(context);
updateRepeatingUpdatesCheck(context);
}
@@ -160,8 +160,8 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
PendingIntent updateCheckIntent = getRepeatingUpdatesCheckIntent(context);
AlarmManager alarmMgr = context.getSystemService(AlarmManager.class);
- alarmMgr.setRepeating(AlarmManager.RTC, System.currentTimeMillis() +
- Utils.getUpdateCheckInterval(context), Utils.getUpdateCheckInterval(context),
+ alarmMgr.setExactAndAllowWhileIdle(AlarmManager.RTC,
+ System.currentTimeMillis() + Utils.getUpdateCheckInterval(context),
updateCheckIntent);
Date nextCheckDate = new Date(System.currentTimeMillis() +
@@ -184,7 +184,7 @@ public class UpdatesCheckReceiver extends BroadcastReceiver {
long millisToNextCheck = AlarmManager.INTERVAL_HOUR * 2;
PendingIntent updateCheckIntent = getUpdatesCheckIntent(context);
AlarmManager alarmMgr = context.getSystemService(AlarmManager.class);
- alarmMgr.set(AlarmManager.ELAPSED_REALTIME,
+ alarmMgr.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME,
SystemClock.elapsedRealtime() + millisToNextCheck,
updateCheckIntent);
diff --git a/src/org/lineageos/updater/UpdatesDbHelper.java b/src/org/lineageos/updater/UpdatesDbHelper.java
index 6c11a60c40289968ac5935cefbbc3f75708fdacf..9dadd4b6095c84a209bca0548b95911cf7167e43 100644
--- a/src/org/lineageos/updater/UpdatesDbHelper.java
+++ b/src/org/lineageos/updater/UpdatesDbHelper.java
@@ -30,7 +30,7 @@ import java.util.List;
public class UpdatesDbHelper extends SQLiteOpenHelper {
- public static final int DATABASE_VERSION = 1;
+ public static final int DATABASE_VERSION = 2;
public static final String DATABASE_NAME = "updates.db";
public static class UpdateEntry implements BaseColumns {
@@ -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 =
@@ -89,6 +91,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());
}
@@ -125,6 +128,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,
};
@@ -146,6 +150,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 6650a783588e6f6b7ec88649dccaad7e55c87e40..c4e9b8190ec1a4c229875fb707c433d06c181fd6 100644
--- a/src/org/lineageos/updater/UpdatesListAdapter.java
+++ b/src/org/lineageos/updater/UpdatesListAdapter.java
@@ -272,8 +272,9 @@ public class UpdatesListAdapter extends RecyclerView.Adapter preferences.edit()
.putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true)
.apply())
diff --git a/src/org/lineageos/updater/controller/UpdaterService.java b/src/org/lineageos/updater/controller/UpdaterService.java
index cd9334baf1ee0f46e7c2151475cb719a992e8d37..5d799bf94c554ebb11bc2522a8872d57317a7e84 100644
--- a/src/org/lineageos/updater/controller/UpdaterService.java
+++ b/src/org/lineageos/updater/controller/UpdaterService.java
@@ -407,7 +407,7 @@ public class UpdaterService extends Service {
mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build());
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
- boolean deleteUpdate = pref.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false);
+ boolean deleteUpdate = pref.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, true);
if (deleteUpdate) {
mUpdaterController.deleteUpdate(update.getDownloadId());
}
@@ -490,7 +490,7 @@ public class UpdaterService extends Service {
private void setNotificationTitle(UpdateInfo update) {
String buildDate = StringGenerator.getDateLocalizedUTC(this,
DateFormat.MEDIUM, update.getTimestamp());
- String buildInfo = getString(R.string.list_build_version_date,
+ String buildInfo = getString(R.string.list_build_version_date_e,
update.getVersion(), buildDate);
mNotificationStyle.setBigContentTitle(buildInfo);
mNotificationBuilder.setContentTitle(buildInfo);
diff --git a/src/org/lineageos/updater/download/HttpURLConnectionClient.java b/src/org/lineageos/updater/download/HttpURLConnectionClient.java
index b9c4b5dc694562cc46c7ef0bd0bee114fc0e43ad..a3d54c229996aab4e6969257358b617c2c0736bd 100644
--- a/src/org/lineageos/updater/download/HttpURLConnectionClient.java
+++ b/src/org/lineageos/updater/download/HttpURLConnectionClient.java
@@ -58,6 +58,11 @@ public class HttpURLConnectionClient implements DownloadClient {
DownloadClient.DownloadCallback callback,
boolean useDuplicateLinks) throws IOException {
mClient = (HttpURLConnection) new URL(url).openConnection();
+
+ String defaultUserAgent = mClient.getRequestProperty("User-Agent");
+ String newUserAgent = defaultUserAgent+" ota_007_eels";
+ mClient.setRequestProperty("User-Agent", newUserAgent);
+
mDestination = destination;
mProgressListener = progressListener;
mCallback = callback;
diff --git a/src/org/lineageos/updater/misc/BuildInfoUtils.java b/src/org/lineageos/updater/misc/BuildInfoUtils.java
index 4b90a45e545419a51c727fd23581071fba205f54..6a647faf2517460c8cd0084a87e285dfddb68b1d 100644
--- a/src/org/lineageos/updater/misc/BuildInfoUtils.java
+++ b/src/org/lineageos/updater/misc/BuildInfoUtils.java
@@ -29,4 +29,8 @@ public final class BuildInfoUtils {
public static String getBuildVersion() {
return SystemProperties.get(Constants.PROP_BUILD_VERSION);
}
+
+ public static String getDisplayVersion() {
+ return SystemProperties.get(Constants.PROP_BUILD_DISPLAY_VERSION);
+ }
}
diff --git a/src/org/lineageos/updater/misc/Constants.java b/src/org/lineageos/updater/misc/Constants.java
index 6144ed745abaea1cf9411d0015aeea5e665d7301..96c0b015391a920a274739e2f5d51cb539bf07bd 100644
--- a/src/org/lineageos/updater/misc/Constants.java
+++ b/src/org/lineageos/updater/misc/Constants.java
@@ -40,12 +40,14 @@ public final class Constants {
public static final String PROP_AB_DEVICE = "ro.build.ab_update";
public static final String PROP_BUILD_DATE = "ro.build.date.utc";
public static final String PROP_BUILD_VERSION = "ro.lineage.build.version";
+ public static final String PROP_BUILD_DISPLAY_VERSION = "ro.lineage.display.version";
public static final String PROP_BUILD_VERSION_INCREMENTAL = "ro.build.version.incremental";
public static final String PROP_DEVICE = "ro.lineage.device";
public static final String PROP_NEXT_DEVICE = "ro.updater.next_device";
public static final String PROP_RELEASE_TYPE = "ro.lineage.releasetype";
public static final String PROP_UPDATER_ALLOW_DOWNGRADING = "lineage.updater.allow_downgrading";
public static final String PROP_UPDATER_URI = "lineage.updater.uri";
+ public static final String PROP_VERSION = "ro.lineage.version";
public static final String PREF_INSTALL_OLD_TIMESTAMP = "install_old_timestamp";
public static final String PREF_INSTALL_NEW_TIMESTAMP = "install_new_timestamp";
diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java
index 79ded8f2fb2d0706879c1be45d8fa6de58b9e399..7194aa4541f4dfbd0ba80d5549dd1837c4958b98 100644
--- a/src/org/lineageos/updater/misc/Utils.java
+++ b/src/org/lineageos/updater/misc/Utils.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2017-2022 The LineageOS Project
+ * Copyright (C) 2022 ECORP SAS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,8 +23,10 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
+import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
+import android.net.Uri;
import android.os.SystemProperties;
import android.os.storage.StorageManager;
import android.preference.PreferenceManager;
@@ -52,10 +55,13 @@ import java.util.Locale;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import java.util.regex.Pattern;
+
public class Utils {
private static final String TAG = "Utils";
+ private static final String CONTENT_URI_PATH = "content://custom.setting.Provider.OTA_SERVER/cte";
private Utils() {
}
@@ -90,16 +96,28 @@ public class Utils {
update.setFileSize(object.getLong("size"));
update.setDownloadUrl(object.getString("url"));
update.setVersion(object.getString("version"));
+ if (object.has("pre_version") && !object.getString("pre_version").isEmpty()) {
+ update.setDisplayVersion(object.getString("version") + "-" + object.getString("pre_version"));
+ } else {
+ update.setDisplayVersion(object.getString("version"));
+ }
return update;
}
public static boolean isCompatible(UpdateBaseInfo update) {
- if (update.getVersion().compareTo(SystemProperties.get(Constants.PROP_BUILD_VERSION)) < 0) {
- Log.d(TAG, update.getName() + " is older than current Android version");
- return false;
- }
+ int[] updateVersionParts = parseSemVer(update.getVersion());
+ int updateMajorVersion = updateVersionParts[0];
+ int updateMinorVersion = updateVersionParts[1];
+ Log.d(TAG, "Update : Major "+updateMajorVersion +" Minor "+ updateMinorVersion );
+
+ int[] deviceVersionParts = parseSemVer(SystemProperties.get(Constants.PROP_BUILD_VERSION));
+ int deviceMajorVersion = deviceVersionParts[0];
+ int deviceMinorVersion = deviceVersionParts[1];
+ Log.d(TAG, "Device : Major "+ deviceMajorVersion +" Minor "+ deviceMinorVersion );
+
+
if (!SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_DOWNGRADING, false) &&
- update.getTimestamp() <= SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) {
+ update.getTimestamp() <= SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) {
Log.d(TAG, update.getName() + " is older than/equal to the current build");
return false;
}
@@ -107,14 +125,32 @@ public class Utils {
Log.d(TAG, update.getName() + " has type " + update.getType());
return false;
}
+ if(updateMajorVersion > deviceMajorVersion){
+ Log.d(TAG, update.getName() + " is Newer to current Major version");
+ return true;
+ }
+ if(updateMajorVersion < deviceMajorVersion){
+ Log.d(TAG, update.getName() + " is Older to current Major version");
+ return false;
+ }
+ if(updateMinorVersion < deviceMinorVersion){
+ Log.d(TAG, update.getName() + " is Older to current Minor version");
+ return false;
+ }
+
return true;
}
+ public static int[] parseSemVer(String versionCode) {
+ String[] versionParts = versionCode.split(Pattern.quote("."));
+ int major = Integer.parseInt(versionParts[0]);
+ int minor = Integer.parseInt(versionParts[1]);
+ return new int[]{ major, minor };
+ }
+
public static boolean canInstall(UpdateBaseInfo update) {
return (SystemProperties.getBoolean(Constants.PROP_UPDATER_ALLOW_DOWNGRADING, false) ||
- update.getTimestamp() > SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0)) &&
- update.getVersion().equalsIgnoreCase(
- SystemProperties.get(Constants.PROP_BUILD_VERSION));
+ update.getTimestamp() > SystemProperties.getLong(Constants.PROP_BUILD_DATE, 0));
}
public static List parseJson(File file, boolean compatibleOnly)
@@ -155,7 +191,20 @@ public class Utils {
SystemProperties.get(Constants.PROP_DEVICE));
String type = SystemProperties.get(Constants.PROP_RELEASE_TYPE).toLowerCase(Locale.ROOT);
- String serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI);
+ String serverUrl = "";
+ if (retrieveStatus(context) != null) {
+ if (retrieveStatus(context).equals("true")) {
+ serverUrl = context.getString(R.string.ota_staging_server_url);
+ return serverUrl.replace("{device}", device)
+ .replace("{type}", type)
+ .replace("{incr}", incrementalVersion);
+ } else {
+ serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI);
+ }
+ } else {
+ serverUrl = SystemProperties.get(Constants.PROP_UPDATER_URI);
+ }
+
if (serverUrl.trim().isEmpty()) {
serverUrl = context.getString(R.string.updater_server_url);
}
@@ -165,6 +214,18 @@ public class Utils {
.replace("{incr}", incrementalVersion);
}
+ /*get the status from database that ota option is on or off*/
+ public static String retrieveStatus(Context context) {
+ String status = null;
+ Cursor cursor = context.getContentResolver().query(Uri.parse(CONTENT_URI_PATH), null, "id=?", new String[]{"1"}, "Status");
+ if (cursor.moveToFirst()) {
+ do {
+ status = cursor.getString(cursor.getColumnIndex("Status"));
+ } while (cursor.moveToNext());
+ }
+ return status;
+ }
+
public static String getUpgradeBlockedURL(Context context) {
String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE,
SystemProperties.get(Constants.PROP_DEVICE));
@@ -172,9 +233,8 @@ public class Utils {
}
public static String getChangelogURL(Context context) {
- String device = SystemProperties.get(Constants.PROP_NEXT_DEVICE,
- SystemProperties.get(Constants.PROP_DEVICE));
- return context.getString(R.string.menu_changelog_url, device);
+ String buildVersion = SystemProperties.get(Constants.PROP_BUILD_VERSION);
+ return context.getString(R.string.menu_changelog_url, buildVersion);
}
public static void triggerUpdate(Context context, String downloadId) {
@@ -200,22 +260,17 @@ public class Utils {
/**
* Compares two json formatted updates list files
*
- * @param oldJson old update list
* @param newJson new update list
- * @return true if newJson has at least a compatible update not available in oldJson
+ * @return true if newJson has an update with higher version than the installed system
*/
- public static boolean checkForNewUpdates(File oldJson, File newJson)
+ public static boolean checkForNewUpdates(File newJson)
throws IOException, JSONException {
- List oldList = parseJson(oldJson, true);
List newList = parseJson(newJson, true);
- Set oldIds = new HashSet<>();
- for (UpdateInfo update : oldList) {
- oldIds.add(update.getDownloadId());
- }
- // In case of no new updates, the old list should
- // have all (if not more) the updates
+ float currentVersion = Float.parseFloat(BuildInfoUtils.getBuildVersion());
+
for (UpdateInfo update : newList) {
- if (!oldIds.contains(update.getDownloadId())) {
+ if (Float.parseFloat(update.getVersion()) > currentVersion) {
+ Log.d(TAG, "New compatiable update available");
return true;
}
}
@@ -280,7 +335,7 @@ public class Utils {
long prevTimestamp = preferences.getLong(Constants.PREF_INSTALL_OLD_TIMESTAMP, 0);
String lastUpdatePath = preferences.getString(Constants.PREF_INSTALL_PACKAGE_PATH, null);
boolean reinstalling = preferences.getBoolean(Constants.PREF_INSTALL_AGAIN, false);
- boolean deleteUpdates = preferences.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, false);
+ boolean deleteUpdates = preferences.getBoolean(Constants.PREF_AUTO_DELETE_UPDATES, true);
if ((buildTimestamp != prevTimestamp || reinstalling) && deleteUpdates &&
lastUpdatePath != null) {
File lastUpdate = new File(lastUpdatePath);
@@ -381,7 +436,7 @@ public class Utils {
public static int getUpdateCheckSetting(Context context) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
return preferences.getInt(Constants.PREF_AUTO_UPDATES_CHECK_INTERVAL,
- Constants.AUTO_UPDATES_CHECK_INTERVAL_WEEKLY);
+ Constants.AUTO_UPDATES_CHECK_INTERVAL_DAILY);
}
public static boolean isUpdateCheckEnabled(Context context) {
diff --git a/src/org/lineageos/updater/model/UpdateBase.java b/src/org/lineageos/updater/model/UpdateBase.java
index 8fcf09c8f962ec56a7787e42ae0f9754325fb521..cfa2027ed82bec55334483be351c1447e195a00b 100644
--- a/src/org/lineageos/updater/model/UpdateBase.java
+++ b/src/org/lineageos/updater/model/UpdateBase.java
@@ -23,6 +23,7 @@ public class UpdateBase implements UpdateBaseInfo {
private long mTimestamp;
private String mType;
private String mVersion;
+ private String mDisplayVersion;
private long mFileSize;
public UpdateBase() {
@@ -35,6 +36,7 @@ public class UpdateBase implements UpdateBaseInfo {
mTimestamp = update.getTimestamp();
mType = update.getType();
mVersion = update.getVersion();
+ mDisplayVersion = update.getDisplayVersion();
mFileSize = update.getFileSize();
}
@@ -83,6 +85,15 @@ public class UpdateBase implements UpdateBaseInfo {
mVersion = version;
}
+ @Override
+ public String getDisplayVersion() {
+ return mDisplayVersion;
+ }
+
+ public void setDisplayVersion(String displayVersion) {
+ mDisplayVersion = displayVersion;
+ }
+
@Override
public String getDownloadUrl() {
return mDownloadUrl;
diff --git a/src/org/lineageos/updater/model/UpdateBaseInfo.java b/src/org/lineageos/updater/model/UpdateBaseInfo.java
index 2041582ad0c613431559f54bb4a04fc6d8aae5ba..2921e96fc57c93c510348eb301abdc961ca3bae9 100644
--- a/src/org/lineageos/updater/model/UpdateBaseInfo.java
+++ b/src/org/lineageos/updater/model/UpdateBaseInfo.java
@@ -26,6 +26,8 @@ public interface UpdateBaseInfo {
String getVersion();
+ String getDisplayVersion();
+
String getDownloadUrl();
long getFileSize();