callscreen: do not show time for calls other than active or held.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 27 Aug 2012 07:17:43 +0000 (04:17 -0300)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Mon, 27 Aug 2012 07:17:43 +0000 (04:17 -0300)
dialer/callscreen.c

index 3cb65e5..1a1c320 100644 (file)
@@ -295,9 +295,14 @@ static void _call_elapsed_update(Callscreen *ctx, unsigned int id,
 {
        Edje_Message_Float msgf = {0};
        Evas_Object *ed;
+       OFono_Call_State state = ofono_call_state_get(c);
        double start, now, elapsed;
        char part[128], buf[128] = "";
 
+       if ((state != OFONO_CALL_STATE_ACTIVE) &&
+               (state != OFONO_CALL_STATE_HELD))
+               goto end;
+
        if (ofono_call_multiparty_get(c))
                start = ctx->multiparty.start;
        else
@@ -338,9 +343,14 @@ static void _activecall_elapsed_update(Callscreen *ctx)
 {
        Edje_Message_Float msgf = {0};
        Evas_Object *ed;
+       OFono_Call_State state = ofono_call_state_get(ctx->calls.current);
        double start, now, elapsed;
        char buf[128] = "";
 
+       if ((state != OFONO_CALL_STATE_ACTIVE) &&
+               (state != OFONO_CALL_STATE_HELD))
+               goto end;
+
        if (ofono_call_multiparty_get(ctx->calls.current))
                start = ctx->multiparty.start;
        else