rui: Fix menu description reset 38/155938/1
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Mon, 16 Oct 2017 11:54:56 +0000 (13:54 +0200)
committerPaweł Szewczyk <p.szewczyk@samsung.com>
Mon, 16 Oct 2017 12:42:45 +0000 (14:42 +0200)
Descriptions in submenus were reset to main menu value. This commit
fixes it.

Change-Id: I75e503d7cfd0515caa7a25956169cc892d6431aa
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
src/system-recovery/recovery-main.c
src/system-recovery/recovery-rui.c

index 1446b79..bda457e 100644 (file)
@@ -83,12 +83,15 @@ char *get_action_from_file(void)
        int ret;
 
        fp = fopen(SYSTEM_RECOVERY_ACTION_FILE, "r");
-       if (!fp)
+       if (!fp) {
+               LOGD("Could not open recovery action file\n");
                return NULL;
+       }
 
        ret = fscanf(fp, "%" STR(ACTION_BUFFER_SIZE) "s", buf);
        fclose(fp);
-       unlink(SYSTEM_RECOVERY_ACTION_FILE);
+       if (unlink(SYSTEM_RECOVERY_ACTION_FILE) < 0)
+               LOGD("Could not unlink recovery action file: %m\n");
 
        if (ret != 1)
                return NULL;
index 777f691..37c4dd5 100644 (file)
@@ -73,8 +73,9 @@ static void timeout_handler(rui_screen *cs)
                }
        }
 
-       if (!user_idle) {
+       if (original_description && !user_idle) {
                cs->description->text = original_description;
+               original_description = NULL;
        }
 
        timer_count++;