Loading app/src/main/java/org/lineageos/updater/UpdaterReceiver.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class UpdaterReceiver extends BroadcastReceiver { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); String buildDate = StringGenerator.getDateLocalizedUTC(context, String buildDate = StringGenerator.getDateLocalizedUTC(context, DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0)); DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0)); String buildInfo = context.getString(R.string.list_build_version_date_e, String buildInfo = context.getString(R.string.e_list_build_version_date, BuildInfoUtils.getBuildVersion(), buildDate); BuildInfoUtils.getBuildVersion(), buildDate); Intent notificationIntent = new Intent(context, UpdatesActivity.class); Intent notificationIntent = new Intent(context, UpdatesActivity.class); Loading app/src/main/java/org/lineageos/updater/UpdatesActivity.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport } } TextView headerTitle = findViewById(R.id.header_title); TextView headerTitle = findViewById(R.id.header_title); headerTitle.setText(getString(R.string.header_title_text_e, headerTitle.setText(getString(R.string.e_header_title_text, BuildInfoUtils.getDisplayVersion())); BuildInfoUtils.getDisplayVersion())); updateLastCheckedString(); updateLastCheckedString(); Loading app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java +13 −13 Original line number Original line Diff line number Diff line Loading @@ -250,7 +250,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. if (update == null) { if (update == null) { // The update was deleted // The update was deleted viewHolder.mAction.setEnabled(false); viewHolder.mAction.setEnabled(false); viewHolder.mAction.setText(Utils.isABDevice() ? R.string.action_update viewHolder.mAction.setText(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download); : R.string.action_download); return; return; } } Loading @@ -274,7 +274,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_e, String buildVersion = mActivity.getString(R.string.e_list_build_version, update.getDisplayVersion()); update.getDisplayVersion()); if (!Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { if (!Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { Loading Loading @@ -345,10 +345,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. // Ignore if needed space is below 1 MB, like 0.25 // Ignore if needed space is below 1 MB, like 0.25 // We only show integer part to the user // We only show integer part to the user if (spaceNeeded >= 1) { if (spaceNeeded >= 1) { String message = resources.getString(R.string.dialog_free_space_low_message_pct, String message = resources.getString(R.string.e_dialog_free_space_low_message_pct, new DecimalFormat("# MB").format(spaceNeeded)); new DecimalFormat("# MB").format(spaceNeeded)); return new AlertDialog.Builder(mActivity) return new AlertDialog.Builder(mActivity) .setTitle(R.string.dialog_free_space_low_title) .setTitle(R.string.e_dialog_free_space_low_title) .setMessage(message) .setMessage(message) .setPositiveButton(android.R.string.ok, null); .setPositiveButton(android.R.string.ok, null); } } Loading @@ -373,7 +373,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. .setTitle(R.string.update_over_metered_network_title) .setTitle(R.string.update_over_metered_network_title) .setMessage(R.string.update_over_metered_network_message) .setMessage(R.string.update_over_metered_network_message) .setView(checkboxView) .setView(checkboxView) .setPositiveButton(Utils.isABDevice() ? R.string.action_update .setPositiveButton(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download, : R.string.action_download, (dialog, which) -> { (dialog, which) -> { if (checkbox.isChecked()) { if (checkbox.isChecked()) { Loading @@ -393,7 +393,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. final View.OnClickListener clickListener; final View.OnClickListener clickListener; switch (action) { switch (action) { case DOWNLOAD: case DOWNLOAD: button.setText(Utils.isABDevice() ? R.string.action_update button.setText(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download); : R.string.action_download); button.setEnabled(enabled); button.setEnabled(enabled); clickListener = enabled ? view -> { clickListener = enabled ? view -> { Loading Loading @@ -543,36 +543,36 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. mActivity, DateFormat.MEDIUM, update.getTimestamp()); mActivity, DateFormat.MEDIUM, update.getTimestamp()); String buildInfoText = String buildInfoText = mActivity.getString( mActivity.getString( R.string.list_build_version_date, update.getVersion(), buildDate); R.string.e_list_build_version_date, update.getVersion(), buildDate); if (Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { if (Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { title = R.string.apply_update_dialog_title; title = R.string.apply_update_dialog_title; if (Utils.isABUpdate(update.getFile())) { if (Utils.isABUpdate(update.getFile())) { message = message = mActivity.getString( mActivity.getString( R.string.apply_update_dialog_message_ab, R.string.e_apply_update_dialog_message_ab, buildInfoText, buildInfoText, mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } else { } else { message = message = mActivity.getString( mActivity.getString( R.string.apply_update_dialog_message, R.string.e_apply_update_dialog_message, buildInfoText, buildInfoText, mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } } } else { } else { title = R.string.version_upgrade_dialog_title; title = R.string.e_version_upgrade_dialog_title; if (Utils.isABUpdate(update.getFile())) { if (Utils.isABUpdate(update.getFile())) { message = message = mActivity.getString( mActivity.getString( R.string.version_upgrade_dialog_message_ab, R.string.e_version_upgrade_dialog_message_ab, buildInfoText, buildInfoText, update.getAndroidVersion(), update.getAndroidVersion(), mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } else { } else { message = message = mActivity.getString( mActivity.getString( R.string.version_upgrade_dialog_message, R.string.e_version_upgrade_dialog_message, buildInfoText, buildInfoText, update.getAndroidVersion(), update.getAndroidVersion(), mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); Loading Loading @@ -614,7 +614,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. } } new AlertDialog.Builder(mActivity) new AlertDialog.Builder(mActivity) .setTitle(R.string.info_dialog_title) .setTitle(R.string.info_dialog_title) .setMessage(R.string.info_dialog_message_e) .setMessage(R.string.e_info_dialog_message) .setPositiveButton(R.string.info_dialog_ok, (dialog, which) -> preferences.edit() .setPositiveButton(R.string.info_dialog_ok, (dialog, which) -> preferences.edit() .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true) .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true) .apply()) .apply()) Loading app/src/main/java/org/lineageos/updater/controller/UpdaterService.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -406,7 +406,7 @@ public class UpdaterService extends Service { mNotificationBuilder.setStyle(null); mNotificationBuilder.setStyle(null); mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update); mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update); mNotificationBuilder.setProgress(0, 0, false); mNotificationBuilder.setProgress(0, 0, false); String text = getString(R.string.download_completed_notification); String text = getString(R.string.e_download_completed_notification); boolean hasRequiredSpace = Utils.availableFreeSpace() > (update.getFileSize() * 2); boolean hasRequiredSpace = Utils.availableFreeSpace() > (update.getFileSize() * 2); if (!Utils.canInstall(update) || !Utils.isBatteryLevelOk(this) if (!Utils.canInstall(update) || !Utils.isBatteryLevelOk(this) Loading @@ -416,7 +416,7 @@ public class UpdaterService extends Service { if (!Utils.isBatteryLevelOk(this)) { if (!Utils.isBatteryLevelOk(this)) { text = text + getString(R.string.dialog_battery_low_title); text = text + getString(R.string.dialog_battery_low_title); } else if (!hasRequiredSpace) { } else if (!hasRequiredSpace) { text = text + getString(R.string.dialog_free_space_low_title); text = text + getString(R.string.e_dialog_free_space_low_title); } else if (!Utils.canInstall(update)) { } else if (!Utils.canInstall(update)) { text = text + getString(R.string.verification_failed_notification); text = text + getString(R.string.verification_failed_notification); } } Loading @@ -424,7 +424,7 @@ public class UpdaterService extends Service { /* Add action to reboot and install for Non-A/B devices. */ /* Add action to reboot and install for Non-A/B devices. */ mNotificationBuilder.mActions.clear(); mNotificationBuilder.mActions.clear(); mNotificationBuilder.addAction(R.drawable.ic_system_update, mNotificationBuilder.addAction(R.drawable.ic_system_update, getString(R.string.reboot_install), getString(R.string.e_reboot_install), getInstallationPendingIntent(update.getDownloadId())); getInstallationPendingIntent(update.getDownloadId())); } } Loading Loading @@ -594,7 +594,7 @@ public class UpdaterService extends Service { private void setNotificationTitle(UpdateInfo update) { private void setNotificationTitle(UpdateInfo update) { String buildDate = StringGenerator.getDateLocalizedUTC(this, String buildDate = StringGenerator.getDateLocalizedUTC(this, DateFormat.MEDIUM, update.getTimestamp()); DateFormat.MEDIUM, update.getTimestamp()); String buildInfo = getString(R.string.list_build_version_date_e, String buildInfo = getString(R.string.e_list_build_version_date, update.getVersion(), buildDate); update.getVersion(), buildDate); mNotificationStyle.setBigContentTitle(buildInfo); mNotificationStyle.setBigContentTitle(buildInfo); mNotificationBuilder.setContentTitle(buildInfo); mNotificationBuilder.setContentTitle(buildInfo); Loading app/src/main/res/layout-television/activity_updates.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:gravity="center" android:text="@string/list_no_updates" android:text="@string/e_list_no_updates" android:textColor="?android:textColorSecondary" /> android:textColor="?android:textColorSecondary" /> </androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView> Loading Loading
app/src/main/java/org/lineageos/updater/UpdaterReceiver.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class UpdaterReceiver extends BroadcastReceiver { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); String buildDate = StringGenerator.getDateLocalizedUTC(context, String buildDate = StringGenerator.getDateLocalizedUTC(context, DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0)); DateFormat.MEDIUM, preferences.getLong(Constants.PREF_INSTALL_NEW_TIMESTAMP, 0)); String buildInfo = context.getString(R.string.list_build_version_date_e, String buildInfo = context.getString(R.string.e_list_build_version_date, BuildInfoUtils.getBuildVersion(), buildDate); BuildInfoUtils.getBuildVersion(), buildDate); Intent notificationIntent = new Intent(context, UpdatesActivity.class); Intent notificationIntent = new Intent(context, UpdatesActivity.class); Loading
app/src/main/java/org/lineageos/updater/UpdatesActivity.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -182,7 +182,7 @@ public class UpdatesActivity extends UpdatesListActivity implements UpdateImport } } TextView headerTitle = findViewById(R.id.header_title); TextView headerTitle = findViewById(R.id.header_title); headerTitle.setText(getString(R.string.header_title_text_e, headerTitle.setText(getString(R.string.e_header_title_text, BuildInfoUtils.getDisplayVersion())); BuildInfoUtils.getDisplayVersion())); updateLastCheckedString(); updateLastCheckedString(); Loading
app/src/main/java/org/lineageos/updater/UpdatesListAdapter.java +13 −13 Original line number Original line Diff line number Diff line Loading @@ -250,7 +250,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. if (update == null) { if (update == null) { // The update was deleted // The update was deleted viewHolder.mAction.setEnabled(false); viewHolder.mAction.setEnabled(false); viewHolder.mAction.setText(Utils.isABDevice() ? R.string.action_update viewHolder.mAction.setText(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download); : R.string.action_download); return; return; } } Loading @@ -274,7 +274,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_e, String buildVersion = mActivity.getString(R.string.e_list_build_version, update.getDisplayVersion()); update.getDisplayVersion()); if (!Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { if (!Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { Loading Loading @@ -345,10 +345,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. // Ignore if needed space is below 1 MB, like 0.25 // Ignore if needed space is below 1 MB, like 0.25 // We only show integer part to the user // We only show integer part to the user if (spaceNeeded >= 1) { if (spaceNeeded >= 1) { String message = resources.getString(R.string.dialog_free_space_low_message_pct, String message = resources.getString(R.string.e_dialog_free_space_low_message_pct, new DecimalFormat("# MB").format(spaceNeeded)); new DecimalFormat("# MB").format(spaceNeeded)); return new AlertDialog.Builder(mActivity) return new AlertDialog.Builder(mActivity) .setTitle(R.string.dialog_free_space_low_title) .setTitle(R.string.e_dialog_free_space_low_title) .setMessage(message) .setMessage(message) .setPositiveButton(android.R.string.ok, null); .setPositiveButton(android.R.string.ok, null); } } Loading @@ -373,7 +373,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. .setTitle(R.string.update_over_metered_network_title) .setTitle(R.string.update_over_metered_network_title) .setMessage(R.string.update_over_metered_network_message) .setMessage(R.string.update_over_metered_network_message) .setView(checkboxView) .setView(checkboxView) .setPositiveButton(Utils.isABDevice() ? R.string.action_update .setPositiveButton(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download, : R.string.action_download, (dialog, which) -> { (dialog, which) -> { if (checkbox.isChecked()) { if (checkbox.isChecked()) { Loading @@ -393,7 +393,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. final View.OnClickListener clickListener; final View.OnClickListener clickListener; switch (action) { switch (action) { case DOWNLOAD: case DOWNLOAD: button.setText(Utils.isABDevice() ? R.string.action_update button.setText(Utils.isABDevice() ? R.string.e_action_update : R.string.action_download); : R.string.action_download); button.setEnabled(enabled); button.setEnabled(enabled); clickListener = enabled ? view -> { clickListener = enabled ? view -> { Loading Loading @@ -543,36 +543,36 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. mActivity, DateFormat.MEDIUM, update.getTimestamp()); mActivity, DateFormat.MEDIUM, update.getTimestamp()); String buildInfoText = String buildInfoText = mActivity.getString( mActivity.getString( R.string.list_build_version_date, update.getVersion(), buildDate); R.string.e_list_build_version_date, update.getVersion(), buildDate); if (Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { if (Build.VERSION.RELEASE.equals(update.getAndroidVersion())) { title = R.string.apply_update_dialog_title; title = R.string.apply_update_dialog_title; if (Utils.isABUpdate(update.getFile())) { if (Utils.isABUpdate(update.getFile())) { message = message = mActivity.getString( mActivity.getString( R.string.apply_update_dialog_message_ab, R.string.e_apply_update_dialog_message_ab, buildInfoText, buildInfoText, mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } else { } else { message = message = mActivity.getString( mActivity.getString( R.string.apply_update_dialog_message, R.string.e_apply_update_dialog_message, buildInfoText, buildInfoText, mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } } } else { } else { title = R.string.version_upgrade_dialog_title; title = R.string.e_version_upgrade_dialog_title; if (Utils.isABUpdate(update.getFile())) { if (Utils.isABUpdate(update.getFile())) { message = message = mActivity.getString( mActivity.getString( R.string.version_upgrade_dialog_message_ab, R.string.e_version_upgrade_dialog_message_ab, buildInfoText, buildInfoText, update.getAndroidVersion(), update.getAndroidVersion(), mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); } else { } else { message = message = mActivity.getString( mActivity.getString( R.string.version_upgrade_dialog_message, R.string.e_version_upgrade_dialog_message, buildInfoText, buildInfoText, update.getAndroidVersion(), update.getAndroidVersion(), mActivity.getString(android.R.string.ok)); mActivity.getString(android.R.string.ok)); Loading Loading @@ -614,7 +614,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter. } } new AlertDialog.Builder(mActivity) new AlertDialog.Builder(mActivity) .setTitle(R.string.info_dialog_title) .setTitle(R.string.info_dialog_title) .setMessage(R.string.info_dialog_message_e) .setMessage(R.string.e_info_dialog_message) .setPositiveButton(R.string.info_dialog_ok, (dialog, which) -> preferences.edit() .setPositiveButton(R.string.info_dialog_ok, (dialog, which) -> preferences.edit() .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true) .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true) .apply()) .apply()) Loading
app/src/main/java/org/lineageos/updater/controller/UpdaterService.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -406,7 +406,7 @@ public class UpdaterService extends Service { mNotificationBuilder.setStyle(null); mNotificationBuilder.setStyle(null); mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update); mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update); mNotificationBuilder.setProgress(0, 0, false); mNotificationBuilder.setProgress(0, 0, false); String text = getString(R.string.download_completed_notification); String text = getString(R.string.e_download_completed_notification); boolean hasRequiredSpace = Utils.availableFreeSpace() > (update.getFileSize() * 2); boolean hasRequiredSpace = Utils.availableFreeSpace() > (update.getFileSize() * 2); if (!Utils.canInstall(update) || !Utils.isBatteryLevelOk(this) if (!Utils.canInstall(update) || !Utils.isBatteryLevelOk(this) Loading @@ -416,7 +416,7 @@ public class UpdaterService extends Service { if (!Utils.isBatteryLevelOk(this)) { if (!Utils.isBatteryLevelOk(this)) { text = text + getString(R.string.dialog_battery_low_title); text = text + getString(R.string.dialog_battery_low_title); } else if (!hasRequiredSpace) { } else if (!hasRequiredSpace) { text = text + getString(R.string.dialog_free_space_low_title); text = text + getString(R.string.e_dialog_free_space_low_title); } else if (!Utils.canInstall(update)) { } else if (!Utils.canInstall(update)) { text = text + getString(R.string.verification_failed_notification); text = text + getString(R.string.verification_failed_notification); } } Loading @@ -424,7 +424,7 @@ public class UpdaterService extends Service { /* Add action to reboot and install for Non-A/B devices. */ /* Add action to reboot and install for Non-A/B devices. */ mNotificationBuilder.mActions.clear(); mNotificationBuilder.mActions.clear(); mNotificationBuilder.addAction(R.drawable.ic_system_update, mNotificationBuilder.addAction(R.drawable.ic_system_update, getString(R.string.reboot_install), getString(R.string.e_reboot_install), getInstallationPendingIntent(update.getDownloadId())); getInstallationPendingIntent(update.getDownloadId())); } } Loading Loading @@ -594,7 +594,7 @@ public class UpdaterService extends Service { private void setNotificationTitle(UpdateInfo update) { private void setNotificationTitle(UpdateInfo update) { String buildDate = StringGenerator.getDateLocalizedUTC(this, String buildDate = StringGenerator.getDateLocalizedUTC(this, DateFormat.MEDIUM, update.getTimestamp()); DateFormat.MEDIUM, update.getTimestamp()); String buildInfo = getString(R.string.list_build_version_date_e, String buildInfo = getString(R.string.e_list_build_version_date, update.getVersion(), buildDate); update.getVersion(), buildDate); mNotificationStyle.setBigContentTitle(buildInfo); mNotificationStyle.setBigContentTitle(buildInfo); mNotificationBuilder.setContentTitle(buildInfo); mNotificationBuilder.setContentTitle(buildInfo); Loading
app/src/main/res/layout-television/activity_updates.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ android:layout_width="match_parent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:gravity="center" android:text="@string/list_no_updates" android:text="@string/e_list_no_updates" android:textColor="?android:textColorSecondary" /> android:textColor="?android:textColorSecondary" /> </androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView> Loading