From: CCC <2393524978@qq.com> Date: Tue, 28 Nov 2023 08:53:26 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=1352ac8c56245049669c7648edf0b4e6d99ab7ae;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c index f661e184..ea41ec8c 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/sos/sos.c @@ -76,10 +76,12 @@ static void set_sos_status(uint8_t state) void sos_destory(void) { - if(SOS_GIF_ON == get_sos_status()) + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_SOS); + if(SOS_GIF_ON == get_sos_status() && (NULL != activity_obj)) { lv_watch_png_cache_all_free(); - lv_sos_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_SOS)); + //lv_sos_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_SOS)); + lv_sos_ext_t * ext = lv_obj_get_ext_attr(activity_obj); gif_close(ext->gif_info); ext->gif_info = NULL; lv_task_del(ext->gif_task_p); @@ -233,50 +235,43 @@ lv_obj_t * sos_create(lv_obj_t * activity_obj) lv_res_t mmi_key_back_sos_btn_action(void) { -#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ - if(true == mmi_watch_is_in_do_not_disturb_time()) + if(false == watch_modem_sim_present_check_req()) { - return LV_RES_OK; - } -#endif + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return LV_RES_INV; + } - lv_obj_t * phone_obj = lv_watch_get_activity_obj(ACT_ID_PHONE); - if(phone_obj) + if(true == mmi_active_screen_is_prohibit_interrupted() + #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + || true == mmi_watch_is_in_do_not_disturb_time() + #endif + ) { - /* don't process sos or shutdown */ - return LV_RES_OK; + return LV_RES_INV; } - if(false == watch_modem_sim_present_check_req()) + 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__); - //shutdown_create_btn_action(NULL,LV_EVENT_CLICKED); - } - else + sos_no_contacts_create(NULL); + } + else { - lv_watch_go_home(); - lv_watch_png_cache_all_free(); - - if(true == mmi_sos_number_is_empty()) + if(true == mmi_watch_tcp_connect_state_get() + && true == mmi_protocol_watch_bind_state_get() + ) { 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; + 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_INV; } return LV_RES_OK;