Files
MuditaOS/module-services/service-evtmgr/AppSettingsNotify.cpp
Lukasz Mastalerz 75b531f7e2 [MOS-871] Loudspeaker icon is not updated when audio routing has changed
Fix for the loudspeaker becomes active again when a headset is unplugged
if it was on while the headset was connected to the phone.
Fix typo in Bluetooth in EventType enum.
2023-02-21 15:40:39 +01:00

32 lines
1.4 KiB
C++

// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "Service/BusProxy.hpp"
#include <application-settings/ApplicationSettings.hpp>
namespace evm::api
{
void notifySettingsBluetoothAudio(sys::BusProxy &bus, std::shared_ptr<audio::Event> event)
{
switch (event->getType()) {
case audio::EventType::BluetoothA2DPDeviceState: {
auto message = std::make_shared<message::bluetooth::ProfileStatus>(
bluetooth::AudioProfile::A2DP, (event->getDeviceState() == audio::Event::DeviceState::Connected));
bus.sendUnicast(message, app::name_settings);
} break;
case audio::EventType::BluetoothHSPDeviceState: {
auto message = std::make_shared<message::bluetooth::ProfileStatus>(
bluetooth::AudioProfile::HSP, (event->getDeviceState() == audio::Event::DeviceState::Connected));
bus.sendUnicast(message, app::name_settings);
} break;
case audio::EventType::BluetoothHFPDeviceState: {
auto message = std::make_shared<message::bluetooth::ProfileStatus>(
bluetooth::AudioProfile::HFP, (event->getDeviceState() == audio::Event::DeviceState::Connected));
bus.sendUnicast(message, app::name_settings);
} break;
default:
break;
}
}
} // namespace evm::api