static const int state_priority[] = {
[OFONO_CALL_STATE_DISCONNECTED] = 0,
[OFONO_CALL_STATE_ACTIVE] = 6,
- [OFONO_CALL_STATE_HELD] = 1,
+ [OFONO_CALL_STATE_HELD] = 3,
[OFONO_CALL_STATE_DIALING] = 5,
[OFONO_CALL_STATE_ALERTING] = 4,
- [OFONO_CALL_STATE_INCOMING] = 3,
- [OFONO_CALL_STATE_WAITING] = 2
+ [OFONO_CALL_STATE_INCOMING] = 2,
+ [OFONO_CALL_STATE_WAITING] = 1
};
if (ctx->calls.active) {
{
Callscreen *ctx = data;
OFono_Call_State state;
- Eina_Bool was_waiting, was_held;
+ Eina_Bool was_waiting, was_held, is_held;
const char *status, *sig = "hide,answer";
char *contact;
ctx, ctx->calls.active, ctx->calls.held, ctx->calls.waiting, c);
was_waiting = !!ctx->calls.waiting;
- was_held = !!ctx->calls.held;
+
+ was_held = (ctx->calls.held) && (ctx->calls.held != ctx->calls.active);
_calls_update(ctx);
elm_object_signal_emit(ctx->self, "hide,waiting", "call");
}
- if ((ctx->calls.held) && (!was_held))
+ is_held = (ctx->calls.held) && (ctx->calls.held != ctx->calls.active);
+
+ if ((is_held) && (!was_held))
elm_object_signal_emit(ctx->self, "show,held", "call");
- else if ((!ctx->calls.held) && (was_held)) {
+ else if ((!is_held) && (was_held)) {
elm_object_part_text_set(ctx->self, "elm.text.held", "");
elm_object_signal_emit(ctx->self, "hide,held", "call");
}
elm_object_signal_emit(ctx->self, sig, "call");
}
- if (ctx->calls.held) {
+ if (is_held) {
contact = _call_name_get(ctx, ctx->calls.held);
elm_object_part_text_set(ctx->self, "elm.text.held", contact);
free(contact);
elm_object_signal_emit(ctx->self, sig, "call");
}
- sig = ctx->calls.held ? "enable,merge" : "disable,merge";
+ sig = is_held ? "enable,merge" : "disable,merge";
elm_object_signal_emit(ctx->self, sig, "call");
sig = ctx->calls.held ? "enable,swap" : "disable,swap";