Merge lp:~jonas-drange/ubuntu-system-settings/lp1478049 into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Merged
Approved by: Ken VanDine
Approved revision: 1552
Merged at revision: 1555
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/lp1478049
Merge into: lp:ubuntu-system-settings
Diff against target: 250 lines (+80/-34)
7 files modified
plugins/phone/CallForwardItem.qml (+3/-1)
plugins/phone/CallForwarding.qml (+38/-5)
plugins/phone/MultiSim.qml (+1/-11)
plugins/phone/Ofono.qml (+25/-6)
plugins/phone/SingleSim.qml (+1/-11)
plugins/phone/callForwardingUtils.js (+7/-0)
schema/com.ubuntu.touch.system-settings.gschema.xml (+5/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/lp1478049
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Sebastien Bacher (community) Approve
Review via email: mp+276789@code.launchpad.net

Commit message

* Cache call forwarding summary for each IMSI/ICCID.
* Block UI until the CallForwarding binding is ready.
* Do not assume a failed callforwarding change means it's disabled (could be forced by carrier).

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

nuke the arbitrary time TTL, use IMSI or ICCID.

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks, that looks fine to me

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

I've restarted this MP to work around an issue triggering generic-deb-autopilot-vivid-touch on krillin hardware.

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
=== modified file 'plugins/phone/CallForwardItem.qml'
--- plugins/phone/CallForwardItem.qml 2015-08-10 13:31:45 +0000
+++ plugins/phone/CallForwardItem.qml 2015-11-09 12:37:53 +0000
@@ -72,7 +72,7 @@
72 /**72 /**
73 * Server is working.73 * Server is working.
74 */74 */
75 property bool _pending: false75 property bool _pending: !callForwarding.ready
7676
77 /**77 /**
78 * Server failed to change/fetch setting.78 * Server failed to change/fetch setting.
@@ -233,10 +233,12 @@
233 Component.onCompleted: {233 Component.onCompleted: {
234 item.callForwarding[item.rule + 'Changed'].connect(Utils.ruleChanged);234 item.callForwarding[item.rule + 'Changed'].connect(Utils.ruleChanged);
235 item.callForwarding[item.rule + 'Complete'].connect(Utils.ruleComplete);235 item.callForwarding[item.rule + 'Complete'].connect(Utils.ruleComplete);
236 item.callForwarding.readyChanged.connect(Utils.ruleReadyChanged);
236 }237 }
237 Component.onDestruction: {238 Component.onDestruction: {
238 item.callForwarding[item.rule + 'Changed'].disconnect(Utils.ruleChanged);239 item.callForwarding[item.rule + 'Changed'].disconnect(Utils.ruleChanged);
239 item.callForwarding[item.rule + 'Complete'].disconnect(Utils.ruleComplete);240 item.callForwarding[item.rule + 'Complete'].disconnect(Utils.ruleComplete);
241 item.callForwarding.readyChanged.disconnect(Utils.ruleReadyChanged);
240 }242 }
241 }243 }
242}244}
243245
=== modified file 'plugins/phone/CallForwarding.qml'
--- plugins/phone/CallForwarding.qml 2015-08-10 13:31:45 +0000
+++ plugins/phone/CallForwarding.qml 2015-11-09 12:37:53 +0000
@@ -28,6 +28,7 @@
2828
29import QtQuick 2.429import QtQuick 2.4
30import QtContacts 5.030import QtContacts 5.0
31import MeeGo.QOfono 0.2
31import SystemSettings 1.032import SystemSettings 1.0
32import Ubuntu.Components 1.333import Ubuntu.Components 1.3
33import Ubuntu.Components.ListItems 1.3 as ListItem34import Ubuntu.Components.ListItems 1.3 as ListItem
@@ -126,7 +127,7 @@
126 id: fwdAll127 id: fwdAll
127 anchors { left: parent.left; right: parent.right }128 anchors { left: parent.left; right: parent.right }
128 rule: "voiceUnconditional"129 rule: "voiceUnconditional"
129 callForwarding: sim.callForwarding130 callForwarding: callForwarding
130 text: i18n.tr("Forward every incoming call")131 text: i18n.tr("Forward every incoming call")
131 onEnteredEditMode: {page.editing = fwdAll; Utils.show(field)}132 onEnteredEditMode: {page.editing = fwdAll; Utils.show(field)}
132 onLeftEditMode: page.editing = null133 onLeftEditMode: page.editing = null
@@ -170,7 +171,7 @@
170 id: fwdBusy171 id: fwdBusy
171 objectName: "fwdBusy"172 objectName: "fwdBusy"
172 anchors { left: parent.left; right: parent.right }173 anchors { left: parent.left; right: parent.right }
173 callForwarding: sim.callForwarding174 callForwarding: callForwarding
174 rule: "voiceBusy"175 rule: "voiceBusy"
175 text: i18n.tr("I’m on another call")176 text: i18n.tr("I’m on another call")
176 onEnteredEditMode: {page.editing = fwdBusy; Utils.show(field)}177 onEnteredEditMode: {page.editing = fwdBusy; Utils.show(field)}
@@ -181,7 +182,7 @@
181 id: fwdLost182 id: fwdLost
182 objectName: "fwdLost"183 objectName: "fwdLost"
183 anchors { left: parent.left; right: parent.right }184 anchors { left: parent.left; right: parent.right }
184 callForwarding: sim.callForwarding185 callForwarding: callForwarding
185 rule: "voiceNoReply"186 rule: "voiceNoReply"
186 text: i18n.tr("I don’t answer")187 text: i18n.tr("I don’t answer")
187 onEnteredEditMode: {page.editing = fwdLost; Utils.show(field)}188 onEnteredEditMode: {page.editing = fwdLost; Utils.show(field)}
@@ -192,7 +193,7 @@
192 id: fwdUnreachable193 id: fwdUnreachable
193 objectName: "fwdUnreachable"194 objectName: "fwdUnreachable"
194 anchors { left: parent.left; right: parent.right }195 anchors { left: parent.left; right: parent.right }
195 callForwarding: sim.callForwarding196 callForwarding: callForwarding
196 rule: "voiceNotReachable"197 rule: "voiceNotReachable"
197 text: i18n.tr("My phone is unreachable")198 text: i18n.tr("My phone is unreachable")
198 onEnteredEditMode: {199 onEnteredEditMode: {
@@ -359,7 +360,39 @@
359 }360 }
360361
361 Connections {362 Connections {
362 target: sim.callForwarding363 target: callForwarding
363 onGetPropertiesFailed: page.state = "forwardFailed";364 onGetPropertiesFailed: page.state = "forwardFailed";
364 }365 }
366
367 OfonoCallForwarding {
368 id: callForwarding
369 modemPath: sim.path
370 function updateSummary () {
371 var val;
372
373 // Clear the summary and exit if any of the values are unknown.
374 if (typeof voiceUnconditional === 'undefined' ||
375 typeof voiceBusy === 'undefined' ||
376 typeof voiceNoReply === 'undefined' ||
377 typeof voiceNotReachable === 'undefined') {
378 sim.setCallForwardingSummary('');
379 return;
380 }
381
382 if (voiceUnconditional) {
383 val = i18n.tr('All calls');
384 } else if (voiceBusy || voiceNoReply || voiceNotReachable) {
385 val = i18n.tr('Some calls')
386 } else {
387 val = i18n.tr('Off')
388 }
389 sim.setCallForwardingSummary(val);
390 }
391
392 Component.onCompleted: updateSummary()
393 onVoiceUnconditionalChanged: updateSummary()
394 onVoiceBusyChanged: updateSummary()
395 onVoiceNoReplyChanged: updateSummary()
396 onVoiceNotReachableChanged: updateSummary()
397 }
365}398}
366399
=== modified file 'plugins/phone/MultiSim.qml'
--- plugins/phone/MultiSim.qml 2015-08-10 13:31:45 +0000
+++ plugins/phone/MultiSim.qml 2015-11-09 12:37:53 +0000
@@ -51,17 +51,7 @@
51 objectName: "callFwdSim" + index51 objectName: "callFwdSim" + index
52 text: i18n.tr("Call forwarding")52 text: i18n.tr("Call forwarding")
53 progression: true53 progression: true
54 value: {54 value: sims[index].getCallForwardingSummary()
55 if (sims[index].callForwarding.voiceUnconditional) {
56 return i18n.tr("All calls");
57 } else if (sims[index].callForwarding.voiceBusy ||
58 sims[index].callForwarding.voiceNoReply ||
59 sims[index].callForwarding.voiceNotReachable) {
60 return i18n.tr("Some calls")
61 } else {
62 return i18n.tr("Off")
63 }
64 }
65 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {55 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {
66 sim: sims[index],56 sim: sims[index],
67 headerTitle: sims[index].title57 headerTitle: sims[index].title
6858
=== modified file 'plugins/phone/Ofono.qml'
--- plugins/phone/Ofono.qml 2015-08-10 13:31:45 +0000
+++ plugins/phone/Ofono.qml 2015-11-09 12:37:53 +0000
@@ -18,10 +18,10 @@
18 *18 *
19*/19*/
20import QtQuick 2.420import QtQuick 2.4
21import GSettings 1.0
21import MeeGo.QOfono 0.222import MeeGo.QOfono 0.2
2223
23Item {24Item {
24 property alias callForwarding: callForwarding
25 property alias netReg: netReg25 property alias netReg: netReg
26 property alias simMng: simMng26 property alias simMng: simMng
27 property alias present: simMng.present27 property alias present: simMng.present
@@ -33,11 +33,6 @@
33 return name + (number ? " (" + number + ")" : "");33 return name + (number ? " (" + number + ")" : "");
34 }34 }
3535
36 OfonoCallForwarding {
37 id: callForwarding
38 modemPath: path
39 }
40
41 OfonoNetworkRegistration {36 OfonoNetworkRegistration {
42 id: netReg37 id: netReg
43 modemPath: path38 modemPath: path
@@ -47,4 +42,28 @@
47 id: simMng42 id: simMng
48 modemPath: path43 modemPath: path
49 }44 }
45
46 function setCallForwardingSummary (val) {
47 var tmp = {};
48 var fwdSum = settings.callforwardingSummaries;
49 for (var k in fwdSum){
50 if (fwdSum.hasOwnProperty(k)) {
51 tmp[k] = fwdSum[k];
52 }
53 }
54 // Prefer IMSI to identify the SIM, use ICCID if IMSI is not available.
55 tmp[simMng.subscriberIdentity || simMng.CardIdentifier] = val;
56 settings.callforwardingSummaries = tmp;
57 }
58
59 function getCallForwardingSummary () {
60 // Use either IMSI or ICCID to identify the SIM.
61 var sid = simMng.subscriberIdentity || simMng.CardIdentifier;
62 return settings.callforwardingSummaries[sid] || '';
63 }
64
65 GSettings {
66 id: settings
67 schema.id: "com.ubuntu.touch.system-settings"
68 }
50}69}
5170
=== modified file 'plugins/phone/SingleSim.qml'
--- plugins/phone/SingleSim.qml 2015-08-10 13:31:45 +0000
+++ plugins/phone/SingleSim.qml 2015-11-09 12:37:53 +0000
@@ -41,17 +41,7 @@
41 text: i18n.tr("Call forwarding")41 text: i18n.tr("Call forwarding")
42 showDivider: false42 showDivider: false
43 progression: true43 progression: true
44 value: {44 value: sim.getCallForwardingSummary()
45 if (sim.callForwarding.voiceUnconditional) {
46 return i18n.tr("All calls");
47 } else if (sim.callForwarding.voiceBusy ||
48 sim.callForwarding.voiceNoReply ||
49 sim.callForwarding.voiceNotReachable) {
50 return i18n.tr("Some calls")
51 } else {
52 return i18n.tr("Off")
53 }
54 }
55 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim})45 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim})
56 }46 }
5747
5848
=== modified file 'plugins/phone/callForwardingUtils.js'
--- plugins/phone/callForwardingUtils.js 2015-07-02 18:36:39 +0000
+++ plugins/phone/callForwardingUtils.js 2015-11-09 12:37:53 +0000
@@ -73,6 +73,13 @@
73}73}
7474
75/**75/**
76 * Handler for when the rule ready changes.
77 */
78function ruleReadyChanged () {
79 d._pending = !callForwarding.ready;
80}
81
82/**
76 * Scroll something into view.83 * Scroll something into view.
77 *84 *
78 * @param {QtObject} item to scroll to.85 * @param {QtObject} item to scroll to.
7986
=== modified file 'schema/com.ubuntu.touch.system-settings.gschema.xml'
--- schema/com.ubuntu.touch.system-settings.gschema.xml 2014-07-29 12:27:37 +0000
+++ schema/com.ubuntu.touch.system-settings.gschema.xml 2015-11-09 12:37:53 +0000
@@ -27,5 +27,10 @@
27 <summary>Whether the applications should be sorted by name.</summary>27 <summary>Whether the applications should be sorted by name.</summary>
28 <description>If true the applications are sorted by name, otherwise by disk size.</description>28 <description>If true the applications are sorted by name, otherwise by disk size.</description>
29 </key>29 </key>
30 <key name="callforwarding-summaries" type="a{ss}">
31 <summary>Call forwarding summaries</summary>
32 <default>{}</default>
33 <description>Mapping of SIM to a call forwarding summary.</description>
34 </key>
30 </schema>35 </schema>
31</schemalist>36</schemalist>

Subscribers

People subscribed via source and target branches