Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
<string name="header_android_version">Android <xliff:g id="version" example="7.1.2">%1$s</xliff:g></string>
<string name="header_last_updates_check">Last checked: <xliff:g id="date" example="1 January 1970">%1$s</xliff:g> (<xliff:g id="time" example="01:23">%2$s</xliff:g>)</string>

<string name="list_build_version">ViperOS <xliff:g id="version" example="14.1">%1$s</xliff:g></string>
<string name="list_build_version_date">ViperOS <xliff:g id="version" example="14.1">%1$s</xliff:g> - <xliff:g id="date" example="July 11, 2017">%2$s</xliff:g></string>
<string name="list_download_progress_new"><xliff:g id="filesize_without_unit" example="12.2">%1$s</xliff:g> of <xliff:g id="filesize_without_unit" example="310 MB">%2$s</xliff:g> • <xliff:g id="percentage" example="56">%3$s</xliff:g></string>
<string name="list_download_progress_eta_new"><xliff:g id="filesize_without_unit" example="12.2">%1$s</xliff:g> of <xliff:g id="filesize_without_unit" example="310 MB">%2$s</xliff:g> (<xliff:g id="eta" example="3 minutes left">%3$s</xliff:g>) • <xliff:g id="percentage" example="56">%4$s</xliff:g></string>
<string name="list_verifying_update">Verifying update</string>
Expand Down
5 changes: 1 addition & 4 deletions src/org/lineageos/updater/UpdaterReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ private static boolean shouldShowUpdateFailedNotification(Context context) {

private static void showUpdateFailedNotification(Context context) {
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,
BuildInfoUtils.getBuildVersion(), buildDate);
String buildInfo = preferences.getString(Constants.PREF_INSTALL_NEW_FILE_NAME, context.getString(R.string.app_name));

Intent notificationIntent = new Intent(context, UpdatesActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent,
Expand Down
9 changes: 2 additions & 7 deletions src/org/lineageos/updater/UpdatesListAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ public void onBindViewHolder(final ViewHolder viewHolder, int i) {

String buildDate = StringGenerator.getDateLocalizedUTC(mActivity,
DateFormat.LONG, update.getTimestamp());
String buildVersion = mActivity.getString(R.string.list_build_version,
update.getVersion());
String buildVersion = update.getName();
viewHolder.mBuildDate.setText(buildDate);
viewHolder.mBuildVersion.setText(buildVersion);
viewHolder.mBuildVersion.setCompoundDrawables(null, null, null, null);
Expand Down Expand Up @@ -453,13 +452,9 @@ private AlertDialog.Builder getInstallDialog(final String downloadId) {
return null;
}

String buildDate = StringGenerator.getDateLocalizedUTC(mActivity,
DateFormat.MEDIUM, update.getTimestamp());
String buildInfoText = mActivity.getString(R.string.list_build_version_date,
BuildInfoUtils.getBuildVersion(), buildDate);
return new AlertDialog.Builder(mActivity)
.setTitle(R.string.apply_update_dialog_title)
.setMessage(mActivity.getString(resId, buildInfoText,
.setMessage(mActivity.getString(resId, update.getName(),
mActivity.getString(android.R.string.ok)))
.setPositiveButton(android.R.string.ok,
(dialog, which) -> Utils.triggerUpdate(mActivity, downloadId))
Expand Down
1 change: 1 addition & 0 deletions src/org/lineageos/updater/controller/UpdateInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void install(String downloadId) {
preferences.edit()
.putLong(Constants.PREF_INSTALL_OLD_TIMESTAMP, buildTimestamp)
.putLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, update.getTimestamp())
.putString(Constants.PREF_INSTALL_NEW_FILE_NAME, update.getName())
.putString(Constants.PREF_INSTALL_PACKAGE_PATH, update.getFile().getAbsolutePath())
.putBoolean(Constants.PREF_INSTALL_AGAIN, isReinstalling)
.putBoolean(Constants.PREF_INSTALL_NOTIFIED, false)
Expand Down
8 changes: 2 additions & 6 deletions src/org/lineageos/updater/controller/UpdaterService.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,8 @@ private void handleInstallProgress(UpdateInfo update) {
}

private void setNotificationTitle(UpdateInfo update) {
String buildDate = StringGenerator.getDateLocalizedUTC(this,
DateFormat.MEDIUM, update.getTimestamp());
String buildInfo = getString(R.string.list_build_version_date,
BuildInfoUtils.getBuildVersion(), buildDate);
mNotificationStyle.setBigContentTitle(buildInfo);
mNotificationBuilder.setContentTitle(buildInfo);
mNotificationStyle.setBigContentTitle(update.getName());
mNotificationBuilder.setContentTitle(update.getName());
}

private PendingIntent getResumePendingIntent(String downloadId) {
Expand Down
1 change: 1 addition & 0 deletions src/org/lineageos/updater/misc/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private Constants() {

public static final String PREF_INSTALL_OLD_TIMESTAMP = "install_old_timestamp";
public static final String PREF_INSTALL_NEW_TIMESTAMP = "install_new_timestamp";
public static final String PREF_INSTALL_NEW_FILE_NAME = "install_new_file_name";
public static final String PREF_INSTALL_PACKAGE_PATH = "install_package_path";
public static final String PREF_INSTALL_AGAIN = "install_again";
public static final String PREF_INSTALL_NOTIFIED = "install_notified";
Expand Down