gengxin
authorCCC <2393524978@qq.com>
Sat, 23 Dec 2023 09:09:31 +0000 (17:09 +0800)
committerCCC <2393524978@qq.com>
Sat, 23 Dec 2023 09:09:31 +0000 (17:09 +0800)
15 files changed:
2.sdk/sdk/gui/lv_watch/lv_apps/alarm/alarm.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/bei_ke_rui_sheng.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.c
2.sdk/sdk/gui/lv_watch/lv_apps/engineer_mode/engineer_mode_audio_calibration.c
2.sdk/sdk/gui/lv_watch/lv_apps/engineer_mode/engineer_mode_hardware_testing.c
2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_hwtest.c
2.sdk/sdk/gui/lv_watch/lv_apps/lowbattery/lowbattery.c
2.sdk/sdk/gui/lv_watch/lv_apps/message/message.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat.c
2.sdk/sdk/gui/lv_watch/lv_apps/mmi_wechat/wechat_circle.c
2.sdk/sdk/gui/lv_watch/lv_apps/phone/phone.c
2.sdk/sdk/gui/lv_watch/lv_apps/phone/phone_api.c
2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_page_main_menu_tts.c
2.sdk/sdk/gui/lv_watch/lv_apps/sms_msg/sms_msg.c
2.sdk/sdk/gui/lv_watch/lv_apps/timer/timer_clock.c

index 5762a23..1fe6117 100644 (file)
@@ -236,6 +236,7 @@ static void alarm_prepare_destory(lv_obj_t * activity_obj)
 
     /* stop playing tone */
     Hal_Tone_Play_End();
+       Hal_Vibrator_Play_End();
 
     lv_alarm_obj_ext_t * ext = alarm_get_ext();
     if(ext) {
@@ -297,7 +298,19 @@ void alarm_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
         if(activity_obj != NULL) return;
 
         /* play tone start */
-        Hal_NFFS_File_Play_Repeat(AUDIO_ALARM, query_current_volume());
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_alarm_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Repeat(AUDIO_ALARM, volume);
+
+        // vibrate
+               if(true == mmi_watch_vibrate_is_permitted())
+               {
+               Hal_Vibrator_Play_Repeat();
+               }
 
         watch_wakeup_lcd(true);
         /* display alarm animation */
@@ -385,7 +398,19 @@ static void alarm_ring(void)
     if(AUDIO_CTRL_PRIORITY_3 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_3,alarm_audio_ctrl_callback))
     {
         /* play tone start */
-        Hal_NFFS_File_Play_Repeat(AUDIO_ALARM, query_current_volume());
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_alarm_volume_get();
+       #else
+        volume = query_current_volume();
+       #endif
+               Hal_NFFS_File_Play_Repeat(AUDIO_ALARM, volume);
+
+        // vibrate
+               if(true == mmi_watch_vibrate_is_permitted())
+               {
+               Hal_Vibrator_Play_Repeat();
+               }
 
         watch_wakeup_lcd(true);
         /* display alarm animation */
index ced170d..dd3985a 100644 (file)
@@ -431,10 +431,15 @@ bool mmi_ai_talk_tts_info_result_display(char * data_buff, int data_buff_len)
        }
 #endif
 
-
+       uint8_t volume = 0;
+#ifdef __MMI_USER_PROFILE_SUPPORT__
+       volume = mmi_user_profile_current_mode_remind_volume_get();
+#else
+       volume = query_current_volume();
+#endif
        Hal_Tone_Play_Onetime((uint32_t *)s_ai_talk_item_info.msg_voice_data_ptr,
                                                        s_ai_talk_item_info.msg_voice_data_size,
-                                                       query_current_volume(),
+                                                       volume,
                                                        mmi_ai_talk_tts_info_result_play_over_cb,
                                                        NULL);  
 
index e687fb6..e2f8ea1 100644 (file)
@@ -669,9 +669,20 @@ void mmi_ui_msg_update_heng_ai_warning(void)
     if(AUDIO_CTRL_PRIORITY_REMIND == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_REMIND, mmi_heng_ai_warning_audio_ctrl_callback))
     {
                if(MMI_HENG_AI_WARNING_TYPE_SLEEP == s_heng_ai_warning_info.type)
-               Hal_NFFS_File_Play_Repeat(AUDIO_REMIND_SLEEP, query_current_volume());
+               {
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = mmi_user_profile_current_mode_remind_volume_get();
+               #else
+               volume = query_current_volume();
+               #endif
+                       Hal_NFFS_File_Play_Repeat(AUDIO_REMIND_SLEEP, volume);
+               }
                else
-                       Hal_Vibrator_Play_Repeat(); 
+               {
+                       if(true == mmi_watch_vibrate_is_permitted())
+                               Hal_Vibrator_Play_Repeat();
+               }
                
                mmi_heng_ai_warning_screen_create(NULL);
     }
index 52a1806..112397e 100644 (file)
@@ -269,8 +269,15 @@ static void recording_play_btn_event_cb(lv_obj_t * btn, lv_event_t e)
         } else {
             lv_label_set_text_id(audio_ext->label_store, WATCH_TEXT_ID_PLAYING);
             audio_ext->play_ongoing = true;
+
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = HAL_AUDIO_SPK_LEVEL_MAX;
+               #else
+                       volume = query_current_volume();
+               #endif
             Hal_NFFS_File_Play_Onetime(AUDIO_CALIBRATION_RECORD_FILE,
-                                       query_current_volume(),
+                                       volume,
                                        audio_calibration_record_file_over_cb,
                                        NULL);
         }
@@ -377,8 +384,15 @@ static void playback_start_btn_event_cb(lv_obj_t * btn, lv_event_t e)
         if(false == audio_ext->play_ongoing) {
             lv_label_set_text_id(audio_ext->label_store, WATCH_TEXT_ID_PLAYING);
             audio_ext->play_ongoing = true;
+
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = HAL_AUDIO_SPK_LEVEL_MAX;
+               #else
+                       volume = query_current_volume();
+               #endif
             Hal_NFFS_File_Play_Onetime(AUDIO_INCOMING_CALL,
-                                       query_current_volume(),
+                                       volume,
                                        audio_calibration_music_over_cb,
                                        NULL);
         } else {
index 7fb1f00..ed2d85f 100644 (file)
@@ -889,7 +889,13 @@ static void speaker_start_btn_event_cb(lv_obj_t * btn, lv_event_t e)
     if(LV_EVENT_CLICKED == e) {
         lv_obj_t * label_tip  = lv_obj_get_child(btn, NULL);
         // play tone
-        Hal_NFFS_File_Play_Onetime(AUDIO_INCOMING_CALL, query_current_volume(), NULL, NULL);
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = HAL_AUDIO_SPK_LEVEL_MAX;
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Onetime(AUDIO_INCOMING_CALL, volume, NULL, NULL);
         lv_label_set_text_id(label_tip, WATCH_TEXT_ID_STOP_TEST);
         lv_obj_set_event_cb(btn, speaker_stop_btn_event_cb);
 
@@ -999,7 +1005,13 @@ static void ht_micphone_record_task_cb(lv_task_t * task)
         case MCI_EVENT_EOS:
             lv_label_set_text_id(ht_ext->label_key_state, WATCH_TEXT_ID_MICPHONE_RECORD_CHECK);
             Hal_Record_Buffer_Stop_Req(&ht_ext->buffer_size, &duration_ms);
-            Hal_Tone_Play_Onetime((uint32_t *)ht_ext->buffer, ht_ext->buffer_size, query_current_volume(), ht_micphone_record_play_over_cb, ht_ext);
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = HAL_AUDIO_SPK_LEVEL_MAX;
+               #else
+                       volume = query_current_volume();
+               #endif
+            Hal_Tone_Play_Onetime((uint32_t *)ht_ext->buffer, ht_ext->buffer_size, volume, ht_micphone_record_play_over_cb, ht_ext);
             break;
         case MCI_EVENT_ERROR:
             /*recoder stop if value is - 996*/
@@ -1738,7 +1750,13 @@ static void alarm_active_callback(void)
 
     lv_label_set_text(ext->date_label, "");
     lv_label_set_text(ext->time_label, "");
-    Hal_File_Play_Onetime(AUDIO_INCOMING_CALL, query_current_volume(), NULL, NULL, 0);
+       uint8_t volume = 0;
+#ifdef __MMI_USER_PROFILE_SUPPORT__
+       volume = HAL_AUDIO_SPK_LEVEL_MAX;
+#else
+       volume = query_current_volume();
+#endif
+    Hal_File_Play_Onetime(AUDIO_INCOMING_CALL, volume, NULL, NULL, 0);
 
     lv_obj_t * btn = lv_obj_get_child_back(par, lv_obj_get_child_back(par, NULL));
     lv_label_set_text_id((lv_obj_get_child(btn, NULL)), WATCH_TEXT_ID_EMODE_HW_ALARM_STOP);
index 5b91edc..772a990 100644 (file)
@@ -352,7 +352,13 @@ static void hwtest_start_test(void)
     }
 
     if(ext->hwtest_sel[i++]) {  //Play music
-        Hal_NFFS_File_Play_Onetime(AUDIO_INCOMING_CALL, query_current_volume(), NULL, NULL);
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = HAL_AUDIO_SPK_LEVEL_MAX;
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Onetime(AUDIO_INCOMING_CALL, volume, NULL, NULL);
     }
 
     if(ext->hwtest_sel[i++]) {  //GPS
index 0714ae4..ed1afc1 100644 (file)
@@ -67,6 +67,9 @@ void lowbattery_task(lv_task_t * task)
                 && (NULL == lv_watch_get_activity_obj(ACT_ID_PHONE))
                 )
             {
+                       #ifdef __MMI_ZHSX_SUPPORT__
+                               mmi_protocol_action_low_battery();
+                       #endif
                 // enter low battery mode
                 printf("enter low battery mode\n");
                 lowbattery_create_btn_action(NULL);
index b83897a..32e15d2 100644 (file)
@@ -146,7 +146,13 @@ void app_adaptor_update_message_info_req(app_adaptor_new_message_info_t * msg_in
     }
     if(AUDIO_CTRL_PRIORITY_8 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_8, message_audio_ctrl_callback))
     {
-        Hal_NFFS_File_Play_Onetime(AUDIO_MSG, query_current_volume(), message_tone_play_onetime_cb, NULL);
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Onetime(AUDIO_MSG, volume, message_tone_play_onetime_cb, NULL);
         printf("AUDIO_MSG has been played in %s\n",__FUNCTION__);
     }
     message_ll_item_add(msg_info);
index 85cb6b3..ad0e986 100644 (file)
@@ -336,8 +336,17 @@ void wechat_msg_receive_update_ui(void)
                {
                        s_item_receive_playing = true;
                
-                       Hal_NFFS_File_Play_Onetime(AUDIO_WECHAT_RECEIVE, (HAL_SPEAKER_GAIN)query_current_volume(), wechat_receive_audio_play_over_cb, NULL);
-                       Hal_Vibrator_Play_Onetime(NULL, 1000);
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = mmi_user_profile_current_mode_remind_volume_get();
+               #else
+                       volume = query_current_volume();
+               #endif
+                       Hal_NFFS_File_Play_Onetime(AUDIO_WECHAT_RECEIVE, (HAL_SPEAKER_GAIN)volume, wechat_receive_audio_play_over_cb, NULL);
+                       if(true == mmi_watch_vibrate_is_permitted())
+                       {
+                               Hal_Vibrator_Play_Onetime(NULL, 1000);
+                       }
                }
        
                if(lv_watch_get_activity_obj(ACT_ID_WECHAT_MAIN)) 
@@ -1497,7 +1506,13 @@ void wechat_chat_list_voice_item_play_action(lv_wechat_msg_list_ext_t * list_pag
        if(AUDIO_CTRL_PRIORITY_5 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_5, wechat_chat_list_voice_item_playing_audio_ctrl_callback))
        {
                WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-               Hal_File_Play_Onetime(msg_item->msg_data_full_file_name, query_current_volume(), wechat_chat_list_voice_item_play_over_cb, list_page_ext, 0);
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+               Hal_File_Play_Onetime(msg_item->msg_data_full_file_name, volume, wechat_chat_list_voice_item_play_over_cb, list_page_ext, 0);
        }
 }
 
index 3abbedc..f4103cb 100644 (file)
@@ -336,8 +336,17 @@ void wechat_msg_receive_update_ui(void)
                {
                        s_item_receive_playing = true;
                
-                       Hal_NFFS_File_Play_Onetime(AUDIO_WECHAT_RECEIVE, (HAL_SPEAKER_GAIN)query_current_volume(), wechat_receive_audio_play_over_cb, NULL);
-                       Hal_Vibrator_Play_Onetime(NULL, 1000);
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = mmi_user_profile_current_mode_remind_volume_get();
+               #else
+                       volume = query_current_volume();
+               #endif
+                       Hal_NFFS_File_Play_Onetime(AUDIO_WECHAT_RECEIVE, (HAL_SPEAKER_GAIN)volume, wechat_receive_audio_play_over_cb, NULL);
+                       if(true == mmi_watch_vibrate_is_permitted())
+                       {
+                               Hal_Vibrator_Play_Onetime(NULL, 1000);
+                       }
                }
        
                if(lv_watch_get_activity_obj(ACT_ID_WECHAT_MAIN)) 
@@ -1464,7 +1473,13 @@ void wechat_chat_list_voice_item_play_action(lv_wechat_msg_list_ext_t * list_pag
        if(AUDIO_CTRL_PRIORITY_5 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_5, wechat_chat_list_voice_item_playing_audio_ctrl_callback))
        {
                WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-               Hal_File_Play_Onetime(msg_item->msg_data_full_file_name, query_current_volume(), wechat_chat_list_voice_item_play_over_cb, list_page_ext, 0);
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+               Hal_File_Play_Onetime(msg_item->msg_data_full_file_name, volume, wechat_chat_list_voice_item_play_over_cb, list_page_ext, 0);
        }
 }
 
index cec079e..cd871f7 100644 (file)
@@ -1034,6 +1034,7 @@ void ring_off_action(lv_obj_t * btn, lv_event_t e)
             break;
 
         case MMI_MODEM_CALL_STATE_INCOMING:
+                       Hal_Vibrator_Play_End();
             Hal_Tone_Play_End();
             watch_modem_call_request_udub();
             break;
@@ -1314,6 +1315,7 @@ void ring_hook_action(lv_obj_t * btn, lv_event_t e)
 
        printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
 
+       Hal_Vibrator_Play_End();
     Hal_Tone_Play_End();
 
     //set voice call status
@@ -1517,6 +1519,7 @@ static void phone_prepare_destory(lv_obj_t * activity_obj)
 
     //stop playing tone
     Hal_Tone_Play_End();
+       Hal_Vibrator_Play_End();
 
     //ring off
     ring_off_action(NULL, LV_EVENT_CLICKED);
index 83a90d5..c2f09f2 100644 (file)
@@ -282,6 +282,7 @@ void watch_modem_call_response_no_carrier(int32_t index, uint8_t isNoCarrier)
     }
 #endif
     Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_1);
+       Hal_Vibrator_Play_End();
     Hal_Mem_Set(&call_params, 0, sizeof(phone_call_params_t));
     call_params.state = MMI_MODEM_CALL_STATE_NULL;
 }
@@ -401,7 +402,19 @@ void watch_modem_call_response_clip(int32_t index, MMI_Modem_Call_Response_Clip_
                 call_params.speaker_volume = volume;
 
                 //play tone
-                Hal_NFFS_File_Play_Repeat(AUDIO_INCOMING_CALL, query_current_volume());
+                               uint8_t ring_volume = 0;
+                       #ifdef __MMI_USER_PROFILE_SUPPORT__
+                               ring_volume = mmi_user_profile_current_mode_incoming_call_volume_get();
+                       #else
+                               ring_volume = query_current_volume();
+                       #endif
+                Hal_NFFS_File_Play_Repeat(AUDIO_INCOMING_CALL, ring_volume);
+
+                               // vibrate
+                               if(true == mmi_watch_vibrate_is_permitted())
+                               {
+                                       Hal_Vibrator_Play_Repeat();
+                               }
 
 #if USE_LV_WATCH_CALL_LOG
                 //record time for call log
index 4b5ead6..b9f58c6 100644 (file)
@@ -174,7 +174,13 @@ void mmi_page_main_menu_tts_broadcast(uint8_t index)
                char * ring_path = mmi_page_main_menu_tts_info_get(index);
                if(NULL != ring_path)
                {
-                       Hal_NFFS_File_Play_Onetime(ring_path, (HAL_SPEAKER_GAIN)query_current_volume(), mmi_page_main_menu_tts_play_over_cb, NULL);
+                       uint8_t volume = 0;
+               #ifdef __MMI_USER_PROFILE_SUPPORT__
+                       volume = mmi_user_profile_current_mode_remind_volume_get();
+               #else
+                       volume = query_current_volume();
+               #endif
+                       Hal_NFFS_File_Play_Onetime(ring_path, (HAL_SPEAKER_GAIN)volume, mmi_page_main_menu_tts_play_over_cb, NULL);
                }
        }
 }
index fd96ab6..11f9edd 100644 (file)
@@ -368,9 +368,18 @@ void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info)
                                #endif\r
                                )\r
                        {\r
-                               Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, query_current_volume(), NULL, 0);\r
+                               uint8_t volume = 0;\r
+                       #ifdef __MMI_USER_PROFILE_SUPPORT__\r
+                               volume = mmi_user_profile_current_mode_new_sms_volume_get();\r
+                       #else\r
+                               volume = query_current_volume();\r
+                       #endif\r
+                               Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, volume, NULL, 0);\r
+                       }\r
+                       if(true == mmi_watch_vibrate_is_permitted())\r
+                       {\r
+                               Hal_Vibrator_Play_Onetime(NULL, 1000);\r
                        }\r
-                       Hal_Vibrator_Play_Onetime(NULL, 1000);\r
                        if(0 == Hal_Pm_Get_State())\r
                        {\r
                                printf("sms_msg_list_update -----> onkey_wakeup\n");\r
index fbdd363..0e42e77 100644 (file)
@@ -802,10 +802,19 @@ static void timer_task_async_cb(void *para)
 
     if(AUDIO_CTRL_PRIORITY_TIMER == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_TIMER, timer_audio_ctrl_callback)) {
         //play tone
-        Hal_NFFS_File_Play_Repeat(AUDIO_TIMER, query_current_volume());
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Repeat(AUDIO_TIMER, volume);
 
         //keep vibrating
-        Hal_Vibrator_Play_Repeat();
+               if(true == mmi_watch_vibrate_is_permitted())
+               {
+               Hal_Vibrator_Play_Repeat();
+               }
 
         //wakeup lcd
         watch_wakeup_lcd(true);
@@ -822,10 +831,19 @@ static void timer_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
 
     if(AUDIO_CTRL_PRIORITY_TIMER == priority) {
         //play tone
-        Hal_NFFS_File_Play_Repeat(AUDIO_TIMER, query_current_volume());
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Repeat(AUDIO_TIMER, volume);
 
         //keep vibrating
-        Hal_Vibrator_Play_Repeat();
+               if(true == mmi_watch_vibrate_is_permitted())
+               {
+               Hal_Vibrator_Play_Repeat();
+               }
 
         //wakeup lcd
         watch_wakeup_lcd(true);