stk: Send the AlphaId's to agent.
PATCH 1/2 stk: Send the AlphaId's to agent.
--- src/stk.c | 9 +++++++-- src/stkagent.c | 31 +++++++++++++++++++++++++++++++ src/stkagent.h | 3 +++ 3 files changed, 41 insertions(+), 2 deletions(-)
src/stk.c +7 -2
@@ -472,12 +472,17 @@ static void stk_alpha_id_set(struct ofono_stk *stk, const char *text, const struct stk_text_attribute *attr, const struct stk_icon_id *icon) { - /* TODO */ + char *alpha = dbus_apply_text_attributes(text, attr); + +if (alpha || icon) +stk_agent_display_alpha_id (stk->current_agent, alpha, icon); + +g_free (alpha); }static void stk_alpha_id_unset (struct ofono_stk *stk) { - /* TODO */ +stk_agent_request_cancel (stk->current_agent); }static int duration_to_msecs (const struct stk_duration *duration)
src/stkagent.c +31 -0
@@ -964,3 +964,34 @@ int stk_agent_loop_tone(struct stk_agent *agent, const char *text,return 0 ; } + +static void alpha_id_cb (DBusPendingCall *call,void *data) +{ +stk_agent_request_end (data); +} + +int stk_agent_display_alpha_id (struct stk_agent *agent,const char *text, +const struct stk_icon_id *icon) +{ +DBusConnection *conn =ofono_dbus_get_connection (); + + agent->msg =dbus_message_new_method_call (agent->bus, agent->path, +OFONO_SIM_APP_INTERFACE , +"DisplayAlphaId" ); +if (agent->msg ==NULL ) +return -ENOMEM ; + +dbus_message_append_args (agent->msg, +DBUS_TYPE_STRING , &text, +DBUS_TYPE_BYTE , &icon->id, +DBUS_TYPE_INVALID ); + +if (dbus_connection_send_with_reply (conn, agent->msg, &agent->call, +0 ) == FALSE || + agent->call ==NULL ) +return -EIO ; + +dbus_pending_call_set_notify (agent->call, alpha_id_cb, agent,NULL ); + +return 0 ; +}
src/stkagent.h +3 -0
@@ -137,3 +137,6 @@ int stk_agent_loop_tone(struct stk_agent *agent, const char *text,void append_menu_items_variant (DBusMessageIter *iter,const struct stk_menu_item *items); + +int stk_agent_display_alpha_id (struct stk_agent *agent,const char *text, +const struct stk_icon_id *icon);
Signature · 1 line
1.7.1.86.g0e460.dirty
PATCH 2/2 doc: Describe DisplayAlphaId().
--- doc/stk-api.txt | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
doc/stk-api.txt +10 -2
@@ -249,12 +249,20 @@ Methods byte RequestSelection(string title, byte icon_id, Possible Errors: [service].Error.SimToolkit.EndSession + void DisplayAlphaId(string text, byte icon_id) + + Supplies a text string and/or icon concerning the + current activity in the terminal and UICC. The + text should be displayed to the user on screen + until the call is canceled using Cancel(). This + method should not return. + void Cancel() Asks the agent to cancel any ongoing operation in progress. This is usually either because the agent - is taking too long to respond or the Sim Application - has terminated the session. + is taking too long to respond, the Sim Application + has terminated the session or a task has finished. void Release()
Signature · 1 line
1.7.1.86.g0e460.dirty
PATCH 1/1 sim: Set valid number length in empty EFmsisdn records.
In reply to Andrzej ZaborowskiValid number length range is 1 - 10 bytes, other values, such as 0xff, could potentially crash external parsers.
--- src/sim.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
src/sim.c +2 -0
@@ -437,6 +437,8 @@ static gboolean set_own_numbers(struct ofono_sim *sim, new_numbers = new_numbers->next; }else {memset (efmsisdn,0xff , sim->efmsisdn_length); +/* Set number length */ + efmsisdn[sim->efmsisdn_length -14 ] =1 ; } if (ofono_sim_write(req->sim, SIM_EFMSISDN_FILEID,
Signature · 1 line
1.7.1.86.g0e460.dirty
Re: [PATCH] sim: Set valid number length in empty EFmsisdn records.
Hi Andrew,
Quoted 6 lines · Andrzej Zaborowski
Valid number length range is 1 - 10 bytes, other values, such as
0xff, could potentially crash external parsers.--- src/sim.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Patch has been applied, thanks.
Regards,
-Denis