Merge lp:~rsalveti/phablet-extras/ofono_data_state_tracking into lp:phablet-extras/ofono

Proposed by Ricardo Salveti
Status: Merged
Approved by: Tony Espy
Approved revision: 53
Merged at revision: 50
Proposed branch: lp:~rsalveti/phablet-extras/ofono_data_state_tracking
Merge into: lp:phablet-extras/ofono
Diff against target: 71 lines (+37/-1)
2 files modified
debian/changelog (+7/-0)
drivers/rilmodem/gprs.c (+30/-1)
To merge this branch: bzr merge lp:~rsalveti/phablet-extras/ofono_data_state_tracking
Reviewer Review Type Date Requested Status
Tony Espy Approve
PS Jenkins bot continuous-integration Approve
Dave Morley (community) tested on maguro device Approve
Review via email: mp+177505@code.launchpad.net

Commit message

rilmodem/gprs.c: adding back state tracking for data network (only when ofono is already attached)

Description of the change

rilmodem/gprs.c: adding back state tracking for data network (only when ofono is already attached)

Adding back some of the logic that was removed when you fixed the roaming bug, as we need to track the data network status anyway (e.g when we get disconnected or when we start roaming).

To avoid a loop when notifying ofono, we only care to check different states if ofono_attached is true (which means we need to tell ofono if something changed). If the device is roaming, ofono_attached will be set to false at the second run, breaking the previous infinite loop logic.

Tested with maguro and I can always get attached, right after boot.

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
Martin Pitt (pitti) wrote :

I installed the .debs on my nexus4, and confirm that I can still successfully make phone calls, as well as that the "ofonod and rild eating CPU" problem did not come back.

Revision history for this message
Dave Morley (davmor2) wrote :

Okay found the debs in the output file. I've installed them, I've reboot and I have a connection. The rild/ofono cpu high percentage issue now seems to be gone. I've disconnected and reconnected several times and they all seemed to of functioned correctly.

review: Approve (tested on maguro device)
52. By Ricardo Salveti

rilmodem/gprs.c fixing coding style

53. By Ricardo Salveti

releasing version 1.12phablet11

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tony Espy (awe) :
review: Approve

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 2013-07-26 19:35:06 +0000
3+++ debian/changelog 2013-07-30 16:00:00 +0000
4@@ -1,3 +1,10 @@
5+ofono (1.12phablet11) saucy; urgency=low
6+
7+ * drivers/rilmodem/gprs.c: adding data network state tracking back, but
8+ handling it better to avoid the roaming bug
9+
10+ -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Tue, 30 Jul 2013 12:54:37 -0300
11+
12 ofono (1.12phablet10) saucy; urgency=low
13
14 * [rilmodem] Fixed disable GPRS bug (LP:1204644).
15
16=== modified file 'drivers/rilmodem/gprs.c'
17--- drivers/rilmodem/gprs.c 2013-07-27 22:51:04 +0000
18+++ drivers/rilmodem/gprs.c 2013-07-30 16:00:00 +0000
19@@ -67,6 +67,25 @@
20 int rild_status;
21 };
22
23+static void ril_gprs_registration_status(struct ofono_gprs *gprs,
24+ ofono_gprs_status_cb_t cb,
25+ void *data);
26+
27+static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
28+{
29+ struct ofono_gprs *gprs = user_data;
30+ struct gprs_data *gd = ofono_gprs_get_data(gprs);
31+
32+ g_assert(message->req == RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED);
33+
34+ /*
35+ * We are just want to track network data status change if ofono
36+ * itself is attached, so we avoid unnecessary data state requests.
37+ */
38+ if (gd->ofono_attached == TRUE)
39+ ril_gprs_registration_status(gprs, NULL, NULL);
40+}
41+
42 static void ril_gprs_set_pref_network_cb(struct ril_msg *message,
43 gpointer user_data)
44 {
45@@ -164,15 +183,25 @@
46 goto error;
47 }
48
49- if (gd->rild_status == -1)
50+ if (gd->rild_status == -1) {
51 ofono_gprs_register(gprs);
52
53+ /* RILD tracks data network state together with voice */
54+ g_ril_register(gd->ril, RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED,
55+ ril_gprs_state_change, gprs);
56+ }
57+
58 if (max_cids > gd->max_cids) {
59 DBG("Setting max cids to %d", max_cids);
60 gd->max_cids = max_cids;
61 ofono_gprs_set_cid_range(gprs, 1, max_cids);
62 }
63
64+ /* Just need to notify ofono if it's already attached */
65+ if (gd->ofono_attached && (gd->rild_status != status)) {
66+ ofono_gprs_status_notify(gprs, status);
67+ }
68+
69 gd->rild_status = status;
70
71 /*

Subscribers

People subscribed via source and target branches