/*************************************************************************
    Local Functions
 *************************************************************************/
static mmi_ret mmi_widget_view_event_handler_proc(mmi_event_struct *evt)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    switch(evt->evt_id)
    {
        case EVT_ID_GROUP_DEINIT:
        {
            mmi_frm_set_protocol_event_handler(MSG_ID_WIDGET_NOTIFY_CONTENT_UPDATE_IND, NULL, KAL_FALSE);
            mmi_frm_set_protocol_event_handler(MSG_ID_WIDGET_CLOSE_VIEW_IND, NULL, KAL_FALSE);
            mmi_frm_set_protocol_event_handler(MSG_ID_WIDGET_TERMINATE_WGT_IND, NULL, KAL_FALSE);
            mmi_frm_set_protocol_event_handler(MSG_ID_WIDGET_TERMINATE_ALL_WGT_IND, NULL, KAL_FALSE);

            gadget_adp_avplugin_notify_close();

            kal_take_mutex(g_widget_view_lock);

            if (!g_widget_view_cntx->closed_by_engine)
            {
                widget_close_view(g_widget_view_cntx->widget_id, g_widget_view_cntx->view_handle, g_widget_view_cntx->view_type, g_widget_view_cntx->view_response);
            }

            if (g_widget_view_cntx->gdi_buffer1)
            {
                  med_free_asm_mem(GRP_ID_WIDGET_VIEW, (void **) &g_widget_view_cntx->gdi_buffer1);
            }

            if (g_widget_view_cntx->gdi_buffer2)
            {
                  med_free_asm_mem(GRP_ID_WIDGET_VIEW, (void **) &g_widget_view_cntx->gdi_buffer2);
            }

            if (g_widget_view_cntx->render_layer)
            {
                gdi_layer_free(g_widget_view_cntx->render_layer);
            }
            OslMfree(g_widget_view_cntx);
            g_widget_view_cntx = NULL;

            kal_give_mutex(g_widget_view_lock);
            
            widget_disable_view_cache();

            break;
        }
        default:
            break;
    }

    return MMI_RET_OK;

}
/*****************************************************************************
 * FUNCTION
 *  avk_pluto_nvram_test_aync_write_record
 * DESCRIPTION
 *  test case of async write record
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
AVK_ASYN_CASE(AVK_PLUTO_NVRAM_TEST_ASYNC_WRITE_RECORD, AVK_PLUTO_NVRAM)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S16 error;
    S32 ret;
    U8 buff[AVK_PLUTO_NVRAM_TEST_REC_SIZE];
        
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ret = ReadRecord(AVK_PLUTO_NVRAM_TEST_REC_LID,
            1, 
            g_avk_pluto_nvram_cntx.buff_backup, 
            AVK_PLUTO_NVRAM_TEST_REC_SIZE, 
            &error);
    MMI_ASSERT((ret == AVK_PLUTO_NVRAM_TEST_REC_SIZE) && (error == NVRAM_READ_SUCCESS));
    mmi_frm_set_protocol_event_handler(
        MSG_ID_NVRAM_WRITE_CNF, 
        avk_pluto_nvram_async_write_handler, 
        MMI_TRUE);
    memset(buff, AVK_PLUTO_NVRAM_TEST_DATA_VAL, AVK_PLUTO_NVRAM_TEST_REC_SIZE);
    mmi_frm_write_async_record(AVK_PLUTO_NVRAM_TEST_REC_LID, 1, buff, AVK_PLUTO_NVRAM_TEST_REC_SIZE);
}
srv_ies_result srv_ies_job_init(srv_ies_app_session_handle hApp)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_uint32 taskID;
    kal_int32  index;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (0 == g_srv_ies_hdl_mutex)
    {
        g_srv_ies_hdl_mutex = kal_create_mutex("IESHDLMX");
        ASSERT(0 != g_srv_ies_hdl_mutex);
    }

    kal_take_mutex(g_srv_ies_hdl_mutex);
    if (0 == g_srv_ies_job_user)
    {
        kal_get_my_task_index(&taskID);
        if(INDX_MMI == taskID)
        {
            mmi_frm_set_protocol_event_handler(MSG_ID_IES_JOB_RSP,
                                               &_srv_ies_job_response_handler,
                                               MMI_FALSE);
        }

        memset(g_srv_ies_curr_job, 0x0, sizeof(srv_ies_job*) * SRV_IES_JOB_MAX_JOB_COUNT);
   
        for (index = 0; index < SRV_IES_JOB_MAX_JOB_COUNT; index++)
        {
            g_srv_ies_job_pool[index].jobID = index;
        }
    }

    hApp->appState |= SRV_IES_APP_STATE_JOB_INITED;

    g_srv_ies_job_user++;
    kal_give_mutex(g_srv_ies_hdl_mutex);

    g_srv_ies_job_deinit = KAL_FALSE;

    return SRV_IES_OK;
}
Beispiel #4
0
/*****************************************************************************
* FUNCTION
*  mmi_bth_init_simap_event_handler
* DESCRIPTION
*   This function is to
*
* PARAMETERS
*  a  IN/OUT      first variable, used as returns
*  b  IN       second variable
* RETURNS
*  NONE.
* GLOBALS AFFECTED
*   external_global
*****************************************************************************/
void mmi_bth_simap_event_handler(void)
{
    /* Init protocol event handler */
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_ACTIVATE_CNF, (PsIntFuncPtr)mmi_bth_simap_activate_cnf, MMI_FALSE);
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_DEACTIVATE_CNF, (PsIntFuncPtr)mmi_bth_simap_deactivate_cnf, MMI_FALSE);
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_DISCONNECT_CNF, (PsIntFuncPtr)mmi_bth_simap_disconnect_cnf, MMI_FALSE);
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_CONNECT_IND, (PsIntFuncPtr)mmi_bth_simap_connect_ind, MMI_FALSE);
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_DISCONNECT_IND, (PsIntFuncPtr)mmi_bth_simap_disconnect_ind, MMI_FALSE);
	mmi_frm_set_protocol_event_handler(MSG_ID_BT_SIMAP_AUTH_REQ, (PsIntFuncPtr)mmi_bth_simap_authorize_ind, MMI_FALSE);
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
}
Beispiel #5
0
VMINT vm_tls_new_ctx(vm_tls_version_enum ver, vm_socket_type_enum sock_type, VMINT apn, vm_tls_side_enum side, callback_t cb)
{
    kal_int32 ret;
    vm_tls_context_t * ctx_p = NULL;
    VMUINT acct_id = 0;
    kal_uint8 val;
    
    MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_S, 1, __LINE__);

    
    ctx_p = vm_tls_malloc_ctx();

    if (NULL == ctx_p)
    {
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E1, 1, __LINE__);
        return VM_TLS_RET_BASE -2;
    }

    ret = tls_new_ctx((tls_version_enum)ver,
        (tls_side_enum)side,
        MOD_MMI,
        STR_MRE_TITLE);

    if (ret < 0)
    {
        vm_tls_free_ctx(ctx_p);
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E2, 1, ret);
        return ret;
    }

    ctx_p->tls_ctx = ret;
    ctx_p->cb = cb;
    ctx_p->soc_id = 0;
    ctx_p->p_hdl = vm_pmng_get_current_handle();


    if (VM_E_SOC_SUCCESS != vm_get_encoded_dtacct_id(apn, &acct_id))
    {
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E3, 1, __LINE__);
        return VM_TLS_RET_BASE -3;
    }

    
    ctx_p->soc_id = soc_create(SOC_PF_INET, sock_type, 0, MOD_MMI, acct_id);
    if (0 > ctx_p->soc_id)
    {
        // TODO: print ctx_p->soc_id
        ctx_p->soc_id = 0;
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E4, 1, __LINE__);
        return VM_TLS_RET_BASE -3;
    }
    
    val = KAL_TRUE;
    ret = soc_setsockopt(ctx_p->soc_id, SOC_NBIO, &val, sizeof(val));
    if (ret < 0)
    {
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E5, 1, __LINE__);
        return VM_TLS_RET_BASE -5;
    }

    val = SOC_READ | SOC_WRITE | SOC_CONNECT | SOC_CLOSE;
    ret = soc_setsockopt(ctx_p->soc_id, SOC_ASYNC, &val, sizeof(val));
    if (ret < 0)
    {
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E6, 1, __LINE__);
        return VM_TLS_RET_BASE -6;
    }
    
    MMI_TRACE(TRACE_GROUP_8, TRC_MRE_DLS_LOG, 
        ctx_p->tls_ctx,
        ctx_p->soc_id,
        ctx_p->p_hdl,
        0,
        0,
        ctx_p->cb,
        1, __LINE__);
    
    if (0 == g_ref_count++)
    {
        mmi_frm_set_protocol_event_handler(MSG_ID_APP_SOC_NOTIFY_IND, (PsIntFuncPtr)vm_tls_notify_cb, MMI_TRUE);
        mmi_frm_set_protocol_event_handler(MSG_ID_APP_TLS_NOTIFY_IND, (PsIntFuncPtr)vm_tls_notify_ind, MMI_TRUE);
        mmi_frm_set_protocol_event_handler(MSG_ID_APP_TLS_ALERT_IND, (PsIntFuncPtr)vm_tls_alert_ind, MMI_TRUE);
        mmi_frm_set_protocol_event_handler(MSG_ID_APP_TLS_INVALID_CERT_IND, (PsIntFuncPtr)vm_tls_invalid_cert_ind, MMI_TRUE);
        mmi_frm_set_protocol_event_handler(MSG_ID_APP_TLS_CLIENT_AUTH_IND, (PsIntFuncPtr)vm_tls_client_auth_ind, MMI_TRUE);
        MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E7, 1, __LINE__);
    }

    MMI_TRACE(TRACE_GROUP_8, TRC_MRE_SSL_E, 1, ctx_p->res_id);
    return ctx_p->res_id;
    
    
}