Compare commits

...

3 Commits

Author SHA1 Message Date
Slava Monich
9bede136cc [ril] Handle NITZ string without DST part. Fixes JB#41890 2018-05-16 16:16:31 +03:00
Slava Monich
b3380c6eca [ril] Don't wait for SIM state change after enabling/disabling pin. JB#41508
There's no real need for that, but most importantly no SIM state change
event is generated by MTK RIL in such cases.
2018-05-14 18:51:31 +03:00
Slava Monich
f98e9a2193 ussd: Don't ignore data from TERMINATED response
Typically responses to USSD requests are coming with status
zero (NOTIFY) but some are coming with status 2 (TERMINATED).
If those contain data, the data should be presented to the user.

[ussd] Don't ignore data from TERMINATED response. Fixes JB#41734
2018-04-25 11:07:35 +03:00
3 changed files with 38 additions and 22 deletions

View File

@@ -436,9 +436,8 @@ static void ril_netreg_nitz_notify(GRilIoChannel *io, guint ril_event,
{
struct ril_netreg *nd = user_data;
GRilIoParser rilp;
struct ofono_network_time time;
int year, mon, mday, hour, min, sec, dst, tzi;
char tzs, tz[4];
int year, mon, mday, hour, min, sec, tzi, dst = 0;
char tzs;
gchar *nitz;
GASSERT(ril_event == RIL_UNSOL_NITZ_TIME_RECEIVED);
@@ -447,20 +446,32 @@ static void ril_netreg_nitz_notify(GRilIoChannel *io, guint ril_event,
nitz = grilio_parser_get_utf8(&rilp);
DBG("%s", nitz);
sscanf(nitz, "%u/%u/%u,%u:%u:%u%c%u,%u", &year, &mon, &mday,
&hour, &min, &sec, &tzs, &tzi, &dst);
snprintf(tz, sizeof(tz), "%c%d", tzs, tzi);
time.utcoff = atoi(tz) * 15 * 60;
time.dst = dst;
time.sec = sec;
time.min = min;
time.hour = hour;
time.mday = mday;
time.mon = mon;
time.year = 2000 + year;
/*
* Format: yy/mm/dd,hh:mm:ss(+/-)tz[,ds]
* The ds part is considered optional, initialized to zero.
*/
if (nitz && sscanf(nitz, "%u/%u/%u,%u:%u:%u%c%u,%u",
&year, &mon, &mday, &hour, &min, &sec, &tzs, &tzi,
&dst) >= 8 && (tzs == '+' || tzs == '-')) {
struct ofono_network_time time;
char tz[4];
snprintf(tz, sizeof(tz), "%c%d", tzs, tzi);
time.utcoff = atoi(tz) * 15 * 60;
time.dst = dst;
time.sec = sec;
time.min = min;
time.hour = hour;
time.mday = mday;
time.mon = mon;
time.year = 2000 + year;
ofono_netreg_time_notify(nd->netreg, &time);
} else {
ofono_warn("Failed to parse NITZ string \"%s\"", nitz);
}
ofono_netreg_time_notify(nd->netreg, &time);
g_free(nitz);
}

View File

@@ -1253,7 +1253,7 @@ static guint ril_perso_change_state(struct ofono_sim *sim,
if (req) {
id = grilio_queue_send_request_full(sd->q, req, code,
ril_sim_pin_change_state_cb, ril_sim_pin_req_done,
ril_sim_pin_cbd_new(sd, passwd_type, TRUE, cb, data));
ril_sim_pin_cbd_new(sd, passwd_type, FALSE, cb, data));
grilio_request_unref(req);
}
@@ -1309,7 +1309,7 @@ static void ril_sim_pin_change_state(struct ofono_sim *sim,
id = grilio_queue_send_request_full(sd->q, req,
RIL_REQUEST_SET_FACILITY_LOCK,
ril_sim_pin_change_state_cb, ril_sim_pin_req_done,
ril_sim_pin_cbd_new(sd, passwd_type, TRUE, cb, data));
ril_sim_pin_cbd_new(sd, passwd_type, FALSE, cb, data));
grilio_request_unref(req);
}

View File

@@ -417,13 +417,18 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
}
if (status == OFONO_USSD_STATUS_TERMINATED) {
ussd_change_state(ussd, USSD_STATE_IDLE);
if (ussd->state == USSD_STATE_ACTIVE && data && data_len > 0) {
/* Interpret that as a Notify */
status = OFONO_USSD_STATUS_NOTIFY;
} else {
ussd_change_state(ussd, USSD_STATE_IDLE);
if (ussd->pending == NULL)
return;
if (ussd->pending == NULL)
return;
reply = __ofono_error_network_terminated(ussd->pending);
goto out;
reply = __ofono_error_network_terminated(ussd->pending);
goto out;
}
}
if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {