on xenial help sign in
Skip second SIM unlock dialog if user presses Emergency Call on first one Fixes: 1387925
0c8b6e5Michael Terry
qml/Notifications/NotificationMenuItemFactory.qml+14−2
@@ -42,6 +42,18 @@ Loader {
42 if (menuData.type !== undefined) {
42 if (menuData.type !== undefined) {
43 var component = _map[menuData.type];
43 var component = _map[menuData.type];
44 if (component !== undefined) {
44 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+ }
45 return component;
57 return component;
46 }
58 }
47 }
59 }
@@ -144,8 +156,8 @@ Loader {
144 }
156 }
145
157
146 onEmergencyCall: {
158 onEmergencyCall: {
147− shell.activateApplication("dialer-app")
159+ shell.startLockedApp("dialer-app");
148− menuModel.activate(menuIndex, false)
160+ menuModel.activate(menuIndex, false);
149 }
161 }
150
162
151 property var extendedData: menuData && menuData.ext || undefined
163 property var extendedData: menuData && menuData.ext || undefined
qml/Shell.qml+4−5
@@ -55,6 +55,7 @@ Item {
55 readonly property real panelHeight: panel.panelHeight
55 readonly property real panelHeight: panel.panelHeight
56
56
57 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
57 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
58+ readonly property alias hasLockedApp: greeter.hasLockedApp
58 readonly property bool forcedUnlock: edgeDemo.running
59 readonly property bool forcedUnlock: edgeDemo.running
59 onForcedUnlockChanged: if (forcedUnlock) lockscreen.hide()
60 onForcedUnlockChanged: if (forcedUnlock) lockscreen.hide()
60
61
@@ -91,12 +92,10 @@ Item {
91 }
92 }
92
93
93 function startLockedApp(app) {
94 function startLockedApp(app) {
94− if (!shell.locked) {
95+ if (shell.locked) {
95− console.warn("Called startLockedApp(%1) when not locked, ignoring".arg(app))
96+ greeter.lockedApp = app;
96− return
97 }
97 }
98− greeter.lockedApp = app
99− shell.activateApplication(app)
98+ shell.activateApplication(app);
100 }
99 }
101
100
102 Binding {
101 Binding {