From: hcj <1224667075@qq.com> Date: Fri, 8 Mar 2024 03:37:37 +0000 (+0800) Subject: 通话记录 X-Git-Tag: release_V1.2.70_20241020_135402~1274^2~19^2~5^2 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=86abb227bdc27a1131ef75c31b9a43e10b46668e;p=mirrors%2FFD230.git 通话记录 --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index d49ff2da7..a5e28a989 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -268,7 +268,8 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemModel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemAboutTheWatchView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemSuperviseView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemLanguageView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/Systemupgrade.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/system/src/SystemFactoryResetView.cpp #声音与震动 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 8ba360851..638122d21 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -43,6 +43,10 @@ void g_callTimesclean() g_callTimes=0; } +int get_g_callTimes() +{ + return g_callTimes; +} void g_callTimesadd() { g_callTimes++; diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h index a3de0f919..c5ce5589f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/include/PhoneService.h @@ -86,6 +86,8 @@ typedef struct { PhoneServiceScoStatusCb scoStatusCb; } PhoneServiceCb; + +void AddToCallLog(CallLogInfo *info); /** * @brief 注册电话服务回调函数 * diff --git a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp index c0abf996e..67d76d800 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -744,7 +744,7 @@ static int GetCallLogFileSize(void) } // 添加通话进通话记录文件 -static void AddToCallLog(CallLogInfo *info) +void AddToCallLog(CallLogInfo *info) { FILE *fp = NULL; size_t ret; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h index c47602b50..d09e732c9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h @@ -14,6 +14,7 @@ #include "system/include/SystemSuperviseView.h" #include "system/include/SystemLanguageView.h" #include "system/include/SystemFactoryResetView.h" +#include "system/include/Systemupgrade.h" namespace OHOS { static const char *ABOUT_THE_WATCH = "AboutTheWatchButton"; // 关于手表 @@ -70,6 +71,7 @@ namespace OHOS bool ChangeSystemSuperviseView(int16_t thisView); bool ChangeSystemLanguageView(int16_t thisView); bool ChangeSystemFactoryResetView(int16_t thisView); + bool ChangeSystemupgradeView(int16_t thisView); bool ClickFunc(int16_t interface); void ChangeView(int16_t hideView, int16_t showView); UIScrollView *GetSystemScrollView(int ViewId); @@ -86,7 +88,9 @@ namespace OHOS SystemSuperviseView *p_SystemSuperviseView{nullptr}; SystemLanguageView *p_SystemLanguageView{nullptr}; SystemFactoryResetView *p_SystemFactoryResetView{nullptr}; - UIScrollView *SystemScrollView[5]{nullptr}; + SystemupgradeView *p_SystemupgradeView{nullptr}; + + UIScrollView *SystemScrollView[10]{nullptr}; UILabel *SystemLabel{nullptr}; // 标题 UIButton *AboutTheWatchButton{nullptr}; UIButton *SuperviseButton = {nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h new file mode 100644 index 000000000..a3aae396e --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h @@ -0,0 +1,57 @@ +#ifndef SYSTEM_UPGRADE_VIEW_H +#define SYSTEM_UPGRADE_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_image_view.h" +#include "components/ui_button.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label.h" +#include "components/ui_label_button_ext.h" + +namespace OHOS +{ + class SystemupgradeView + { + + public: + SystemupgradeView(); + virtual ~SystemupgradeView(); + static SystemupgradeView *GetInstance(void); + + UIScrollView *SystemupgradeViewInit(void); + void ClearAll(void); + + struct LabelConfig + { + int16_t left; + int16_t top; + int16_t width; + int16_t height; + int16_t fontSize; // 字体大小 + int16_t lineHeigh; // 行高 + char *text; // 文本 + uint8_t lineBreakMode; // 断行模式。 + }; + UILabel *InitLabel(LabelConfig &labelConfig); + + private: + UIScrollView *scrollView{nullptr}; + UIImageView *FactoryResetImage{nullptr}; // 恢复出厂设置背景图片 + UIButton *FactoryResetButtonCheckOn{nullptr}; // 重置确认 + UIButton *FactoryResetButtonCheckOff{nullptr}; // 重置否定 + + UILabel *systemupgrade{nullptr}; // "固件版本" + + UILabel *FirmwareVersionTitle{nullptr}; // "固件版本" + UILabel *FirmwareVersion{nullptr}; + + UILabel *newVersionTitle{nullptr}; // "最新软件版本" + UILabel *newVersion{nullptr}; + + + bool initViewStatus{false}; + }; +} // namespace OHOS +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp index 1b202bfff..1921ea40c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -109,7 +109,7 @@ namespace OHOS //int len=5; // 根据控件id查找是哪个控件触发了点击回调 - for(int i=0;i<5;i++) + for(int i=0;iChangeView(SYSTEMVIEW, ViewMapper_t[i].viewId); return true; } - } - if (strcmp(view.GetViewId(), FACTORYRESET_CHECKON) == 0) + if (strcmp(view.GetViewId(), FACTORYRESET_CHECKON) == 0) { + p_SystemView->ChangeView(FACTORYRESETVIEW, SYSTEMVIEW); return true; } else if (strcmp(view.GetViewId(), FACTORYRESET_CHECKOFF) == 0) diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index e140474f2..89f55ee33 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -21,7 +21,7 @@ namespace OHOS {SUPERVISEVIEW,"SuperviseButton","监管模式",&SystemView::ChangeSystemSuperviseView}, {SYSTEMLANGUAGEVIEW,"SystemLanguageButton","切换语言", &SystemView::ChangeSystemLanguageView}, {FACTORYRESETVIEW,"FactoryResetButton","恢复出厂", &SystemView::ChangeSystemFactoryResetView}, - {SYSTEMLUPGRADE,"systemupgread","系统升级",&SystemView::ChangeSystemFactoryResetView}, + {SYSTEMLUPGRADE,"systemupgread","系统升级",&SystemView::ChangeSystemupgradeView}, // {ABOUTTHEWATCHVIEW, &SystemView::ChangeSystemAboutView}, // {SUPERVISEVIEW, &SystemView::ChangeSystemSuperviseView}, @@ -58,12 +58,6 @@ namespace OHOS delete draglistener; draglistener = nullptr; } - for(int i=0;iSystemupgradeViewInit(); + RootView::GetInstance()->Add(SystemScrollView[thisView]); + } + return true; + } + + UIScrollView *SystemView::GetSystemScrollView(int ViewId) { if (SystemScrollView[ViewId] == nullptr) diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp new file mode 100644 index 000000000..2079ddf91 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp @@ -0,0 +1,232 @@ +#include "system/include/Systemupgrade.h" +#include "system/include/SystemPresenter.h" +#include "wearable_log.h" +#include "UiConfig.h" +#include "custom_utils.h" +namespace OHOS +{ + + static SystemupgradeView *g_pSystemFactoryResetView{nullptr}; + + SystemupgradeView::SystemupgradeView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::SystemFactoryResetView"); + g_pSystemFactoryResetView = this; + } + + SystemupgradeView::~SystemupgradeView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::~SystemFactoryResetView"); + ClearAll(); + g_pSystemFactoryResetView = nullptr; + } + + SystemupgradeView *SystemupgradeView::GetInstance() + { + return g_pSystemFactoryResetView; + } + + void SystemupgradeView::ClearAll() + { + if (initViewStatus == true) + { + scrollView->RemoveAll(); + delete FactoryResetImage; + FactoryResetImage = nullptr; + delete FactoryResetButtonCheckOn; + FactoryResetButtonCheckOn = nullptr; + delete FactoryResetButtonCheckOff; + FactoryResetButtonCheckOff = nullptr; + delete scrollView; + scrollView = nullptr; + } + } + + UILabel *SystemupgradeView::InitLabel(LabelConfig &labelConfig) + { + UILabel *label = new UILabel(); + if (label == nullptr) + { + return nullptr; + } + label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小 + label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小 + label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高 + label->SetText(labelConfig.text); // 内容 + label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。 + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize); + return label; + } + + UIScrollView *SystemupgradeView::SystemupgradeViewInit(void) + { + + scrollView = new UIScrollView(); + if (scrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemFactoryResetView::new scrollView fail!"); + return nullptr; + } + scrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetStyle(STYLE_BORDER_RADIUS, 1294); + scrollView->SetScrollBlankSize(35); + scrollView->SetReboundSize(50); + scrollView->SetDirection(1); + + UIView::OnDragListener *draglistener = static_cast(SystemPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); + return NULL; + } + scrollView->SetOnDragListener(draglistener); + scrollView->SetTouchable(true); + scrollView->SetDraggable(true); + + LabelConfig Config = { + .left = 190, + .top = 52, + .width = 60, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "系统升级", + .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + }; + systemupgrade = InitLabel(Config); + if (systemupgrade == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemAboutTheWatchTitle new fail!"); + return nullptr; + } + scrollView->Add(systemupgrade); + + /* -------------------------------------------------------------------------- */ + Config = { + .left = 168, + .top = 105, + .width = 120, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "当前固件版本", + .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + }; + FirmwareVersionTitle = InitLabel(Config); + if (FirmwareVersionTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersionTitle new fail!"); + return nullptr; + } + scrollView->Add(FirmwareVersionTitle); + + char version_buf[128]={0}; + uint32_t version_len=128; + uapi_get_buildversion((uint8_t*)version_buf,version_len); + Config = { + .left = 37, + .top = 110, + .width = 400, + .height = 30, + .fontSize = 26, + .lineHeigh = 30, + .text = (char*)version_buf, + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + FirmwareVersion = InitLabel(Config); + if (FirmwareVersion == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!"); + return nullptr; + } + FirmwareVersion->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView->Add(FirmwareVersion); + + Config = { + .left = 168, + .top = 200, + .width = 120, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .text = "最新固件版本", + .lineBreakMode = UILabel::LINE_BREAK_ADAPT, + }; + newVersionTitle = InitLabel(Config); + if (newVersionTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersionTitle new fail!"); + return nullptr; + } + scrollView->Add(newVersionTitle); + + char version_buf_1[128]={0}; + version_len=128; + uapi_get_buildversion((uint8_t*)version_buf_1,version_len); + Config = { + .left = 37, + .top = 210, + .width = 400, + .height = 30, + .fontSize = 26, + .lineHeigh = 30, + .text = (char*)version_buf_1, + .lineBreakMode = UILabel::LINE_BREAK_WRAP, + }; + newVersion = InitLabel(Config); + if (FirmwareVersion == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!"); + return nullptr; + } + newVersion->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87)); + scrollView->Add(newVersion); + + UILabelButtonExt * SystemUpgradeButton = new UILabelButtonExt(); + if (SystemUpgradeButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!"); + } + SystemUpgradeButton->SetPosition(43, 400, 100, 100); + SystemUpgradeButton->SetViewId(SYSTEM_UPGRADE); + SystemUpgradeButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + //SystemUpgradeButton->SetImagePosition(326, 37); + //SystemUpgradeButton->SetImageSrc("/user/res/SETTING_NEXT.bin", "/user/res/SETTING_NEXT.bin"); + SystemUpgradeButton->SetText("开始下载"); + SystemUpgradeButton->SetAlign(TEXT_ALIGNMENT_LEFT); + SystemUpgradeButton->SetLabelPosition(45, 0); + SystemUpgradeButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + SystemUpgradeButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + scrollView->Add(SystemUpgradeButton); + + UILabelButtonExt * SystemUpgradeButton_2 = new UILabelButtonExt(); + if (SystemUpgradeButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!"); + } + SystemUpgradeButton_2->SetPosition(163, 400, 100, 100); + SystemUpgradeButton_2->SetViewId(SYSTEM_UPGRADE); + SystemUpgradeButton_2->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + //SystemUpgradeButton->SetImagePosition(326, 37); + //SystemUpgradeButton->SetImageSrc("/user/res/SETTING_NEXT.bin", "/user/res/SETTING_NEXT.bin"); + SystemUpgradeButton_2->SetText("开始升级"); + SystemUpgradeButton_2->SetAlign(TEXT_ALIGNMENT_LEFT); + SystemUpgradeButton_2->SetLabelPosition(45, 0); + SystemUpgradeButton_2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20); + SystemUpgradeButton_2->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED); + + + UIView::OnClickListener *Click = static_cast(SystemPresenter::GetInstance()); + SystemUpgradeButton_2->SetOnClickListener(Click); + scrollView->Add(SystemUpgradeButton_2); + //SystemUpgradeButton->SetOnClickListener(clickListener); + + + + + return scrollView; + } + +} \ No newline at end of file diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h index 3b6c07b36..ad21adb9a 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h @@ -30,6 +30,7 @@ enum PhoneStatus { }; void g_callTimesclean(); void g_callTimesadd(); +int get_g_callTimes(); bool MulitplePhoneTextReplaces(); bool FindCallListInfoAndSetPriorityNumber(); void PhoneScoStatausCallback(hfp_sco_connect_state_t state); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h index 2cfce573f..36eeaa6e7 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/include/PhoneService.h @@ -86,6 +86,7 @@ typedef struct { PhoneServiceScoStatusCb scoStatusCb; } PhoneServiceCb; +void AddToCallLog(CallLogInfo *info); /** * @brief 注册电话服务回调函数 * diff --git a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp index 3fadd3445..07d41f3cf 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/phoneservice/src/PhoneService.cpp @@ -732,7 +732,7 @@ static int GetCallLogFileSize(void) } // 添加通话进通话记录文件 -static void AddToCallLog(CallLogInfo *info) +void AddToCallLog(CallLogInfo *info) { FILE *fp = NULL; size_t ret; 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 0bade757d..c2e5252a2 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 @@ -30,6 +30,8 @@ #include "cat1_server_hal.h" #include "NativeAbility.h" +#include "custom_utils.h" + namespace OHOS { int changeImage = 0; osTimerId_t g_callDuration = NULL; // timer of call duration @@ -84,6 +86,77 @@ UILabel *diallabel1 = nullptr; UILabel *diallabl2 = nullptr; UIButton *button1dial = nullptr; +uint8 call_stat=0; +PhoneCallInfo *phoneCall = NULL; + +// typedef struct { +// char name[NAME_SIZE]; +// unsigned char nameLen; +// unsigned char tel[MAX_PHONE_NUM]; +// unsigned char telLen; + CallFinishStatus status; +// uint64 creationTime; // 通话创建时间(不是接通时间) +// uint64 callDurTime; // 通话持续时间 +// } CallLogInfo; + +CallLogInfo info; +void calllog_info_init() +{ + strcpy(info.name,"xxx"); + info.nameLen=3; + int len=strlen(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + memcpy_s(info.tel,20,CallerLogModel::GetInstance()->GetPhoneNumber().c_str(),len+1); + uapi_get_timestampe_ms(&info.creationTime); + info.callDurTime=0; + + info.telLen=len; + + +} +void addcalllog() +{ + if(call_stat==0) + info.status=CALL_OUTGOING; + if(call_stat==1) + info.status=CALL_INCOMING; + if(call_stat==2) + info.status=CALL_MISSED; + + AddToCallLog(&info); +} + +// PhoneCallInfo tmp; + +// WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] start g_scoFlag = %d, g_currCallNum = %d", +// g_scoFlag, g_currCallNum); +// if (call == NULL || g_currCallNum == 0) { +// return; +// } + + //phoneCall = FindCallInfoInCallList((const unsigned char*)call->number, call->number_len); +// if (phoneCall == NULL) { +// WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[CallChangeFinishPro] FindCallInfoInCallList Finish no this call"); +// return; +// } +// if (g_finishOperate == OPERATE_WATCH_FINISH) { +// phoneCall->operate = OPERATE_WATCH_FINISH; +// } else if (g_finishOperate == OPERATE_WATCH_REJECT) { +// phoneCall->operate = OPERATE_WATCH_REJECT; +// } else { +// phoneCall->operate = OPERATE_NON_WATCH_FINISH; +// } +// g_finishOperate = OPERATE_NON_WATCH_FINISH; +// g_currCallNum--; + +// (void)memcpy_s(&tmp, sizeof(PhoneCallInfo), phoneCall, sizeof(PhoneCallInfo)); +// (void)memcpy_s(&tmp.unitCalls, sizeof(hfp_hf_calls_info_t), call, sizeof(hfp_hf_calls_info_t)); +// (void)memset_s(phoneCall, sizeof(PhoneCallInfo), 0, sizeof(PhoneCallInfo)); +// (void)memset_s(phoneCall->name, NAME_SIZE, '\0', NAME_SIZE); +// (void)memset_s(phoneCall->tel, MAX_PHONE_NUM, '\0', MAX_PHONE_NUM); +// phoneCall->lastStatus = HFP_HF_CALL_STATE_FINISHED; + +// // 添加通话记录 + // @@ -107,6 +180,7 @@ void CalldialTimerCallBackProc(int data) dail_falg++; if(dail_falg>=70) NotificationManager::GetInstance()->StopNotify(); + addcalllog(); } @@ -177,7 +251,9 @@ void DisableCallTimer(CallTimerType type) switch (type) { case NOTIFY_PHONE_CALLING_DISPLAY: if (g_callDuration != NULL) { + info.callDurTime=get_g_callTimes(); g_callTimesclean(); + addcalllog(); ret = osTimerDelete(g_callDuration); if (ret != osOK) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisableCallTimer failed, type= %d ret = %lx!", type, ret); @@ -461,6 +537,8 @@ UIViewGroup* CreatePhoneCallView(void) phoneView->Add(comingTimes); phoneView->SetDraggable(true); phoneView->SetTouchable(true); + call_stat=2; + calllog_info_init(); return phoneView; } @@ -544,17 +622,15 @@ UIViewGroup* CreateCalldialView(void) { diallabl2 = new UILabel(); } - diallabl2->SetPosition(109, 104); // widget's left position and top position - diallabl2->Resize(249, 40); // widget's width and height - diallabl2->SetViewId("label1"); // Set style - diallabl2->SetStyle(STYLE_TEXT_FONT, 40); - // Set additional property - diallabl2->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); - diallabl2->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); - diallabl2->SetAlign(TEXT_ALIGNMENT_CENTER); - diallabl2->SetRollSpeed(0); - diallabl2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40); + diallabl2->SetPosition(LABEL_PERCENT_POSITION_X, LABEL_PERCENT_POSITION_Y, + Screen::GetInstance().GetWidth(), TITLE_LABEL_DEFAULT_HEIGHT); + diallabl2->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT); + diallabl2->SetText(CallerLogModel::GetInstance()->GetPhoneNumber().c_str()); + diallabl2->SetAlign(TEXT_ALIGNMENT_CENTER); + diallabl2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_CALLER_SIZE); + diallabl2->SetTextColor(Color::White()); + // Add to rootView calldialView->Add(diallabl2); @@ -593,6 +669,8 @@ UIViewGroup* CreateCalldialView(void) StartCallTimer(NOTIFY_PHONE_DIAL_DISPLAY, (int32_t)NOTIFY_ONE_SECOND); + call_stat=0; + calllog_info_init(); return calldialView; } @@ -634,6 +712,12 @@ UIViewGroup* CreateCallingView(void) StartCallTimer(NOTIFY_PHONE_CALLING_DISPLAY, (int32_t)NOTIFY_ONE_SECOND); StartCallTimer(NOTIFY_PHONE_CURTIME_DISPLAY, (int32_t)NOTIFY_THIRTY_SECONDS); NotificationManager::GetInstance()->SetVolumeScreenStatus(false); + + if(call_stat==2) + { + call_stat=1; + } + return callingView; } @@ -704,7 +788,7 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event) //#ifdef SUPPORT_CAT1_SERVICE WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[AcceptIncomingCall] start"); - + incomedcall_event_sendmsg_toUI("ok"); cat1_call_answer(); @@ -733,6 +817,7 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event) //#ifdef SUPPORT_CAT1_SERVICE WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 "); cat1_call_hungup(); + addcalllog(); // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); // NativeAbility::GetInstance().ChangeSlice(preSlice); NotificationManager::GetInstance()->StopNotify(); @@ -759,6 +844,7 @@ bool CallViewEventListener::OnClick(UIView& view, const ClickEvent& event) //#ifdef SUPPORT_CAT1_SERVICE WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 "); cat1_call_hungup(); + // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); // NativeAbility::GetInstance().ChangeSlice(preSlice); NotificationManager::GetInstance()->StopNotify(); diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp index 7d9aa7a54..76a37cbc8 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server_hal.cpp @@ -133,7 +133,7 @@ int incomingcall_event_sendmsg_toUI(char* callno) int calldial_event_sendmsg_toUI(char* callno) { /**通过UI事件发送Notify*/ - GraphicService::GetInstance()->PostGraphicEvent(std::bind(incomingcall_event_notify, callno)); + GraphicService::GetInstance()->PostGraphicEvent(std::bind(calldial_event_notify, callno)); return ERRCODE_SUCC; }