立即注册
查看: 1900|回复: 0

[原创] mt2503 [Framework]如何单独打开EVENT_LIST feature?如何添加一个新的EVENT_LIST...

发表于 2017-11-3 11:00:01 | 显示全部楼层 |阅读模式 来自 广东省深圳市
[Framework]如何单独打开EVENT_LISTfeature? 如何添加一个新的EVENT_LIST事件类型
[Description]
如何单独打开EVENT_LIST feature? 如何添加一个新的EVENT_LIST事件类型?
[Solution]
solution适用的SW version:09A 09B
1. 单独打开Event List Feature
在IdleNotificationManagerGprot.h文件中修改如下代码:
//#ifdef __OP12__
/*
* Note that the string resource also depend on __OP12__.
* To turn on event list for all project also have to reMOVe the compile option of string resource.
*/
#define __MMI_EVENT_LIST__
//#endif
在Res_IdleScreen.c文件中按照如下方式修改:
//#ifdef __OP12__
ADD_APPLICATION_STRING2(STR_ID_NMGR_MISSED_CALL_SUFFIX, "missed call", "missed call (suffix string)");
ADD_APPLICATION_STRING2(STR_ID_NMGR_MISSED_CALLS_SUFFIX, "missed calls", "missed calls (suffix string)");
...... //省略
//需要在这里添加新的通知项相关的字符串资源
//#endif /* __OP12__ */2. 在IdleNotificationManagerGprot.h文件中添加新的Application ID,仿照现有的Application ID写即可。
如:#define MMI_NMGR_APP_BT_RECV_FILE 0x0x00000400


3. 在IdleNotificationManagerConfig.c的mmi_nmgr_ctrl_tbl数组中添加新的表项
表项的数据结构为:
typedef struct
{
/* The type of the APP */
U32 type;
/* Query function to check whether new event is present. */
mmi_nmgr_query_new_event_func_t query_new_event;
/* Query function to get the information of the events. */
mmi_nmgr_query_func_t query_func;
/* Cancel function to cancel the notification of the new event. */
mmi_nmgr_cancel_func_t cancel_func;
} mmi_nmgr_ctrl_tbl_struct;
第一个参数是Application ID,
后三个参数需要APP自己定义函数注册进来。
query_new_event函数主要作用是query app是否有新的event需要通知,因此app需要自己维护是否有新的通知事件的状态。
query_func函数是由idle nmgr调用于获取app的通知信息的,在这个函数中会调用mmi_nmgr_answer函数将app的信息反馈给idle nmgr,同时还会通
过参数传入自己的左软键处理函数(即在一个event list通知项上点左软键后调用的函数)。
cancel_func函数在show出通知界面时点击左右软键均会调用,作用是让APP自己标记当前用户已经处理过idle通知了,当用户再进入其他界面返回
idle时不会对未读的事件再通知,除非再有一个新的通知事件到来。
上面这三个函数实现有赖于APP,APP必须自己维护自己的通知事件的状态(包括已处理,未处理等)。


4. 在IdleNotificationManagerGprot.h文件中修改MMI_NMGR_INTGR_APP_NORMAL_IDLE宏的定义,用"|"的方式添加新的Application ID.


5. 在IdleNotificationManagerConfig.c文件中的g_mmi_nmgr_event_list_item_config数组中添加和新的Application ID对应的表项
主要是定义两个字符串ID,一个用于通知单个新事件,一个用于通知多于一个新事件时,主要是通知字符串的单复数的差别。


6. 在IdleApp.c文件的mmi_idle_callbacks数组中添加新的表项
表项的数据结构为:
typedef struct _sublcd_master_app_info
{
FuncPtrRtn is_playing_f; /* callback to check if there is any pending event in idle screen */
FuncPtrRtn entry_sublcd_master_main_f; /* callback to execute the corresponding function in idle screen */
} IDLECALLBACKINFO;
第一个函数指针使用在mmi_nmgr_ctrl_tbl中注册的query_new_event对应的函数指针即可。

第二函数指针对应的函数中需要重新调用一下mmi_nmgr_notify函数,这样在在非IDLE界面来了新的事件通知后,回到idle界面后才会再显示出来。

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

合作/建议

TEL: 19168984579

工作时间:
周一到周五 9:00-11:30 13:30-19:30
  • 扫一扫关注公众号
  • 扫一扫打开小程序
Copyright © 2013-2024 一牛网 版权所有 All Rights Reserved. 帮助中心|隐私声明|联系我们|手机版|粤ICP备13053961号|营业执照|EDI证
在本版发帖搜索
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表