Bug 938809 - Support calling seeking/tuning functions off main thread in HAL, r=dhylands

This commit is contained in:
Michael Wu 2014-07-29 20:28:12 -04:00
Родитель bd7088ebea
Коммит b63474122c
2 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -526,6 +526,8 @@ void DisableFMRadio();
/**
* Seek to an available FM radio station.
*
* This can be called off main thread, but all calls must be completed
* before calling DisableFMRadio.
*/
void FMRadioSeek(const hal::FMRadioSeekDirection& aDirection);
@ -536,6 +538,9 @@ void GetFMRadioSettings(hal::FMRadioSettings* aInfo);
/**
* Set the FM radio's frequency.
*
* This can be called off main thread, but all calls must be completed
* before calling DisableFMRadio.
*/
void SetFMRadioFrequency(const uint32_t frequency);

Просмотреть файл

@ -402,20 +402,18 @@ FMRadioSeek(const hal::FMRadioSeekDirection& aDirection)
if (sMsmFMMode && rc >= 0)
return;
hal::FMRadioOperationInformation info;
info.operation() = hal::FM_RADIO_OPERATION_SEEK;
info.status() = rc < 0 ? hal::FM_RADIO_OPERATION_STATUS_FAIL :
hal::FM_RADIO_OPERATION_STATUS_SUCCESS;
hal::NotifyFMRadioStatus(info);
NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_SEEK,
rc < 0 ?
hal::FM_RADIO_OPERATION_STATUS_FAIL :
hal::FM_RADIO_OPERATION_STATUS_SUCCESS));
if (rc < 0) {
HAL_LOG(("Could not initiate hardware seek"));
return;
}
info.operation() = hal::FM_RADIO_OPERATION_TUNE;
info.status() = hal::FM_RADIO_OPERATION_STATUS_SUCCESS;
hal::NotifyFMRadioStatus(info);
NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_TUNE,
hal::FM_RADIO_OPERATION_STATUS_SUCCESS));
}
void
@ -450,11 +448,10 @@ SetFMRadioFrequency(const uint32_t frequency)
if (sMsmFMMode && rc >= 0)
return;
hal::FMRadioOperationInformation info;
info.operation() = hal::FM_RADIO_OPERATION_TUNE;
info.status() = rc < 0 ? hal::FM_RADIO_OPERATION_STATUS_FAIL :
hal::FM_RADIO_OPERATION_STATUS_SUCCESS;
hal::NotifyFMRadioStatus(info);
NS_DispatchToMainThread(new RadioUpdate(hal::FM_RADIO_OPERATION_TUNE,
rc < 0 ?
hal::FM_RADIO_OPERATION_STATUS_FAIL :
hal::FM_RADIO_OPERATION_STATUS_SUCCESS));
}
uint32_t