Push-client should be disabled when in flight-mode (no network connection)

Bug #1437135 reported by Ricardo Salveti
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Bret Barker
Ubuntu Push Notifications
Fix Released
High
Samuele Pedroni
ubuntu-push (Ubuntu)
Fix Released
Undecided
Unassigned
ubuntu-push (Ubuntu RTM)
Fix Released
Undecided
Unassigned

Bug Description

current build number: 258
device name: krillin
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed
last update: 2015-03-26 16:39:52
version version: 258
version ubuntu: 20150326
version device: 20150310-3201c0a
version custom: 20150216-561-29-186

Push-client should be disabled when in flight-mode (no network connection), as it makes no sense to wake up the phone at every 5 minutes if we know the check will fail.

The system should be smart enough to enable the push-client service only when there is a valid connection (either 3g or wifi).

After manually stopping push-client and enabling flight-mode, my battery consumption reduced quite a bit, as it was in deep sleep during all the period I had the screen turned off.

Tags: battery bq

Related branches

tags: added: battery bq
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-push (Ubuntu):
status: New → Confirmed
Revision history for this message
Richard Somlói (ricsipontaz) wrote :

I agree with this. Push-client should be disabled when mobile data and wifi are turned off too.

Revision history for this message
John Lenton (chipaca) wrote :

Disabling push client at the moment would also disable the postal service, which we wouldn't want to do i don't think. At some point those two can (and possibly should) be split, but not for now. In view of that, we could either expose an interface to tell us whether to wake up the phone (to be called when entering and leaving flight mode), or monitor flight mode status from push itself. The latter shouldn't be hard, as long as it's exposed either as a property of network manager, or by the AccountsService dbus thing (we're currently tracking properties from both of those, so adding another property would be fairly straightforward).

Changed in ubuntu-push (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
John Lenton (chipaca) wrote :

(marking incomplete until we learn how flight mode is exposed)

Revision history for this message
John Lenton (chipaca) wrote :

So, flight mode is exposed via dbus on its own interface (org.freedesktop.URfkill.IsFlightMode and its FlightModeChanged signal). This is more work, but still doable I think.

If we were to interface to urfkill, and enable the polling when not in flightmode (and disable it when in flightmode), that would be sufficient, yes?

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

As discussed over IRC, we just need to handle the situation where the user enables flight mode and then manually enable wifi.

We don't yet have an API for this it seems, but everything goes via urfkill, so there might be the way to go.

Changed in ubuntu-push:
importance: Undecided → High
Changed in canonical-devices-system-image:
importance: Undecided → High
milestone: none → ww13-ota
status: New → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote :

dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Get string:"org.freedesktop.NetworkManager" string:"WirelessEnabled"

will get you the info if wireless is on or off ... (just translate it into whatever language your app uses)

Changed in ubuntu-push:
assignee: nobody → Samuele Pedroni (pedronis)
status: New → In Progress
Changed in canonical-devices-system-image:
assignee: nobody → Bret Barker (noise)
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Changed in ubuntu-push (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-push - 0.64.1+15.04.20150331.2~rtm-0ubuntu1

---------------
ubuntu-push (0.64.1+15.04.20150331.2~rtm-0ubuntu1) 14.09; urgency=medium

  [ CI Train Bot ]
  * New rebuild forced.

  [ Samuele Pedroni (Canonical Services Ltd.) ]
  * [Bret Barker] add a hacky busy sleep loop to workaround go's sleep
    not   accounting for suspended time (lp:1435109). (LP: #1435109,
    #1437135)
 -- CI Train Bot <email address hidden> Tue, 31 Mar 2015 21:52:22 +0000

Changed in ubuntu-push (Ubuntu RTM):
status: New → Fix Released
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
Changed in ubuntu-push:
status: In Progress → Fix Committed
Changed in ubuntu-push:
status: Fix Committed → Fix Released
Changed in ubuntu-push (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.