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

📄 jam_interaction.c

📁 java 1.1 gemini 08_16
💻 C
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *   jam_adaptation.c
 *
 * Project:
 * --------
 *   Maui_Software
 *
 * Description:
 * ------------
 *   This file implements Java task UI/message interaction with other task
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

/*************************************************************************
 * Include Header Files
 *************************************************************************/
#include "jal.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "task_main_func.h"
#include "app_ltlcom.h"
#include "lcd_ip_cqueue.h"
#include "stack_types.h"
#include "task_config.h"
#include "syscomp_config.h"
#include "custom_config.h"
#include "custom_util.h"
#include "stack_init.h"
#include "stack_ltlcom.h"
#include "stack_msgs.h"
#include "app_buff_alloc.h"
#include "jam_msg_handler.h"
#include "JavaAgencyDef.h"
#include "GlobalDefs.h"
#include "wgui_categories_util.h"
#include "Ucs2prot.h"
#include "ExtDeviceDefs.h"

/*************************************************************************
 * External Declaration
 *************************************************************************/

/*************************************************************************
 * Global Definition
 *************************************************************************/
kal_bool endKeyPressed;

/* Time slice counter for executing checkEventOver() */
int checkEventCountTimeSlice = 0;

/*************************************************************************
 * Function Definition
 *************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  initCheckEvent
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void initCheckEvent()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
}


/*****************************************************************************
 * FUNCTION
 *  j2me_send_alertuser
 * DESCRIPTION
 *  
 * PARAMETERS
 *  message     [?]         
 *  len         [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void j2me_send_alertuser(char *message, int len)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr;
    kal_char *alertString;
    mmi_java_show_alert_user_dialog_req_struct *msg;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    alertString = (char*)get_string(STR_JAVA_ALERT);
    len = mmi_ucs2strlen((S8*) alertString);
    msg = (mmi_java_show_alert_user_dialog_req_struct*)
        construct_local_para((kal_uint16) (sizeof(mmi_java_show_alert_user_dialog_req_struct) + len * 2), 0);
    mmi_ucs2cpy((S8*) msg->message, (S8*) alertString);
    msg->message[(len << 1)] = 0;
    msg->message[(len << 1) + 1] = 0;

    ilm_ptr = allocate_ilm(MOD_J2ME);
    ilm_ptr->msg_id = (msg_type) MSG_ID_MMI_JAVA_SHOW_ALERT_USER_DIALOG_REQ;  /* Set the message id */
    ilm_ptr->peer_buff_ptr = NULL;  /* there are no peer message */
    ilm_ptr->local_para_ptr = (local_para_struct*) msg;

    SEND_ILM(MOD_J2ME, MOD_MMI, J2ME_MMI_SAP, ilm_ptr);
}

#ifdef __DRM_SUPPORT__


/*****************************************************************************
 * FUNCTION
 *  j2me_send_DRM_alertuser
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void j2me_send_DRM_alertuser(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int len;
    ilm_struct *ilm_ptr;
    kal_char *alertString;
    mmi_java_show_alert_user_dialog_req_struct *msg;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    alertString = (char*)get_string(STR_GLOBAL_DRM_PROHIBITED);
    len = mmi_ucs2strlen((S8*) alertString);
    msg = (mmi_java_show_alert_user_dialog_req_struct*)
        construct_local_para((kal_uint16) (sizeof(mmi_java_show_alert_user_dialog_req_struct) + len * 2), 0);
    mmi_ucs2cpy((S8*) msg->message, (S8*) alertString);
    msg->message[(len << 1)] = 0;
    msg->message[(len << 1) + 1] = 0;

    ilm_ptr = allocate_ilm(MOD_J2ME);
    ilm_ptr->msg_id = (kal_uint16) MSG_ID_MMI_JAVA_SHOW_ALERT_USER_DIALOG_REQ;  /* Set the message id */
    ilm_ptr->peer_buff_ptr = NULL;  /* there are no peer message */
    ilm_ptr->local_para_ptr = (local_para_struct*) msg;

    SEND_ILM(MOD_J2ME, MOD_MMI, J2ME_MMI_SAP, ilm_ptr);
}

#endif /* __DRM_SUPPORT__ */ 

/*****************************************************************************
 * FUNCTION
 *  j2me_send_not_found
 * DESCRIPTION
 *  
 * PARAMETERS
 *  kal_int32 	error code
 * RETURNS
 *  void
 *****************************************************************************/
void j2me_send_not_found(kal_int32 error_code)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int len;
    ilm_struct *ilm_ptr;
    kal_char *alertString;
    mmi_java_show_alert_user_dialog_req_struct *msg;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __USB_IN_NORMAL_MODE__
    if(error_code == USB_IN_USE)
	{
    	alertString = (char*)get_string(STR_ID_USB_MODE_EXPORTED_WARNING);
	}else
#endif
    if(error_code == DISK_NOT_FOUND){
    	alertString = (char*)get_string(STR_JAVA_ERROR_CODE_NO_CARD);
    }
    else if (error_code == BT_IN_USE)
    {
        alertString = (char*)get_string(STR_JAVA_ERROR_CODE_BT_IN_USE);
    }
    else
    {
    	alertString = (char*)get_string(STR_JAVA_ERROR_CODE_JAR_NOT_FOUND);
	}
    len = mmi_ucs2strlen((S8*) alertString);
    msg = (mmi_java_show_alert_user_dialog_req_struct*)
        construct_local_para((kal_uint16) (sizeof(mmi_java_show_alert_user_dialog_req_struct) + len * 2), 0);
    mmi_ucs2cpy((S8*) msg->message, (S8*) alertString);
    msg->message[(len << 1)] = 0;
    msg->message[(len << 1) + 1] = 0;

    ilm_ptr = allocate_ilm(MOD_J2ME);
    ilm_ptr->msg_id = (msg_type) MSG_ID_MMI_JAVA_SHOW_ALERT_USER_DIALOG_REQ;  /* Set the message id */
    ilm_ptr->peer_buff_ptr = NULL;  /* there are no peer message */
    ilm_ptr->local_para_ptr = (local_para_struct*) msg;

    SEND_ILM(MOD_J2ME, MOD_MMI, J2ME_MMI_SAP, ilm_ptr);
}

⌨️ 快捷键说明

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