From a574faf55fa65c06afa7e3f8aa3b5826de68091f Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Wed, 6 Nov 2024 15:54:22 +0800 Subject: [PATCH] =?utf8?q?=E7=94=B5=E8=AF=9D=E6=9D=A5=E7=94=B5=E9=93=83?= =?utf8?q?=E5=A3=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativelauncher/include/UiConfig.h | 6 ++++++ .../nativeui/bluetooth/src/Bluetooyhpabpserver.cpp | 12 ++++++++---- .../nativeui/callerlog/src/CallerLogModel.cpp | 5 +++-- .../nativeui/phoneservice/src/PhoneService.cpp | 10 ++++------ .../service/msg_center/src/msg_center_customer.cpp | 9 ++++----- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index b8afb16c1..7d08b4f60 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -77,6 +77,12 @@ namespace OHOS #define APP_LIST_PATH "/user/res/applist_icon" #define APP_HEARET_ICON_PATH "/user/res/heart_chart/hearticon"//心率动画 +#ifdef SINGLE_USER_PARTITION + #define RING_MUSIC "/user/music/ring/ring.mp3" +#else + #define RING_MUSIC "/music/ring/ring.mp3" +#endif + #define MIN_BRIGHTNESS 51 /*最低亮度*/ #define MAX_BRIGHTNESS 255 /*最高亮度*/ #define MAX_BRIGHTNESS_HALF 127 /*最高亮度的一半*/ diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp index f9bc8164a..361e924c9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp @@ -70,10 +70,14 @@ static void sample_pbap_receive_data(const bd_addr_t *bd_addr, const uint8_t* da printf("receive %d bytes(%s)\n", len, data); if(strstr((char*)data,"vcard-listing.dtd")) { - char * name_str=strstr((char*)data,"name"); - char *name_=strtok(name_str,"\""); - name_=strtok(NULL,"\""); - OHOS:: CallerLogModel::GetInstance()->Setphonebname(name_,strlen(name_)); + if(strstr((char*)data,"name")) + { + char * name_str=strstr((char*)data,"name"); + char *name_=strtok(name_str,"\""); + name_=strtok(NULL,"\""); + OHOS:: CallerLogModel::GetInstance()->Setphonebname(name_,strlen(name_)); + } + } return; 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 95c024e08..265b6584d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp @@ -139,7 +139,6 @@ void StatusReset(void) CallerLogModel::GetInstance()->Setphonebname("0",0); CallerLogModel::GetInstance()->SetCallDial(CallerLogModel::HFP_PHONE_DIAL); CallerLogModel::GetInstance()->set_RejectIncomingCall_falg(0); - CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::callleisure); NotificationManager::GetInstance()->SetWatchCallStatus(false); CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourcePhone); DisshakeTimer(); @@ -595,10 +594,12 @@ static void NonWatchFinishHandle(int laststatus) } if (GetCurrCallNum() == 0) { g_phoneStatus = PHONE_SINGLE_STATUS; - + StatusReset(); set_TransCallToMobilePhone_falg(0); } + + if(get_falg_SOS()) { sos_falg_add(); 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 eef946517..0a36bfc4c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp @@ -39,6 +39,7 @@ #include "gfx_utils/mem_api.h" #include "ConfigModelC.h" #include "cat1_ctl.h" +#include "UiConfig.h" #ifdef __cplusplus extern "C" { #endif @@ -1495,12 +1496,9 @@ static void PlayWatchRing(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[PlayWatchRing] start"); if(true != OHOS::ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()) && true != OHOS::ConfigModel::GetInstance()->GetSilentMode()) { - #ifdef SINGLE_USER_PARTITION - OHOS::AlarmClockModel::GetInstance()->testPlayerStart("/user/music/ring/ring.mp3"); - #else - OHOS::AlarmClockModel::GetInstance()->testPlayerStart("/music/ring/ring.mp3"); - g_audioState = AUDIO_ACT_INTERRUPT_WATCH_RING; - #endif + + OHOS::AlarmClockModel::GetInstance()->testPlayerStart(RING_MUSIC); + g_audioState = AUDIO_ACT_INTERRUPT_WATCH_RING; } } 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 bce7e2ae6..f04395db4 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 @@ -75,6 +75,9 @@ #include "system/include/SystemLogModelC.h" #include "cat1_ctl.h" #include "ui_service.h" + +#include "UiConfig.h" + #define DIALDATASET 1 //#include "Systemupgrade.h" namespace OHOS { @@ -946,11 +949,7 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) if(true != ConfigModel::GetInstance()->GetDnotdisturb() && (!uapi_sleep_mode_flag_get()) && true != ConfigModel::GetInstance()->GetSilentMode()) { -#ifdef SINGLE_USER_PARTITION - AlarmClockModel::GetInstance()->testPlayerStart("/user/music/ring/ring.mp3"); -#else - AlarmClockModel::GetInstance()->testPlayerStart("/music/ring/ring.mp3"); -#endif + AlarmClockModel::GetInstance()->testPlayerStart(RING_MUSIC); } CallerLogModel::GetInstance()->SetoperateNumber(call_data,strlen(call_data)); -- 2.17.1