Merge lp:~mterry/unity8/interactive-while-locked into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1183
Merged at revision: 1223
Proposed branch: lp:~mterry/unity8/interactive-while-locked
Merge into: lp:unity8
Diff against target: 304 lines (+105/-8)
7 files modified
debian/control (+1/-1)
plugins/AccountsService/AccountsService.cpp (+38/-0)
plugins/AccountsService/AccountsService.h (+14/-0)
qml/Shell.qml (+2/-2)
tests/mocks/AccountsService/AccountsService.cpp (+24/-0)
tests/mocks/AccountsService/AccountsService.h (+16/-0)
tests/qmltests/tst_ShellWithPin.qml (+10/-5)
To merge this branch: bzr merge lp:~mterry/unity8/interactive-while-locked
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+231253@code.launchpad.net

Commit message

Reverse default for the user option "allow launcher/panel in greeter when locked." And allow that property to be controlled by an AccountsService property. (LP: #1358340)

Description of the change

Reverse default for the user option "allow launcher/panel in greeter when locked." And allow that property to be controlled by an AccountsService property. (LP: #1358340)

I also restored the check for whether we are in 'emergency dialer' mode (i.e. 'fakeActiveForApp' mode) because in that case we still don't want the edges functional.

== Checklist ==

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 - Yes, https://code.launchpad.net/~mterry/gsettings-ubuntu-touch-schemas/enable-edges-while-locked/+merge/231562
   And https://code.launchpad.net/~mterry/ubuntu-system-settings/interactive-while-locked/+merge/231567 lets you change the property in a pretty manner.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 - Yes

 * Did you make sure that your branch does not contain spurious tags?
 - Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 - NA

 * If you changed the UI, has there been a design review?
 - In the bug, this is the way design specified it.

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
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't merge with trunk anymore

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in debian/control
Text conflict in tests/qmltests/tst_ShellWithPin.qml
2 conflicts encountered.

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

Merge from trunk

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

Merged and updated! Tests don't pass because they need the latest schemas package.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Michael do you think we can get a silo for easier testing of all these branches?

review: Abstain
Revision history for this message
Albert Astals Cid (aacid) wrote :

And ↑↑↑ wanted to be a needs info

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote :
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass? If not, please explain why.
No, missing dependency on CI servers

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-08-25 13:10:28 +0000
3+++ debian/control 2014-08-26 14:19:16 +0000
4@@ -168,7 +168,7 @@
5 Architecture: any
6 Multi-Arch: same
7 Pre-Depends: ${misc:Pre-Depends},
8-Depends: accountsservice-ubuntu-schemas,
9+Depends: accountsservice-ubuntu-schemas (>= 0.0.3),
10 gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
11 libhardware2,
12 libunity-core-6.0-9,
13
14=== modified file 'plugins/AccountsService/AccountsService.cpp'
15--- plugins/AccountsService/AccountsService.cpp 2014-07-30 11:08:29 +0000
16+++ plugins/AccountsService/AccountsService.cpp 2014-08-26 14:19:16 +0000
17@@ -26,6 +26,8 @@
18 m_service(new AccountsServiceDBusAdaptor(this)),
19 m_user(qgetenv("USER")),
20 m_demoEdges(false),
21+ m_enableLauncherWhileLocked(false),
22+ m_enableIndicatorsWhileLocked(false),
23 m_statsWelcomeScreen(false),
24 m_passwordDisplayHint(Keyboard),
25 m_failedLogins(0)
26@@ -47,6 +49,8 @@
27 Q_EMIT userChanged();
28
29 updateDemoEdges();
30+ updateEnableLauncherWhileLocked();
31+ updateEnableIndicatorsWhileLocked();
32 updateBackgroundFile();
33 updateStatsWelcomeScreen();
34 updatePasswordDisplayHint();
35@@ -64,6 +68,16 @@
36 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
37 }
38
39+bool AccountsService::enableLauncherWhileLocked() const
40+{
41+ return m_enableLauncherWhileLocked;
42+}
43+
44+bool AccountsService::enableIndicatorsWhileLocked() const
45+{
46+ return m_enableIndicatorsWhileLocked;
47+}
48+
49 QString AccountsService::backgroundFile() const
50 {
51 return m_backgroundFile;
52@@ -88,6 +102,24 @@
53 }
54 }
55
56+void AccountsService::updateEnableLauncherWhileLocked()
57+{
58+ auto enableLauncherWhileLocked = m_service->getUserProperty(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableLauncherWhileLocked").toBool();
59+ if (m_enableLauncherWhileLocked != enableLauncherWhileLocked) {
60+ m_enableLauncherWhileLocked = enableLauncherWhileLocked;
61+ Q_EMIT enableLauncherWhileLockedChanged();
62+ }
63+}
64+
65+void AccountsService::updateEnableIndicatorsWhileLocked()
66+{
67+ auto enableIndicatorsWhileLocked = m_service->getUserProperty(m_user, "com.ubuntu.AccountsService.SecurityPrivacy", "EnableIndicatorsWhileLocked").toBool();
68+ if (m_enableIndicatorsWhileLocked != enableIndicatorsWhileLocked) {
69+ m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
70+ Q_EMIT enableIndicatorsWhileLockedChanged();
71+ }
72+}
73+
74 void AccountsService::updateBackgroundFile()
75 {
76 auto backgroundFile = m_service->getUserProperty(m_user, "org.freedesktop.Accounts.User", "BackgroundFile").toString();
77@@ -157,6 +189,12 @@
78 if (changed.contains("PasswordDisplayHint")) {
79 updatePasswordDisplayHint();
80 }
81+ if (changed.contains("EnableLauncherWhileLocked")) {
82+ updateEnableLauncherWhileLocked();
83+ }
84+ if (changed.contains("EnableIndicatorsWhileLocked")) {
85+ updateEnableIndicatorsWhileLocked();
86+ }
87 }
88 }
89
90
91=== modified file 'plugins/AccountsService/AccountsService.h'
92--- plugins/AccountsService/AccountsService.h 2014-07-30 11:08:29 +0000
93+++ plugins/AccountsService/AccountsService.h 2014-08-26 14:19:16 +0000
94@@ -36,6 +36,12 @@
95 READ demoEdges
96 WRITE setDemoEdges
97 NOTIFY demoEdgesChanged)
98+ Q_PROPERTY (bool enableLauncherWhileLocked
99+ READ enableLauncherWhileLocked
100+ NOTIFY enableLauncherWhileLockedChanged)
101+ Q_PROPERTY (bool enableIndicatorsWhileLocked
102+ READ enableIndicatorsWhileLocked
103+ NOTIFY enableIndicatorsWhileLockedChanged)
104 Q_PROPERTY (QString backgroundFile
105 READ backgroundFile
106 NOTIFY backgroundFileChanged)
107@@ -62,6 +68,8 @@
108 void setUser(const QString &user);
109 bool demoEdges() const;
110 void setDemoEdges(bool demoEdges);
111+ bool enableLauncherWhileLocked() const;
112+ bool enableIndicatorsWhileLocked() const;
113 QString backgroundFile() const;
114 bool statsWelcomeScreen() const;
115 PasswordDisplayHint passwordDisplayHint() const;
116@@ -71,6 +79,8 @@
117 Q_SIGNALS:
118 void userChanged();
119 void demoEdgesChanged();
120+ void enableLauncherWhileLockedChanged();
121+ void enableIndicatorsWhileLockedChanged();
122 void backgroundFileChanged();
123 void statsWelcomeScreenChanged();
124 void passwordDisplayHintChanged();
125@@ -82,6 +92,8 @@
126
127 private:
128 void updateDemoEdges();
129+ void updateEnableLauncherWhileLocked();
130+ void updateEnableIndicatorsWhileLocked();
131 void updateBackgroundFile();
132 void updateStatsWelcomeScreen();
133 void updatePasswordDisplayHint();
134@@ -90,6 +102,8 @@
135 AccountsServiceDBusAdaptor *m_service;
136 QString m_user;
137 bool m_demoEdges;
138+ bool m_enableLauncherWhileLocked;
139+ bool m_enableIndicatorsWhileLocked;
140 QString m_backgroundFile;
141 bool m_statsWelcomeScreen;
142 PasswordDisplayHint m_passwordDisplayHint;
143
144=== modified file 'qml/Shell.qml'
145--- qml/Shell.qml 2014-08-25 13:04:43 +0000
146+++ qml/Shell.qml 2014-08-26 14:19:16 +0000
147@@ -506,7 +506,7 @@
148 anchors.fill: parent //because this draws indicator menus
149 indicators {
150 hides: [launcher]
151- available: edgeDemo.panelEnabled && !shell.locked
152+ available: edgeDemo.panelEnabled && (!shell.locked || AccountsService.enableIndicatorsWhileLocked) && greeter.fakeActiveForApp === ""
153 contentEnabled: edgeDemo.panelContentEnabled
154 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
155 panelHeight: units.gu(3)
156@@ -530,7 +530,7 @@
157 anchors.bottom: parent.bottom
158 width: parent.width
159 dragAreaWidth: shell.edgeSize
160- available: edgeDemo.launcherEnabled && !shell.locked
161+ available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
162
163 onShowDashHome: showHome()
164 onDash: showDash()
165
166=== modified file 'tests/mocks/AccountsService/AccountsService.cpp'
167--- tests/mocks/AccountsService/AccountsService.cpp 2014-07-30 11:08:29 +0000
168+++ tests/mocks/AccountsService/AccountsService.cpp 2014-08-26 14:19:16 +0000
169@@ -22,6 +22,8 @@
170
171 AccountsService::AccountsService(QObject* parent)
172 : QObject(parent),
173+ m_enableLauncherWhileLocked(true),
174+ m_enableIndicatorsWhileLocked(true),
175 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
176 m_statsWelcomeScreen(true),
177 m_failedLogins(0)
178@@ -50,6 +52,28 @@
179 Q_UNUSED(demoEdges)
180 }
181
182+bool AccountsService::enableLauncherWhileLocked() const
183+{
184+ return m_enableLauncherWhileLocked;
185+}
186+
187+void AccountsService::setEnableLauncherWhileLocked(bool enableLauncherWhileLocked)
188+{
189+ m_enableLauncherWhileLocked = enableLauncherWhileLocked;
190+ Q_EMIT enableLauncherWhileLockedChanged();
191+}
192+
193+bool AccountsService::enableIndicatorsWhileLocked() const
194+{
195+ return m_enableIndicatorsWhileLocked;
196+}
197+
198+void AccountsService::setEnableIndicatorsWhileLocked(bool enableIndicatorsWhileLocked)
199+{
200+ m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
201+ Q_EMIT enableIndicatorsWhileLockedChanged();
202+}
203+
204 QString AccountsService::backgroundFile() const
205 {
206 return m_backgroundFile;
207
208=== modified file 'tests/mocks/AccountsService/AccountsService.h'
209--- tests/mocks/AccountsService/AccountsService.h 2014-07-30 11:08:29 +0000
210+++ tests/mocks/AccountsService/AccountsService.h 2014-08-26 14:19:16 +0000
211@@ -36,6 +36,14 @@
212 READ demoEdges
213 WRITE setDemoEdges
214 NOTIFY demoEdgesChanged)
215+ Q_PROPERTY (bool enableLauncherWhileLocked
216+ READ enableLauncherWhileLocked
217+ WRITE setEnableLauncherWhileLocked // only available in mock
218+ NOTIFY enableLauncherWhileLockedChanged)
219+ Q_PROPERTY (bool enableIndicatorsWhileLocked
220+ READ enableIndicatorsWhileLocked
221+ WRITE setEnableIndicatorsWhileLocked // only available in mock
222+ NOTIFY enableIndicatorsWhileLockedChanged)
223 Q_PROPERTY (QString backgroundFile
224 READ backgroundFile
225 WRITE setBackgroundFile // only available in mock
226@@ -64,6 +72,10 @@
227 void setUser(const QString &user);
228 bool demoEdges() const;
229 void setDemoEdges(bool demoEdges);
230+ bool enableLauncherWhileLocked() const;
231+ void setEnableLauncherWhileLocked(bool enableLauncherWhileLocked);
232+ bool enableIndicatorsWhileLocked() const;
233+ void setEnableIndicatorsWhileLocked(bool enableIndicatorsWhileLocked);
234 QString backgroundFile() const;
235 void setBackgroundFile(const QString &backgroundFile);
236 bool statsWelcomeScreen() const;
237@@ -75,12 +87,16 @@
238 Q_SIGNALS:
239 void userChanged();
240 void demoEdgesChanged();
241+ void enableLauncherWhileLockedChanged();
242+ void enableIndicatorsWhileLockedChanged();
243 void backgroundFileChanged();
244 void statsWelcomeScreenChanged();
245 void passwordDisplayHintChanged();
246 void failedLoginsChanged();
247
248 private:
249+ bool m_enableLauncherWhileLocked;
250+ bool m_enableIndicatorsWhileLocked;
251 QString m_backgroundFile;
252 QString m_user;
253 bool m_statsWelcomeScreen;
254
255=== modified file 'tests/qmltests/tst_ShellWithPin.qml'
256--- tests/qmltests/tst_ShellWithPin.qml 2014-08-19 18:06:33 +0000
257+++ tests/qmltests/tst_ShellWithPin.qml 2014-08-26 14:19:16 +0000
258@@ -90,6 +90,8 @@
259 swipeAwayGreeter()
260 shell.failedLoginsDelayAttempts = -1
261 maxRetriesTextField.text = "-1"
262+ AccountsService.enableLauncherWhileLocked = true
263+ AccountsService.enableIndicatorsWhileLocked = true
264 }
265
266 function cleanup() {
267@@ -145,9 +147,13 @@
268
269 function test_disabledEdges() {
270 var launcher = findChild(shell, "launcher")
271+ tryCompare(launcher, "available", true)
272+ AccountsService.enableLauncherWhileLocked = false
273 tryCompare(launcher, "available", false)
274
275 var indicators = findChild(shell, "indicators")
276+ tryCompare(indicators, "available", true)
277+ AccountsService.enableIndicatorsWhileLocked = false
278 tryCompare(indicators, "available", false)
279 }
280
281@@ -165,13 +171,10 @@
282 tryCompare(greeter, "fakeActiveForApp", "dialer-app")
283 tryCompare(lockscreen, "shown", false)
284 tryCompare(panel, "fullscreenMode", true)
285+ tryCompare(indicators, "available", false)
286+ tryCompare(launcher, "available", false)
287 tryCompare(stage, "spreadEnabled", false)
288
289- // These are normally false anyway, but confirm they remain so in
290- // emergency mode.
291- tryCompare(launcher, "available", false)
292- tryCompare(indicators, "available", false)
293-
294 // Cancel emergency mode, and go back to normal
295 waitForRendering(greeter)
296 LightDM.Greeter.showGreeter()
297@@ -180,6 +183,8 @@
298 tryCompare(greeter, "fakeActiveForApp", "")
299 tryCompare(lockscreen, "shown", true)
300 tryCompare(panel, "fullscreenMode", false)
301+ tryCompare(indicators, "available", true)
302+ tryCompare(launcher, "available", true)
303 tryCompare(stage, "spreadEnabled", true)
304 }
305

Subscribers

People subscribed via source and target branches