From 83cb5f4d8b9f22de87b3b58e1dd7e3ab216529a2 Mon Sep 17 00:00:00 2001 From: guowei Date: Mon, 18 Aug 2025 11:30:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?settings=E6=97=A5=E5=BF=97=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guowei --- napi/settings/napi_settings.cpp | 4 ++-- .../pages/abilityDialog/BluetoothDialog.ets | 21 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/napi/settings/napi_settings.cpp b/napi/settings/napi_settings.cpp index bab2d13a..2ba7e7de 100644 --- a/napi/settings/napi_settings.cpp +++ b/napi/settings/napi_settings.cpp @@ -1137,7 +1137,7 @@ napi_value napi_set_value_sync(napi_env env, napi_callback_info info) } std::string argsName = unwrap_string_from_js(env, args[PARAM1]); - std::string argsDefaultValue = unwrap_string_from_js(env, args[PARAM2]); + std::string argsDefaultValue = unwrap_string_from_js(env, args[PARAM2], true, true); OHOS::NativeRdb::ValuesBucket val; val.PutString(SETTINGS_DATA_FIELD_KEYWORD, argsName); @@ -1406,7 +1406,7 @@ napi_value napi_set_value(napi_env env, napi_callback_info info) } asyncCallbackInfo->key = unwrap_string_from_js(env, args[PARAM1]); - asyncCallbackInfo->value = unwrap_string_from_js(env, args[PARAM2]); + asyncCallbackInfo->value = unwrap_string_from_js(env, args[PARAM2], true, true); SETTING_LOG_INFO("set input param is : (key %{public}s, value %{public}s)", asyncCallbackInfo->key.c_str(), asyncCallbackInfo->value.c_str()); diff --git a/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets b/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets index 1fcc5fc1..9483f0da 100644 --- a/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets +++ b/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets @@ -29,9 +29,13 @@ struct BluetoothSwitchWindowDialog { autoCancel: true, customStyle: true, cancel: () => { - let dialogSession: UIExtensionContentSession | undefined = - AppStorage.get('accessibilityDialogSession'); - dialogSession?.terminateSelf(); + try { + let dialogSession: UIExtensionContentSession | undefined = + AppStorage.get('accessibilityDialogSession'); + dialogSession?.terminateSelf(); + } catch(err) { + LogUtil.error("settings: bluetoothSwitchDialog cancel err " + err?.message); + } } }); @@ -152,9 +156,14 @@ struct BluetoothSwitchDialog { onDialogClose(): void { LogUtil.info(`${TAG} onDialogClose in`); this.controller?.close(); - let dialogSession: UIExtensionContentSession | undefined = - AppStorage.get('accessibilityDialogSession'); - dialogSession?.terminateSelf(); + try { + let dialogSession: UIExtensionContentSession | undefined = + AppStorage.get('accessibilityDialogSession'); + dialogSession?.terminateSelf(); + } catch(err) { + LogUtil.error("settings: bluetoothSwitchDialog onDialogClose err " + err?.message); + } + } aboutToAppear(): void { -- Gitee From 5012e797a0f3de18707be775ee2290e2625b0bfb Mon Sep 17 00:00:00 2001 From: guowei Date: Mon, 18 Aug 2025 14:32:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?setitngs=E6=97=A5=E5=BF=97=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guowei --- .../src/main/ets/pages/abilityDialog/BluetoothDialog.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets b/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets index 9483f0da..23c7d1a6 100644 --- a/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets +++ b/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets @@ -34,7 +34,7 @@ struct BluetoothSwitchWindowDialog { AppStorage.get('accessibilityDialogSession'); dialogSession?.terminateSelf(); } catch(err) { - LogUtil.error("settings: bluetoothSwitchDialog cancel err " + err?.message); + LogUtil.error('settings: bluetoothSwitchDialog cancel err:' + err?.message); } } }); @@ -161,7 +161,7 @@ struct BluetoothSwitchDialog { AppStorage.get('accessibilityDialogSession'); dialogSession?.terminateSelf(); } catch(err) { - LogUtil.error("settings: bluetoothSwitchDialog onDialogClose err " + err?.message); + LogUtil.error('settings: bluetoothSwitchDialog onDialogClose err:' + err?.message); } } -- Gitee From 2b5587fc06f7a3e459c577efb26078d4e64a694b Mon Sep 17 00:00:00 2001 From: guowei Date: Mon, 18 Aug 2025 20:28:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?font=5Fscale=E6=98=A0=E5=B0=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guowei --- napi/settings/napi_settings_init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napi/settings/napi_settings_init.cpp b/napi/settings/napi_settings_init.cpp index 2b654ffb..d7f5cccc 100644 --- a/napi/settings/napi_settings_init.cpp +++ b/napi/settings/napi_settings_init.cpp @@ -175,7 +175,7 @@ const std::string Date::TIME_FORMAT = "settings.date.time_format"; const std::string Date::AUTO_GAIN_TIME = "settings.date.auto_gain_time"; const std::string Date::AUTO_GAIN_TIME_ZONE = "settings.date.auto_gain_time_zone"; -const std::string Display::FONT_SCALE = "settings.display.font_scale"; +const std::string Display::FONT_SCALE = "font_scale"; const std::string Display::SCREEN_BRIGHTNESS_STATUS = "settings.display.screen_brightness_status"; const std::string Display::AUTO_SCREEN_BRIGHTNESS = "settings.display.auto_screen_brightness"; const int Display::AUTO_SCREEN_BRIGHTNESS_MODE = 1; -- Gitee