From: Joogab Yun Date: Thu, 23 Jan 2020 10:00:14 +0000 (+0900) Subject: [Tizen] system_settings_set_changed_cb can only register one callback per process. X-Git-Tag: accepted/tizen/5.5/unified/20200206.060330~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a105f0a67b011821078e03e85c86170b435d858f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [Tizen] system_settings_set_changed_cb can only register one callback per process. 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 --- diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 695688f..689c913 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -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; diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index fd39a3a..aa7dce5 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -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: diff --git a/dali/internal/adaptor/generic/adaptor-impl-generic.cpp b/dali/internal/adaptor/generic/adaptor-impl-generic.cpp old mode 100644 new mode 100755 index 1b05919..2329059 --- a/dali/internal/adaptor/generic/adaptor-impl-generic.cpp +++ b/dali/internal/adaptor/generic/adaptor-impl-generic.cpp @@ -45,6 +45,12 @@ void Adaptor::SetupSystemInformation() { } +void Adaptor::ResetSystemInformation() +{ +} + + + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp b/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp old mode 100644 new mode 100755 index 3e2865d..8daa681 --- a/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/adaptor-impl-tizen.cpp @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #ifdef APPCORE_WATCH_AVAILABLE #include @@ -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