blueman-applet enables bluethooth when it starts

Bug #1763221 reported by pqwoerituytrueiwoq
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
blueman (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When the blueman-applet starts it changes turn the bluetooth hardware on
This makes the AutoEnable option in /etc/bluetooth/main.conf pointless

The applet should not change the state of bluetooth on startup

Line 76 of /usr/lib/python3/dist-packages/blueman/plugins/applet/PowerManager.py turns the applet on
furthermore line 75 does not respect the value set on line 28

The applet should check the AutoEnable variable defined in /etc/bluetooth/main.conf
in the event it is not defined it should check for the for it under the old name of InitiallyPowered

On another note we have this:
    def on_manager_state_changed(self, state):
        if state:
            def timeout():
                self.adapter_state = self.get_adapter_state()
                if self.get_option("auto-power-on"):
                    self.RequestPowerState(True, force=True)
                else:
                    self.RequestPowerState(self.adapter_state)
            GObject.timeout_add(1000, timeout)
it would be better to do this:
    def on_manager_state_changed(self, state):
        if state:
            def timeout():
                if self.get_option("auto-power-on"):
                    self.RequestPowerState(True, force=True)
                else:
                    self.RequestPowerState(self.get_adapter_state())
            GObject.timeout_add(1000, timeout)
as there is no need to make a variable for something are are using only once especically when we do not know that we even need to check the adapter state yet

but the real question is why we need a auto-power-on option anyway
we could just drop lines 25-32 and do this
    def on_manager_state_changed(self, state):
        if state:
            def timeout():
                self.RequestPowerState(self.get_adapter_state())
            GObject.timeout_add(1000, timeout)

The only reason I can imaging we would want to turn bluetooth on when the applet starts is if the user manually started it as that would mean they have a bluetooth device they want to it

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: blueman 2.0.5-1ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-13.14-generic 4.15.10
Uname: Linux 4.15.0-13-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
CasperVersion: 1.393
CurrentDesktop: XFCE
Date: Wed Apr 11 23:00:25 2018
LiveMediaBuild: Xubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180411)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: blueman
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
pqwoerituytrueiwoq (pqwoerituytrueiwoq) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "/usr/lib/python3/dist-packages/blueman/plugins/applet/PowerManager.py.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
pqwoerituytrueiwoq (pqwoerituytrueiwoq) wrote :

I just finished a better patch and sent it upstream
https://github.com/blueman-project/blueman/issues/859

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in blueman (Ubuntu):
status: New → Confirmed
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.