From: hcj <1224667075@qq.com> Date: Mon, 14 Oct 2024 09:11:33 +0000 (+0800) Subject: 增加通话显示时间的更新 X-Git-Tag: release_V1.2.70_20241020_135402~9^2~25 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=2223aed6c21912a36e1fe6ac4ad806982197bce9;p=mirrors%2FFD230.git 增加通话显示时间的更新 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h index 9130e27a8..515a179a5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h @@ -45,6 +45,7 @@ void StatusReset(void); void UsingPhoneChangeStatusCallback(const PhoneCallInfo *phoneCall); void UsingPhoneErrorCallback(PhoneServiceErrorType type); void CAT1_ChangeStatusScreendisplay(int lastStatus); +void InitCallingTimer(); namespace OHOS { 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 508f3069f..a393d01b7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -21,7 +21,7 @@ #include "ConfigModel.h" #include "vibrator_service.h" #include "custom_runtime.h" - +#include "MainCallingView.h" #include "dial_sos_c.h" #ifdef __cplusplus extern "C" { @@ -159,20 +159,34 @@ void StatusReset(void) /* 定时器回调函数 */ static void CallTimerCallbackProc(int data) { - g_callTimes++; - - if (CallingView::GetInstance() == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance is nullptr"); + if(MainCallingView::GetInstance()==nullptr) + { return; - } + } + + if(MainCallingView::GetInstance()->GetCallingView()) + { + if (MainCallingView::GetInstance()->GetCallingView()->GetCallingDurationLabel()) + { + + MainCallingView::GetInstance()->GetCallingView()->GetCallingDurationLabel()-> + SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); + MainCallingView::GetInstance()->GetCallingView()->GetCallingDurationLabel()->Invalidate(); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingView::xxx"); + } + } + +// if(MainCallingView::GetInstance()->GetScreenView()) +// { +// if (MainCallingView::GetInstance()->GetScreenView()->GetCallingDurationLabel()) +// { + +// MainCallingView::GetInstance()->GetScreenView()->GetCallingDurationLabel()-> +// SetText(CallerLogModel::GetInstance()->InitDateHourTime().c_str()); +// } +// } - if (CallingView::GetInstance()->GetCallingDurationLabel() == nullptr) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallTimerCallbackProc] GetInstance()->GetCallingDurationLabel is nullptr"); - return; - } - CallingView::GetInstance()->GetCallingDurationLabel()-> - SetText(CallerLogModel::GetInstance()->DisplayCallDuration().c_str()); } static void snakeCallback(int data) @@ -192,7 +206,7 @@ static void CallTimerCallback(int data) /* 开启定时器 */ -static void InitCallingTimer() +void InitCallingTimer() { if (g_startCounting != nullptr) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CallerLogModel::CallerTimer already exists!!"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp index 85a963336..7c616b33f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/makephone/src/CallingView.cpp @@ -137,7 +137,7 @@ bool CallingView::InitAddOnclickevent() UILabel *CallingView::GetCallingDurationLabel() { - return callDuration; + return currentTimes; } void CallingView::updataCallingname(void) 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 d15f37b08..8149122fd 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 @@ -533,6 +533,7 @@ static void WaitingOpreate() static void WatchActiveHandle() { DisableCallTimer(CallTimerType::NOTIFY_PHONE_DIAL_DISPLAY); + InitCallingTimer(); CallerLogModel::GetInstance()->SetCallStatus(true); CallerLogModel::GetInstance()->SetWaitingStatus(false); @@ -600,6 +601,7 @@ void cat1_phone_state_change_cb(uint8_t state) if (true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get())) { ui_api_vibrate_once_func(); + } call_stat=2; break;