Add support for USSD messages

The implementation is based on the code for USSD support that was used
before the rewrite of Samsung-RIL.
USSD messages in GSM7 format are decoded to UTF8. The decoding code
was adapted from huaweigeneric-ril[1].

Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>

[1]  https://github.com/DerArtem/huaweigeneric-ril
parent 56be0888
......@@ -33,6 +33,7 @@ LOCAL_SRC_FILES := \
network.c \
sound.c \
misc.c \
ss.c \
oem.c \
data.c \
rfs.c \
......
......@@ -170,6 +170,11 @@ struct ipc_dispatch_handler ipc_fmt_dispatch_handlers[] = {
.command = IPC_MISC_TIME_INFO,
.handler = ipc_misc_time_info,
},
/* SS */
{
.command = IPC_SS_USSD,
.handler = ipc_ss_ussd,
},
/* OEM */
{
.command = IPC_SVC_DISPLAY_SCREEN,
......@@ -440,6 +445,15 @@ struct ril_request_handler ril_request_handlers[] = {
.request = RIL_REQUEST_SCREEN_STATE,
.handler = ril_request_screen_state,
},
/* SS */
{
.request = RIL_REQUEST_SEND_USSD,
.handler = ril_request_send_ussd,
},
{
.request = RIL_REQUEST_CANCEL_USSD,
.handler = ril_request_cancel_ussd,
},
/* OEM */
{
.request = RIL_REQUEST_OEM_HOOK_RAW,
......
......@@ -366,6 +366,20 @@ int ipc_misc_time_info(struct ipc_message *message);
int ril_request_screen_state(void *data, size_t size, RIL_Token token);
/*
* SS
*/
enum {
USSD_ENCODING_UNKNOWN,
USSD_ENCODING_GSM7,
USSD_ENCODING_UCS2
};
int ipc_ss_ussd(struct ipc_message *message);
int ril_request_send_ussd(void *data, size_t size, RIL_Token token);
int ril_request_cancel_ussd(void *data, size_t size, RIL_Token token);
/*
* OEM
*/
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment