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

Commit 758fd991 authored by Steve Kondik's avatar Steve Kondik
Browse files

recovery: Cleanup touch UI code for N

 * And remove all dialog code

Change-Id: I6acc0dcc5061f6112a0b7f07a316534ba5707c49
parent 5f0f5924
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -1136,8 +1136,6 @@ static void run_graphics_test(Device* device) {
static int apply_from_storage(Device* device, const std::string& id, bool* wipe_cache) {
    modified_flash = true;

    int status;

    if (!vdc->volumeMount(id)) {
        return INSTALL_ERROR;
    }
@@ -1185,7 +1183,7 @@ static int apply_from_storage(Device* device, const std::string& id, bool* wipe_

        struct stat sb;
        if (stat(FUSE_SIDELOAD_HOST_PATHNAME, &sb) == -1) {
            if (errno == ENOENT && i < SDCARD_INSTALL_TIMEOUT-1) {
            if (errno == ENOENT) {
                sleep(1);
				now = time(NULL);
                continue;
@@ -1276,7 +1274,7 @@ refresh:
    }

    if (status != INSTALL_SUCCESS && status != INSTALL_NONE) {
        ui->DialogShowErrorLog("Install failed");
        ui->Print("Install failed");
    }

    return status;
@@ -1297,7 +1295,7 @@ prompt_and_wait(Device* device, int status) {

            case INSTALL_ERROR:
            case INSTALL_CORRUPT:
                ui->SetBackground(RecoveryUI::D_ERROR);
                ui->SetBackground(RecoveryUI::ERROR);
                break;
        }
        ui->SetProgressType(RecoveryUI::EMPTY);
@@ -1348,7 +1346,7 @@ prompt_and_wait(Device* device, int status) {

                        if (status >= 0 && status != INSTALL_NONE) {
                            if (status != INSTALL_SUCCESS) {
                                ui->SetBackground(RecoveryUI::D_ERROR);
                                ui->SetBackground(RecoveryUI::ERROR);
                                ui->Print("Installation aborted.\n");
                                copy_logs();
                            } else if (!ui->IsTextVisible()) {
@@ -1357,7 +1355,6 @@ prompt_and_wait(Device* device, int status) {
                                ui->Print("\nInstall complete.\n");
                            }
                        }
                    break;
                    }
                    break;

@@ -1931,7 +1928,7 @@ int main(int argc, char **argv) {

    if (!sideload_auto_reboot && (status == INSTALL_ERROR || status == INSTALL_CORRUPT)) {
        copy_logs();
        ui->SetBackground(RecoveryUI::D_ERROR);
        ui->SetBackground(RecoveryUI::ERROR);
    }

    Device::BuiltinAction after = shutdown_after ? Device::SHUTDOWN : Device::REBOOT;
+1 −1
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ void ScreenRecoveryUI::draw_screen_locked() {
        if (currentIcon == INSTALLING_UPDATE) {
            size_t y = header_height_ + 4;

            draw_background_locked(currentIcon);
            draw_background_locked();

            SetColor(LOG);
            int cx, cy;
+1 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
class ScreenRecoveryUI : public RecoveryUI {
  public:
    ScreenRecoveryUI();
    virtual ~ScreenRecoveryUI() { }

    void Init();
    void SetLocale(const char* locale);
@@ -155,8 +156,6 @@ class ScreenRecoveryUI : public RecoveryUI {

    int stage, max_stage;

    int char_width_;
    int char_height_;
    pthread_mutex_t updateMutex;
    bool rtl_locale;

+4 −13
Original line number Diff line number Diff line
@@ -526,13 +526,6 @@ void RecoveryUI::handle_release(input_device* dev) {
        }
    }

    if (DialogShowing()) {
        if (DialogDismissable() && !dev->in_swipe) {
            DialogDismiss();
        }
        return;
    }

    if (in_swipe) {
        if (abs(diff.x) > abs(diff.y)) {
            if (abs(diff.x) > min_swipe_px.x) {
@@ -572,7 +565,6 @@ void RecoveryUI::handle_gestures(input_device* dev) {
        diff.y = dev->touch_pos.y - dev->touch_track.y;
        if (abs(diff.y) > MenuItemHeight()) {
            dev->in_swipe = true;
            if (!DialogShowing()) {
            dev->touch_track = dev->touch_pos;
            int key = (diff.y < 0) ? KEY_VOLUMEUP : KEY_VOLUMEDOWN;
            ProcessKey(dev, key, 1);
@@ -580,7 +572,6 @@ void RecoveryUI::handle_gestures(input_device* dev) {
        }
    }
}
}

void RecoveryUI::EnqueueKey(int key_code) {
    pthread_mutex_lock(&key_queue_mutex);
+3 −3
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ void WearRecoveryUI::draw_background_locked(Icon icon)
// Should only be called with updateMutex locked.
void WearRecoveryUI::draw_progress_locked()
{
    if (currentIcon == D_ERROR) return;
    if (currentIcon == ERROR) return;
    if (progressBarType != DETERMINATE) return;

    int width = progress_bar_width;
@@ -298,8 +298,8 @@ void WearRecoveryUI::Init()

    LoadBitmap("icon_installing", &backgroundIcon[INSTALLING_UPDATE]);
    backgroundIcon[ERASING] = backgroundIcon[INSTALLING_UPDATE];
    LoadBitmap("icon_error", &backgroundIcon[D_ERROR]);
    backgroundIcon[NO_COMMAND] = backgroundIcon[D_ERROR];
    LoadBitmap("icon_error", &backgroundIcon[ERROR]);
    backgroundIcon[NO_COMMAND] = backgroundIcon[ERROR];

    introFrames = (GRSurface**)malloc(intro_frames * sizeof(GRSurface*));
    for (int i = 0; i < intro_frames; ++i) {
Loading