Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b51b07da authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Updater: Update A/B devices on one go

- Simplify asper this suggestion https://gitlab.e.foundation/e/backlog/-/issues/5705
parent c37d7cf2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@
    <string name="list_no_updates">No new updates found. To manually check for new updates, use the Refresh button.</string>

    <string name="action_download">Download</string>
    <string name="action_download_install">Update</string>
    <string name="action_pause">Pause</string>
    <string name="action_resume">Resume</string>
    <string name="action_install">Install</string>
+6 −3
Original line number Diff line number Diff line
@@ -255,7 +255,8 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
        if (update == null) {
            // The update was deleted
            viewHolder.mAction.setEnabled(false);
            viewHolder.mAction.setText(R.string.action_download);
            viewHolder.mAction.setText(Utils.isABDevice() ?
                    R.string.action_download_install : R.string.action_download);
            return;
        }

@@ -337,7 +338,8 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
                .setTitle(R.string.update_on_mobile_data_title)
                .setMessage(R.string.update_on_mobile_data_message)
                .setView(checkboxView)
                .setPositiveButton(R.string.action_download,
                .setPositiveButton(Utils.isABDevice() ?
                                R.string.action_download_install : R.string.action_download,
                        (dialog, which) -> {
                            if (checkbox.isChecked()) {
                                preferences.edit()
@@ -356,7 +358,8 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
        final View.OnClickListener clickListener;
        switch (action) {
            case DOWNLOAD:
                button.setText(R.string.action_download);
                button.setText(Utils.isABDevice() ?
                        R.string.action_download_install : R.string.action_download);
                button.setEnabled(enabled);
                clickListener = enabled ? view -> startDownloadWithWarning(downloadId) : null;
                break;
+14 −10
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ public class UpdaterService extends Service {
            }
            case VERIFIED: {
                stopForeground(STOP_FOREGROUND_DETACH);
                if (!Utils.isABDevice()) {
                    mNotificationBuilder.setStyle(null);
                    mNotificationBuilder.setSmallIcon(R.drawable.ic_system_update);
                    mNotificationBuilder.setProgress(0, 0, false);
@@ -353,6 +354,9 @@ public class UpdaterService extends Service {
                    mNotificationBuilder.setAutoCancel(true);
                    mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build());
                    tryStopSelf();
                } else {
                    Utils.triggerUpdate(this, update.getDownloadId());
                }
                break;
            }
            case VERIFICATION_FAILED: {