如何实现后台自动发送彩信 MMSApplicationfile

时间:2023-02-16 10:59:03
1. flag0kal_uint8 mms_auto_send = 0 



2. mms_general_insert_hdlrflag1

mms_auto_send = 1



3. mmi_uc_entry_write_msgflag

if(mms_auto_send)

{

mmi_uc_exit_wirte_msg();

mmi_uc_update_msg_size();

mmi_uc_process_send();

mms_auto_send = 0;

}

mmsmms_general_insert_hdlraddress,subject,text,filepath

09B1012

1)UC Editor

MMI_bool auto_send_flag=false;

auto_send_flag = true;

Call mmi_fmgr_to_mms_hdlr(void)Image Objectg_uc_p->srv_main->file_path

mmi_uc_get_mms_setting()UC Editor

if(GetExitScrnID() == SCR_ID_UC_PROCESSING && auto_send_flag != true)

mmi_uc_entry_write_msg();



2)

U16 special_addr[20]= L"13500057350";//

U16 add_addr[20];

mmi_ucs2cpy((U8 *)add_addr,(U8 *)special_addr);

//TO

result = srv_uc_add_address(

g_uc_p->main.instance,

//g_uc_p->done.to,

(U8*)add_addr,

MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,

g_uc_p->done.current_addr_type);

srv_uc_update_msg_size(g_uc_p->main.instance);

3)MMS:

mmi_uc_pre_entry_sim_option()g_uc_p->srv_sim_info->is_sim1/2_validg_uc_p->srv_send_info->send_sim_id

4)Call API:mmi_uc_process_send()

1. BOOL auto_send_mms = FALSE;

#include "ucappprot.h"

void mmi_fmgr_to_send_mms_to_special_number(S8 *buffer) //mmsbuffer

{

mms_content_entry_struct mms_data;

MMI_BOOL result = MMI_FALSE;

U8 addr[MMS_MAX_ENCODE_ADDRESS_LENGTH * ENCODING_LENGTH];

S8 *my_addr = "9798";//

extern mmi_uc_context_struct *g_uc_p;

memset(&mms_data, 0x00, sizeof(mms_content_entry_struct));

mms_data.file_path = (char *) buffer;

mms_data.text_buffer = NULL;

mmi_asc_to_ucs2((S8*)addr, (S8*)my_addr);

mms_data.addr = (char *)addr;

mms_data.callback = NULL;

mms_data.callback_param = NULL

mms_data.mode = MMS_NEW_GENERAL;

mms_data.msg_type = 0;

mms_data.subject = NULL;

mms_data.text_buffer = NULL;

auto_send_mms = TRUE;

mms_general_insert_hdlr(&mms_data);

if (auto_send_mms)

{



result = srv_uc_add_address(

g_uc_p->main.instance,

(U8*)addr,

MMI_UC_ADDRESS_TYPE_PHONE_NUMBER,

g_uc_p->done.current_addr_type);

g_uc_p->done.current_addr_index = 2;

//sim

srv_uc_update_msg_size(g_uc_p->main.instance);

mmi_uc_process_send();

auto_send_mms = FALSE;

}

}



2. ucappcore.c

void mmi_uc_process_state_write_new_msg_in_mms_setting_rsp(void)

{

extern BOOL auto_send_mms;//

if (mmi_frm_scrn_is_present(g_uc_p->main.uc_cui_gid, SCR_ID_UC_PROCESSING,

MMI_FRM_NODE_EXCLUDE_ACTIVE_SCRN_FLAG))

{

mmi_uc_replace_screen(SCR_ID_UC_PROCESSING, SCR_ID_UC_EDITOR, (mmi_proc_func)

mmi_uc_entry_write_msg, 0);

mmi_frm_scrn_close(g_uc_p->main.uc_cui_gid, SCR_ID_UC_CONFIRM);

}

else

if ((mmi_frm_scrn_get_active_id() == SCR_ID_UC_PROCESSING) || (mmi_frm_scrn_get_active_id()

== SCR_ID_UC_CONFIRM))

{

if (!auto_send_mms)//flag

{

mmi_uc_entry_write_msg(); //

}

mmi_frm_scrn_close(g_uc_p->main.uc_cui_gid, SCR_ID_UC_PROCESSING);

mmi_frm_scrn_close(g_uc_p->main.uc_cui_gid, SCR_ID_UC_CONFIRM);

}

}

}



3. ucappcore.c

mmi_uc_handle_image_object_resize_process_before_resolution_verification

{

extern BOOL auto_send_mms;//

if ((img_width != 0) && (img_height != 0)

&& !auto_send_mms //

)

{



mmi_uc_entry_processing_generic(); //



}

}



4ucappcore.c

void mmi_uc_process_entry_write_msg(void)

{

extern BOOL auto_send_mms;



if(g_uc_p->srv_main->state != MMI_UC_STATE_WRITE_NEW_MSG)

{



mmi_uc_set_processing_screen(

0,

STR_GLOBAL_PLEASE_WAIT,

mmi_get_event_based_image(MMI_EVENT_PROGRESS),

0);

if(!auto_send_mms)//

{

mmi_uc_entry_processing_generic(); //

}



}

}



5ucmsghdlrapp.c

void mmi_uc_get_mms_setting(void)

{

extern BOOL auto_send_mms;



if (mmi_frm_scrn_is_present(g_uc_p->main.uc_cui_gid, SCR_ID_UC_PROCESSING,

MMI_FRM_NODE_EXCLUDE_ACTIVE_SCRN_FLAG))

{

MMI_TRACE(MMI_COMMON_TRC_G6_MSG,

TRC_MMI_UC_GET_MMS_CONTENT_RSP_INTERRUPT);

mmi_uc_replace_screen(SCR_ID_UC_PROCESSING, SCR_ID_UC_EDITOR, (mmi_proc_func)

mmi_uc_entry_write_msg, 0);

}

else /*if (mmi_frm_scrn_get_active_id() == SCR_ID_UC_PROCESSING)*/

{



if (!auto_send_mms)//

{

mmi_uc_entry_write_msg(); //



}

mmi_frm_scrn_close(g_uc_p->main.uc_cui_gid, SCR_ID_UC_PROCESSING);

}

}



MMS V01(“MMS”)

1. “MMS”



2. nvrambuffer



3. flagmy_control_auto_flag = 0;



4. flag1.



5. cameraApp.cstruct

typedef struct

{

mms_new_type_enum mode;

char *addr;

char *subject;

char *file_path; /* UCS2 MMI filename */

char *text_buffer;

kal_uint8 my_flag ; //

func_ptr callback;

void *callback_param;

} mms_content_entry_struct1;



typedef struct{

mms_new_type_enum mode;

mms_msg_type_enum msg_type;

char *addr;

char *subject;

char *file_path; /* UCS2 MMI filename */

char *text_buffer;

kal_uint8 my_flag ;//struct

func_ptr callback;

void *callback_param;

} mms_content_entry_struct;

mms_content_entry_struct1 mms_content_entry_struct

6. mmi_camera_forward_to_hdlr

case MMI_CAMERA_FORWARD_TO_MMS:

//

{

if(my_control_auto_flag)

{

mms_content_entry_struct1 data;

U8 addr[MAX_PB_NUMBER_LENGTH * ENCODING_LENGTH];

U8 subject[40];

S8 *my_addr = "15818888888";//buffer

S8 my_text[40] = "happybirday";//subject

//

//

data.my_flag = 111;

data.file_path = (S8*)g_camera_cntx.captured_filepath;

data.text_buffer = NULL;

mmi_asc_to_ucs2((S8*)addr, (S8*)my_addr);

mmi_asc_to_ucs2((S8*)subject,(S8*)my_text);

data.addr = (char *)addr;

data.callback = NULL;

data.subject = (char *)subject;

data.mode = MMS_NEW_GENERAL ;

data.callback_param = NULL;

my_control_auto_flag = 1;

mms_general_insert_hdlr((mms_content_entry_struct *)&data);

}

else

{

//

mms_content_insert_hdlr((PS8) g_camera_cntx.captured_filepath);

}



7. goto_mms_editormy_auto_send = 0;

case MMS_NEW_GENERAL:

{

mea_new_mms_req_struct *p = NULL;

peer_buff_struct *peer_buff_ptr = NULL;

char *fileName = NULL;

int len = 0;

long fileSize = 0;

mms_content_entry_struct_peer_buf *peer_pdu = NULL;

MSF_UINT16 buffer_size = 0, peer_pdu_len = 0;

//

if(data->my_flag == 111)

{

my_auto_send = 1;

}

……

8. meaActivateStartupFsm

case MEA_STARTUP_MODE_NEW:

#ifdef __MMI_URI_AGENT__

case MEA_STARTUP_MODE_URI:

#endif /*#ifdef __MMI_URI_AGENT__*/

//

if(my_auto_send == 1)

{

my_auto_send = 2;

}

meaMeSignalHandler

if (! handleStartup(inst->mode, inst->origMsgId))

{

(void)MEA_SIGNAL_SENDTO(MEA_ME_FSM, MEA_SIG_ME_DEACTIVATE);

} /* if */

//case

if(my_auto_send == 2)

{

(void)MEA_SIGNAL_SENDTO(MEA_ME_FSM, MEA_SIG_ME_SAVE_AND_SEND);

my_auto_send = 0;//

}

break;



case MEA_SIG_ME_DEACTIVATE:

{

......

9.

meaMeSignalHandler()case MEA_SIG_ME_SAVE_AND_SEND:

if (my_auto_send == 2)

{

S8 * number1 = "15344826342";

S8 * number2 = "76293672912";

MeaAddrItem *address1 = NULL;

MeaAddrItem *address2 = NULL;



my_auto_send =0

address1 = (MeaAddrItem *)MEA_ALLOC(sizeof(MeaAddrItem));

address2 = (MeaAddrItem *)MEA_ALLOC(sizeof(MeaAddrItem));

memset(address1,0x00,sizeof(MeaAddrItem));

memset(address2,0x00,sizeof(MeaAddrItem));

address1->address = (S8*)MEA_ALLOC(strlen(number1) + 1);

address2->address = (S8*)MEA_ALLOC(strlen(number2) + 1);

memset(address1->address,'/0',strlen(number1) + 1);

memset(address2->address,'/0',strlen(number2) + 1);

address1->name = (S8*)MEA_ALLOC(strlen(number1) + 1);

address2->name = (S8*)MEA_ALLOC(strlen(number2) + 1);

memset(address1->name,'/0',strlen(number1) + 1);

memset(address2->name,'/0',strlen(number2) + 1);



memcpy((S8*)address1->address, (S8*)number1,strlen(number1) + 1);

memcpy((S8*)address1->name, (S8*)number1,strlen(number1) + 1);

memcpy((S8*)address2->address, (S8*)number2,strlen(number2) + 1);

memcpy((S8*)address2->name, (S8*)number2,strlen(number2) + 1);

address1->next = NULL;

address2->next = NULL;

address1->addrType = MEA_ADDR_TYPE_PLMN;

address2->addrType = MEA_ADDR_TYPE_PLMN;



setAddr(&(inst->theMessage->msgProperties->to),address1);

setAddr(&(inst->theMessage->msgProperties->to),address2);

}



10. mms editorhandleStartupModemeaMeCreatePropView



if (my_auto_send != 2)

{

if (!meaMeCreatePropView(inst->theMessage->msgProperties, inst->mode))

{

MSF_LOG_MSG_OFF((MSF_LOG_DETAIL_HIGH, MSF_MODID_MEA,

MAME_C339F59A049C8D3DE7F766C87349F83F, "(%s) (%d) failed to create message

property form!\n",

__FILE__, __LINE__));

meaMeDeletePropView();

return FALSE;

}

}

HDIa_widgetExtCloseTransitionAnimationwidget_MMI_close_transition_animation