[Tizen] system_settings_set_changed_cb can only register one callback per process. 08/223808/1
authorJoogab Yun <joogab.yun@samsung.com>
Thu, 23 Jan 2020 10:00:14 +0000 (19:00 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Tue, 4 Feb 2020 06:37:00 +0000 (15:37 +0900)
If other app registers the system_settings_set_changed_cb callback, DALi cannot use this callback.
So I changed to the way using vconf.

Change-Id: I5e4a100fbb4f13164393ef0973b80c834a8000e5

dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/generic/adaptor-impl-generic.cpp [changed mode: 0644->0755]
dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp [changed mode: 0644->0755]

index 695688f..689c913 100755 (executable)
@@ -334,6 +334,9 @@ Adaptor::~Adaptor()
   // Ensure stop status
   Stop();
 
+  // reset SystemInformation
+  ResetSystemInformation();
+
   // set to NULL first as we do not want any access to Adaptor as it is being destroyed.
   gThreadLocalAdaptor = NULL;
 
index fd39a3a..aa7dce5 100755 (executable)
@@ -602,6 +602,11 @@ private:
   void SetupSystemInformation();
 
   /**
+   * Reset up system information if needs
+   */
+  void ResetSystemInformation();
+
+  /**
    * Adds a callback to be run when entering an idle state.
    *
    * A callback of the following type should be used:
old mode 100644 (file)
new mode 100755 (executable)
index 1b05919..2329059
@@ -45,6 +45,12 @@ void Adaptor::SetupSystemInformation()
 {
 }
 
+void Adaptor::ResetSystemInformation()
+{
+}
+
+
+
 } // namespace Adaptor
 
 } // namespace Internal
old mode 100644 (file)
new mode 100755 (executable)
index 3e2865d..8daa681
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <app_common.h>
 #include <system_settings.h>
+#include <vconf.h>
 
 #ifdef APPCORE_WATCH_AVAILABLE
 #include <screen_connector_provider.h>
@@ -45,7 +46,7 @@ namespace Adaptor
 namespace
 {
 
-static void OnSystemLanguageChanged( system_settings_key_e key, void* data )
+static void OnSystemLanguageChanged( keynode_t *key, void* data )
 {
   char* locale = NULL;
   if( system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale ) != SYSTEM_SETTINGS_ERROR_NONE ||
@@ -126,7 +127,7 @@ void Adaptor::SurfaceInitialized()
 
 void Adaptor::SetupSystemInformation()
 {
-  if( system_settings_set_changed_cb( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, OnSystemLanguageChanged, this ) != SYSTEM_SETTINGS_ERROR_NONE )
+  if( vconf_notify_key_changed( VCONFKEY_LANGSET, OnSystemLanguageChanged, this ) < 0)
   {
     DALI_LOG_ERROR( "DALI system_settings_set_changed_cb failed.\n" );
     return;
@@ -146,6 +147,11 @@ void Adaptor::SetupSystemInformation()
 
 }
 
+void Adaptor::ResetSystemInformation()
+{
+  vconf_ignore_key_changed( VCONFKEY_LANGSET, OnSystemLanguageChanged );
+}
+
 } // namespace Adaptor
 
 } // namespace Internal