Merge lp:~phablet-team/ofono/ww10-update into lp:~phablet-team/ofono/ubuntu

Proposed by Tony Espy
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 6888
Merged at revision: 6888
Proposed branch: lp:~phablet-team/ofono/ww10-update
Merge into: lp:~phablet-team/ofono/ubuntu
Diff against target: 392 lines (+159/-59)
8 files modified
debian/changelog (+15/-0)
drivers/mtkmodem/voicecall.c (+2/-6)
gril/grilreply.c (+50/-12)
gril/grilrequest.c (+0/-9)
gril/grilutil.c (+20/-0)
gril/ril_constants.h (+12/-0)
plugins/mtk.c (+35/-7)
unit/test-grilrequest.c (+25/-25)
To merge this branch: bzr merge lp:~phablet-team/ofono/ww10-update
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+250665@code.launchpad.net

Commit message

[ Alfonso Sanchez-Beato ]
  * mtkmodem/voicecall.c: fix fast call answer (LP: #1422401)
    Fix problem that occurs when calls are answer too quickly.
  * mtk.c: wait for radio event before onlining (LP: #1419675)
    Ensure that the 2nd SIM slot on krillin is always
    initialized properly.
  * gril/grilrequest.c, unit: support empty APN
    Allow data calls with GPRS contexts that have empty APNs.
  * grilreply.c, grilutil.c, ril_constants.c: fix arale parcel parsing
    Fix parcel parsing issues with radio tech and SIM PIN retries.

Description of the change

This branch includes four bug fixes:

1. Fix a problem that occurs when calls are answered too quickly (LP: #1422401)

2. Fix parsing problems on arale with SIM PIN retries and radio technologies

3. Fix an issue where the 2nd slot on krillin isn't always recognized (LP: #1419675; REGRESSION)

4. Allow data calls to be established with GPRS contexts that have no APN specified.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Looks good to me

review: Approve
Revision history for this message
Tony Espy (awe) wrote :

Test Results:

1. mako - #111

Tested 'Empty APN' change. Prior to this change, ofono would not send a RIL_REQUEST_SETUP_DATA_CALL for a gprs context with an empty ( ie. "" ) access point name. As none of the operators in the US support this, all I could confirm is that the request is sent.

2. krillin - #122

 - tested fast answer of incoming calls
 - rebooted 12 times to ensure that 2nd SIM is properly recognized
   NOTE - 2 out of 12 attempts, after unlocking the 2nd SIM and then unlocking the phone,
   the 2nd SIM needed to be unlocked a 2nd time. It seems there's a race condition present.
 - verified that radio technology is parsed correctly ( unfortunately it's only ever edge in the US )
 - verified that SIM retries count is properly parsed

3. arale - #103

 - tested fast answer of incoming calls (6 times)
 - rebooted to ensure modem is properly recognized (6 times)
 - verified that radio technology is correct for 2G (edge) and 3G+ (HSPA)
 - verified that SIM PIN retries are parsed correctly

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Test results:

1. arale, vivid-proposed #110

  - SIM PIN retries parsing tested
  - No <INVALID> techs shown in log when ofono is run with debugging on
  - Tested fast answer
  - Sanity testing of outgoing calls and mobile data

2. krillin, 14.09-proposed #245

  - SIM PIN retries parsing tested
  - Tested fast answer
  - Sanity testing of outgoing calls and mobile data
  - Tested empty APN with movistar Spain operator, editing the <IMSI>/gprs file
Verified that the second slot is always recognized (10 reboots). I have not seen the issue with the PIN Tony mentions, although I activated the PIN for the second SIM. The setup was 2 SIMs inserted, and only the second one with PIN. In latest RTM release (#18) a bug appeared due to changes to libqofono: the welcome wizard did not ask for a SIM to be inserted and then reboot (libqofono had changed its behaviour to asynchronous). I wonder if it is the same issue. The unity changes to solve this already landed in RTM, for vivid I have seen they have just landed (line 40 in the spreadsheet), but maybe they are not yet in an image. It might be worth to wait for them and test again.

Revision history for this message
Tony Espy (awe) wrote :

Additional test results for krillin - #127:

Performed another 30+ reboots and finally isolated the PIN unlock proplem to unity8 bug:

https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1426876

Revision history for this message
Tony Espy (awe) wrote :

Also reported an indicator-network bug discovered during testing:

https://bugs.launchpad.net/ubuntu/+source/indicator-network/+bug/1426467

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-02-04 09:18:00 +0000
3+++ debian/changelog 2015-02-23 18:25:23 +0000
4@@ -1,3 +1,18 @@
5+ofono (1.12.bzr6888+15.04.20150223-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ [ Alfonso Sanchez-Beato ]
8+ * mtkmodem/voicecall.c: fix fast call answer (LP: #1422401)
9+ Fix problem that occurs when calls are answer too quickly.
10+ * mtk.c: wait for radio event before onlining (LP: #1419675)
11+ Ensure that the 2nd SIM slot on krillin is always
12+ initialized properly.
13+ * gril/grilrequest.c, unit: support empty APN
14+ Allow data calls with GPRS contexts that have empty APNs.
15+ * grilreply.c, grilutil.c, ril_constants.c: fix arale parcel parsing
16+ Fix parcel parsing issues with radio tech and SIM PIN retries.
17+
18+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 23 Feb 2015 12:45:21 -0500
19+
20 ofono (1.12.bzr6886+15.04.20150204-0ubuntu1) vivid; urgency=medium
21
22 [ Tony Espy ]
23
24=== modified file 'drivers/mtkmodem/voicecall.c'
25--- drivers/mtkmodem/voicecall.c 2015-01-13 13:14:13 +0000
26+++ drivers/mtkmodem/voicecall.c 2015-02-23 18:25:23 +0000
27@@ -57,15 +57,11 @@
28 struct ofono_voicecall *vc = user_data;
29 struct ril_voicecall_data *vd = ofono_voicecall_get_data(vc);
30
31- if (message->error == RIL_E_SUCCESS) {
32+ if (message->error == RIL_E_SUCCESS)
33 g_ril_print_response_no_args(vd->ril, message);
34-
35- /* Request the call list again */
36- ril_poll_clcc(vc);
37- } else {
38+ else
39 ofono_error("%s: RIL error %s", __func__,
40 ril_error_to_string(message->error));
41- }
42 }
43
44 static void mtk_incoming_notify(struct ril_msg *message, gpointer user_data)
45
46=== modified file 'gril/grilreply.c'
47--- gril/grilreply.c 2015-02-04 00:09:22 +0000
48+++ gril/grilreply.c 2015-02-23 18:25:23 +0000
49@@ -332,9 +332,33 @@
50 g_ril_append_print_buf(gril, "%s0x%x", print_buf, val);
51 break;
52 case RST_IX_RAT:
53- reply->tech = val;
54 g_ril_append_print_buf(gril, "%s%s", print_buf,
55 ril_radio_tech_to_string(val));
56+
57+ if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK) {
58+ switch (val) {
59+ case MTK_RADIO_TECH_HSDPAP:
60+ case MTK_RADIO_TECH_HSDPAP_UPA:
61+ case MTK_RADIO_TECH_HSUPAP:
62+ case MTK_RADIO_TECH_HSUPAP_DPA:
63+ val = RADIO_TECH_HSPAP;
64+ break;
65+ case MTK_RADIO_TECH_DC_DPA:
66+ val = RADIO_TECH_HSDPA;
67+ break;
68+ case MTK_RADIO_TECH_DC_UPA:
69+ val = RADIO_TECH_HSUPA;
70+ break;
71+ case MTK_RADIO_TECH_DC_HSDPAP:
72+ case MTK_RADIO_TECH_DC_HSDPAP_UPA:
73+ case MTK_RADIO_TECH_DC_HSDPAP_DPA:
74+ case MTK_RADIO_TECH_DC_HSPAP:
75+ val = RADIO_TECH_HSPAP;
76+ break;
77+ }
78+ }
79+
80+ reply->tech = val;
81 break;
82 default:
83 goto no_val;
84@@ -1305,22 +1329,36 @@
85 g_ril_append_print_buf(gril, "{%d}", retries[passwd_type]);
86 break;
87 case OFONO_RIL_VENDOR_MTK:
88- if (numint != 4) {
89- ofono_error("%s: wrong format", __func__);
90- goto no_data;
91- }
92-
93- retries[OFONO_SIM_PASSWORD_SIM_PIN] = parcel_r_int32(&rilp);
94- retries[OFONO_SIM_PASSWORD_SIM_PIN2] = parcel_r_int32(&rilp);
95- retries[OFONO_SIM_PASSWORD_SIM_PUK] = parcel_r_int32(&rilp);
96- retries[OFONO_SIM_PASSWORD_SIM_PUK2] = parcel_r_int32(&rilp);
97-
98- g_ril_append_print_buf(gril,
99+ /*
100+ * Some versions of MTK modem return just the retries for the
101+ * password just entered while others return the retries for all
102+ * passwords.
103+ */
104+ if (numint == 1) {
105+ retries[passwd_type] = parcel_r_int32(&rilp);
106+
107+ g_ril_append_print_buf(gril, "{%d}",
108+ retries[passwd_type]);
109+ } else if (numint == 4) {
110+ retries[OFONO_SIM_PASSWORD_SIM_PIN] =
111+ parcel_r_int32(&rilp);
112+ retries[OFONO_SIM_PASSWORD_SIM_PIN2] =
113+ parcel_r_int32(&rilp);
114+ retries[OFONO_SIM_PASSWORD_SIM_PUK] =
115+ parcel_r_int32(&rilp);
116+ retries[OFONO_SIM_PASSWORD_SIM_PUK2] =
117+ parcel_r_int32(&rilp);
118+
119+ g_ril_append_print_buf(gril,
120 "{pin %d, pin2 %d, puk %d, puk2 %d}",
121 retries[OFONO_SIM_PASSWORD_SIM_PIN],
122 retries[OFONO_SIM_PASSWORD_SIM_PIN2],
123 retries[OFONO_SIM_PASSWORD_SIM_PUK],
124 retries[OFONO_SIM_PASSWORD_SIM_PUK2]);
125+ } else {
126+ ofono_error("%s: wrong format", __func__);
127+ goto no_data;
128+ }
129 break;
130 case OFONO_RIL_VENDOR_INFINEON:
131 ofono_error("%s: infineon type should not arrive here",
132
133=== modified file 'gril/grilrequest.c'
134--- gril/grilrequest.c 2015-01-28 13:58:34 +0000
135+++ gril/grilrequest.c 2015-02-23 18:25:23 +0000
136@@ -240,7 +240,6 @@
137 gchar *tech_str;
138 gchar *auth_str;
139 gchar *profile_str;
140- size_t apn_len;
141 int num_param = SETUP_DATA_CALL_PARAMS;
142
143 DBG("");
144@@ -295,14 +294,6 @@
145 if (req->apn == NULL)
146 goto error;
147
148- apn_len = strlen(req->apn);
149- if (apn_len == 0 || apn_len > 100) {
150- ofono_error("%s: invalid apn length: %d",
151- __func__,
152- (int) apn_len);
153- goto error;
154- }
155-
156 if (req->auth_type > RIL_AUTH_BOTH) {
157 ofono_error("%s: Invalid auth type: %d",
158 __func__,
159
160=== modified file 'gril/grilutil.c'
161--- gril/grilutil.c 2015-01-28 13:58:34 +0000
162+++ gril/grilutil.c 2015-02-23 18:25:23 +0000
163@@ -266,6 +266,26 @@
164 return "HSPAP";
165 case RADIO_TECH_GSM:
166 return "GSM";
167+ case MTK_RADIO_TECH_HSDPAP:
168+ return "MTK_HSDPAP";
169+ case MTK_RADIO_TECH_HSDPAP_UPA:
170+ return "MTK_HSDPAP_UPA";
171+ case MTK_RADIO_TECH_HSUPAP:
172+ return "MTK_HSUPAP";
173+ case MTK_RADIO_TECH_HSUPAP_DPA:
174+ return "MTK_HSUPAP_DPA";
175+ case MTK_RADIO_TECH_DC_DPA:
176+ return "MTK_DC_DPA";
177+ case MTK_RADIO_TECH_DC_UPA:
178+ return "MTK_DC_UPA";
179+ case MTK_RADIO_TECH_DC_HSDPAP:
180+ return "MTK_DC_HSDPAP";
181+ case MTK_RADIO_TECH_DC_HSDPAP_UPA:
182+ return "MTK_DC_HSDPAP_UPA";
183+ case MTK_RADIO_TECH_DC_HSDPAP_DPA:
184+ return "MTK_DC_HSDPAP_DPA";
185+ case MTK_RADIO_TECH_DC_HSPAP:
186+ return "MTK_DC_HSPAP";
187 default:
188 if (g_snprintf(temp_str, sizeof(temp_str),
189 "<INVALID (%d)>",
190
191=== modified file 'gril/ril_constants.h'
192--- gril/ril_constants.h 2015-01-29 14:50:30 +0000
193+++ gril/ril_constants.h 2015-02-23 18:25:23 +0000
194@@ -139,6 +139,18 @@
195 #define RADIO_TECH_LTE 14
196 #define RADIO_TECH_HSPAP 15
197 #define RADIO_TECH_GSM 16
198+/* MTK specific values for radio technologies */
199+#define MTK_RADIO_TECH_BASE 128
200+#define MTK_RADIO_TECH_HSDPAP (MTK_RADIO_TECH_BASE + 1)
201+#define MTK_RADIO_TECH_HSDPAP_UPA (MTK_RADIO_TECH_BASE + 2)
202+#define MTK_RADIO_TECH_HSUPAP (MTK_RADIO_TECH_BASE + 3)
203+#define MTK_RADIO_TECH_HSUPAP_DPA (MTK_RADIO_TECH_BASE + 4)
204+#define MTK_RADIO_TECH_DC_DPA (MTK_RADIO_TECH_BASE + 5)
205+#define MTK_RADIO_TECH_DC_UPA (MTK_RADIO_TECH_BASE + 6)
206+#define MTK_RADIO_TECH_DC_HSDPAP (MTK_RADIO_TECH_BASE + 7)
207+#define MTK_RADIO_TECH_DC_HSDPAP_UPA (MTK_RADIO_TECH_BASE + 8)
208+#define MTK_RADIO_TECH_DC_HSDPAP_DPA (MTK_RADIO_TECH_BASE + 9)
209+#define MTK_RADIO_TECH_DC_HSPAP (MTK_RADIO_TECH_BASE + 10)
210
211 /* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
212 #define CALL_FAIL_UNOBTAINABLE_NUMBER 1
213
214=== modified file 'plugins/mtk.c'
215--- plugins/mtk.c 2015-01-29 14:50:30 +0000
216+++ plugins/mtk.c 2015-02-23 18:25:23 +0000
217@@ -133,6 +133,8 @@
218 ofono_bool_t has_3g;
219 struct mtk_settings_data *mtk_settings;
220 int fw_type;
221+ ofono_modem_online_cb_t online_cb;
222+ void *online_data;
223 };
224
225 /*
226@@ -249,7 +251,7 @@
227 if (radio_state != sock->radio_state) {
228 struct socket_data *sock_c = socket_complement(sock);
229
230- ofono_info("%s, state: %s", __func__,
231+ ofono_info("%s, %s, state: %s", __func__, sock->path,
232 ril_radio_state_to_string(radio_state));
233
234 /*
235@@ -278,6 +280,7 @@
236 message);
237
238 if (radio_state != md->radio_state) {
239+ gboolean success = FALSE;
240
241 ofono_info("%s, slot %d: state: %s md->ofono_online: %d",
242 __func__, md->slot,
243@@ -288,23 +291,35 @@
244
245 switch (radio_state) {
246 case RADIO_STATE_ON:
247- /* MTK */
248+ /* Deprecated in AOSP, but still used by MTK */
249 case RADIO_STATE_SIM_NOT_READY:
250 case RADIO_STATE_SIM_LOCKED_OR_ABSENT:
251 case RADIO_STATE_SIM_READY:
252+ if (md->ofono_online)
253+ success = TRUE;
254 break;
255
256 case RADIO_STATE_UNAVAILABLE:
257 case RADIO_STATE_OFF:
258- if (md->ofono_online) {
259- ofono_warn("%s, slot %d: radio powered off!",
260- __func__, md->slot);
261- }
262+ if (!md->ofono_online)
263+ success = TRUE;
264 break;
265 default:
266 /* Malformed parcel; no radio state == broken rild */
267 g_assert(FALSE);
268 }
269+
270+ if (md->online_cb != NULL) {
271+ if (success)
272+ CALLBACK_WITH_SUCCESS(md->online_cb,
273+ md->online_data);
274+ else
275+ CALLBACK_WITH_FAILURE(md->online_cb,
276+ md->online_data);
277+
278+ md->online_cb = NULL;
279+ md->online_data = NULL;
280+ }
281 }
282 }
283
284@@ -762,7 +777,20 @@
285 if (message->error == RIL_E_SUCCESS) {
286 g_ril_print_response_no_args(md->ril, message);
287
288- CALLBACK_WITH_SUCCESS(cb, cbd->data);
289+ /*
290+ * Although the request was successful, radio state might not
291+ * have changed yet. In that case we wait for the radio event,
292+ * otherwise RIL requests that depend on radio state will fail.
293+ */
294+ if ((md->ofono_online && md->radio_state != RADIO_STATE_OFF) ||
295+ (!md->ofono_online &&
296+ md->radio_state == RADIO_STATE_OFF)) {
297+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
298+ } else {
299+ /* Wait for the radio state event */
300+ md->online_cb = cb;
301+ md->online_data = cbd->data;
302+ }
303 } else {
304 ofono_error("%s: RIL error %s", __func__,
305 ril_error_to_string(message->error));
306
307=== modified file 'unit/test-grilrequest.c'
308--- unit/test-grilrequest.c 2015-02-04 00:09:22 +0000
309+++ unit/test-grilrequest.c 2015-02-23 18:25:23 +0000
310@@ -107,26 +107,13 @@
311 static const struct req_setup_data_call req_setup_data_call_invalid_5 = {
312 .tech = RADIO_TECH_GPRS,
313 .data_profile = RIL_DATA_PROFILE_DEFAULT,
314- .apn = "",
315+ .apn = "test.apn",
316+ .auth_type = 4,
317 };
318
319 static const struct req_setup_data_call req_setup_data_call_invalid_6 = {
320 .tech = RADIO_TECH_GPRS,
321 .data_profile = RIL_DATA_PROFILE_DEFAULT,
322- .apn = "12345678901234567890123456789012345678901234567890"
323- "123456789012345678901234567890123456789012345678901",
324-};
325-
326-static const struct req_setup_data_call req_setup_data_call_invalid_7 = {
327- .tech = RADIO_TECH_GPRS,
328- .data_profile = RIL_DATA_PROFILE_DEFAULT,
329- .apn = "test.apn",
330- .auth_type = 4,
331-};
332-
333-static const struct req_setup_data_call req_setup_data_call_invalid_8 = {
334- .tech = RADIO_TECH_GPRS,
335- .data_profile = RIL_DATA_PROFILE_DEFAULT,
336 .apn = "test.apn",
337 .auth_type = RIL_AUTH_BOTH,
338 .protocol = 3,
339@@ -173,6 +160,19 @@
340 .protocol = OFONO_GPRS_PROTO_IPV6,
341 };
342
343+static const struct req_setup_data_call req_setup_data_call_valid_5 = {
344+ .tech = RADIO_TECH_GPRS,
345+ .data_profile = RIL_DATA_PROFILE_DEFAULT,
346+ .apn = "",
347+};
348+
349+static const struct req_setup_data_call req_setup_data_call_valid_6 = {
350+ .tech = RADIO_TECH_GPRS,
351+ .data_profile = RIL_DATA_PROFILE_DEFAULT,
352+ .apn = "12345678901234567890123456789012345678901234567890"
353+ "123456789012345678901234567890123456789012345678901",
354+};
355+
356 static const char sim_read_info_path_valid_1[] = {0x3F, 0x00};
357
358 static const struct req_sim_read_info req_sim_read_info_valid_1 = {
359@@ -1473,16 +1473,6 @@
360 test_request_setup_data_call_invalid);
361
362 g_test_add_data_func("/testgrilrequest/gprs-context: "
363- "invalid SETUP_DATA_CALL Test 7",
364- &req_setup_data_call_invalid_7,
365- test_request_setup_data_call_invalid);
366-
367- g_test_add_data_func("/testgrilrequest/gprs-context: "
368- "invalid SETUP_DATA_CALL Test 8",
369- &req_setup_data_call_invalid_8,
370- test_request_setup_data_call_invalid);
371-
372- g_test_add_data_func("/testgrilrequest/gprs-context: "
373 "valid SETUP_DATA_CALL Test 1",
374 &req_setup_data_call_valid_1,
375 test_request_setup_data_call_valid);
376@@ -1502,6 +1492,16 @@
377 &req_setup_data_call_valid_4,
378 test_request_setup_data_call_valid);
379
380+ g_test_add_data_func("/testgrilrequest/gprs-context: "
381+ "valid SETUP_DATA_CALL Test 5",
382+ &req_setup_data_call_valid_5,
383+ test_request_setup_data_call_valid);
384+
385+ g_test_add_data_func("/testgrilrequest/gprs-context: "
386+ "valid SETUP_DATA_CALL Test 6",
387+ &req_setup_data_call_valid_6,
388+ test_request_setup_data_call_valid);
389+
390 g_test_add_data_func("/testgrilrequest/power: "
391 "valid POWER Test 1",
392 &power_valid_test_1,

Subscribers

People subscribed via source and target branches

to all changes: