Convey launching condition to screen-reader 26/129326/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 16 May 2017 05:22:27 +0000 (14:22 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 16 May 2017 06:07:59 +0000 (15:07 +0900)
The screen-reader reads "Screen reader (TTS) on" when the screen-reader launches.
It is not necessary to read this information for the screen-reader launching at
booting time. It is necessary only if the screen-reader is launched by the Vconf
value change from the Settings application.

Change-Id: I73cb17be6c6b561d77ed2f6d7226a21896f62e1a

bus/at-spi-bus-launcher.c

index db1db5c..89860b6 100644 (file)
@@ -604,7 +604,7 @@ gsettings_key_changed (GSettings *gsettings, const gchar *key, void *user_data)
 }
 
 static gboolean
-_launch_screen_reader(gpointer user_data)
+_launch_screen_reader(gpointer user_data, gboolean by_vconf_change)
 {
    A11yBusLauncher *bl = user_data;
    LOGD("Launching screen reader");
@@ -619,6 +619,15 @@ _launch_screen_reader(gpointer user_data)
         LOGD("Can't create bundle");
         return FALSE;
      }
+
+   if (by_vconf_change)
+     {
+        if (bundle_add_str(kb, "by_vconf_change", "yes") != BUNDLE_ERROR_NONE)
+          {
+             LOGD("Can't add information to bundle");
+          }
+     }
+
    int operation_error = appsvc_set_operation(kb, APP_CONTROL_OPERATION_SCREEN_READ);
    LOGD("appsvc_set_operation: %i", operation_error);
 
@@ -649,7 +658,7 @@ _launch_screen_reader_repeat_until_success(gpointer user_data) {
          return FALSE;
       }
 
-    gboolean ret = _launch_screen_reader(user_data);
+    gboolean ret = _launch_screen_reader(user_data, FALSE);
 
     if (ret)
       {
@@ -727,7 +736,7 @@ void screen_reader_cb(keynode_t *node, void *user_data)
    if (!bl->screen_reader_needed && (bl->pid > 0))
      _terminate_screen_reader(bl);
    else if (bl->screen_reader_needed && (bl->pid <= 0))
-     _launch_screen_reader(bl);
+     _launch_screen_reader(bl, TRUE);
 }
 
 int