on xenial help sign in
Skip second SIM unlock dialog if user presses Emergency Call on first one Fixes: 1387925

Approved by: Michael Zanetti, PS Jenkins bot

commit0c8b6e5d7691f854f665eda737af8bc24cd3b807 authorMichael Terry <michael.terry@canonical.com> dateFri 7 Nov 2014, 14:30 (12 years ago) parent1a13033c13b8bd
2 files changed+18−7
qml/Notifications/NotificationMenuItemFactory.qml+14−2 qml/Shell.qml+4−5
qml/Notifications/NotificationMenuItemFactory.qml+14−2
@@ -42,6 +42,18 @@ Loader {
4242 if (menuData.type !== undefined) {
4343 var component = _map[menuData.type];
4444 if (component !== undefined) {
45+ if (component === pinLock && shell.hasLockedApp) {
46+ // In case we are in emergency mode, just skip this unlock.
47+ // Happens with two locked SIMs but the user clicks
48+ // Emergency Call on the first unlock dialog.
49+ // TODO: if we ever allow showing the indicators in
50+ // emergency mode, we'll need to differentiate between
51+ // user-initiated ones which we *do* want to show and the
52+ // dialogs that appear on boot, which we don't. But for
53+ // now we can get away with skipping all such dialogs.
54+ menuModel.activate(menuIndex, false);
55+ return null;
56+ }
4557 return component;
4658 }
4759 }
@@ -144,8 +156,8 @@ Loader {
144156 }
145157
146158 onEmergencyCall: {
147− shell.activateApplication("dialer-app")
148− menuModel.activate(menuIndex, false)
159+ shell.startLockedApp("dialer-app");
160+ menuModel.activate(menuIndex, false);
149161 }
150162
151163 property var extendedData: menuData && menuData.ext || undefined
qml/Shell.qml+4−5
@@ -55,6 +55,7 @@ Item {
5555 readonly property real panelHeight: panel.panelHeight
5656
5757 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
58+ readonly property alias hasLockedApp: greeter.hasLockedApp
5859 readonly property bool forcedUnlock: edgeDemo.running
5960 onForcedUnlockChanged: if (forcedUnlock) lockscreen.hide()
6061
@@ -91,12 +92,10 @@ Item {
9192 }
9293
9394 function startLockedApp(app) {
94− if (!shell.locked) {
95− console.warn("Called startLockedApp(%1) when not locked, ignoring".arg(app))
96− return
95+ if (shell.locked) {
96+ greeter.lockedApp = app;
9797 }
98− greeter.lockedApp = app
99− shell.activateApplication(app)
98+ shell.activateApplication(app);
10099 }
101100
102101 Binding {