⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jprovwap.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
           if (g_prov_data_queue_size == 1)
			{
        mmi_prov_show_install_settings_dialog();
			}

    }
    else
    {
		if ((!isInCall()) && (!AlmIsTonePlaying()))
        {
			if(GetActiveScreenId() != SCR_ID_PROV_INSTALL_NEW_SETTINGS && 
				GetActiveScreenId() != SCR_ID_PROV_PROF_NEW_SETTINGS_POPUP)
        {
            //commented by tk
            // PlayMessageArrivalTone();
            // mmi_prov_entry_show_new_settings_popup();
            mmi_msg_entry_new_msg_popup(MSG_NEW_PROV_SETTING);  /* Added by Tk */
        }
			else
			{
				PlayMessageArrivalTone();
			}
        }
    }

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_entry_show_new_settings_popup
 * DESCRIPTION
 *  This is entry function for New Settings popup
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_entry_show_new_settings_popup(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_PROV_PROF_NEW_SETTINGS_POPUP, NULL, mmi_prov_entry_show_new_settings_popup, NULL);
    /* ShowCategory65Screen((PU8) GetString(STR_ID_PROV_NEW_SETTINGS), IMG_ID_PROV_NEW_NOTIFICATION_MSG, NULL); */
//    ShowCategory65Screen((PU8) GetString(STR_ID_PROV_NEW_SETTINGS), IMG_NEW_MESSAGE_NOTIFICATION_MSG, NULL);
//	ShowCategory164Screen(STR_GLOBAL_OK, IMG_GLOBAL_OK, STR_GLOBAL_CANCEL, IMG_ID_PROV_CANCEL, (U16) STR_ID_PROV_INSTALL_SETTINGS, IMG_GLOBAL_QUESTION, NULL);
	ShowCategory123Screen(
        0,
        0,
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_CANCEL,
        IMG_ID_PROV_CANCEL,
        STR_ID_PROV_INSTALL_SETTINGS,
        IMG_GLOBAL_QUESTION,
        0);
    /*
     * End key is also disabled. We set GoBackHistory on key up such that KeyUp indication wont be used 
     * * by the overlapped screen. 
     */
    /* SetGroupKeyHandler(NULL,(PU16)PresentAllKeys,(U8) TOTAL_KEYS, (U16) KEY_EVENT_UP); */
//    SetGroupKeyHandler(GoBackHistory, (PU16) PresentAllKeys, (U8) TOTAL_KEYS, (U16) KEY_EVENT_UP);
//    SetGroupKeyHandler(NULL, (PU16) PresentAllKeys, (U8) TOTAL_KEYS, (U16) KEY_EVENT_DOWN);

    SetLeftSoftkeyFunction(mmi_prov_oma_handle_install_application, KEY_EVENT_UP);
    SetRightSoftkeyFunction(mmi_prov_handle_cancel, KEY_EVENT_UP);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_show_install_settings_dialog
 * DESCRIPTION
 *  This displays Confirmation screen for the settings to be installed or cancled
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_show_install_settings_dialog(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif /* 0 */ 

	mmi_prov_set_current_instal_stringID();

    EntryNewScreen(SCR_ID_PROV_INSTALL_NEW_SETTINGS, NULL, mmi_prov_show_install_settings_dialog, NULL);

    ShowCategory123Screen(
        0,
        0,
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_CANCEL,
        IMG_ID_PROV_CANCEL,
        /* STR_ID_PROV_INSTALL_SETTINGS, */ g_prov_instal_stringID,
        IMG_GLOBAL_QUESTION,
        0);

    SetLeftSoftkeyFunction(mmi_prov_handle_ok, KEY_EVENT_UP);
    SetRightSoftkeyFunction(mmi_prov_handle_cancel, KEY_EVENT_UP);
    SetKeyHandler(mmi_prov_handle_cancel, KEY_END, KEY_EVENT_DOWN);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_handle_ok
 * DESCRIPTION
 *  This deals with the sequences that happen when a user accepts the setings to be installed
 *  in this the wbxml prov. doc is decoded and information is extracted from it
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_handle_ok(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    struct xml XMLInfo = {0, };
    WBXML_HANDLE WBXMLHandle;
    PROV_RETCODE i_ret = PROV_OK;
    prov_queue_data_struct *prov_data_p;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_prov_setting_type = 0x00; /* dara  reset all the previous values */
    g_prov_setting_type |= PROV_BRS_SETTINGS;
    prov_data_p = prov_data_queue[g_prov_data_queue_current_item];

    //      i_ret = jdi_XMLMakeTree ((JC_UINT8 *) prov_data_p->pbuffer, prov_data_p->plength, NULL, &XMLInfo, NULL, 0, 0, &XMLHandle) ;
    //dara temp end 
    i_ret = jdi_WBXMLDecode((U8*) prov_data_p->pbuffer, prov_data_p->plength, &XMLInfo, NULL, 0, 0, &WBXMLHandle);
    if (i_ret != PROV_OK)
    {
        g_prov_timeout_hdlr = mmi_prov_handle_error_state_callback;
        PRINT_INFORMATION(("Inside mmi_prov_handle_ok, checks WBXMLDecode"));
        DisplayPopupCallBack(
            (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
            IMG_GLOBAL_ERROR,
            1,
            PROV_INVALID_SETTINGS_TIMEOUT,
            ERROR_TONE,
            g_prov_timeout_hdlr);
		goto error_handle;
    }
	mmi_prov_handle_data_account_mem_free();/*Added by tk to handle empty APN case*/
    mmi_prov_handle_data_account_mem_allocate();
    mmi_prov_handle_profile_mem_allocate();

    if (strcmp(XMLInfo.root->name, NE_ROOT_TAG) == 0)
    {

        g_prov_setting_type |= PROV_NOKIA_SETTINGS;
        i_ret = mmi_prov_NE_insert_settings_parm(XMLInfo.root);
        if (i_ret == PROV_ERR)
        {
            g_prov_timeout_hdlr = mmi_prov_handle_error_state_callback;
            PRINT_INFORMATION(("Inside mmi_prov_handle_ok, checks mmi_prov_NE_insert_settings_parm"));
            DisplayPopupCallBack(
                (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
                IMG_GLOBAL_ERROR,
                1,
                PROV_INVALID_SETTINGS_TIMEOUT,
                ERROR_TONE,
                g_prov_timeout_hdlr);
            goto error_handle;
        }

    }
    else if (strcmp(XMLInfo.root->name, OMA_ROOT_TAG) == 0)
    {
        g_prov_setting_type |= PROV_OMA_SETTINGS;
        i_ret = mmi_prov_oma_insert_settings_parm(XMLInfo.root);
        if ((i_ret == PROV_OK) && (g_prov_appl_flag != PROV_NO_APPLICATION))
        {
            mmi_prov_oma_handle_install_application();
            goto error_handle;
        }
        else
        {
            g_prov_timeout_hdlr = mmi_prov_handle_error_state_callback;
            PRINT_INFORMATION(("Inside mmi_prov_handle_ok, checks mmi_prov_oma_insert_settings_parm"));
            DisplayPopupCallBack(
                (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
                IMG_GLOBAL_ERROR,
                1,
                PROV_INVALID_SETTINGS_TIMEOUT,
                ERROR_TONE,
                g_prov_timeout_hdlr);
            goto error_handle;
        }
    }
    else
    {
        mmi_prov_handle_error_state();
        goto error_handle;
    }

    if (g_prov_setting_type & PROV_BOOKMARK_SETTINGS)
    {
        g_prov_timeout_hdlr = mmi_prov_handle_error_state_callback;
        if (i_ret == PROV_BKM_OK)
        {
            DisplayPopupCallBack(
                (PU8) GetString(STR_ID_PROV_BOOKMARK_STORED),
                IMG_GLOBAL_ACTIVATED,
                1,
                UI_POPUP_NOTIFYDURATION_TIME,
                SUCCESS_TONE,
                g_prov_timeout_hdlr);

        }
        else if (i_ret == PROV_BKM_FULL)
        {
            DisplayPopupCallBack(
                (PU8) GetString(STR_ID_PROV_BOOKMARK_FULL),
                IMG_GLOBAL_WARNING,
                1,
                UI_POPUP_NOTIFYDURATION_TIME,
                WARNING_TONE,
                g_prov_timeout_hdlr);

        }
        else if (i_ret == PROV_BKM_INVALID)
        {
            DisplayPopupCallBack(
                (PU8) GetString(STR_ID_PROV_BOOKMARK_INVALID),
                IMG_GLOBAL_ERROR,
                1,
                UI_POPUP_NOTIFYDURATION_TIME,
                ERROR_TONE,
                g_prov_timeout_hdlr);
        }
        goto error_handle;
    }

    if ((i_ret == PROV_ERR) || (g_prov_bearer == PROV_INVALID_BEARER))
    {
        g_prov_timeout_hdlr = mmi_prov_handle_error_state_callback;
        DisplayPopupCallBack(
            (PU8) GetString(STR_ID_PROV_INVALID_BEARER),
            IMG_GLOBAL_ERROR,
            1,
            PROV_INVALID_SETTINGS_TIMEOUT,
            ERROR_TONE,
            g_prov_timeout_hdlr);
        goto error_handle;
    }

    mmi_prov_show_profile_list_menu();
error_handle:

	jdi_XMLFreeTree (&XMLInfo) ;
	
}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_set_curent_instal_stringID
 * DESCRIPTION
 *  This API is to set the current instal string id to display.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_set_current_instal_stringID(void)
{

	if(prov_data_queue[g_prov_data_queue_current_item])
	{
		g_prov_instal_stringID = prov_data_queue[g_prov_data_queue_current_item]->instal_stringID;
	}

}

/*****************************************************************************
 * FUNCTION
 *  mmi_prov_handle_get_next_prov_data
 * DESCRIPTION
 *  This API is to remove the present entry from the queue & get the next provisioing doc if any
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_handle_get_next_prov_data(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
	g_prov_pend_set = 0;
    g_prov_bearer = PROV_INVALID_BEARER;
    g_prov_setting_type |= PROV_BRS_SETTINGS;
    g_ph_cntx.profile_module = PH_PROFILE_NULL;

    if (g_prov_data_queue_size > 0)
    {
        mmi_prov_delete_queue_entry();
    }
    mmi_prov_handle_profile_mem_free();

    if (g_prov_data_queue_size > 0)
    {
        /* Do not merge with the above condition ..its intentional */
        mmi_prov_show_install_settings_dialog();
    }
    else
    {
        /* EntryIdleScreen(); */
        DisplayIdleScreen();
        /* DeleteUptoScrID(IDLE_SCREEN_ID); */
    }

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_handle_error_state
 * DESCRIPTION
 *  It handles the error state if any occured during installing the settings
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_handle_error_state(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_prov_handle_get_next_prov_data();
}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_handle_error_state_callback
 * DESCRIPTION
 *  It handles the error state if any occured during installing the settings
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_prov_handle_error_state_callback(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -