mirror of
https://github.com/sailfishos/ofono
synced 2025-11-24 19:39:44 +08:00
Compare commits
3 Commits
mer/1.23+g
...
upgrade-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bede136cc | ||
|
|
b3380c6eca | ||
|
|
f98e9a2193 |
@@ -436,9 +436,8 @@ static void ril_netreg_nitz_notify(GRilIoChannel *io, guint ril_event,
|
|||||||
{
|
{
|
||||||
struct ril_netreg *nd = user_data;
|
struct ril_netreg *nd = user_data;
|
||||||
GRilIoParser rilp;
|
GRilIoParser rilp;
|
||||||
struct ofono_network_time time;
|
int year, mon, mday, hour, min, sec, tzi, dst = 0;
|
||||||
int year, mon, mday, hour, min, sec, dst, tzi;
|
char tzs;
|
||||||
char tzs, tz[4];
|
|
||||||
gchar *nitz;
|
gchar *nitz;
|
||||||
|
|
||||||
GASSERT(ril_event == RIL_UNSOL_NITZ_TIME_RECEIVED);
|
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);
|
nitz = grilio_parser_get_utf8(&rilp);
|
||||||
|
|
||||||
DBG("%s", nitz);
|
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;
|
* Format: yy/mm/dd,hh:mm:ss(+/-)tz[,ds]
|
||||||
time.sec = sec;
|
* The ds part is considered optional, initialized to zero.
|
||||||
time.min = min;
|
*/
|
||||||
time.hour = hour;
|
if (nitz && sscanf(nitz, "%u/%u/%u,%u:%u:%u%c%u,%u",
|
||||||
time.mday = mday;
|
&year, &mon, &mday, &hour, &min, &sec, &tzs, &tzi,
|
||||||
time.mon = mon;
|
&dst) >= 8 && (tzs == '+' || tzs == '-')) {
|
||||||
time.year = 2000 + year;
|
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);
|
g_free(nitz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1253,7 +1253,7 @@ static guint ril_perso_change_state(struct ofono_sim *sim,
|
|||||||
if (req) {
|
if (req) {
|
||||||
id = grilio_queue_send_request_full(sd->q, req, code,
|
id = grilio_queue_send_request_full(sd->q, req, code,
|
||||||
ril_sim_pin_change_state_cb, ril_sim_pin_req_done,
|
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);
|
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,
|
id = grilio_queue_send_request_full(sd->q, req,
|
||||||
RIL_REQUEST_SET_FACILITY_LOCK,
|
RIL_REQUEST_SET_FACILITY_LOCK,
|
||||||
ril_sim_pin_change_state_cb, ril_sim_pin_req_done,
|
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);
|
grilio_request_unref(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -417,13 +417,18 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (status == OFONO_USSD_STATUS_TERMINATED) {
|
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)
|
if (ussd->pending == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
reply = __ofono_error_network_terminated(ussd->pending);
|
reply = __ofono_error_network_terminated(ussd->pending);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
|
if (status == OFONO_USSD_STATUS_NOT_SUPPORTED) {
|
||||||
|
|||||||
Reference in New Issue
Block a user