From: Eunki, Hong Date: Wed, 16 Apr 2025 08:50:03 +0000 (+0900) Subject: [NUI] Catch exception when Tizen.System.SystemSettings throw excpetion X-Git-Tag: submit/tizen/20250417.075952~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f7dddcb72ef15d75ec83c32a73d2771a4627914;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Catch exception when Tizen.System.SystemSettings throw excpetion There was some exception throwing at some targets s.t. SystemSettings not supported. If then, we should not do anything after those exception occured. Signed-off-by: Eunki, Hong --- diff --git a/src/Tizen.NUI/src/internal/Common/SystemFontSizeChangedManager.cs b/src/Tizen.NUI/src/internal/Common/SystemFontSizeChangedManager.cs index b032a4c58..b3024d2d6 100644 --- a/src/Tizen.NUI/src/internal/Common/SystemFontSizeChangedManager.cs +++ b/src/Tizen.NUI/src/internal/Common/SystemFontSizeChangedManager.cs @@ -34,7 +34,15 @@ namespace Tizen.NUI static SystemFontSizeChangedManager() { - SystemSettings.FontSizeChanged += SystemFontSizeChanged; + try + { + SystemSettings.FontSizeChanged += SystemFontSizeChanged; + } + catch(Exception e) + { + Tizen.Log.Info("NUI", $"{e} Exception caught! SystemFontSizeChanged will not be detected!\n"); + fontSize = SystemSettingsFontSize.Normal; + } } /// diff --git a/src/Tizen.NUI/src/internal/Common/SystemFontTypeChangedManager.cs b/src/Tizen.NUI/src/internal/Common/SystemFontTypeChangedManager.cs index aba4bbabc..3a8b5b605 100644 --- a/src/Tizen.NUI/src/internal/Common/SystemFontTypeChangedManager.cs +++ b/src/Tizen.NUI/src/internal/Common/SystemFontTypeChangedManager.cs @@ -35,7 +35,15 @@ namespace Tizen.NUI static SystemFontTypeChangedManager() { - SystemSettings.FontTypeChanged += SystemFontTypeChanged; + try + { + SystemSettings.FontTypeChanged += SystemFontTypeChanged; + } + catch(Exception e) + { + Tizen.Log.Info("NUI", $"{e} Exception caught! SystemFontTypeChanged will not be detected!\n"); + fontType = defaultFontType; + } } /// diff --git a/src/Tizen.NUI/src/internal/Common/SystemLocaleLanguageChangedManager.cs b/src/Tizen.NUI/src/internal/Common/SystemLocaleLanguageChangedManager.cs index c440494ae..011a59c3a 100644 --- a/src/Tizen.NUI/src/internal/Common/SystemLocaleLanguageChangedManager.cs +++ b/src/Tizen.NUI/src/internal/Common/SystemLocaleLanguageChangedManager.cs @@ -35,7 +35,15 @@ namespace Tizen.NUI static SystemLocaleLanguageChangedManager() { - SystemSettings.LocaleLanguageChanged += SystemLocaleLanguageChanged; + try + { + SystemSettings.LocaleLanguageChanged += SystemLocaleLanguageChanged; + } + catch(Exception e) + { + Tizen.Log.Info("NUI", $"{e} Exception caught! SystemLocaleLangeChanged will not be detected!\n"); + localeLanguage = defaultLocaleLanguage; + } } /// diff --git a/src/Tizen.NUI/src/public/Visuals/VisualObject/AdvancedTextVisual.cs b/src/Tizen.NUI/src/public/Visuals/VisualObject/AdvancedTextVisual.cs index cee81c7d3..8336d01ab 100644 --- a/src/Tizen.NUI/src/public/Visuals/VisualObject/AdvancedTextVisual.cs +++ b/src/Tizen.NUI/src/public/Visuals/VisualObject/AdvancedTextVisual.cs @@ -68,7 +68,15 @@ namespace Tizen.NUI.Visuals } string translatableText = null; textLabelSid = value; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new global::System.Globalization.CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); + try + { + translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new global::System.Globalization.CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); + } + catch(global::System.Exception e) + { + Tizen.Log.Info("NUI", $"{e} Exception caught! Translate {value} failed!\n"); + translatableText = null; + } if (translatableText != null) {