Merge lp:~morphis/indicator-bluetooth/fix-lp1530807 into lp:indicator-bluetooth/15.10

Proposed by Simon Fels on 2016-03-24
Status: Approved
Approved by: Charles Kerr on 2016-04-08
Approved revision: 99
Proposed branch: lp:~morphis/indicator-bluetooth/fix-lp1530807
Merge into: lp:indicator-bluetooth/15.10
Diff against target: 15 lines (+4/-1)
1 file modified
src/bluez.vala (+4/-1)
To merge this branch: bzr merge lp:~morphis/indicator-bluetooth/fix-lp1530807
Reviewer Review Type Date Requested Status
Charles Kerr (community) 2016-03-31 Approve on 2016-04-08
PS Jenkins bot (community) continuous-integration Approve on 2016-04-06
Konrad Zapałowicz (community) Approve on 2016-03-24
Indicator Applet Developers 2016-03-24 Pending
Review via email: mp+290022@code.launchpad.net

Commit message

Try to power on bluetooth through bluez if rfkill is already unblocked

In situations where we have to active bluetooth and the rfkill is already unblocked we need to go straight and set the 'Powered' property of the BlueZ adapter to true. The code now checks if the rfkill already has the state it should be in and if yes just switches the 'Powered' property.

To post a comment you must log in.
Konrad Zapałowicz (kzapalowicz) wrote :

It is good.

review: Approve
Charles Kerr (charlesk) wrote :

LGTM.

review: Approve

Unmerged revisions

99. By Simon Fels on 2016-03-11

Remove changelog entry to be ready for landing

98. By Simon Fels on 2016-03-09

Fix version

97. By Simon Fels on 2016-03-09

Correctly check if killswitch already has the requested state and if yes
directly request BlueZ to switch the controller power state.

96. By Simon Fels on 2016-03-09

Check killswitch state before setting it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bluez.vala'
2--- src/bluez.vala 2016-02-14 21:05:19 +0000
3+++ src/bluez.vala 2016-03-24 11:12:29 +0000
4@@ -437,7 +437,10 @@
5
6 public void try_set_enabled (bool b)
7 {
8- if (killswitch != null)
9+ // If either the killswitch is already in the state we request it
10+ // here to switch to or we don't have a killswitch at all we
11+ // directly switch to setting the powered property for BlueZ.
12+ if (killswitch != null && killswitch.blocked == b)
13 {
14 debug (@"setting killswitch blocked to $(!b)");
15 killswitch.try_set_blocked (!b);

Subscribers

People subscribed via source and target branches