static wifi_manager_h g_WifiManager = NULL;
+static int
+voice_call_noti_tbl[] = {
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_HELD,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_DIALING,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_ALERTING,
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_INCOMING,
+};
+
+static int
+video_call_noti_tbl[] = {
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_IDLE,
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_ACTIVE,
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_DIALING,
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_ALERTING,
+ TELEPHONY_NOTI_VIDEO_CALL_STATUS_INCOMING,
+};
+
telephony_handle_list_s tel_list;
/**
telephony_error_e ret_sim;
unsigned int count_sim = 0;
- VideoLogDebug("getting call status");
+ VideoLogDebug("Noti!!! Call Status [%d]!!!", noti_id);
ret_sim =
telephony_call_get_call_list(handle, &count_sim,
telephony_call_release_call_list(count_sim, &call_list_sim);
- if (status != TELEPHONY_CALL_STATE_IDLE) {
+ if (status != TELEPHONY_CALL_STATUS_IDLE) {
if (!vp_play_normal_view_pause(pPlayView->pNormalView)) {
VideoLogError("vp_play_normal_view_pause fail");
}
- } else if (status == TELEPHONY_CALL_STATE_IDLE) {
+ } else if (status == TELEPHONY_CALL_STATUS_IDLE) {
bool bManualPause = FALSE;
vp_play_normal_view_get_manual_pause(pPlayView->pNormalView,
&bManualPause);
return FALSE;
}
+ int voice_call_noti_tbl_sz = (sizeof(voice_call_noti_tbl) / sizeof(int));
+ int video_call_noti_tbl_sz = (sizeof(video_call_noti_tbl) / sizeof(int));
+
/*setting callbacks */
for (int i = 0; i < tel_list.count; i++) {
- int api_err =
- telephony_set_noti_cb(tel_list.handle[i], TELEPHONY_NOTI_VOICE_CALL_STATE,
- (telephony_noti_cb)
- _call_async_event_callback,
- (void *) pUserData);
- if (api_err != TELEPHONY_ERROR_NONE) {
- VideoLogError
- ("tel_register_noti_event for voice call failed ( api_err : %d ) !!",
- api_err);
+
+ int api_err;
+
+ for (int j = 0; j < voice_call_noti_tbl_sz; j++) {
+ api_err =
+ telephony_set_noti_cb(tel_list.handle[i], voice_call_noti_tbl[j],
+ (telephony_noti_cb)
+ _call_async_event_callback,
+ (void *) pUserData);
+ if (api_err != TELEPHONY_ERROR_NONE) {
+ VideoLogError
+ ("tel_register_noti_event for voice call failed ( api_err : %d ) !!",
+ api_err);
+ }
}
- api_err =
- telephony_set_noti_cb(tel_list.handle[i], TELEPHONY_NOTI_VIDEO_CALL_STATE,
- (telephony_noti_cb)
- _call_async_event_callback,
- (void *) pUserData);
- if (api_err != TELEPHONY_ERROR_NONE) {
- VideoLogError
- ("tel_register_noti_event for video call failed ( api_err : %d ) !!",
- api_err);
+ for (int j = 0; j < video_call_noti_tbl_sz; j++) {
+ api_err =
+ telephony_set_noti_cb(tel_list.handle[i], video_call_noti_tbl[j],
+ (telephony_noti_cb)
+ _call_async_event_callback,
+ (void *) pUserData);
+ if (api_err != TELEPHONY_ERROR_NONE) {
+ VideoLogError
+ ("tel_register_noti_event for video call failed ( api_err : %d ) !!",
+ api_err);
+ }
}
}
{
telephony_h *newhandle = tel_list.handle;
int nErr = -1;
+ int voice_call_noti_tbl_sz = (sizeof(voice_call_noti_tbl) / sizeof(int));
+ int video_call_noti_tbl_sz = (sizeof(video_call_noti_tbl) / sizeof(int));
- nErr =
- telephony_unset_noti_cb(*newhandle,
- TELEPHONY_NOTI_VOICE_CALL_STATE);
- if (nErr != TELEPHONY_ERROR_NONE) {
- VideoLogError("telephony_unset_noti_cb is fail [0x%x]", nErr);
+ for (int i = 0; i < voice_call_noti_tbl_sz; i++) {
+ nErr =
+ telephony_unset_noti_cb(*newhandle,
+ voice_call_noti_tbl[i]);
+ if (nErr != TELEPHONY_ERROR_NONE) {
+ VideoLogError("telephony_unset_noti_cb is fail [0x%x] for voice call type %d",
+ nErr, voice_call_noti_tbl[i]);
+ }
}
- nErr =
- telephony_unset_noti_cb(*newhandle,
- TELEPHONY_NOTI_VIDEO_CALL_STATE);
- if (nErr != TELEPHONY_ERROR_NONE) {
- VideoLogError("telephony_unset_noti_cb is fail [0x%x]", nErr);
+
+ for (int i = 0; i < video_call_noti_tbl_sz; i++) {
+ nErr =
+ telephony_unset_noti_cb(*newhandle,
+ video_call_noti_tbl[i]);
+ if (nErr != TELEPHONY_ERROR_NONE) {
+ VideoLogError("telephony_unset_noti_cb is fail [0x%x] for video call type %d",
+ nErr, video_call_noti_tbl[i]);
+ }
}
+
nErr = telephony_deinit(&tel_list);
if (nErr != TELEPHONY_ERROR_NONE) {
VideoLogError("telephony_deinit is fail [0x%x]", nErr);