lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_set_click(label, false);
lv_label_set_text_id(label, WATCH_TEXT_ID_NO_NUM);
- lv_obj_align(label, obj, LV_ALIGN_CENTER, 0, 0);
+ lv_obj_align(label, obj, LV_ALIGN_CENTER, 0, -10);
return obj;
}
lv_obj_t * sos_create(lv_obj_t * activity_obj)
{
- if(true == mmi_sos_number_is_empty())
- {
- activity_obj = sos_no_contacts_create(NULL);
- return activity_obj;
- }
-
lv_watch_activity_ext_t activity_ext;
memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t));
activity_ext.actId = ACT_ID_SOS;
return activity_obj;
}
+lv_res_t mmi_key_back_sos_btn_action(void)
+{
+ lv_obj_t * phone_obj = lv_watch_get_activity_obj(ACT_ID_PHONE);
+ if(phone_obj)
+ {
+ /* don't process sos or shutdown */
+ return LV_RES_OK;
+ }
+
+ if(false == watch_modem_sim_present_check_req())
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ //shutdown_create_btn_action(NULL,LV_EVENT_CLICKED);
+ }
+ else
+ {
+ lv_watch_go_home();
+ lv_watch_png_cache_all_free();
+
+ if(true == mmi_sos_number_is_empty())
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ sos_no_contacts_create(NULL);
+ }
+ else
+ {
+ if(true == mmi_watch_tcp_connect_state_get()
+ && true == mmi_protocol_watch_bind_state_get()
+ )
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ mmi_protocol_action_sos();
+ }
+
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_t * obj = sos_create(NULL);
+ if(obj == NULL)
+ return LV_RES_OK;
+ }
+ }
+
+ return LV_RES_OK;
+}
+
lv_res_t sos_btn_action(lv_obj_t * btn)
{
(void)btn;
lv_watch_go_home();
lv_watch_png_cache_all_free();
- mmi_protocol_action_sos();
-
- lv_obj_t * obj = sos_create(NULL);
- if(obj == NULL)
- return LV_RES_OK;
+ if(true == mmi_sos_number_is_empty())
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ sos_no_contacts_create(NULL);
+ }
+ else
+ {
+ if(true == mmi_watch_tcp_connect_state_get()
+ && true == mmi_protocol_watch_bind_state_get()
+ )
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ mmi_protocol_action_sos();
+ }
+
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_t * obj = sos_create(NULL);
+ if(obj == NULL)
+ return LV_RES_OK;
+ }
}
return LV_RES_OK;