Merge lp:~ken-vandine/ubuntu-system-settings/call_waiting_fixes into lp:ubuntu-system-settings

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 1458
Merged at revision: 1465
Proposed branch: lp:~ken-vandine/ubuntu-system-settings/call_waiting_fixes
Merge into: lp:ubuntu-system-settings
Diff against target: 106 lines (+49/-5)
2 files modified
plugins/phone/CallWaiting.qml (+11/-4)
tests/autopilot/ubuntu_system_settings/tests/test_phone.py (+38/-1)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-system-settings/call_waiting_fixes
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Jonas G. Drange (community) Approve
Review via email: mp+263804@code.launchpad.net

Commit message

Fixed property binding for voiceCallWaiting and don't enable the switch if the SIM isn't registered on the network

Description of the change

Fixed property binding for voiceCallWaiting and don't enable the switch if the SIM isn't registered on the network

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Is the log supposed to be there? Maybe make it less ambiguous if so.

review: Needs Information
1454. By Ken VanDine

Added comment about log output

1455. By Ken VanDine

Don't use the ConnectionManager API, that's for data, use the NetworkRegistration API to determine if we're registered on the network

1456. By Ken VanDine

Use existing netReg binding

1457. By Ken VanDine

Updated autopilot tests for call waiting

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

LGTM. Tested on krillin for two SIMs. Works well.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1458. By Ken VanDine

Merged trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/phone/CallWaiting.qml'
2--- plugins/phone/CallWaiting.qml 2014-08-23 19:52:39 +0000
3+++ plugins/phone/CallWaiting.qml 2015-07-06 17:30:57 +0000
4@@ -29,6 +29,7 @@
5 title: headerTitle
6 property var sim
7 property string headerTitle: i18n.tr("Call waiting")
8+ property bool attached: sim.netReg.status === "registered" || sim.netReg.status === "roaming"
9
10 OfonoCallSettings {
11 id: callSettings
12@@ -41,6 +42,10 @@
13 callWaitingIndicator.running = false;
14 }
15 onVoiceCallWaitingComplete: {
16+ //When the property change is complete, the value of checked should always be in sync with serverChecked
17+ callWaitingSwitch.checked = callWaitingSwitch.serverChecked
18+ /* Log some additional output to help debug when things don't work */
19+ console.warn('callSettings, onVoiceCallWaitingComplete modem: ' + modemPath + ' success: ' + success + ' ' + voiceCallWaiting);
20 callWaitingIndicator.running = false;
21 }
22 }
23@@ -48,16 +53,18 @@
24 ActivityIndicator {
25 id: callWaitingIndicator
26 running: true
27- visible: running
28+ visible: running && attached
29 }
30
31 Switch {
32 id: callWaitingSwitch
33 objectName: "callWaitingSwitch"
34 visible: !callWaitingIndicator.running
35- enabled: callSettings.ready
36- checked: callSettings.voiceCallWaiting !== "disabled"
37- onClicked: {
38+ enabled: callSettings.ready && attached
39+ property bool serverChecked: callSettings.voiceCallWaiting !== "disabled"
40+ onServerCheckedChanged: checked = serverChecked
41+ Component.onCompleted: checked = serverChecked
42+ onTriggered: {
43 callWaitingIndicator.running = true;
44 if (checked)
45 callSettings.voiceCallWaiting = "enabled";
46
47=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_phone.py'
48--- tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-06-23 12:26:15 +0000
49+++ tests/autopilot/ubuntu_system_settings/tests/test_phone.py 2015-07-06 17:30:57 +0000
50@@ -13,7 +13,8 @@
51 from ubuntu_system_settings.tests import (
52 PhoneOfonoBaseTestCase,
53 CALL_FWD_IFACE,
54- CALL_SETTINGS_IFACE
55+ CALL_SETTINGS_IFACE,
56+ NETREG_IFACE
57 )
58
59
60@@ -155,6 +156,18 @@
61 'VoiceCallWaiting')),
62 Eventually(Contains('enabled')))
63
64+ def test_call_waiting_switch_not_attached(self):
65+ self.phone_page._enter_call_waiting()
66+ self.modem_0.EmitSignal(
67+ NETREG_IFACE, 'PropertyChanged', 'sv',
68+ ['Status', 'unregistered'])
69+ call_wait_switch = self.main_view.wait_select_single(
70+ objectName='callWaitingSwitch')
71+ self.assertThat(
72+ call_wait_switch.enabled,
73+ Eventually(Equals(False))
74+ )
75+
76
77 class PhoneDualSimTestCase(PhoneOfonoBaseTestCase):
78
79@@ -435,3 +448,27 @@
80 lambda: str(self.modem_1.Get(CALL_SETTINGS_IFACE,
81 'VoiceCallWaiting')),
82 Eventually(Contains('enabled')))
83+
84+ def test_call_waiting_switch_not_attached_sim_1(self):
85+ self.phone_page._enter_call_waiting(sim=0)
86+ self.modem_0.EmitSignal(
87+ NETREG_IFACE, 'PropertyChanged', 'sv',
88+ ['Status', 'unregistered'])
89+ call_wait_switch = self.main_view.wait_select_single(
90+ objectName='callWaitingSwitch')
91+ self.assertThat(
92+ call_wait_switch.enabled,
93+ Eventually(Equals(False))
94+ )
95+
96+ def test_call_waiting_switch_not_attached_sim_2(self):
97+ self.phone_page._enter_call_waiting(sim=1)
98+ self.modem_1.EmitSignal(
99+ NETREG_IFACE, 'PropertyChanged', 'sv',
100+ ['Status', 'unregistered'])
101+ call_wait_switch = self.main_view.wait_select_single(
102+ objectName='callWaitingSwitch')
103+ self.assertThat(
104+ call_wait_switch.enabled,
105+ Eventually(Equals(False))
106+ )

Subscribers

People subscribed via source and target branches