电话来电铃声修改 1352/3 1352/head
authorhcj <1224667075@qq.com>
Wed, 6 Nov 2024 07:54:22 +0000 (15:54 +0800)
committerhcj <1224667075@qq.com>
Wed, 6 Nov 2024 07:54:22 +0000 (15:54 +0800)
code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/Bluetooyhpabpserver.cpp
code/sdk/application/wearable/fd230app/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230app/nativeui/phoneservice/src/PhoneService.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp

index b8afb16..7d08b4f 100644 (file)
@@ -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  /*最高亮度的一半*/
index f9bc816..361e924 100644 (file)
@@ -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;
index 95c024e..265b658 100644 (file)
@@ -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();
index eef9465..0a36bfc 100644 (file)
@@ -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;
 
     }
 }
index bce7e2a..f04395d 100644 (file)
@@ -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));