Added reference. Added better error handling.
[Verification]
TCT pass:
AudioControlManager_getOutputMode
AudioControlManager_getOutputMode_extra_argument
Change-Id: Ib3590e783fe7b1456cdbf360822b4d03621efa2b
Signed-off-by: Przemyslaw Ciezkowski <p.ciezkowski@samsung.com>
if (result.IsError()) {
LoggerD("Error occured");
ReportError(result, &out);
+ } else if (AudioOutputModeMap.find(mode) == AudioOutputModeMap.end()) {
+ LoggerE("Unknown mode type: %d", mode);
+ ReportError(common::PlatformResult(common::ErrorCode::UNKNOWN_ERR,
+ "Uknown audio output mode"), &out);
} else {
- ReportSuccess(picojson::value(AudioOutputModeMap.at(mode)), out);
+ ReportSuccess(picojson::value(AudioOutputModeMap.at(mode)), out);
}
}
return common::PlatformResult(ErrorCode::NO_ERROR);
}
-common::PlatformResult AudioControlManager::getOutputMode(AudioOutputMode mode) {
+common::PlatformResult AudioControlManager::getOutputMode(AudioOutputMode &mode) {
LoggerD("Enter");
avoc_audio_format_e type;
int ret = avoc_get_audio_format(&type);
common::PlatformResult setVolumeDown();
common::PlatformResult playSound(const std::string &type);
common::PlatformResult getVolume(u_int16_t &volume);
- common::PlatformResult getOutputMode(AudioOutputMode mode);
+ common::PlatformResult getOutputMode(AudioOutputMode &mode);
common::PlatformResult registerVolumeChangeListener(VolumeChangeListener* listener);
common::PlatformResult unregisterVolumeChangeListener();
static void volumeChangeCallback(unsigned int volume, void* user_data);