Expand the prestate of radio_scan_start function 58/86858/1 accepted/tizen/common/20160907.154630 accepted/tizen/ivi/20160908.044135 accepted/tizen/mobile/20160908.043107 accepted/tizen/wearable/20160908.044025 submit/tizen/20160907.074000
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 5 Sep 2016 08:20:41 +0000 (17:20 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Mon, 5 Sep 2016 08:29:50 +0000 (17:29 +0900)
[Version] 0.2.6
[Profile] Common
[Issue Type] Tizen Mobile Platform Requirement

Change-Id: Ic20925b0479dde601918c4f2e24f1c4716c73c32

Makefile.am
packaging/libmm-radio.spec
src/mm_radio_priv.c
src/mm_radio_priv_emulator.c

index f2066a6..c9ea877 100644 (file)
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS='-I m4' 
 
-SUBDIRS = src test
+SUBDIRS = src
 
 pcfiles = mm-radio.pc
 
index cc4200b..29f8a6e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-radio
 Summary:    Multimedia Framework Radio Library
-Version:    0.2.5
+Version:    0.2.6
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
@@ -27,14 +27,6 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 Description: Multimedia Framework Radio Library (DEV)
 
-%package test
-Summary:    Multimedia Framework Radio Library (TEST)
-Group:      Development/Libraries
-Requires:   %{name} = %{version}-%{release}
-
-%description test
-Description: Multimedia Framework Radio Library (TEST)
-
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -80,7 +72,3 @@ cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
 %{_libdir}/pkgconfig/mm-radio.pc
 %{_includedir}/mmf/mm_radio.h
 
-%files test
-%manifest %{name}.manifest
-%defattr(-,root,root,-)
-%{_bindir}/mm_radio_testsuite
index 17a30a3..6098578 100755 (executable)
@@ -988,7 +988,14 @@ void __mmradio_scan_thread(mm_radio_t *radio)
  FINISHED:
        radio->scan_thread = 0;
 
-       MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
+       if (radio->old_state == MM_RADIO_STATE_READY) {
+               MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
+       } else if (radio->old_state == MM_RADIO_STATE_PLAYING) {
+               MMRADIO_LOG_DEBUG("old state is playing");
+               ret = _mmradio_unmute(radio);
+               ret = _mmradio_set_frequency(radio->hal_inf, prev_freq);
+               MMRADIO_SET_STATE(radio, MM_RADIO_STATE_PLAYING);
+       }
 
        if (!radio->stop_scan)
                MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SCAN_FINISH, NULL);
@@ -1203,7 +1210,7 @@ static int __mmradio_check_state(mm_radio_t *radio, MMRadioCommand command)
                        if (radio_state == MM_RADIO_STATE_SCANNING)
                                goto NO_OP;
 
-                       if (radio_state != MM_RADIO_STATE_READY)
+                       if (radio_state == MM_RADIO_STATE_NULL)
                                goto INVALID_STATE;
                }
                break;
index 75a70bd..845aba3 100644 (file)
@@ -875,6 +875,10 @@ void __mmradio_scan_thread(mm_radio_t * radio)
        if (_mmradio_set_frequency(radio, radio->region_setting.band_min) != MM_ERROR_NONE)
                goto FINISHED;
 
+       if (radio->old_state == MM_RADIO_STATE_PLAYING) {
+               _mmradio_mute(radio);
+       }
+
        MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SCAN_START, NULL);
        MMRADIO_SET_STATE(radio, MM_RADIO_STATE_SCANNING);
 
@@ -922,7 +926,12 @@ void __mmradio_scan_thread(mm_radio_t * radio)
  FINISHED:
        radio->scan_thread = 0;
 
-       MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
+       if (radio->old_state == MM_RADIO_STATE_READY) {
+               MMRADIO_SET_STATE(radio, MM_RADIO_STATE_READY);
+       } else if (radio->old_state == MM_RADIO_STATE_PLAYING) {
+               _mmradio_unmute(radio);
+               MMRADIO_SET_STATE(radio, MM_RADIO_STATE_PLAYING);
+       }
 
        if (!radio->stop_scan)
                MMRADIO_POST_MSG(radio, MM_MESSAGE_RADIO_SCAN_FINISH, NULL);
@@ -1138,7 +1147,7 @@ static int __mmradio_check_state(mm_radio_t * radio, MMRadioCommand command)
                        if (radio_state == MM_RADIO_STATE_SCANNING)
                                goto NO_OP;
 
-                       if (radio_state != MM_RADIO_STATE_READY)
+                       if (radio_state == MM_RADIO_STATE_NULL)
                                goto INVALID_STATE;
                }
                break;