Merge ~awe/network-manager/+git/ubuntu:touch-vivid2 into network-manager:touch-vivid

Proposed by Tony Espy
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 418ce9b8e301bd50592edade23d7ff062cdb4412
Merged at revision: 832d695d64c3d9fe37fd410e80da0723dc43b0e9
Proposed branch: ~awe/network-manager/+git/ubuntu:touch-vivid2
Merge into: network-manager:touch-vivid
Diff against target: 1538 lines (+832/-167)
24 files modified
debian/changelog (+22/-0)
debian/control (+19/-1)
debian/default-wifi-powersave-on.conf (+2/-0)
debian/indicator-network.pkla (+6/-0)
debian/libnm-dev.install (+1/-1)
debian/network-manager.install (+1/-1)
debian/patches/Add-modem-reconnect-delay-to-policy.patch (+115/-0)
debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch (+1/-1)
debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch (+32/-0)
debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch (+38/-0)
debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch (+37/-0)
debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch (+1/-0)
debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch (+32/-0)
debian/patches/Ignore-p2p-wifi-devices-from-android.patch (+34/-0)
debian/patches/Ignore-rild-modem-devices.patch (+27/-0)
debian/patches/Modify-NMDeviceModem-s-available-logic.patch (+4/-4)
debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch (+2/-0)
debian/patches/Track-killswitch-change-signals-from-urfkill.patch (+4/-4)
debian/patches/Update-dnsmasq-parameters.patch (+1/-1)
debian/patches/series (+8/-3)
debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch (+74/-89)
debian/patches/wwan-fix-ofono-connection-problems.patch (+343/-0)
debian/rules (+28/-11)
dev/null (+0/-51)
Reviewer Review Type Date Requested Status
Simon Fels Approve
Review via email: mp+296476@code.launchpad.net

Description of the change

This merge proposal is a backport of the stable 1.2.2 version of NetworkManager from yakkety to Touch, intended for the Touch overlay PPA.

Changes include ( besides switching to git ):

 - Dropping default WiFi powersave patch and installing a config file to do the same
 - Syncing the Touch NMManager device patches
 - Syncing the Touch WWAN patches
 - Adding a few Touch wpa_supplicant & platform patches
 - Restoring bug headers in some of the patches
 - Disabling ppp and gir in the build, due to build errors on vivid. This should have no impact on our images, and will be fixed when we move to xenial.
 - Adding a final patch to deal with ofono connection edge cases, and a mobile-data re-connect hang.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 893a649..813c545 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,25 @@
6+network-manager (1.2.2-0ubuntu1~vivid1) UNRELEASED; urgency=medium
7+
8+ * Backported to vivid for Ubuntu Touch:
9+ - Added d/indicator-network.pkla: policy kit config
10+ - Modified d/rules: disable bluez, gir*, ppp, systemd-journal,
11+ and install indicator-network polkit config.
12+ - Modified d/control: adjusted ppp-dev version, and restored
13+ -dbg package
14+ - Modified install files for temporary gir & ppp changes
15+ - Re-sync d/p/Ignore* nm-manager device patches from Touch
16+ - Re-synced d/p/wwan-add-support* patch from Touch
17+ - Re-stored patches from Touch:
18+ - Add-modem-reconnect-delay* (LP: #1461593)
19+ - indicator-network DBus 'sudo' policy
20+ - wpa_suppl scan fixes
21+ - OpenVPN EEXISTS bug (LP: #1579222)
22+ - Removed d/p/Set-the-default-powersave*.patch, and instead install
23+ a config file that accomplishes the same (LP: #1557026).
24+ - Add d/p/wwan-fix-ofono-connection-problems (LP: #1565717, #1579098).
25+
26+ -- Tony Espy <espy@canonical.com> Tue, 24 May 2016 15:30:42 -0400
27+
28 network-manager (1.2.2-0ubuntu1) yakkety; urgency=medium
29
30 * Rebase to upstream stable point release. (LP: #1574347)
31diff --git a/debian/control b/debian/control
32index 354dfd7..e8429c0 100644
33--- a/debian/control
34+++ b/debian/control
35@@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 9),
36 libnl-3-dev (>= 3.2.8),
37 libnl-route-3-dev (>= 3.2.8),
38 libnl-genl-3-dev (>= 3.2.8),
39- ppp-dev (>= 2.4.7-1+1),
40+ ppp-dev (>= 2.4.6),
41 libpolkit-gobject-1-dev,
42 libpolkit-agent-1-dev (>= 0.97),
43 libgnutls-dev,
44@@ -248,6 +248,24 @@ Description: GObject-based client library for NetworkManager (development files)
45 .
46 This package contains header and development files.
47
48+Package: network-manager-dbg
49+Architecture: linux-any
50+Section: debug
51+Priority: extra
52+Depends: ${misc:Depends},
53+ network-manager (= ${binary:Version}),
54+ libnm-util2 (= ${binary:Version}),
55+ libnm-glib4 (= ${binary:Version}),
56+ libnm-glib-vpn1 (= ${binary:Version})
57+Description: network management framework (debugging symbols)
58+ NetworkManager is a system network service that manages your network devices
59+ and connections, attempting to keep active network connectivity when
60+ available. It manages ethernet, WiFi, mobile broadband (WWAN), and PPPoE
61+ devices, and provides VPN integration with a variety of different VPN
62+ services.
63+ .
64+ This package contains detached debugging symbols.
65+
66 Package: gir1.2-networkmanager-1.0
67 Section: introspection
68 Architecture: linux-any
69diff --git a/debian/default-wifi-powersave-on.conf b/debian/default-wifi-powersave-on.conf
70new file mode 100644
71index 0000000..0580544
72--- /dev/null
73+++ b/debian/default-wifi-powersave-on.conf
74@@ -0,0 +1,2 @@
75+[connection]
76+wifi.powersave = 3
77\ No newline at end of file
78diff --git a/debian/indicator-network.pkla b/debian/indicator-network.pkla
79new file mode 100644
80index 0000000..4e64cae
81--- /dev/null
82+++ b/debian/indicator-network.pkla
83@@ -0,0 +1,6 @@
84+[indicator-network-service]
85+Identity=unix-group:sudo
86+Action=org.freedesktop.NetworkManager.*
87+ResultAny=yes
88+ResultInactive=no
89+ResultActive=yes
90diff --git a/debian/libnm-dev.install b/debian/libnm-dev.install
91index 4dddc86..58dd896 100644
92--- a/debian/libnm-dev.install
93+++ b/debian/libnm-dev.install
94@@ -2,4 +2,4 @@ usr/lib/*/pkgconfig/libnm.pc
95 usr/lib/*/libnm.so
96 usr/include/libnm/
97 usr/share/gtk-doc/html/libnm/
98-usr/share/gir-1.0/NM-1.0.gir
99+#usr/share/gir-1.0/NM-1.0.gir
100diff --git a/debian/network-manager.install b/debian/network-manager.install
101index c1012ff..950b918 100644
102--- a/debian/network-manager.install
103+++ b/debian/network-manager.install
104@@ -10,7 +10,7 @@ usr/lib/*/NetworkManager/libnm-settings-plugin-ibft.so
105 usr/lib/*/NetworkManager/libnm-settings-plugin-ofono.so
106 usr/lib/*/NetworkManager/libnm-device-plugin-*.so
107 usr/lib/*/NetworkManager/libnm-wwan.so
108-usr/lib/pppd/*/*.so
109+#usr/lib/pppd/*/*.so
110 usr/share/doc/NetworkManager/examples/
111 usr/share/locale/
112 usr/share/man/
113diff --git a/debian/patches/Add-modem-reconnect-delay-to-policy.patch b/debian/patches/Add-modem-reconnect-delay-to-policy.patch
114new file mode 100644
115index 0000000..5bdb503
116--- /dev/null
117+++ b/debian/patches/Add-modem-reconnect-delay-to-policy.patch
118@@ -0,0 +1,115 @@
119+From: Tony Espy <espy@canonical.com>
120+Date: Tue, 24 May 2016 20:59:42 -0400
121+Subject: Add modem reconnect delay to policy
122+
123+This patch introduces a 5s delay between retry activations
124+for modem devices. Otherwise, the activation attempts can
125+flood the modem all at once, and then trigger the reset_retries
126+timeout ( which defaults to 300s ).
127+
128+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593
129+---
130+ src/nm-policy.c | 34 +++++++++++++++++++++++++++-------
131+ 1 file changed, 27 insertions(+), 7 deletions(-)
132+
133+diff --git a/src/nm-policy.c b/src/nm-policy.c
134+index 07bcce8..5c59604 100644
135+--- a/src/nm-policy.c
136++++ b/src/nm-policy.c
137+@@ -931,7 +931,7 @@ sleeping_changed (NMManager *manager, GParamSpec *pspec, gpointer user_data)
138+ }
139+
140+ static void
141+-schedule_activate_check (NMPolicy *self, NMDevice *device)
142++schedule_activate_check (NMPolicy *self, NMDevice *device, guint delay)
143+ {
144+ NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self);
145+ ActivateData *data;
146+@@ -960,7 +960,12 @@ schedule_activate_check (NMPolicy *self, NMDevice *device)
147+ data = g_slice_new0 (ActivateData);
148+ data->policy = self;
149+ data->device = g_object_ref (device);
150+- data->autoactivate_id = g_idle_add (auto_activate_device, data);
151++
152++ if (delay)
153++ data->autoactivate_id = g_timeout_add_seconds (delay, auto_activate_device, data);
154++ else
155++ data->autoactivate_id = g_idle_add (auto_activate_device, data);
156++
157+ priv->pending_activation_checks = g_slist_append (priv->pending_activation_checks, data);
158+ }
159+
160+@@ -1155,6 +1160,7 @@ device_state_changed (NMDevice *device,
161+ NMIP4Config *ip4_config;
162+ NMIP6Config *ip6_config;
163+ NMSettingConnection *s_con = NULL;
164++ guint delay = 0;
165+
166+ switch (new_state) {
167+ case NM_DEVICE_STATE_FAILED:
168+@@ -1172,7 +1178,7 @@ device_state_changed (NMDevice *device,
169+
170+ nm_settings_connection_set_autoconnect_blocked_reason (connection, NM_DEVICE_STATE_REASON_NO_SECRETS);
171+ } else if (tries > 0) {
172+- _LOGD (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left",
173++ _LOGI (LOGD_DEVICE, "connection '%s' failed to autoconnect; %d tries left",
174+ nm_settings_connection_get_id (connection), tries);
175+ nm_settings_connection_set_autoconnect_retries (connection, tries - 1);
176+ }
177+@@ -1183,6 +1189,10 @@ device_state_changed (NMDevice *device,
178+ /* Schedule a handler to reset retries count */
179+ if (!priv->reset_retries_id) {
180+ gint32 retry_time = nm_settings_connection_get_autoconnect_retry_time (connection);
181++ gint32 actual_time = MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ());
182++
183++ _LOGI (LOGD_DEVICE, "Disabling autoconnect for connection '%s'; setting retry of %d.",
184++ nm_connection_get_id (NM_CONNECTION (connection)), actual_time);
185+
186+ g_warn_if_fail (retry_time != 0);
187+ priv->reset_retries_id = g_timeout_add_seconds (MAX (0, retry_time - nm_utils_get_monotonic_timestamp_s ()), reset_connections_retries, self);
188+@@ -1250,7 +1260,17 @@ device_state_changed (NMDevice *device,
189+ update_routing_and_dns (self, FALSE);
190+
191+ /* Device is now available for auto-activation */
192+- schedule_activate_check (self, device);
193++ if (nm_device_get_device_type (device) == NM_DEVICE_TYPE_MODEM)
194++ delay = 5;
195++
196++ if (connection)
197++ _LOGI (LOGD_DEVICE, "Connection '%s' disconnected, scheduling activate_check in %u seconds.",
198++ nm_connection_get_id (NM_CONNECTION (connection)), delay);
199++ else
200++ _LOGI (LOGD_DEVICE, "Device '%s' has no connection; scheduling activate_check in %u seconds.",
201++ nm_device_get_iface (device), delay);
202++
203++ schedule_activate_check (self, device, delay);
204+ break;
205+
206+ case NM_DEVICE_STATE_PREPARE:
207+@@ -1363,7 +1383,7 @@ device_autoconnect_changed (NMDevice *device,
208+ NMPolicy *self = priv->self;
209+
210+ if (nm_device_autoconnect_allowed (device))
211+- schedule_activate_check (self, device);
212++ schedule_activate_check (self, device, 0);
213+ }
214+
215+ static void
216+@@ -1372,7 +1392,7 @@ device_recheck_auto_activate (NMDevice *device, gpointer user_data)
217+ NMPolicyPrivate *priv = user_data;
218+ NMPolicy *self = priv->self;
219+
220+- schedule_activate_check (self, device);
221++ schedule_activate_check (self, device, 0);
222+ }
223+
224+ static void
225+@@ -1586,7 +1606,7 @@ schedule_activate_all (NMPolicy *self)
226+ const GSList *iter;
227+
228+ for (iter = nm_manager_get_devices (priv->manager); iter; iter = g_slist_next (iter))
229+- schedule_activate_check (self, NM_DEVICE (iter->data));
230++ schedule_activate_check (self, NM_DEVICE (iter->data), 0);
231+ }
232+
233+ static void
234diff --git a/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch b/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
235index 3fc4826..a10ac51 100644
236--- a/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
237+++ b/debian/patches/Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
238@@ -6,7 +6,7 @@ This patch adds get/set methods to NMSettingsConnection for the
239 reset_retries_timeout. This allows sub-classes to override the
240 default setting ( 300s ).
241
242-Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1461593
243+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1461593
244 ---
245 src/settings/nm-settings-connection.c | 18 +++++++++++++++++-
246 src/settings/nm-settings-connection.h | 3 +++
247diff --git a/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch b/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
248new file mode 100644
249index 0000000..814de4b
250--- /dev/null
251+++ b/debian/patches/Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
252@@ -0,0 +1,32 @@
253+From: Tony Espy <espy@canonical.com>
254+Date: Tue, 24 May 2016 21:19:06 -0400
255+Subject: Add sudo policy to DBus conf for indicator-network
256+
257+This patch adds a 'sudo' group DBus policy to allow
258+indicator-network to interact with the NetworkManager and
259+NetworkManager.SecretAgent interfaces.
260+
261+This was previously handled by a dirty hack/hook in the
262+livecd-rootfs tool used to build touch images.
263+
264+---
265+ src/org.freedesktop.NetworkManager.conf | 5 +++++
266+ 1 file changed, 5 insertions(+)
267+
268+diff --git a/src/org.freedesktop.NetworkManager.conf b/src/org.freedesktop.NetworkManager.conf
269+index 35ed4e7..58e6c7f 100644
270+--- a/src/org.freedesktop.NetworkManager.conf
271++++ b/src/org.freedesktop.NetworkManager.conf
272+@@ -2,6 +2,12 @@
273+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
274+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
275+ <busconfig>
276++ <policy group="sudo">
277++ <allow send_destination="org.freedesktop.NetworkManager"
278++ send_interface="org.freedesktop.NetworkManager"/>
279++ <allow send_destination="org.freedesktop.NetworkManager"
280++ send_interface="org.freedesktop.NetworkManager.SecretAgent"/>
281++ </policy>
282+ <policy user="root">
283+ <allow own="org.freedesktop.NetworkManager"/>
284+ <allow send_destination="org.freedesktop.NetworkManager"/>
285diff --git a/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch
286new file mode 100644
287index 0000000..88f9891
288--- /dev/null
289+++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-exits.patch
290@@ -0,0 +1,38 @@
291+From: Tony Espy <espy@canonical.com>
292+Date: Tue, 24 May 2016 21:36:20 -0400
293+Subject: Clear WiFi requested_scan if suppl exits
294+
295+It's possible for wpa_supplicant to exit with an
296+outstanding requested_scan pending. This can lead
297+to a stall condition where scanning no longer occurs.
298+---
299+ src/devices/wifi/nm-device-wifi.c | 9 ++++++++-
300+ 1 file changed, 8 insertions(+), 1 deletion(-)
301+
302+diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
303+index f6325a6..b147409 100644
304+--- a/src/devices/wifi/nm-device-wifi.c
305++++ b/src/devices/wifi/nm-device-wifi.c
306+@@ -246,6 +246,13 @@ supplicant_interface_release (NMDeviceWifi *self)
307+
308+ priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
309+
310++ if (priv->requested_scan) {
311++ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): reset requested_scan flag to FALSE",
312++ nm_device_get_iface (NM_DEVICE (self)));
313++ priv->requested_scan = FALSE;
314++ nm_device_remove_pending_action (NM_DEVICE (self), "scan", TRUE);
315++ }
316++
317+ nm_clear_g_source (&priv->pending_scan_id);
318+
319+ /* Reset the scan interval to be pretty frequent when disconnected */
320+@@ -1915,7 +1922,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
321+ priv->requested_scan = FALSE;
322+ }
323+
324+- cancel_pending_scan (self);
325++ nm_clear_g_source (&priv->pending_scan_id);
326+ request_wireless_scan (self, NULL);
327+ }
328+ default:
329diff --git a/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch b/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
330new file mode 100644
331index 0000000..d81b534
332--- /dev/null
333+++ b/debian/patches/Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
334@@ -0,0 +1,37 @@
335+From: Tony Espy <espy@canonical.com>
336+Date: Tue, 24 May 2016 21:22:48 -0400
337+Subject: Clear WiFi requested_scan if suppl goes INACTIVE
338+
339+It's possible for wpa_supplicant to transition to INACTIVE
340+state with an outstanding requested_scan pending. This can
341+lead to a stall condition where scanning no longer occurs.
342+---
343+ src/devices/wifi/nm-device-wifi.c | 15 +++++++++++++++
344+ 1 file changed, 15 insertions(+)
345+
346+diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
347+index bacd5e6..f6325a6 100644
348+--- a/src/devices/wifi/nm-device-wifi.c
349++++ b/src/devices/wifi/nm-device-wifi.c
350+@@ -1903,6 +1903,21 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
351+ else
352+ _LOGI (LOGD_DEVICE | LOGD_WIFI, "supplicant interface keeps failing, giving up");
353+ break;
354++ case NM_SUPPLICANT_INTERFACE_STATE_INACTIVE:
355++ if (old_state == NM_SUPPLICANT_INTERFACE_STATE_SCANNING) {
356++ nm_log_warn (LOGD_HW | LOGD_WIFI, "(%s): supplicant state: SCANNING -> INACTIVE",
357++ nm_device_get_iface (NM_DEVICE (self)));
358++
359++ if (priv->requested_scan) {
360++ nm_log_dbg (LOGD_WIFI_SCAN, "(%s): clearing requested_scan",
361++ nm_device_get_iface (NM_DEVICE (self)));
362++
363++ priv->requested_scan = FALSE;
364++ }
365++
366++ cancel_pending_scan (self);
367++ request_wireless_scan (self, NULL);
368++ }
369+ default:
370+ break;
371+ }
372diff --git a/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch b/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
373index fae01f9..648dd6f 100644
374--- a/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
375+++ b/debian/patches/Filter-DNS-servers-to-add-to-dnsmasq-based-on-availa.patch
376@@ -3,6 +3,7 @@ Date: Fri, 13 May 2016 11:00:11 +0800
377 Subject: Filter DNS servers to add to dnsmasq based on availability and VPN
378 status
379
380+Bug-Ubuntu: https://bugs.launchpad.net/bugs/898224
381 ---
382 src/dns-manager/nm-dns-dnsmasq.c | 47 +++++++++++++++++++++++++++++++++-------
383 1 file changed, 39 insertions(+), 8 deletions(-)
384diff --git a/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch b/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
385new file mode 100644
386index 0000000..9a538f0
387--- /dev/null
388+++ b/debian/patches/Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
389@@ -0,0 +1,32 @@
390+From: Tony Espy <espy@canonical.com>
391+Date: Tue, 24 May 2016 21:41:18 -0400
392+Subject: Fix openvpn by handling do_add_route EEXISTS
393+
394+This patch fixes issues with the updated Netlink code in
395+NMLinuxPlatform and ineroperability with older ( <= 3.10 )
396+kernels.
397+
398+Add EEXIST logic similar to logic found in 0.9.10 to the
399+NMLinuxPlatform do_add_addroute().
400+
401+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579222
402+---
403+ src/platform/nm-linux-platform.c | 5 +++++
404+ 1 file changed, 5 insertions(+)
405+
406+diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
407+index c504550..f453b6e 100644
408+--- a/src/platform/nm-linux-platform.c
409++++ b/src/platform/nm-linux-platform.c
410+@@ -3915,6 +3915,11 @@ do_add_addrroute (NMPlatform *platform, const NMPObject *obj_id, struct nl_msg *
411+ obj = nmp_cache_lookup_obj (priv->cache, obj_id);
412+ }
413+
414++ if (seq_result == -EEXIST) {
415++ _LOGI ("do_add_addroute: seq_restul == -EEXISTS; treating as OK");
416++ seq_result = WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK;
417++ }
418++
419+ /* Adding is only successful, if kernel reported success *and* we have the
420+ * expected object in cache afterwards. */
421+ return obj && seq_result == WAIT_FOR_NL_RESPONSE_RESULT_RESPONSE_OK;
422diff --git a/debian/patches/Ignore-p2p-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch
423new file mode 100644
424index 0000000..c09e7d3
425--- /dev/null
426+++ b/debian/patches/Ignore-p2p-wifi-devices-from-android.patch
427@@ -0,0 +1,34 @@
428+From: Tony Espy <espy@canonical.com>
429+Date: Fri, 3 Jun 2016 15:50:53 -0400
430+Subject: Ignore p2p wifi devices from android
431+
432+This patch causes NMManager to ignore any p2p WiFi
433+devices exposed by Android WiFi drivers.
434+
435+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1099983
436+---
437+ src/nm-manager.c | 11 +++++++++++
438+ 1 file changed, 11 insertions(+)
439+
440+diff --git a/src/nm-manager.c b/src/nm-manager.c
441+index c2ed1da..8cf70c7 100644
442+--- a/src/nm-manager.c
443++++ b/src/nm-manager.c
444+@@ -2097,6 +2097,17 @@ platform_link_added (NMManager *self,
445+ return;
446+ }
447+
448++ /*
449++ * Ubuntu: Explicitly unmanage all p2p Wi-Fi devices which are
450++ * managed externally in the case of Wi-Fi Direct.
451++ */
452++ NMDeviceType devtype = nm_device_get_device_type (device);
453++ if ((plink->type == NM_LINK_TYPE_WIFI)
454++ && g_strstr_len (plink->name, NM_STRLEN ("p2p"), "p2p")) {
455++ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name);
456++ return;
457++ }
458++
459+ device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error);
460+ if (!device) {
461+ if (!ignore) {
462diff --git a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch b/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch
463deleted file mode 100644
464index c567c96..0000000
465--- a/debian/patches/Ignore-p2p0-wifi-devices-from-android.patch
466+++ /dev/null
467@@ -1,29 +0,0 @@
468-From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
469-Date: Fri, 13 May 2016 11:08:30 +0800
470-Subject: Ignore p2p0 wifi devices from android.
471-
472----
473- src/nm-manager.c | 10 ++++++++++
474- 1 file changed, 10 insertions(+)
475-
476-diff --git a/src/nm-manager.c b/src/nm-manager.c
477-index 769662c..b770139 100644
478---- a/src/nm-manager.c
479-+++ b/src/nm-manager.c
480-@@ -2105,6 +2105,16 @@ platform_link_added (NMManager *self,
481- !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni")))
482- return;
483-
484-+ /*
485-+ * Ubuntu: Explicitly unmanage p2p Wi-Fi devices exposed by Android JB Wi-Fi drivers.
486-+ */
487-+ NMDeviceType devtype = nm_device_get_device_type (device);
488-+ if ((plink->type == NM_LINK_TYPE_WIFI)
489-+ && !strncmp (plink->name, "p2p0", NM_STRLEN ("p2p0"))) {
490-+ nm_log_info (LOGD_HW, "(%s): ignoring P2P wireless iface", plink->name);
491-+ return;
492-+ }
493-+
494- if (device == NULL) {
495- switch (plink->type) {
496- case NM_LINK_TYPE_WWAN_ETHERNET:
497diff --git a/debian/patches/Ignore-rild-modem-devices.patch b/debian/patches/Ignore-rild-modem-devices.patch
498new file mode 100644
499index 0000000..c0cc6ae
500--- /dev/null
501+++ b/debian/patches/Ignore-rild-modem-devices.patch
502@@ -0,0 +1,27 @@
503+From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
504+Date: Fri, 13 May 2016 11:08:17 +0800
505+Subject: Ignore rild modem devices.
506+
507+---
508+ src/nm-manager.c | 8 ++++++++
509+ 1 file changed, 8 insertions(+)
510+
511+diff --git a/src/nm-manager.c b/src/nm-manager.c
512+index 10aa3d7..c2ed1da 100644
513+--- a/src/nm-manager.c
514++++ b/src/nm-manager.c
515+@@ -2089,6 +2089,14 @@ platform_link_added (NMManager *self,
516+ gboolean ignore = FALSE;
517+ gs_free_error GError *error = NULL;
518+
519++ /* Ignore rild modem devices, which will be handled by their modem parent */
520++ if (g_strstr_len (plink->name, NM_STRLEN ("rmnet"), "rmnet") ||
521++ g_strstr_len (plink->name, NM_STRLEN ("rev_rmnet"), "rev_rmnet") ||
522++ g_strstr_len (plink->name, NM_STRLEN ("ccmni"), "ccmni")) {
523++ _LOGW (LOGD_HW, "Ignoring rild modem device: %s", plink->name);
524++ return;
525++ }
526++
527+ device = nm_device_factory_create_device (factory, plink->name, plink, NULL, &ignore, &error);
528+ if (!device) {
529+ if (!ignore) {
530diff --git a/debian/patches/Ignore-rmnet_usbX-devices.patch b/debian/patches/Ignore-rmnet_usbX-devices.patch
531deleted file mode 100644
532index f973a5f..0000000
533--- a/debian/patches/Ignore-rmnet_usbX-devices.patch
534+++ /dev/null
535@@ -1,25 +0,0 @@
536-From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
537-Date: Fri, 13 May 2016 11:08:17 +0800
538-Subject: Ignore rmnet_usbX devices.
539-
540----
541- src/nm-manager.c | 6 ++++++
542- 1 file changed, 6 insertions(+)
543-
544-diff --git a/src/nm-manager.c b/src/nm-manager.c
545-index 10aa3d7..769662c 100644
546---- a/src/nm-manager.c
547-+++ b/src/nm-manager.c
548-@@ -2099,6 +2099,12 @@ platform_link_added (NMManager *self,
549- }
550- }
551-
552-+ /* Ignore rmnet_usb devices, which will be handled by their modem parent
553-+ */
554-+ if (!strncmp (plink->name, "rmnet_usb", NM_STRLEN ("rmnet_usb")) ||
555-+ !strncmp (plink->name, "ccmni", NM_STRLEN ("ccmni")))
556-+ return;
557-+
558- if (device == NULL) {
559- switch (plink->type) {
560- case NM_LINK_TYPE_WWAN_ETHERNET:
561diff --git a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
562index 1630362..6f5a018 100644
563--- a/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
564+++ b/debian/patches/Modify-NMDeviceModem-s-available-logic.patch
565@@ -9,16 +9,16 @@ meaning the device is in such a state that it can be activated.
566 This change prevents NM from trying to activate a modem which
567 is not yet ready to be activated.
568
569-Bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1445080
570+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1445080
571 ---
572 src/devices/wwan/nm-device-modem.c | 7 ++++---
573 1 file changed, 4 insertions(+), 3 deletions(-)
574
575 diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
576-index a7523f5..774fd24 100644
577+index 39a34db..3bbd170 100644
578 --- a/src/devices/wwan/nm-device-modem.c
579 +++ b/src/devices/wwan/nm-device-modem.c
580-@@ -428,14 +428,15 @@ check_connection_available (NMDevice *device,
581+@@ -410,14 +410,15 @@ check_connection_available (NMDevice *device,
582 return FALSE;
583
584 state = nm_modem_get_state (priv->modem);
585@@ -36,7 +36,7 @@ index a7523f5..774fd24 100644
586 return TRUE;
587 }
588
589-@@ -616,7 +617,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
590+@@ -598,7 +599,7 @@ is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags)
591
592 g_assert (priv->modem);
593 modem_state = nm_modem_get_state (priv->modem);
594diff --git a/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch b/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
595index 83d8940..0d67e33 100644
596--- a/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
597+++ b/debian/patches/Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
598@@ -13,6 +13,8 @@ This is a very simple implementation of such re-ordering, just add the IPv6
599 nameservers first when building the list of IP configurations (which will
600 include nameservers, search domains, etc.), the IPv4 data will be appended
601 right after.
602+
603+Bug-Ubuntu: https://bugs.launchpad.net/bugs/936712
604 ---
605 src/dns-manager/nm-dns-manager.c | 8 ++++----
606 1 file changed, 4 insertions(+), 4 deletions(-)
607diff --git a/debian/patches/Set-the-default-powersave-value-to-enabled.patch b/debian/patches/Set-the-default-powersave-value-to-enabled.patch
608deleted file mode 100644
609index 7449719..0000000
610--- a/debian/patches/Set-the-default-powersave-value-to-enabled.patch
611+++ /dev/null
612@@ -1,51 +0,0 @@
613-From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
614-Date: Fri, 13 May 2016 11:08:10 +0800
615-Subject: Set the default powersave value to enabled
616-
617-This is an Ubuntu-specific patch to enable wireless powersave by default.
618-
619-Should it not work for you for some reason, you can safely add:
620-
621-powersave=0
622-
623-to the section:
624-[802-11-wireless]
625-
626-In the configuration file for your connection under
627-/etc/NetworkManager/system-connections/.
628----
629- libnm-util/nm-setting-wireless.c | 7 +++++--
630- 1 file changed, 5 insertions(+), 2 deletions(-)
631-
632-diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
633-index 234d7ba..613539d 100644
634---- a/libnm-util/nm-setting-wireless.c
635-+++ b/libnm-util/nm-setting-wireless.c
636-@@ -675,7 +675,7 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting)
637- guint32
638- nm_setting_wireless_get_powersave (NMSettingWireless *setting)
639- {
640-- g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0);
641-+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 1);
642-
643- return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave;
644- }
645-@@ -885,6 +885,9 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
646- static void
647- nm_setting_wireless_init (NMSettingWireless *setting)
648- {
649-+ NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
650-+
651-+ priv->powersave = 1;
652- }
653-
654- static void
655-@@ -1283,7 +1286,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
656- g_object_class_install_property
657- (object_class, PROP_POWERSAVE,
658- g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "",
659-- 0, G_MAXUINT32, 0,
660-+ 0, G_MAXUINT32, 1,
661- G_PARAM_READWRITE |
662- G_PARAM_STATIC_STRINGS));
663- }
664diff --git a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
665index 45b668e..f96673b 100644
666--- a/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
667+++ b/debian/patches/Track-killswitch-change-signals-from-urfkill.patch
668@@ -79,7 +79,7 @@ index 2495bbc..49028f1 100644
669 if SUSPEND_RESUME_UPOWER
670 libNetworkManager_la_SOURCES += nm-sleep-monitor-upower.c
671 diff --git a/src/nm-manager.c b/src/nm-manager.c
672-index b770139..04b0a43 100644
673+index 8cf70c7..8f45b0f 100644
674 --- a/src/nm-manager.c
675 +++ b/src/nm-manager.c
676 @@ -34,6 +34,7 @@
677@@ -108,7 +108,7 @@ index b770139..04b0a43 100644
678
679 gboolean startup;
680 gboolean devices_inited;
681-@@ -5210,6 +5215,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr,
682+@@ -5213,6 +5218,49 @@ dbus_connection_changed_cb (NMBusManager *dbus_mgr,
683
684 /**********************************************************************/
685
686@@ -158,7 +158,7 @@ index b770139..04b0a43 100644
687 NM_DEFINE_SINGLETON_REGISTER (NMManager);
688
689 NMManager *
690-@@ -5231,6 +5279,44 @@ nm_connection_provider_get (void)
691+@@ -5234,6 +5282,44 @@ nm_connection_provider_get (void)
692 return p;
693 }
694
695@@ -203,7 +203,7 @@ index b770139..04b0a43 100644
696 NMManager *
697 nm_manager_setup (const char *state_file,
698 gboolean initial_net_enabled,
699-@@ -5311,16 +5397,38 @@ constructed (GObject *object)
700+@@ -5314,16 +5400,38 @@ constructed (GObject *object)
701 "rfkill-changed",
702 G_CALLBACK (rfkill_manager_rfkill_changed_cb),
703 self);
704diff --git a/debian/patches/Update-dnsmasq-parameters.patch b/debian/patches/Update-dnsmasq-parameters.patch
705index 20d8f91..3b83b82 100644
706--- a/debian/patches/Update-dnsmasq-parameters.patch
707+++ b/debian/patches/Update-dnsmasq-parameters.patch
708@@ -6,7 +6,7 @@ Disable caching since it's a potential security issue (local dns cache poisoning
709
710 See also: https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-dns-resolving
711
712-=== modified file 'src/dns-manager/nm-dns-dnsmasq.c'
713+Bug-Ubuntu: https://bugs.launchpad.net/bugs/903854
714 ---
715 src/dns-manager/nm-dns-dnsmasq.c | 4 ++--
716 src/dns-manager/nm-dns-manager.c | 6 +++---
717diff --git a/debian/patches/series b/debian/patches/series
718index f0a8f73..421ffe9 100644
719--- a/debian/patches/series
720+++ b/debian/patches/series
721@@ -12,13 +12,18 @@ Order-IPv6-nameservers-before-IPv4-for-dns-plugins-d.patch
722 Revert-wifi-disable-Ad-Hoc-WPA-connections-lp-905748.patch
723 Replace-Ad-Hoc-WPA-None-support-with-IBSS-RSN-PSK.patch
724 wifi-Signal-on-the-wifi-device-when-its-supplicant-i.patch
725-Set-the-default-powersave-value-to-enabled.patch
726-Ignore-rmnet_usbX-devices.patch
727-Ignore-p2p0-wifi-devices-from-android.patch
728+Ignore-rild-modem-devices.patch
729+Ignore-p2p-wifi-devices-from-android.patch
730 wwan-add-support-for-using-oFono-as-a-modem-manager.patch
731 Add-new-NMSettingsConnection-reset_retries-get-set-m.patch
732 Let-NetworkManager-read-oFono-settings-file-and-crea.patch
733+Add-modem-reconnect-delay-to-policy.patch
734 Modify-NMDeviceModem-s-available-logic.patch
735 Track-killswitch-change-signals-from-urfkill.patch
736 Only-test-team-devices-if-we-built-support-for-them.patch
737 Disable-general-with-expect-which-tends-to-fail-on-p.patch
738+Add-sudo-policy-to-DBus-conf-for-indicator-network.patch
739+Clear-WiFi-requested_scan-if-suppl-goes-INACTIVE.patch
740+Clear-WiFi-requested_scan-if-suppl-exits.patch
741+Fix-openvpn-by-handling-do_add_route-EEXISTS.patch
742+wwan-fix-ofono-connection-problems.patch
743diff --git a/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch b/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
744index cd18c65..377ec85 100644
745--- a/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
746+++ b/debian/patches/wwan-add-support-for-using-oFono-as-a-modem-manager.patch
747@@ -8,13 +8,13 @@ Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
748 ---
749 configure.ac | 9 +
750 src/devices/wwan/Makefile.am | 7 +
751- src/devices/wwan/nm-device-modem.c | 20 +
752- src/devices/wwan/nm-modem-manager.c | 220 +++++-
753- src/devices/wwan/nm-modem-ofono.c | 1449 +++++++++++++++++++++++++++++++++++
754+ src/devices/wwan/nm-device-modem.c | 2 +
755+ src/devices/wwan/nm-modem-manager.c | 241 +++++-
756+ src/devices/wwan/nm-modem-ofono.c | 1436 +++++++++++++++++++++++++++++++++++
757 src/devices/wwan/nm-modem-ofono.h | 64 ++
758 src/devices/wwan/nm-modem.c | 8 +-
759 src/nm-core-utils.c | 20 +-
760- 8 files changed, 1787 insertions(+), 10 deletions(-)
761+ 8 files changed, 1766 insertions(+), 21 deletions(-)
762 create mode 100644 src/devices/wwan/nm-modem-ofono.c
763 create mode 100644 src/devices/wwan/nm-modem-ofono.h
764
765@@ -57,7 +57,7 @@ index 1777eb3..65d9952 100644
766
767 libnm_wwan_la_LDFLAGS = \
768 diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
769-index a8361c4..a7523f5 100644
770+index a8361c4..39a34db 100644
771 --- a/src/devices/wwan/nm-device-modem.c
772 +++ b/src/devices/wwan/nm-device-modem.c
773 @@ -100,6 +100,7 @@ modem_prepare_result (NMModem *modem,
774@@ -68,39 +68,7 @@ index a8361c4..a7523f5 100644
775 if (reason == NM_DEVICE_STATE_REASON_SIM_PIN_INCORRECT) {
776 /* If the connect failed because the SIM PIN was wrong don't allow
777 * the device to be auto-activated anymore, which would risk locking
778-@@ -282,6 +283,16 @@ modem_state_cb (NMModem *modem,
779- }
780- }
781-
782-+ if (dev_state >= NM_DEVICE_STATE_DISCONNECTED &&
783-+ new_state == NM_MODEM_STATE_REGISTERED && old_state < NM_MODEM_STATE_REGISTERED) {
784-+
785-+ nm_log_info (LOGD_MB, "(%s): modem re-registered; re-checking autoconnect",
786-+ nm_device_get_iface (device));
787-+
788-+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, TRUE, NULL);
789-+ nm_device_emit_recheck_auto_activate (device);
790-+ }
791-+
792- if (new_state < NM_MODEM_STATE_CONNECTING &&
793- old_state >= NM_MODEM_STATE_CONNECTING &&
794- dev_state >= NM_DEVICE_STATE_NEED_AUTH &&
795-@@ -345,6 +356,14 @@ device_state_changed (NMDevice *device,
796- nm_modem_state_to_string (nm_modem_get_state (priv->modem)));
797- }
798-
799-+ /* Block autoconnect until the modem is registered again */
800-+ if (new_state == NM_DEVICE_STATE_FAILED && nm_modem_get_state (priv->modem) == NM_MODEM_STATE_SEARCHING) {
801-+ nm_log_info (LOGD_MB, "(%s): modem searching; disabling autoconnect",
802-+ nm_device_get_iface (device));
803-+
804-+ g_object_set (G_OBJECT (device), NM_DEVICE_AUTOCONNECT, FALSE, NULL);
805-+ }
806-+
807- nm_modem_device_state_changed (priv->modem, new_state, old_state, reason);
808-
809- switch (reason) {
810-@@ -545,6 +564,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid)
811+@@ -545,6 +546,7 @@ get_ip_iface_identifier (NMDevice *device, NMUtilsIPv6IfaceId *out_iid)
812
813 g_return_val_if_fail (priv->modem, FALSE);
814 success = nm_modem_get_iid (priv->modem, out_iid);
815@@ -109,7 +77,7 @@ index a8361c4..a7523f5 100644
816 success = NM_DEVICE_CLASS (nm_device_modem_parent_class)->get_ip_iface_identifier (device, out_iid);
817 return success;
818 diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c
819-index 9e9bc13..0d1ec78 100644
820+index 9e9bc13..cd97b87 100644
821 --- a/src/devices/wwan/nm-modem-manager.c
822 +++ b/src/devices/wwan/nm-modem-manager.c
823 @@ -17,7 +17,7 @@
824@@ -251,7 +219,7 @@ index 9e9bc13..0d1ec78 100644
825 +{
826 + gchar *name_owner;
827 +
828-+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (self->priv->ofono_proxy));
829++ name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (self->priv->ofono_proxy));
830 + if (name_owner) {
831 + /* Available! */
832 + ofono_appeared (self);
833@@ -324,7 +292,37 @@ index 9e9bc13..0d1ec78 100644
834
835 static void
836 modem_manager_poke_cb (GDBusConnection *connection,
837-@@ -336,22 +518,44 @@ manager_new_ready (GObject *source,
838+@@ -233,19 +415,18 @@ modem_manager_poke_cb (GDBusConnection *connection,
839+
840+ result = g_dbus_connection_call_finish (connection, res, &error);
841+ if (error) {
842+- /* Ignore common errors when MM is not installed and such */
843+- if ( !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)
844+- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_EXEC_FAILED)
845+- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FORK_FAILED)
846+- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_FAILED)
847+- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_TIMEOUT)
848+- && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
849+- nm_log_dbg (LOGD_MB, "error poking ModemManager: %s", error->message);
850++ nm_log_warn (LOGD_MB, "error poking ModemManager: %s",
851++ error ? error->message : "");
852++
853++ /* Don't reschedule poke is MM service doesn't exist. */
854++ if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)
855++ && !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND)) {
856++
857++ /* Setup timeout to relaunch */
858++ schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL);
859+ }
860+- g_error_free (error);
861+
862+- /* Setup timeout to relaunch */
863+- schedule_modem_manager_relaunch (self, MODEM_POKE_INTERVAL);
864++ g_error_free (error);
865+ } else
866+ g_variant_unref (result);
867+
868+@@ -336,22 +517,44 @@ manager_new_ready (GObject *source,
869 static void
870 ensure_client (NMModemManager *self)
871 {
872@@ -373,7 +371,7 @@ index 9e9bc13..0d1ec78 100644
873 }
874
875 static void
876-@@ -430,6 +634,12 @@ dispose (GObject *object)
877+@@ -430,6 +633,12 @@ dispose (GObject *object)
878
879 modem_manager_clear_signals (self);
880 g_clear_object (&self->priv->modem_manager);
881@@ -388,10 +386,10 @@ index 9e9bc13..0d1ec78 100644
882 if (self->priv->modems) {
883 diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c
884 new file mode 100644
885-index 0000000..162b88d
886+index 0000000..4566be0
887 --- /dev/null
888 +++ b/src/devices/wwan/nm-modem-ofono.c
889-@@ -0,0 +1,1449 @@
890+@@ -0,0 +1,1436 @@
891 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
892 +/* NetworkManager -- Network link manager
893 + *
894@@ -604,12 +602,7 @@ index 0000000..162b88d
895 + nm_log_dbg (LOGD_MB, "(%s): modem disconnected",
896 + nm_modem_get_uid (NM_MODEM (self)));
897 +
898-+ /* NOTES(1.2): This doesn't accomplish anything as none of the attributes that
899-+ * are checked by update_modem_state are changed by this function!
900-+ *
901-+ * update_modem_state (self);
902-+ */
903-+
904++ update_modem_state (self);
905 + disconnect_context_complete (ctx);
906 +}
907 +
908@@ -784,7 +777,7 @@ index 0000000..162b88d
909 + &error);
910 + if (!v_properties) {
911 + g_dbus_error_strip_remote_error (error);
912-+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: %s",
913++ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: %s",
914 + nm_modem_get_uid (NM_MODEM (self)),
915 + error->message);
916 + g_error_free (error);
917@@ -795,7 +788,7 @@ index 0000000..162b88d
918 +
919 + v_dict = g_variant_get_child_value (v_properties, 0);
920 + if (!v_dict) {
921-+ nm_log_warn (LOGD_BT, "(%s) error getting sim properties: no v_dict",
922++ nm_log_warn (LOGD_MB, "(%s) error getting sim properties: no v_dict",
923 + nm_modem_get_uid (NM_MODEM (self)));
924 + return;
925 + }
926@@ -897,7 +890,7 @@ index 0000000..162b88d
927 + gboolean attached = g_variant_get_boolean (v);
928 +
929 + nm_log_dbg (LOGD_MB, "(%s): Attached: %s",
930-+ nm_modem_get_uid (NM_MODEM (self)), property ? "True" : "False");
931++ nm_modem_get_uid (NM_MODEM (self)), attached ? "True" : "False");
932 +
933 + if (priv->gprs_attached != attached) {
934 + priv->gprs_attached = attached;
935@@ -941,7 +934,7 @@ index 0000000..162b88d
936 + &error);
937 + if (!v_properties) {
938 + g_dbus_error_strip_remote_error (error);
939-+ nm_log_warn (LOGD_BT, "(%s) error getting connman properties: %s",
940++ nm_log_warn (LOGD_MB, "(%s) error getting connman properties: %s",
941 + nm_modem_get_uid (NM_MODEM (self)),
942 + error->message);
943 + g_error_free (error);
944@@ -1121,7 +1114,7 @@ index 0000000..162b88d
945 + &error);
946 + if (!v_properties) {
947 + g_dbus_error_strip_remote_error (error);
948-+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: %s",
949++ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: %s",
950 + nm_modem_get_uid (NM_MODEM (self)),
951 + error->message);
952 + g_error_free (error);
953@@ -1130,7 +1123,7 @@ index 0000000..162b88d
954 +
955 + v_dict = g_variant_get_child_value (v_properties, 0);
956 + if (!v_dict) {
957-+ nm_log_warn (LOGD_BT, "(%s) error getting modem properties: no v_dict",
958++ nm_log_warn (LOGD_MB, "(%s) error getting modem properties: no v_dict",
959 + nm_modem_get_uid (NM_MODEM (self)));
960 + return;
961 + }
962@@ -1226,14 +1219,6 @@ index 0000000..162b88d
963 + nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
964 +
965 + /*
966-+ * 0.9.10.x:
967-+ *
968-+ * The old code got PropertyChanged for Settings, and then immediately
969-+ * called 'GetProperties' to get the current values of 'Settings'.
970-+ *
971-+ * There's no need to do this, as the PropertyChanged has the value of
972-+ * 'Settings' as its payload!!!
973-+ *
974 + * TODO: might be a good idea and re-factor this to mimic bluez-device,
975 + * ie. have this function just check the key, and call a sub-func to
976 + * handle the action.
977@@ -1242,24 +1227,14 @@ index 0000000..162b88d
978 + if (g_strcmp0 (property, "Settings") != 0)
979 + return;
980 +
981-+ nm_log_dbg (LOGD_MB, "found 'Settings' DICTIONARY property");
982-+
983-+ if (nm_modem_get_state (NM_MODEM (self)) == NM_MODEM_STATE_CONNECTED && g_variant_n_children (v) <= 0) {
984-+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings empty", nm_modem_get_uid (NM_MODEM (self)));
985-+
986-+ goto out;
987-+ }
988-+
989-+ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static configuration:", nm_modem_get_uid (NM_MODEM (self)));
990-+
991 + v_dict = g_variant_get_child_value (v, 0);
992 + if (!v_dict) {
993-+ nm_log_warn (LOGD_BT, "ofono: (%s): error getting IPv4 Settings: no v_dict",
994++ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
995 + nm_modem_get_uid (NM_MODEM (self)));
996-+ return;
997++ goto out;
998 + }
999 +
1000-+ /* NOTE - 0.9.10x code didn't fail if 'Interface' missing */
1001++ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
1002 +
1003 + if (g_variant_lookup (v_dict, "Interface", "&s", &s)) {
1004 +
1005@@ -1271,7 +1246,7 @@ index 0000000..162b88d
1006 + NM_MODEM_IP4_METHOD, NM_MODEM_IP_METHOD_STATIC,
1007 + NULL);
1008 + } else {
1009-+ nm_log_warn (LOGD_BT, "ofono: (%s): Settings 'Interface'; empty",
1010++ nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Interface'; empty",
1011 + nm_modem_get_uid (NM_MODEM (self)));
1012 + goto out;
1013 + }
1014@@ -1323,6 +1298,7 @@ index 0000000..162b88d
1015 + } else {
1016 + nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'Address' missing",
1017 + nm_modem_get_uid (NM_MODEM (self)));
1018++ goto out;
1019 + }
1020 +
1021 + if (g_variant_lookup (v_dict, "Netmask", "&s", &s)) {
1022@@ -1345,7 +1321,9 @@ index 0000000..162b88d
1023 + goto out;
1024 + }
1025 +
1026-+ nm_log_info (LOGD_MB, " address %s/%d", addr_s, prefix);
1027++ nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d",
1028++ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
1029++
1030 + nm_ip4_config_add_address (priv->ip4_config, &addr);
1031 +
1032 + if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) {
1033@@ -1372,7 +1350,7 @@ index 0000000..162b88d
1034 +
1035 + while (*iter) {
1036 + if (ip_string_to_network_address (*iter, &address_network) && address_network > 0) {
1037-+ nm_log_info (LOGD_MB, "ofono: (%s): DNS %s",
1038++ nm_log_info (LOGD_MB, "ofono: (%s): DNS: %s",
1039 + nm_modem_get_uid (NM_MODEM (self)), *iter);
1040 +
1041 + nm_ip4_config_add_nameserver (priv->ip4_config, address_network);
1042@@ -1384,13 +1362,15 @@ index 0000000..162b88d
1043 + *iter++;
1044 + }
1045 +
1046-+ /* TOOD: check for minimum NameServers >= 1? */
1047++ if (iter == array) {
1048++ nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified",
1049++ nm_modem_get_uid (NM_MODEM (self)));
1050++ g_free (array);
1051++ goto out;
1052++ }
1053 +
1054 + g_free (array);
1055 + } else {
1056-+
1057-+ /* NOTE - 0.9.10.x would not throw an error in this case!!! */
1058-+
1059 + nm_log_warn (LOGD_MB, "ofono: (%s): Settings 'DomainNameServers' missing",
1060 + nm_modem_get_uid (NM_MODEM (self)));
1061 + goto out;
1062@@ -1419,14 +1399,19 @@ index 0000000..162b88d
1063 + ret = TRUE;
1064 +
1065 +out:
1066-+ if (!ret)
1067-+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
1068++ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) {
1069++ nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s",
1070++ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
1071 +
1072-+ nm_log_dbg (LOGD_MB, "(%s): DONE w/Settings; ret: %s",
1073-+ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
1074++ if (!ret)
1075++ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
1076 +
1077-+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED)
1078 + g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, ret, reason);
1079++ } else {
1080++ nm_log_warn (LOGD_MB, "ofono: (%s): MODEM_PPP_FAILED", nm_modem_get_uid (NM_MODEM (self)));
1081++
1082++ g_signal_emit_by_name (self, NM_MODEM_PPP_FAILED, NM_DEVICE_STATE_REASON_PPP_FAILED);
1083++ }
1084 +}
1085 +
1086 +static NMActStageReturn
1087diff --git a/debian/patches/wwan-fix-ofono-connection-problems.patch b/debian/patches/wwan-fix-ofono-connection-problems.patch
1088new file mode 100644
1089index 0000000..bff500d
1090--- /dev/null
1091+++ b/debian/patches/wwan-fix-ofono-connection-problems.patch
1092@@ -0,0 +1,343 @@
1093+From: Tony Espy <espy@canonical.com>
1094+Date: Fri, 3 Jun 2016 18:03:32 -0400
1095+Subject: Fix ofono connection problems
1096+
1097+This patch fixes three (re) connection problems with
1098+the ofono plugin:
1099+
1100+1) If the modem is connected, and registrations drops,
1101+and then is restored, the connection isn't re-activated.
1102+The fix was simply to change modem_state_cb to not return
1103+after setting the state to failed, which allows nm_device_
1104+queue_recheck_available to be called, which queues a state
1105+transition to UNAVAILABLE.
1106+
1107+2) If ofono returns InProgress, don't treat as a PREPARE_FAILURE.
1108+
1109+3) If the ofono conext is already active, use it's existing
1110+'Settings' property to configure the device.
1111+
1112+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1565717
1113+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1579098
1114+---
1115+ src/devices/wwan/nm-device-modem.c | 4 +-
1116+ src/devices/wwan/nm-modem-ofono.c | 193 +++++++++++++++++++++++++++----------
1117+ src/devices/wwan/nm-modem-ofono.h | 2 +
1118+ 3 files changed, 145 insertions(+), 54 deletions(-)
1119+
1120+diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c
1121+index 3bbd170..22009f8 100644
1122+--- a/src/devices/wwan/nm-device-modem.c
1123++++ b/src/devices/wwan/nm-device-modem.c
1124+@@ -286,12 +286,10 @@ modem_state_cb (NMModem *modem,
1125+ if (new_state < NM_MODEM_STATE_CONNECTING &&
1126+ old_state >= NM_MODEM_STATE_CONNECTING &&
1127+ dev_state >= NM_DEVICE_STATE_NEED_AUTH &&
1128+- dev_state <= NM_DEVICE_STATE_ACTIVATED) {
1129++ dev_state <= NM_DEVICE_STATE_ACTIVATED)
1130+ /* Fail the device if the modem disconnects unexpectedly while the
1131+ * device is activating/activated. */
1132+ nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER);
1133+- return;
1134+- }
1135+
1136+ if (new_state > NM_MODEM_STATE_LOCKED && old_state == NM_MODEM_STATE_LOCKED) {
1137+ /* If the modem is now unlocked, enable/disable it according to the
1138+diff --git a/src/devices/wwan/nm-modem-ofono.c b/src/devices/wwan/nm-modem-ofono.c
1139+index 4566be0..c09cfd5 100644
1140+--- a/src/devices/wwan/nm-modem-ofono.c
1141++++ b/src/devices/wwan/nm-modem-ofono.c
1142+@@ -789,42 +789,35 @@ stage1_prepare_done (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data
1143+ g_dbus_proxy_call_finish (proxy, result, &error);
1144+
1145+ if (error) {
1146+- nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s",
1147+- error ? error->code : -1,
1148+- error && error->message ? error->message : "(unknown)");
1149++ if (!g_strstr_len (error->message, NM_STRLEN (OFONO_ERROR_IN_PROGRESS), OFONO_ERROR_IN_PROGRESS)) {
1150++ nm_log_warn (LOGD_MB, "ofono: connection failed: (%d) %s",
1151++ error ? error->code : -1,
1152++ error && error->message ? error->message : "(unknown)");
1153+
1154+- g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
1155+- NM_DEVICE_STATE_REASON_MODEM_BUSY);
1156+- /*
1157+- * FIXME: add code to check for InProgress so that the
1158+- * connection doesn't continue to try and activate,
1159+- * leading to the connection being disabled, and a 5m
1160+- * timeout...
1161+- */
1162++ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
1163++ NM_DEVICE_STATE_REASON_MODEM_BUSY);
1164++ } else
1165++ nm_log_warn (LOGD_MB, "ofono: connection activation returned Error.InProgress");
1166+
1167+ g_clear_error (&error);
1168+ }
1169+ }
1170+
1171+ static void
1172+-context_property_changed (GDBusProxy *proxy,
1173+- const char *property,
1174+- GVariant *v,
1175+- gpointer user_data)
1176++handle_settings (GVariant *v_dict, gpointer user_data)
1177+ {
1178+ NMModemOfono *self = NM_MODEM_OFONO (user_data);
1179+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
1180+ NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE;
1181+ NMPlatformIP4Address addr;
1182+ gboolean ret = FALSE;
1183+- GVariant *v_dict;
1184+ GVariantIter i;
1185+ const gchar *s, *addr_s;
1186+ const gchar **array, **iter;
1187+ guint32 address_network, gateway_network;
1188+ guint prefix = 0;
1189+
1190+- nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
1191++ nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
1192+
1193+ /*
1194+ * TODO: might be a good idea and re-factor this to mimic bluez-device,
1195+@@ -832,18 +825,6 @@ context_property_changed (GDBusProxy *proxy,
1196+ * handle the action.
1197+ */
1198+
1199+- if (g_strcmp0 (property, "Settings") != 0)
1200+- return;
1201+-
1202+- v_dict = g_variant_get_child_value (v, 0);
1203+- if (!v_dict) {
1204+- nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
1205+- nm_modem_get_uid (NM_MODEM (self)));
1206+- goto out;
1207+- }
1208+-
1209+- nm_log_info (LOGD_MB, "ofono: (%s): IPv4 static Settings:", nm_modem_get_uid (NM_MODEM (self)));
1210+-
1211+ if (g_variant_lookup (v_dict, "Interface", "&s", &s)) {
1212+
1213+ nm_log_dbg (LOGD_MB, "(%s): Interface: %s", nm_modem_get_uid (NM_MODEM (self)), s);
1214+@@ -930,8 +911,7 @@ context_property_changed (GDBusProxy *proxy,
1215+ }
1216+
1217+ nm_log_info (LOGD_MB, "ofono (%s) Address: %s/%d",
1218+- nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
1219+-
1220++ nm_modem_get_uid (NM_MODEM (self)), addr_s, prefix);
1221+ nm_ip4_config_add_address (priv->ip4_config, &addr);
1222+
1223+ if (g_variant_lookup (v_dict, "Gateway", "&s", &s)) {
1224+@@ -972,7 +952,7 @@ context_property_changed (GDBusProxy *proxy,
1225+
1226+ if (iter == array) {
1227+ nm_log_warn (LOGD_MB, "ofono: (%s): Settings: 'DomainNameServers': none specified",
1228+- nm_modem_get_uid (NM_MODEM (self)));
1229++ nm_modem_get_uid (NM_MODEM (self)));
1230+ g_free (array);
1231+ goto out;
1232+ }
1233+@@ -1009,7 +989,7 @@ context_property_changed (GDBusProxy *proxy,
1234+ out:
1235+ if (nm_modem_get_state (NM_MODEM (self)) != NM_MODEM_STATE_CONNECTED) {
1236+ nm_log_info (LOGD_MB, "ofono: (%s): emitting PREPARE_RESULT: %s",
1237+- nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
1238++ nm_modem_get_uid (NM_MODEM (self)), ret ? "TRUE" : "FALSE");
1239+
1240+ if (!ret)
1241+ reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
1242+@@ -1022,6 +1002,33 @@ out:
1243+ }
1244+ }
1245+
1246++static void
1247++context_property_changed (GDBusProxy *proxy,
1248++ const char *property,
1249++ GVariant *v,
1250++ gpointer user_data)
1251++{
1252++ NMModemOfono *self = NM_MODEM_OFONO (user_data);
1253++ GVariant *v_dict;
1254++
1255++ nm_log_dbg (LOGD_MB, "PropertyChanged: %s", property);
1256++
1257++ if (g_strcmp0 (property, "Settings") != 0)
1258++ return;
1259++
1260++ v_dict = g_variant_get_child_value (v, 0);
1261++ if (!v_dict) {
1262++ nm_log_warn (LOGD_MB, "ofono: (%s): error getting IPv4 Settings",
1263++ nm_modem_get_uid (NM_MODEM (self)));
1264++ return;
1265++ }
1266++
1267++ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT));
1268++
1269++ handle_settings (v_dict, user_data);
1270++ g_variant_unref (v_dict);
1271++}
1272++
1273+ static NMActStageReturn
1274+ static_stage3_ip4_config_start (NMModem *_self,
1275+ NMActRequest *req,
1276+@@ -1053,11 +1060,100 @@ static_stage3_ip4_config_start (NMModem *_self,
1277+ }
1278+
1279+ static void
1280++context_properties_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
1281++{
1282++ NMModemOfono *self = NM_MODEM_OFONO (user_data);
1283++ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
1284++ GError *error = NULL;
1285++ GVariant *properties, *settings;
1286++ GVariant *v_dict = NULL;
1287++ gboolean active;
1288++
1289++ nm_log_dbg (LOGD_MB, "in %s", __func__);
1290++
1291++ properties = g_dbus_proxy_call_finish (proxy, result, &error);
1292++
1293++ if (error) {
1294++ nm_log_warn (LOGD_MB, "ofono: connection failed; couldn't read context properties (%d) %s",
1295++ error ? error->code : -1,
1296++ error && error->message ? error->message : "(unknown)");
1297++
1298++ g_clear_error (&error);
1299++ goto error;
1300++ }
1301++
1302++ if (properties == NULL) {
1303++ nm_log_warn (LOGD_MB, "ofono: connection failed; no context properties returned");
1304++ goto error;
1305++ }
1306++
1307++ v_dict = g_variant_get_child_value (properties, 0);
1308++ g_assert (v_dict);
1309++ g_assert (g_variant_is_of_type (v_dict, G_VARIANT_TYPE_VARDICT));
1310++
1311++ g_variant_unref (properties);
1312++
1313++ if (!g_variant_lookup (v_dict, "Active", "b", &active)) {
1314++ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Active' property");
1315++ goto error;
1316++ }
1317++
1318++ /* Watch for custom ofono PropertyChanged signals */
1319++ _nm_dbus_signal_connect (priv->context_proxy,
1320++ "PropertyChanged",
1321++ G_VARIANT_TYPE ("(sv)"),
1322++ G_CALLBACK (context_property_changed),
1323++ self);
1324++
1325++ if (active) {
1326++ nm_log_dbg (LOGD_MB, "connection is already Active");
1327++
1328++ settings = g_variant_lookup_value (v_dict, "Settings", G_VARIANT_TYPE_VARDICT);
1329++ if (settings == NULL) {
1330++ nm_log_warn (LOGD_MB, "ofono: connection failed; can't read 'Settings' property");
1331++ goto error;
1332++ }
1333++
1334++ handle_settings (settings, user_data);
1335++ g_variant_unref (settings);
1336++
1337++ } else
1338++ g_dbus_proxy_call (priv->context_proxy,
1339++ "SetProperty",
1340++ g_variant_new ("(sv)",
1341++ "Active",
1342++ g_variant_new ("b", TRUE)),
1343++ G_DBUS_CALL_FLAGS_NONE,
1344++ 20000,
1345++ NULL,
1346++ (GAsyncReadyCallback) stage1_prepare_done,
1347++ g_object_ref (self));
1348++
1349++ g_variant_unref (v_dict);
1350++
1351++ return;
1352++
1353++error:
1354++ if (properties)
1355++ g_variant_unref (properties);
1356++
1357++ if (v_dict)
1358++ g_variant_unref (v_dict);
1359++
1360++ g_signal_emit_by_name (self, NM_MODEM_PREPARE_RESULT, FALSE,
1361++ NM_DEVICE_STATE_REASON_MODEM_BUSY);
1362++}
1363++
1364++static void
1365+ context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data)
1366+ {
1367+ NMModemOfono *self = NM_MODEM_OFONO (user_data);
1368+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
1369++ gboolean context_active;
1370+ GError *error = NULL;
1371++ GVariant *v_dict;
1372++ GVariant *active_property;
1373++ GVariant *settings_property;
1374+
1375+ nm_log_dbg (LOGD_MB, "%s:", __func__);
1376+
1377+@@ -1087,23 +1183,18 @@ context_proxy_new_cb (GDBusProxy *proxy, GAsyncResult *result, gpointer user_dat
1378+ if (priv->ip4_config)
1379+ g_clear_object (&priv->ip4_config);
1380+
1381+- /* Watch for custom ofono PropertyChanged signals */
1382+- _nm_dbus_signal_connect (priv->context_proxy,
1383+- "PropertyChanged",
1384+- G_VARIANT_TYPE ("(sv)"),
1385+- G_CALLBACK (context_property_changed),
1386+- self);
1387+-
1388++ /* As ofono doesn't properly implement DBus.Properties, we need to
1389++ * query the ConnectionContextinteface directly to get the current
1390++ * property values vs. using g_dbus_proxy_get_cached_property.
1391++ */
1392+ g_dbus_proxy_call (priv->context_proxy,
1393+- "SetProperty",
1394+- g_variant_new ("(sv)",
1395+- "Active",
1396+- g_variant_new ("b", TRUE)),
1397+- G_DBUS_CALL_FLAGS_NONE,
1398+- 20000,
1399+- NULL,
1400+- (GAsyncReadyCallback) stage1_prepare_done,
1401+- g_object_ref (self));
1402++ "GetProperties",
1403++ NULL,
1404++ G_DBUS_CALL_FLAGS_NONE,
1405++ 20000,
1406++ NULL,
1407++ (GAsyncReadyCallback) context_properties_cb,
1408++ g_object_ref (self));
1409+ }
1410+
1411+ static void
1412+@@ -1112,8 +1203,8 @@ do_context_activate (NMModemOfono *self)
1413+ NMModemOfonoPrivate *priv = NM_MODEM_OFONO_GET_PRIVATE (self);
1414+ GValue value = G_VALUE_INIT;
1415+
1416+- g_return_val_if_fail (self != NULL, FALSE);
1417+- g_return_val_if_fail (NM_IS_MODEM_OFONO (self), FALSE);
1418++ g_assert (self != NULL);
1419++ g_assert (NM_IS_MODEM_OFONO (self));
1420+
1421+ nm_log_dbg (LOGD_MB, "in %s", __func__);
1422+
1423+diff --git a/src/devices/wwan/nm-modem-ofono.h b/src/devices/wwan/nm-modem-ofono.h
1424+index fa79e15..02eca11 100644
1425+--- a/src/devices/wwan/nm-modem-ofono.h
1426++++ b/src/devices/wwan/nm-modem-ofono.h
1427+@@ -41,6 +41,8 @@ G_BEGIN_DECLS
1428+ #define OFONO_DBUS_INTERFACE_CONNECTION_CONTEXT "org.ofono.ConnectionContext"
1429+ #define OFONO_DBUS_INTERFACE_SIM_MANAGER "org.ofono.SimManager"
1430+
1431++#define OFONO_ERROR_IN_PROGRESS "org.ofono.Error.InProgress"
1432++
1433+ typedef enum {
1434+ NM_OFONO_ERROR_CONNECTION_NOT_OFONO = 0, /*< nick=ConnectionNotOfono >*/
1435+ NM_OFONO_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/
1436diff --git a/debian/rules b/debian/rules
1437index 2e449a4..801508c 100755
1438--- a/debian/rules
1439+++ b/debian/rules
1440@@ -2,11 +2,24 @@
1441
1442 include /usr/share/dpkg/architecture.mk
1443
1444-PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)
1445+# The following line is used by 1.2x desktop, but doesn't
1446+# work on vivid or wily, preventing a source package from
1447+# being built on this releases. This is because ppp 2.4.6-3*
1448+# doesn't include dh_ppp.
1449+#
1450+# PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)
1451 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
1452
1453 %:
1454- dh $@ --with gir,systemd,autoreconf,ppp --parallel
1455+# This is from the 1.2x desktop branch; ppp fails due to lack of
1456+# dh_ppp ( see above ). This is a no-op until we fix pptp VPN
1457+# on the phone. gir fails when building the binary packages with
1458+# the error:
1459+#
1460+# dh_girepository: Could not find gir file for NM-1.0.typelib
1461+#
1462+# dh $@ --with gir,systemd,autoreconf,ppp --parallel
1463+ dh $@ --with systemd,autoreconf --parallel
1464
1465 autoreconf:
1466 gtkdocize --copy
1467@@ -19,14 +32,13 @@ override_dh_autoreconf:
1468 override_dh_auto_configure:
1469 dh_auto_configure -- \
1470 --libexecdir=/usr/lib/NetworkManager \
1471- --with-pppd-plugin-dir=$(PPPD_PLUGIN_DIR) \
1472- --with-pppd=/usr/sbin/pppd \
1473 --with-resolvconf=/sbin/resolvconf \
1474 --with-dhclient=/sbin/dhclient \
1475 --with-iptables=/sbin/iptables \
1476 --with-dnsmasq=/usr/sbin/dnsmasq \
1477 --with-dnssec-trigger=/usr/lib/dnssec-trigger/dnssec-trigger-script \
1478 --with-systemdsystemunitdir=/lib/systemd/system \
1479+ --with-systemd-journal=no \
1480 --with-udev-dir=/lib/udev \
1481 --with-crypto=gnutls \
1482 --with-session-tracking=systemd \
1483@@ -36,9 +48,9 @@ override_dh_auto_configure:
1484 --with-nmcli \
1485 --disable-more-warnings \
1486 --disable-modify-system \
1487+ --disable-bluez5 \
1488 --enable-polkit \
1489 --enable-polkit-agent \
1490- --enable-ppp \
1491 --enable-ifupdown \
1492 --enable-config-plugin-ibft \
1493 --enable-introspection \
1494@@ -46,8 +58,7 @@ override_dh_auto_configure:
1495 --enable-concheck \
1496 --enable-teamdctl=no \
1497 --enable-vala \
1498- --with-tests \
1499- --enable-bluez5-dun
1500+ --with-tests
1501
1502 override_dh_install:
1503 rm -vf $(CURDIR)/debian/tmp/etc/init.d/NetworkManager
1504@@ -60,6 +71,15 @@ override_dh_install:
1505 mkdir -p debian/network-manager/etc/dnsmasq.d
1506 cp debian/network-manager.dnsmasq debian/network-manager/etc/dnsmasq.d/network-manager
1507
1508+ # copy indicator-network polkit configuration
1509+ mkdir -p debian/network-manager/etc/polkit-1/localauthority/50-local.d
1510+ cp debian/indicator-network.pkla \
1511+ debian/network-manager/etc/polkit-1/localauthority/50-local.d/org.freedesktop.NetworkManager.pkla
1512+
1513+ # copy powersave configuration
1514+ mkdir -p debian/network-manager/etc/NetworkManager/conf.d
1515+ cp debian/default-wifi-powersave-on.conf debian/network-manager/etc/NetworkManager/conf.d/
1516+
1517 override_dh_installinit:
1518 dh_installinit --noscripts
1519
1520@@ -67,7 +87,7 @@ override_dh_makeshlibs:
1521 dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/NetworkManager/ -X/usr/lib/pppd/
1522
1523 override_dh_strip:
1524- dh_strip --dbgsym-migration='network-manager-dbg (<< 1.1.91-2~)'
1525+ dh_strip --dbg-package=network-manager-dbg
1526
1527 override_dh_systemd_start:
1528 dh_link lib/systemd/system/NetworkManager.service \
1529@@ -76,9 +96,6 @@ override_dh_systemd_start:
1530 dh_systemd_start -pnetwork-manager --no-start NetworkManager-wait-online.service
1531 dh_systemd_start -pnetwork-manager --restart-after-upgrade NetworkManager.service
1532
1533-override_dh_ppp:
1534- dh_ppp --breaks
1535-
1536 override_dh_auto_test:
1537 ifeq (, $(filter nocheck, $(DEB_BUILD_OPTIONS)))
1538 make check || ( find . -name test-suite.log -exec cat {} \;; exit 1; )

Subscribers

People subscribed via source and target branches

to all changes: