diff --git a/napi/settings/napi_settings.cpp b/napi/settings/napi_settings.cpp index bab2d13a9eb4101a80892971675d3124a5076af4..2ba7e7dec0a541e1fa1fdf56fc7a648a8205dcf6 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/napi/settings/napi_settings_init.cpp b/napi/settings/napi_settings_init.cpp index 2b654ffb713bb84f308edc33140d1df2e36983ff..d7f5cccc215eea28b11f472f6b9bf0aa0c9d1522 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; diff --git a/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets b/product/phone/src/main/ets/pages/abilityDialog/BluetoothDialog.ets index 1fcc5fc1a8719d6a010936805d50828a1b117c30..23c7d1a6c78fc2ac302e6b702d05bb5c5061c61f 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 {