Merge lp:~tiagosh/dialer-app/sim-lock into lp:dialer-app

Proposed by Tiago Salem Herrmann on 2014-09-25
Status: Merged
Approved by: Gustavo Pichorim Boiko on 2014-09-30
Approved revision: 297
Merged at revision: 297
Proposed branch: lp:~tiagosh/dialer-app/sim-lock
Merge into: lp:dialer-app
Diff against target: 114 lines (+81/-1)
3 files modified
src/qml/DialerPage/DialerPage.qml (+7/-0)
src/qml/Dialogs/SimLockedDialog.qml (+68/-0)
src/qml/dialer-app.qml (+6/-1)
To merge this branch: bzr merge lp:~tiagosh/dialer-app/sim-lock
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) 2014-09-25 Approve on 2014-09-30
PS Jenkins bot continuous-integration Needs Fixing on 2014-09-25
Review via email: mp+236024@code.launchpad.net

Commit message

Add support for sim lock detection

Description of the change

Add support for sim lock detection

--Checklist--
Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~tiagosh/telephony-service/sim-lock/+merge/235505

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/dialer-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
Yes

If you changed UI labels, did you update the pot file?
Will be done later.

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
lp:~tiagosh/dialer-app/sim-lock updated on 2014-09-25
295. By Tiago Salem Herrmann on 2014-09-25

remove commented code

296. By Tiago Salem Herrmann on 2014-09-25

dont check for sim lock if on greeter mode and if this is an emergency number

297. By Tiago Salem Herrmann on 2014-09-25

perform the same check on call()

Gustavo Pichorim Boiko (boiko) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
No, but not related to the MR

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

Code looks good and works as expected!

review: Approve
lp:~tiagosh/dialer-app/sim-lock updated on 2014-10-01
298. By Tiago Salem Herrmann on 2014-10-01

Disable unlock button for now

299. By Tiago Salem Herrmann on 2014-10-01

change dialog message

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/DialerPage/DialerPage.qml'
2--- src/qml/DialerPage/DialerPage.qml 2014-09-19 18:11:24 +0000
3+++ src/qml/DialerPage/DialerPage.qml 2014-10-01 15:58:56 +0000
4@@ -383,6 +383,13 @@
5 return
6 }
7
8+ if (mainView.account && !greeter.greeterActive && !mainView.isEmergencyNumber(dialNumber) && mainView.account.simLocked) {
9+ var properties = {}
10+ properties["accountId"] = mainView.account.accountId
11+ PopupUtils.open(Qt.createComponent("../Dialogs/SimLockedDialog.qml").createObject(page), footer, properties)
12+ return
13+ }
14+
15 // avoid cleaning the keypadEntry in case there is no signal
16 if (!mainView.account.connected) {
17 PopupUtils.open(noNetworkDialog)
18
19=== added file 'src/qml/Dialogs/SimLockedDialog.qml'
20--- src/qml/Dialogs/SimLockedDialog.qml 1970-01-01 00:00:00 +0000
21+++ src/qml/Dialogs/SimLockedDialog.qml 2014-10-01 15:58:56 +0000
22@@ -0,0 +1,68 @@
23+/*
24+ * Copyright 2012-2013 Canonical Ltd.
25+ *
26+ * This file is part of dialer-app.
27+ *
28+ * dialer-app is free software; you can redistribute it and/or modify
29+ * it under the terms of the GNU General Public License as published by
30+ * the Free Software Foundation; version 3.
31+ *
32+ * dialer-app is distributed in the hope that it will be useful,
33+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
34+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35+ * GNU General Public License for more details.
36+ *
37+ * You should have received a copy of the GNU General Public License
38+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
39+ */
40+
41+import QtQuick 2.0
42+import Ubuntu.Components 1.1
43+import Ubuntu.Components.Popups 0.1
44+
45+Component {
46+ Dialog {
47+ id: dialogue
48+ title: i18n.tr("SIM Card is locked")
49+ Column {
50+ anchors.left: parent.left
51+ anchors.right: parent.right
52+ spacing: units.gu(2)
53+
54+ Label {
55+ anchors.left: parent.left
56+ anchors.right: parent.right
57+ height: paintedHeight
58+ verticalAlignment: Text.AlignVCenter
59+ text: i18n.tr("Please unlock your SIM card to call or send a message. You can unlock your SIM card from the Network Indicator at the top of the screen or by visiting <a href=\"system_settings\">System Settings &gt; Security &amp; Privacy</a>.")
60+ wrapMode: Text.WordWrap
61+ onLinkActivated: {
62+ PopupUtils.close(dialogue)
63+ Qt.openUrlExternally("settings:///system/security-privacy")
64+ }
65+ }
66+ Row {
67+ spacing: units.gu(4)
68+ anchors.horizontalCenter: parent.horizontalCenter
69+ Button {
70+ objectName: "okSimLockedDialog"
71+ text: i18n.tr("Ok")
72+ color: UbuntuColors.orange
73+ onClicked: {
74+ PopupUtils.close(dialogue)
75+ }
76+ }
77+ // Please, reenable this once lp:1374215 gets fixed
78+ /*Button {
79+ objectName: "unlockSimLockedDialog"
80+ text: i18n.tr("Unlock")
81+ color: UbuntuColors.orange
82+ onClicked: {
83+ PopupUtils.close(dialogue)
84+ telepathyHelper.unlockSimCards()
85+ }
86+ }*/
87+ }
88+ }
89+ }
90+}
91
92=== modified file 'src/qml/dialer-app.qml'
93--- src/qml/dialer-app.qml 2014-09-17 17:50:00 +0000
94+++ src/qml/dialer-app.qml 2014-10-01 15:58:56 +0000
95@@ -202,13 +202,18 @@
96 return
97 }
98
99+ var account = telepathyHelper.accountForId(accountId);
100+ if (account && !greeter.greeterActive && !mainView.isEmergencyNumber(number) && account.simLocked) {
101+ PopupUtils.open(Qt.createComponent("Dialogs/SimLockedDialog.qml").createObject(mainView))
102+ return
103+ }
104+
105 if (!telepathyHelper.connected && !isEmergencyNumber((number))) {
106 pendingNumberToDial = number;
107 pendingAccountId = accountId;
108 return;
109 }
110
111- var account = telepathyHelper.accountForId(accountId);
112 if (!account) {
113 account = telepathyHelper.accounts[0];
114 }

Subscribers

People subscribed via source and target branches