fw/popups/phone_ui: fix call duration timer showing on unanswered calls#875
fw/popups/phone_ui: fix call duration timer showing on unanswered calls#875spr4bhu wants to merge 1 commit intocoredevices:mainfrom
Conversation
dce19fe to
39343f8
Compare
gmarull
left a comment
There was a problem hiding this comment.
please, follow commit guidelines
src/fw/popups/phone_ui.c
Outdated
| // Just pop the window - it'll handle all the cleanup | ||
| prv_window_pop(); | ||
| if (!s_phone_ui_data) { | ||
| return; | ||
| } | ||
| prv_stop_ringing(); | ||
| prv_stop_call_duration_timer(); | ||
| prv_action_bar_setup(PhoneCallActions_None); | ||
| prv_set_icon_resource(TIMELINE_RESOURCE_DISMISSED_PHONE_CALL); | ||
| prv_set_window_color(DECLINE_COLOR, true); | ||
| prv_set_status_text(ENDED); | ||
| prv_window_pop_with_delay(CALL_END_DELAY_MS); |
There was a problem hiding this comment.
this looks overcomplicated compared to the previous impl
There was a problem hiding this comment.
The previous phone_ui_handle_call_hide() just called prv_window_pop() which silently dismissed the UI with no status text or delay
I will simplify it to reuse the phone_ui_handle_call_end(bool call_accepted, bool disconnected) function
| if (call_accepted) { | ||
| prv_set_icon_resource(TIMELINE_RESOURCE_DURING_PHONE_CALL); | ||
| prv_set_window_color(ACCEPT_COLOR, true); | ||
| prv_set_status_text(ACCEPTED); | ||
| prv_set_status_text(ENDED); | ||
| } else { | ||
| prv_set_icon_resource(TIMELINE_RESOURCE_DISMISSED_PHONE_CALL); | ||
| prv_set_window_color(DECLINE_COLOR, true); | ||
| if (disconnected) { | ||
| prv_set_status_text(DISCONNECTED); | ||
| } else { | ||
| prv_set_status_text(DECLINED); | ||
| prv_set_status_text(ENDED); | ||
| } |
There was a problem hiding this comment.
both branches now set 'ENDED', code is hard to follow
There was a problem hiding this comment.
Both branches set ENDED because the status text is always 'Call Ended' regardless of whether the call was answered (The status appears on screen only when the call ends so ACCEPTED is the wrong thing to display)
the if else only controls the icon and colour
Signed-off-by: Shashvat Prabhu <shashvatprabhu2006@gmail.com>
39343f8 to
89483fc
Compare
This PR complements the mobileapp fix (coredevices/mobileapp#124) by adding guards against stale call_start_time values and explicit status text handling for all call end scenarios.
Changes:
Closes #808