From b555aa582ec6d77a89051fb416d0f1592f9ce432 Mon Sep 17 00:00:00 2001 From: Kyeonghun Lee Date: Thu, 6 Oct 2016 15:52:33 +0900 Subject: [PATCH] use recorder api to get recorder state(MMFW team request) Change-Id: Id8f32bfb419eba3825cded39edf7eb84c1bbcd32 Signed-off-by: Kyeonghun Lee --- manager/CMakeLists.txt | 2 +- manager/src/msg-manager-sound.cpp | 26 ++++++++++++++------------ packaging/msg-service.spec | 1 + 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/manager/CMakeLists.txt b/manager/CMakeLists.txt index f052474..ac9132b 100755 --- a/manager/CMakeLists.txt +++ b/manager/CMakeLists.txt @@ -27,7 +27,7 @@ INCLUDE_DIRECTORIES( ) INCLUDE(FindPkgConfig) -pkg_check_modules(mgr_pkgs REQUIRED glib-2.0 dlog alarm-service badge callmgr_client contacts-service2 capi-appfw-application capi-appfw-service-application capi-appfw-package-manager notification vconf feedback capi-media-player capi-media-sound-manager capi-system-device) +pkg_check_modules(mgr_pkgs REQUIRED glib-2.0 dlog alarm-service badge callmgr_client contacts-service2 capi-appfw-application capi-appfw-service-application capi-appfw-package-manager notification vconf feedback capi-media-player capi-media-sound-manager capi-media-recorder capi-system-device) INCLUDE_DIRECTORIES(${mgr_pkgs_INCLUDE_DIRS}) LINK_DIRECTORIES(${mgr_pkgs_LIBRARY_DIRS}) diff --git a/manager/src/msg-manager-sound.cpp b/manager/src/msg-manager-sound.cpp index df7e527..d111b24 100644 --- a/manager/src/msg-manager-sound.cpp +++ b/manager/src/msg-manager-sound.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -259,10 +260,10 @@ void MsgMgrGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *bPlayVibration } else { /* 2. Call is not active */ MSG_MGR_DEBUG("Call is not active."); - int voiceRecording = 0; - if (vconf_get_int(VCONFKEY_RECORDER_STATE, &voiceRecording) != 0) { - MSG_MGR_INFO("vconf_get_int() is failed"); - } + recorder_device_state_e recorderState = RECORDER_DEVICE_STATE_IDLE; + int ret = recorder_get_device_state(RECORDER_TYPE_AUDIO, &recorderState); + if (ret != 0) + MSG_MGR_INFO("recorder_get_device_state() is failed [%d]", ret); if (bVoiceMail) { /* 2-1. Voice message */ if (bMsgSettingNoti) { @@ -273,7 +274,7 @@ void MsgMgrGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *bPlayVibration } } else { /* 2-1. Normal message */ if (bMsgSettingNoti) { - if (voiceRecording != VCONFKEY_RECORDER_STATE_RECORDING) { + if (recorderState != RECORDER_DEVICE_STATE_RECORDING) { MsgMgrGetPlayStatus(false, bSoundOn, bVibrationOn, bMsgSettingSound, bMsgSettingVibration, bPlaySound, bPlayVibration); } else { MSG_MGR_DEBUG("It doesn't play sound/vibration."); @@ -335,14 +336,15 @@ void MsgMgrSoundPlayStart(const MSG_MGR_ADDRESS_INFO_S *pAddrInfo, MSG_MGR_SOUND MSG_MGR_DEBUG("soundType [%d]", soundType); - /* check camera state */ - int cameraState = 0; /* camera recording state */ - if (vconf_get_int(VCONFKEY_CAMERA_STATE, &cameraState) != 0) { - MSG_MGR_INFO("vconf_get_int() is failed"); - } - MSG_MGR_SEC_DEBUG("Camera state [%d]", cameraState); + /* check recorder state */ + recorder_device_state_e recorderState = RECORDER_DEVICE_STATE_IDLE; + int ret = recorder_get_device_state(RECORDER_TYPE_VIDEO, &recorderState); + if (ret != 0) + MSG_MGR_INFO("recorder_get_device_state() is failed [%d]", ret); + + MSG_MGR_SEC_DEBUG("Recorder state [%d]", recorderState); - if (cameraState == VCONFKEY_CAMERA_STATE_RECORDING) { + if (recorderState == RECORDER_DEVICE_STATE_RECORDING) { MSG_MGR_END(); return; } diff --git a/packaging/msg-service.spec b/packaging/msg-service.spec index 704590e..cdd0f8d 100755 --- a/packaging/msg-service.spec +++ b/packaging/msg-service.spec @@ -63,6 +63,7 @@ BuildRequires: pkgconfig(capi-appfw-package-manager) BuildRequires: pkgconfig(capi-appfw-service-application) BuildRequires: pkgconfig(capi-media-player) BuildRequires: pkgconfig(capi-media-sound-manager) +BuildRequires: pkgconfig(capi-media-recorder) BuildRequires: pkgconfig(feedback) BuildRequires: pkgconfig(notification) %endif -- 2.7.4