Fixed state of screen-reader wher screen-reader exits abnormally 84/49784/2
authorTomasz Olszak <t.olszak@samsung.com>
Wed, 10 Jun 2015 10:12:54 +0000 (12:12 +0200)
committerTomasz Olszak <t.olszak@samsung.com>
Fri, 23 Oct 2015 14:53:22 +0000 (16:53 +0200)
When screen-reader e.g. crashed, bus-launcher didn't check if the process
is still running before it tried to terminated it. In result screen-reader's
invalid PID was kept and new screen-reader couldn't be launched.

Change-Id: I599c7e7962a16b031e913c1a957b2f33f225a6f3
Signed-off-by: Tomasz Olszak <t.olszak@samsung.com>
bus/at-spi-bus-launcher.c

index 08566d6..a84270b 100644 (file)
@@ -601,6 +601,16 @@ _terminate_screen_reader(A11yBusLauncher *bl)
    if (bl->pid <= 0)
      return FALSE;
 
+
+   int status = aul_app_get_status_bypid(bl->pid);
+
+   if (status < 0)
+     {
+       LOGD("App with pid %d already terminated", bl->pid);
+       bl->pid = 0;
+       return TRUE;
+     }
+
    LOGD("terminate process with pid %d", bl->pid);
    if (!aul_terminate_pid(bl->pid))
      {