From 36e9c012d5df430849bf6d8f22fd3a7c897990ba Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 16 Dec 2024 16:56:19 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E7=94=B5=E8=AF=9D=E5=A4=84?= =?utf8?q?=E7=90=86=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96=E7=94=B5=E8=AF=9D?= =?utf8?q?=E5=8D=A1=E5=9C=A8=E5=8D=95=E7=8B=AC=E7=95=8C=E9=9D=A2=E9=97=AE?= =?utf8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/callerlog/src/CallerLogModel.cpp | 4 +-- .../nativeabilityfwk/include/Ability.h | 20 +++------------ .../wearable/nativeabilityfwk/src/Ability.cpp | 25 +++++++++++++++++++ .../msg_center/src/msg_center_customer.cpp | 12 ++------- .../src/notify/makephone_notification.cpp | 14 +++++++++++ 5 files changed, 46 insertions(+), 29 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp index 09f090064..63ff5a2b3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -173,11 +173,11 @@ void StatusReset(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxx"); PhoneServiceScreenCtr(false); - if(NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL || NativeAbility::GetInstance().GetCurSliceId() == VIEW_BLUETOOTH_EARPHONE) + if(NativeAbility::GetInstance().GetCurSliceId() == VIEW_INCOMING_CALL) { NativeAbility::GetInstance().Back_CountSlice_make_phone(); } - else if (NativeAbility::GetInstance().GetCurSliceId() == VIEW_REBOOTANDSHUTDOWN ) + else if (!uapi_dev_runtime_get_train_status())// || NativeAbility::GetInstance().GetCurSliceId() == VIEW_BLUETOOTH_EARPHONE ) { NativeAbility::GetInstance().ClearSliceIdStack(); } diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h b/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h index 69136fd70..8953b097d 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/Ability.h @@ -28,7 +28,7 @@ #include "soc_osal.h" #include "stack" #include "wearable_log.h" -// #include "AppViewIDs.h" +#include "AppViewIDs.h" namespace OHOS { const static uint16_t gSliceInvalid = 0; const static uint16_t gSliceDefaultPriority = 4; // 页面默认是最低优先级 @@ -150,22 +150,8 @@ public: } //仅用于打电话结束恢复时使用 bool Back_CountSlice_make_phone(const TransitionType transitionId = TransitionType::TRANSITION_INVALID, - const uint16_t priority = gSliceDefaultPriority) { - if(!backStack_.empty()) - { - // 如果此时 backStack_ 栈不为空,取出栈顶的切片 ID ,并调用 ChangeSlice 切换到该切片,返回 true 。 - uint16_t preSlice = backStack_.top(); - backStack_.pop(); - ChangeSlice(preSlice,transitionId,priority); - return true; - } - else - { - //如果 backStack_ 栈为空,切换到默认切片,返回 false 。 - ChangeSlice(defaultSliceId_, transitionId, priority); - return false; // 返回false表示无前一个slice,退回到默认slice - } - } + const uint16_t priority = gSliceDefaultPriority); + bool make_phone_push(uint16_t preSlice) { if(backStack_.empty()) diff --git a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp index c2ae26e2e..2404c1386 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp +++ b/code/sdk/application/wearable/nativeabilityfwk/src/Ability.cpp @@ -316,4 +316,29 @@ namespace OHOS curSlicePriority_ = gSliceDefaultPriority; } } + + bool Ability::Back_CountSlice_make_phone(const TransitionType transitionId, + const uint16_t priority ) { + if(!backStack_.empty()) + { + // 如果此时 backStack_ 栈不为空,取出栈顶的切片 ID ,并调用 ChangeSlice 切换到该切片,返回 true 。 + uint16_t preSlice = backStack_.top(); + backStack_.pop(); + + #ifdef FD230 + if(preSlice!=VIEW_INCOMING_CALL) + ChangeSlice(preSlice,transitionId,priority); + else + ChangeSlice(defaultSliceId_, transitionId, priority); + #endif + return true; + } + else + { + //如果 backStack_ 栈为空,切换到默认切片,返回 false 。 + ChangeSlice(defaultSliceId_, transitionId, priority); + return false; // 返回false表示无前一个slice,退回到默认slice + } + } + } // namespace OHOS diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 4ef298ac6..d572ea65f 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -1073,7 +1073,6 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) { CallerLogModel::GetInstance()->tempSetoperateNumberCAT1(call_data,req->len); - NotificationManager::GetInstance()->SetWatchCallStatus(true); cat1_phone_state_change_cb(OPERATE_WAITING); free(call_data); @@ -1099,8 +1098,7 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) } CallerLogModel::GetInstance()->SetoperateNumber(call_data,strlen(call_data)); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); - NotificationManager::GetInstance()->SetWatchCallStatus(true); + // NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); cat1_phone_state_change_cb(OPERATE_INCOMING); @@ -1136,13 +1134,11 @@ void MsgCenterNotifyCat1CallConnectedProc(const Topic topic, Request* req) cat1_ag_send_call_event(TOPIC_EVENT_CAT1_CALLCONNTED,NULL); #endif - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); - SetMicMutecat1(false); cat1_phone_state_change_cb(OPERATE_WATCH_ACTIVE); - NotificationManager::GetInstance()->SetWatchCallStatus(true); + } @@ -1179,10 +1175,6 @@ void MsgCenterNotifyCat1dialProc(const Topic topic, Request* req) #endif CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); - NotificationManager::GetInstance()->SetWatchCallStatus(true); - - cat1_phone_state_change_cb(OPERATE_DIALING); #ifdef SUPPORT_CAT1_HFP_AG_SERV if(headset_Is_connect()) diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp index 6d8d8b395..745be7313 100755 --- a/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/makephone_notification.cpp @@ -629,6 +629,10 @@ static int g_callOperate = OPERATE_NO_OPE; static void DialingHandle(void) { + + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); + NotificationManager::GetInstance()->SetWatchCallStatus(true); + CallerLogModel::GetInstance()->SetDialingStatus("正在拨号"); CallerLogModel::GetInstance()->SetMakePhoneStatus(true); @@ -649,6 +653,9 @@ static void IncomingHandle(void) { CallerLogModel::GetInstance()->SetMakePhoneStatus(false); + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); + NotificationManager::GetInstance()->SetWatchCallStatus(true); + InitCallingTimer(); @@ -657,6 +664,9 @@ static void IncomingHandle(void) static void WaitingOpreate() { { + // CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); + NotificationManager::GetInstance()->SetWatchCallStatus(true); + cat1_call_hungup(); CustomEventPublish(TOPIC_EVENT_HFP_HINT,NULL,0); CallerLogModel::GetInstance()->set_RejectIncomingCall_falg(1); @@ -668,6 +678,10 @@ static void WaitingOpreate() static void WatchActiveHandle() { + + CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1); + NotificationManager::GetInstance()->SetWatchCallStatus(true); + InitCallingTimer(); CallerLogModel::GetInstance()->SetCallStatus(true); CallerLogModel::GetInstance()->SetWaitingStatus(false); -- 2.17.1