Revise codes as per DPM API change 79/85379/3 accepted/tizen/common/20160831.162126 accepted/tizen/ivi/20160901.065310 accepted/tizen/mobile/20160901.065053 accepted/tizen/tv/20160901.065145 accepted/tizen/wearable/20160901.065224 submit/tizen/20160831.052250
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Aug 2016 00:50:52 +0000 (09:50 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 25 Aug 2016 03:21:20 +0000 (12:21 +0900)
[Version] 0.3.41
[Profile] Common
[Issue Type] Revision

Change-Id: Iacf116061429f3015e05ccd33b22238c74fb4f40
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-audio-io.spec
src/cpp/CPulseAudioClient.cpp

index b46f218..e3b1ccd 100644 (file)
@@ -1,6 +1,6 @@
 Name:           capi-media-audio-io
 Summary:        An Audio Input & Audio Output library in Tizen Native API
-Version:        0.3.40
+Version:        0.3.41
 Release:        0
 Group:          Multimedia/API
 License:        Apache-2.0
index 1a79bc5..74cd735 100644 (file)
@@ -18,7 +18,6 @@
 #include <mm.h>
 #include "CAudioIODef.h"
 #ifdef ENABLE_DPM
-#include <dpm/context.h>
 #include <dpm/restriction.h>
 #endif
 
@@ -93,22 +92,17 @@ void CPulseAudioClient::__successContextCb(pa_context* c, int success, void* use
 static bool __is_microphone_restricted(void) {
     int state = 1;
 #ifdef ENABLE_DPM
-    dpm_context_h dpm_ctx_h;
-    dpm_restriction_policy_h dpm_policy_h;
+    device_policy_manager_h dpm_h = NULL;
     int ret = 0;
 
-    if ((dpm_ctx_h = dpm_context_create())) {
-        if ((dpm_policy_h = dpm_context_acquire_restriction_policy(dpm_ctx_h))) {
-            /* state: 0(disallowed), 1(allowed) */
-            if ((ret = dpm_restriction_get_microphone_state(dpm_policy_h, &state)))
-                AUDIO_IO_LOGE("Failed to dpm_restriction_get_microphone_state(), ret(0x%x)", ret);
-            dpm_context_release_restriction_policy(dpm_ctx_h, dpm_policy_h);
-        } else {
-            AUDIO_IO_LOGE("Failed to dpm_context_acquire_restriction_policy()");
-        }
-        dpm_context_destroy(dpm_ctx_h);
+    if ((dpm_h = dpm_manager_create())) {
+        /* state: 0(disallowed), 1(allowed) */
+        if ((ret = dpm_restriction_get_microphone_state(dpm_h, &state)))
+            AUDIO_IO_LOGE("Failed to dpm_restriction_get_microphone_state(), ret(0x%x)", ret);
+        dpm_manager_destroy(dpm_h);
+        AUDIO_IO_LOGD("microphone restriction state: %d(1:allowed, 0:disallowed)", state);
     } else {
-        AUDIO_IO_LOGE("Failed to dpm_context_create()");
+        AUDIO_IO_LOGE("Failed to dpm_manager_create()");
     }
 #endif
     return (state ? false : true);