Reset radio focus cb type 26/116226/1
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 22 Feb 2017 11:09:15 +0000 (20:09 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Thu, 23 Feb 2017 10:33:17 +0000 (19:33 +0900)
Somtimes an unintended interrupt callback is called.

[Version] 0.2.2
[Profile] Mobile, Wearable
[Issue Type] Fix bugs

Change-Id: I5633d92eed01504d74d59b8c3d6b33aeaf5063de

packaging/libmm-radio.spec
src/mm_radio_priv_hal.c
src/mm_radio_sound_focus.c

index 1c59636..4c31c5e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-radio
 Summary:    Multimedia Framework Radio Library
-Version:    0.2.21
+Version:    0.2.22
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 82afebb..e9752ae 100644 (file)
@@ -924,19 +924,16 @@ void __mmradio_scan_thread(mm_radio_t *radio)
                if (ret != MM_ERROR_NONE) {
                        MMRADIO_LOG_ERROR("failed to get current frequency");
                } else {
-                       if (freq < prev_freq) {
-                               MMRADIO_LOG_DEBUG("scanning wrapped around. stopping scan");
+                       if (freq <= prev_freq) {
+                               MMRADIO_LOG_ERROR("frequency is less than previous [%d] -> [%d] we wrapped around, we are finished scanning", prev_freq, freq);
                                break;
                        }
 
-                       if (freq == prev_freq)
-                               continue;
-
                        prev_freq = param.radio_scan.frequency = (int)freq;
                        MMRADIO_LOG_INFO("scanning : new frequency : [%d]", param.radio_scan.frequency);
 
                        /* drop if max freq is scanned */
-                       if (param.radio_scan.frequency == radio->region_setting.band_max) {
+                       if (param.radio_scan.frequency >= radio->region_setting.band_max) {
                                MMRADIO_LOG_WARNING("%d freq is dropping...and stopping scan", param.radio_scan.frequency);
                                break;
                        }
@@ -1372,6 +1369,8 @@ static void __mmradio_sound_focus_cb(int id, mm_sound_focus_type_e focus_type,
                        if (result)
                                MMRADIO_LOG_ERROR("failed to stop radio");
 
+                       radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
+
                        MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d", radio->sound_focus.cur_focus_type);
                }
                break;
@@ -1424,6 +1423,7 @@ static void __mmradio_sound_focus_watch_cb(int id, mm_sound_focus_type_e focus_t
                        result = _mmradio_stop(radio);
                        if (result)
                                MMRADIO_LOG_ERROR("failed to stop radio");
+                       radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
 
                        MMRADIO_LOG_DEBUG("FOCUS_IS_RELEASED cur_focus_type : %d\n", radio->sound_focus.cur_focus_type);
                }
index 696bc8f..766a913 100644 (file)
@@ -54,6 +54,7 @@ static void _mmradio_device_connected_cb(MMSoundDevice_t device, bool is_connect
                                result = _mmradio_stop(radio);
                                if (result != MM_ERROR_NONE)
                                        MMRADIO_LOG_ERROR("failed to stop radio");
+                               radio->sound_focus.by_focus_cb = MMRADIO_FOCUS_CB_NONE;
                        }
                        break;
                default: