on xenial help sign in
Don't lock phone if user tries to switch back to an active call. Fixes: 1388156

Approved by: Michael Zanetti

commitb668003297f97e130f14a7699fc00b3803d90983 authorMichael Terry <michael.terry@canonical.com> dateTue 4 Nov 2014, 12:55 (12 years ago) parent11146b8e530f6b
2 files changed+59−1
qml/Shell.qml+1−1 tests/qmltests/tst_ShellWithPin.qml+58
qml/Shell.qml+1−1
@@ -185,7 +185,7 @@ Item {
185185 target: ApplicationManager
186186 onFocusRequested: {
187187 if (greeter.narrowMode) {
188− if (appId === "dialer-app" && callManager.hasCalls) {
188+ if (appId === "dialer-app" && callManager.hasCalls && shell.locked) {
189189 // If we are in the middle of a call, make dialer lockedApp and show it.
190190 // This can happen if user backs out of dialer back to greeter, then
191191 // launches dialer again.
tests/qmltests/tst_ShellWithPin.qml+58
@@ -160,6 +160,7 @@ Item {
160160 AccountsService.enableLauncherWhileLocked = true
161161 AccountsService.enableIndicatorsWhileLocked = true
162162 AccountsService.demoEdges = false
163+ callManager.foregroundCall = null
163164
164165 // reload our test subject to get it in a fresh state once again
165166 shellLoader.active = true
@@ -212,6 +213,7 @@ Item {
212213 tryCompare(lockscreen, "shown", false)
213214 tryCompare(greeter, "hasLockedApp", true)
214215 tryCompare(greeter, "lockedApp", app)
216+ tryCompare(LightDM.Greeter, "active", true)
215217 tryCompare(ApplicationManager, "focusedApplicationId", app)
216218 }
217219
@@ -386,5 +388,61 @@ Item {
386388 callManager.foregroundCall = phoneCall
387389 confirmLockedApp("dialer-app")
388390 }
391+
392+ function test_emergencyDialerActiveCallPanel() {
393+ // Make sure that the following sequence works:
394+ // - Enter emergency mode call
395+ // - Return to greeter
396+ // - Click on active call panel
397+ // - Should be back in emergency mode dialer
398+
399+ var greeter = findChild(shell, "greeter");
400+ var lockscreen = findChild(shell, "lockscreen");
401+
402+ lockscreen.emergencyCall();
403+ confirmLockedApp("dialer-app");
404+ callManager.foregroundCall = phoneCall;
405+
406+ LightDM.Greeter.showGreeter();
407+ tryCompare(lockscreen, "shown", true);
408+ tryCompare(greeter, "hasLockedApp", false);
409+
410+ // simulate a callHint press, the real thing requires dialer: url support
411+ ApplicationManager.requestFocusApplication("dialer-app");
412+
413+ confirmLockedApp("dialer-app");
414+ }
415+
416+ function test_normalDialerActiveCallPanel() {
417+ // Make sure that the following sequence works:
418+ // - Log in
419+ // - Start a call
420+ // - Switch apps
421+ // - Click on active call panel
422+ // - Should be back in normal dialer
423+ // (we've had a bug where we locked screen in this case)
424+
425+ var lockscreen = findChild(shell, "lockscreen");
426+ var panel = findChild(shell, "panel");
427+
428+ enterPin("1234");
429+ tryCompare(lockscreen, "shown", false);
430+ tryCompare(LightDM.Greeter, "active", false);
431+
432+ ApplicationManager.startApplication("dialer-app", ApplicationManager.NoFlag);
433+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
434+ callManager.foregroundCall = phoneCall;
435+
436+ ApplicationManager.requestFocusApplication("unity8-dash");
437+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
438+ tryCompare(panel.callHint, "visible", true);
439+
440+ // simulate a callHint press, the real thing requires dialer: url support
441+ ApplicationManager.requestFocusApplication("dialer-app");
442+
443+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
444+ tryCompare(lockscreen, "shown", false);
445+ tryCompare(LightDM.Greeter, "active", false);
446+ }
389447 }
390448}