From: luozheng <1732036298@qq.com> Date: Mon, 14 Oct 2024 11:17:56 +0000 (+0800) Subject: 解决播放音乐过程中接电话后死机bug X-Git-Tag: release_V1.2.70_20241020_135402~5^2~37 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=d617c7f6b51c83bd0848e6d9d99d1db49981c78a;p=mirrors%2FFD230.git 解决播放音乐过程中接电话后死机bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp index dffca0533..64f477812 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersModel.cpp @@ -916,6 +916,10 @@ bool PlayersModel::GetCurrentMusicIsPlaying(void) { return; } + if(PlayersPresenter::GetInstance() == nullptr) + { + return; + } if(PlayersModel::GetInstance()->GetMusicSource() == false) //如果当前为本地音乐 { int32_t playerState; diff --git a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp index adddd0aa8..7e08f45ea 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/player/src/PlayersPresenter.cpp @@ -985,7 +985,6 @@ static void Pause(void) PlayersModel::GetInstance()->SetPlayButtonState(false); } else { playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::UNSELECTED); - playersView->GetPlayerButton()->Invalidate(); } PlayerIntrptListener->RestFlag(); PlayerIntrptListener->SetPaused(true); @@ -1027,7 +1026,6 @@ static void Resume(void) PlayersModel::GetInstance()->SetPlayButtonState(true); } else { playersView->SetPlayerButtonState(UICheckBox::UICheckBoxState::SELECTED); - playersView->GetPlayerButton()->Invalidate(); } PlayerIntrptListener->RestFlag(); PlayerIntrptListener->SetResumed(true); 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 46eaaee5d..163e6fb86 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 @@ -71,6 +71,7 @@ #include "vibrator_service.h" #include "respiratorytraining/include/RespiratoryTrainingModel.h" #include "main/include/PullUpDownView.h" +#include "player/include/PlayersModelC.h" #define DIALDATASET 1 //#include "Systemupgrade.h" @@ -905,7 +906,8 @@ void MsgCenterNotifyCatIncomingCallProc(const Topic topic, Request* req) } - int ret = PlayersModel::GetInstance()->PlayerStop(); + // int ret = PlayersModel::GetInstance()->PlayerStop(); + stopPlayingMusic(); const power_display_svr_api_t *display_api = power_display_svr_get_api(); if (display_api->get_screen_state() != SCREEN_ON)