use recorder api to get recorder state(MMFW team request) 80/91180/1
authorKyeonghun Lee <kh9090.lee@samsung.com>
Thu, 6 Oct 2016 06:52:33 +0000 (15:52 +0900)
committerKyeonghun Lee <kh9090.lee@samsung.com>
Thu, 6 Oct 2016 06:52:33 +0000 (15:52 +0900)
Change-Id: Id8f32bfb419eba3825cded39edf7eb84c1bbcd32
Signed-off-by: Kyeonghun Lee <kh9090.lee@samsung.com>
manager/CMakeLists.txt
manager/src/msg-manager-sound.cpp
packaging/msg-service.spec

index f052474..ac9132b 100755 (executable)
@@ -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})
 
index df7e527..d111b24 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 
 #include <player.h>
+#include <recorder.h>
 #include <sound_manager.h>
 #include <feedback.h>
 #include <feedback-internal.h>
@@ -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;
        }
index 704590e..cdd0f8d 100755 (executable)
@@ -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