1 Star 0 Fork 373

luojingsong/notification_distributed_notification_service_2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0001-.patch 3.66 KB
一键复制 编辑 原始数据 按行查看 历史
luojingsong 提交于 2025-06-06 10:55 +08:00 . 1
From 9101c49bcee470c7f9713b9c1884e040feced07d Mon Sep 17 00:00:00 2001
From: l30060944 <l30060944@notesmail.huawei.com/>
Date: Thu, 5 Jun 2025 09:28:22 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=AA=8C=E8=AF=81=20TicketNo?=
=?UTF-8?q?:=20DTS2025052322968=20Description:=20=E5=BC=B9=E7=AA=97?=
=?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=AA=8C=E8=AF=81=20Team:OTHERS=20Feature=20?=
=?UTF-8?q?or=20Bugfix:=20Bugfix=20Binary=20Source:=20sync=20from=20gitee?=
=?UTF-8?q?=20PrivateCode(Yes/No):No?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I7858b373fd744c33a255ad32acd4fe918395b752
---
.../napi/src/manager/napi_open_settings.cpp | 41 ++++++++++---------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/frameworks/js/napi/src/manager/napi_open_settings.cpp b/frameworks/js/napi/src/manager/napi_open_settings.cpp
index cda74b8d..3be8a7d6 100644
--- a/frameworks/js/napi/src/manager/napi_open_settings.cpp
+++ b/frameworks/js/napi/src/manager/napi_open_settings.cpp
@@ -76,35 +76,36 @@ napi_value NapiOpenNotificationSettings(napi_env env, napi_callback_info info)
napi_create_string_latin1(env, "openNotificationSettings", NAPI_AUTO_LENGTH, &resourceName);
auto createExtension = [](napi_env env, void* data) {
+ };
+ auto jsCb = [](napi_env env, napi_status status, void* data) {
ANS_LOGD("enter");
if (data == nullptr) {
ANS_LOGE("data is invalid");
return;
}
auto* asynccallbackinfo = static_cast<AsyncCallbackInfoOpenSettings*>(data);
-
- if (asynccallbackinfo->params.context != nullptr) {
- ANS_LOGD("stage mode");
- std::string bundleName {""};
- if (isExist.exchange(true)) {
- ANS_LOGE("SettingsUIExtension existed");
- asynccallbackinfo->info.errorCode = ERROR_SETTING_WINDOW_EXIST;
- return;
- }
- bool success = CreateSettingsUIExtension(asynccallbackinfo->params.context, bundleName);
- if (success) {
- asynccallbackinfo->info.errorCode = ERR_ANS_DIALOG_POP_SUCCEEDED;
+ while (true) {
+ if (asynccallbackinfo->params.context != nullptr) {
+ ANS_LOGD("stage mode");
+ std::string bundleName {""};
+ if (isExist.exchange(true)) {
+ ANS_LOGE("SettingsUIExtension existed");
+ asynccallbackinfo->info.errorCode = ERROR_SETTING_WINDOW_EXIST;
+ break;
+ }
+ bool success = CreateSettingsUIExtension(asynccallbackinfo->params.context, bundleName);
+ if (success) {
+ asynccallbackinfo->info.errorCode = ERR_ANS_DIALOG_POP_SUCCEEDED;
+ } else {
+ asynccallbackinfo->info.errorCode = ERROR_INTERNAL_ERROR;
+ }
} else {
- asynccallbackinfo->info.errorCode = ERROR_INTERNAL_ERROR;
+ ANS_LOGD("un stage mode");
}
- } else {
- ANS_LOGD("un stage mode");
+ ANS_LOGI("done, code is %{public}d.", asynccallbackinfo->info.errorCode);
+ break;
}
- ANS_LOGI("done, code is %{public}d.", asynccallbackinfo->info.errorCode);
- };
- auto jsCb = [](napi_env env, napi_status status, void* data) {
- ANS_LOGD("enter jsCb");
- auto* asynccallbackinfo = static_cast<AsyncCallbackInfoOpenSettings*>(data);
+
ErrCode errCode = asynccallbackinfo->info.errorCode;
if (errCode != ERR_ANS_DIALOG_POP_SUCCEEDED) {
ANS_LOGE("error, code is %{public}d.", errCode);
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/songbao1/notification_distributed_notification_service_2.git
git@gitee.com:songbao1/notification_distributed_notification_service_2.git
songbao1
notification_distributed_notification_service_2
notification_distributed_notification_service_2
master

搜索帮助