Skip master volume in set_volume_level 11/108211/1 accepted/tizen/3.0.m2/mobile/20170104.100316 accepted/tizen/3.0/mobile/20170103.160144 submit/tizen_3.0.m2/20170104.093748 submit/tizen_3.0/20170103.121528
authorJeongho Mok <jho.mok@samsung.com>
Tue, 3 Jan 2017 10:42:53 +0000 (19:42 +0900)
committerJeongho Mok <jho.mok@samsung.com>
Tue, 3 Jan 2017 10:42:53 +0000 (19:42 +0900)
[Version] 0.1.21
[Profile] Common
[Issue Type] Code Enhancement

Change-Id: Ib2a9aab42debaeef4108b2cc2f2895e5eca0f64a

packaging/audio-hal-sc7727.spec
tizen-audio-volume.c

index 460b156..24f038c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       audio-hal-sc7727
 Summary:    TIZEN Audio HAL for SC7727
-Version:    0.1.20
+Version:    0.1.21
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 18582de..fa96693 100644 (file)
@@ -42,6 +42,8 @@
 #define RADIO_TUNING_VOLUME_TABLE   "fmradio:volume_table"
 #define RADIO_VOLUME_NUM_MAX        100
 
+uint32_t g_master_volume_level = 100;
+
 static const char *g_volume_vconf[AUDIO_VOLUME_TYPE_MAX] = {
     "file/private/sound/volume/system",         /* AUDIO_VOLUME_TYPE_SYSTEM */
     "file/private/sound/volume/notification",   /* AUDIO_VOLUME_TYPE_NOTIFICATION */
@@ -458,6 +460,11 @@ audio_return_t audio_get_volume_level_max(void *audio_handle, audio_volume_info_
     AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
     AUDIO_RETURN_VAL_IF_FAIL(level, AUDIO_ERR_PARAMETER);
 
+    if (!strncmp(info->type, "master", strlen("master"))) {
+        *level = g_master_volume_level;
+        return AUDIO_RET_OK;
+    }
+
     /* Get max volume level by device & type */
     *level = ah->volume.volume_level_max[__get_volume_idx_by_string_type(info->type)];
 
@@ -512,6 +519,10 @@ audio_return_t audio_set_volume_level(void *audio_handle, audio_volume_info_t *i
 
     AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER);
     AUDIO_RETURN_VAL_IF_FAIL(info, AUDIO_ERR_PARAMETER);
+    if (!strncmp(info->type, "master", strlen("master"))) {
+        g_master_volume_level = level;
+        return AUDIO_RET_OK;
+    }
     AUDIO_RETURN_VAL_IF_FAIL((ah->volume.volume_level_max[__get_volume_idx_by_string_type(info->type)] >= level), AUDIO_ERR_PARAMETER);
 
     /* Update volume level */