From b63f1ff9f9bd8eabedac70ba64eb363aaa2b2ce7 Mon Sep 17 00:00:00 2001 From: Terrence Date: Sat, 7 Feb 2026 12:57:01 +0800 Subject: [PATCH] refactor: Delay audio success sound playback until after activation completion - Moved the success sound playback to a scheduled task to ensure it occurs after the activation process is complete. - This change improves the responsiveness of the application during activation events. --- main/application.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main/application.cc b/main/application.cc index 5a640c85..d69d43d0 100644 --- a/main/application.cc +++ b/main/application.cc @@ -309,13 +309,15 @@ void Application::HandleActivationDoneEvent() { display->ShowNotification(message.c_str()); display->SetChatMessage("system", ""); - // Play the success sound to indicate the device is ready - audio_service_.PlaySound(Lang::Sounds::OGG_SUCCESS); - // Release OTA object after activation is complete ota_.reset(); auto& board = Board::GetInstance(); board.SetPowerSaveLevel(PowerSaveLevel::LOW_POWER); + + Schedule([this]() { + // Play the success sound to indicate the device is ready + audio_service_.PlaySound(Lang::Sounds::OGG_SUCCESS); + }); } void Application::ActivationTask() {