return converted_state;
}
-static radio_interrupted_code_e __convert_interrupted_code(int code)
-{
- LOGI("[%s] Enter code: %d", __func__, code);
- radio_interrupted_code_e ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
- switch (code) {
- case MM_MSG_CODE_INTERRUPTED_BY_CALL_END:
- case MM_MSG_CODE_INTERRUPTED_BY_ALARM_END:
- case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_END:
- case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_END:
- ret = RADIO_INTERRUPTED_COMPLETED;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_MEDIA:
- case MM_MSG_CODE_INTERRUPTED_BY_OTHER_PLAYER_APP:
- ret = RADIO_INTERRUPTED_BY_MEDIA;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_CALL_START:
- ret = RADIO_INTERRUPTED_BY_CALL;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_EARJACK_UNPLUG:
- ret = RADIO_INTERRUPTED_BY_EARJACK_UNPLUG;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_ALARM_START:
- ret = RADIO_INTERRUPTED_BY_ALARM;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_NOTIFICATION_START:
- ret = RADIO_INTERRUPTED_BY_NOTIFICATION;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_EMERGENCY_START:
- ret = RADIO_INTERRUPTED_BY_EMERGENCY;
- break;
- case MM_MSG_CODE_INTERRUPTED_BY_RESOURCE_CONFLICT:
- default:
- ret = RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT;
- break;
- }
- LOGE("[%s] interrupted code(%d) => ret(%d)", __FUNCTION__, code, ret);
- return ret;
-}
-
static int __set_callback(_radio_event_e type, radio_h radio, void *callback, void *user_data)
{
RADIO_INSTANCE_CHECK(radio);
if (msg->union_type == MM_MSG_UNION_STATE) {
handle->state = __convert_radio_state(msg->state.current);
if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])
- ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->state.code), handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
+ ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_BY_RESOURCE_CONFLICT, handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
}
break;
- case MM_MESSAGE_READY_TO_RESUME:
- if (handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])
- ((radio_interrupted_cb)handle->user_cb[_RADIO_EVENT_TYPE_INTERRUPT])(RADIO_INTERRUPTED_COMPLETED, handle->user_data[_RADIO_EVENT_TYPE_INTERRUPT]);
- break;
case MM_MESSAGE_ERROR:
__convert_error_code(msg->code, (char *)__FUNCTION__);
break;