summaryrefslogtreecommitdiff
path: root/src/mm_radio_priv_hal.c
diff options
context:
space:
mode:
authorGilbok Lee <gilbok.lee@samsung.com>2017-02-22 20:09:15 +0900
committerGilbok Lee <gilbok.lee@samsung.com>2017-02-23 19:33:17 +0900
commitb1b635792c09e8fa3f758a8bc9b85d5d49f2116d (patch)
tree3d9eb1f206bfced14b15bae8302533603ce71545 /src/mm_radio_priv_hal.c
parent6ebdd69081e06c5888eefe785f0c2c37062c483f (diff)
downloadlibmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.tar.gz
libmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.tar.bz2
libmm-radio-b1b635792c09e8fa3f758a8bc9b85d5d49f2116d.zip
Reset radio focus cb type
Somtimes an unintended interrupt callback is called. [Version] 0.2.2 [Profile] Mobile, Wearable [Issue Type] Fix bugs Change-Id: I5633d92eed01504d74d59b8c3d6b33aeaf5063de
Diffstat (limited to 'src/mm_radio_priv_hal.c')
-rw-r--r--src/mm_radio_priv_hal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c
index 82afebb..e9752ae 100644
--- a/src/mm_radio_priv_hal.c
+++ b/src/mm_radio_priv_hal.c
@@ -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);
}