You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/windows-voice-assistants-best-practices.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,9 +74,6 @@ When the assistant app has focus, the customer intent is clearly to interact wit
74
74
75
75
Available with 19H2, assistants built on Windows voice activation platform are available to answer above lock.
76
76
77
-
> [!NOTE]
78
-
> Due to an active issue, assistants that draw above lock UI must implement WindowService.CloseWindow() for all dismissals. This will result in app termination, but mitigates a technical issue and keeps the assistant in a clean state. Furthermore, to maintain clean state if an app is enabled for above lock voice activation, it must listen for lock state changes and WindowService.CloseWindow() when the device locks.
79
-
80
77
### Customer opt-in
81
78
82
79
Voice activation above lock is always disabled by default. Customers opt-in through the Windows settings>Privacy>Voice Activation. For details on monitoring and prompting for this setting, see the [above lock implementation guide](windows-voice-assistants-implementation-guide.md#detecting-above-lock-activation-user-preference).
The following steps cover the requirements to enable a voice assistant on Windows to run above lock, including references to example code and guidelines for managing the application lifecycle. For guidance on designing above lock experiences, visit the [best practices guide](windows-voice-assistants-best-practices.md).
111
+
The following steps cover the requirements to enable a voice assistant on Windows to run above lock, including references to example code and guidelines for managing the application lifecycle.
112
+
113
+
For guidance on designing above lock experiences, visit the [best practices guide](windows-voice-assistants-best-practices.md).
114
+
115
+
When an app shows a view above lock, it is considered to be in "Kiosk Mode". For more information on implementing an app that uses Kiosk Mode, see the [kiosk mode documentation](https://docs.microsoft.com/windows-hardware/drivers/partnerapps/create-a-kiosk-app-for-assigned-access).
116
+
117
+
### Transitioning above lock
118
+
119
+
An activation above lock is similar to an activation below lock. If there are no active instances of the application, a new instance will be started in the background and `OnBackgroundActivated` in App.xaml.cs will be called. If there is an instance of the application, that instance will get a notification through the `ConversationalAgentSession.SignalDetected` event.
120
+
121
+
If the application is not already showing above lock, it must call `ConversationalAgentSession.RequestForegroundActivationAsync`. This triggers the `OnLaunched` method in App.xaml.cs which should navigate to the view that will be shown above lock.
112
122
113
123
### Detecting lock screen transitions
114
124
115
-
The ConversationalAgent library in the Windows SDK provides an API to make the lock screen state and changes to the lock screen state easily accessible. To detect the current lock screen state, check the `ConversationalAgentSession.IsUserAuthenticated` field. To detect changes in lock state, add an event handler to the `ConversationalAgentSession` object's `SystemStateChanged` event. It will fire whenever the screen changes from unlocked to locked or vice versa. If the value of the event arguments is `ConversationalAgentSystemStateChangeType.UserAuthentication`, then the lock screen state has changed and the application should close.
125
+
The ConversationalAgent library in the Windows SDK provides an API to make the lock screen state and changes to the lock screen state easily accessible. To detect the current lock screen state, check the `ConversationalAgentSession.IsUserAuthenticated` field. To detect changes in lock state, add an event handler to the `ConversationalAgentSession` object's `SystemStateChanged` event. It will fire whenever the screen changes from unlocked to locked or vice versa. If the value of the event arguments is `ConversationalAgentSystemStateChangeType.UserAuthentication`, then the lock screen state has changed.
116
126
117
127
```csharp
118
-
// When the app changes lock state, close the application to prevent duplicates running at once
if (e.SystemStateChangeType==ConversationalAgentSystemStateChangeType.UserAuthentication)
122
131
{
123
-
WindowService.CloseWindow();
132
+
// Handle lock state change
124
133
}
125
134
};
126
135
```
@@ -133,6 +142,9 @@ The application entry in the Voice Activation Privacy settings page has a toggle
133
142
134
143
To properly close the application programmatically while above or below lock, use the `WindowService.CloseWindow()` API. This triggers all UWP lifecycle methods, including OnSuspend, allowing the application to dispose of its `ConversationalAgentSession` instance before closing.
135
144
145
+
> [!NOTE]
146
+
> The application can close without closing the [below lock instance](https://docs.microsoft.com/windows-hardware/drivers/partnerapps/create-a-kiosk-app-for-assigned-access#add-a-way-out-of-assigned-access-). In this case, the above lock view needs to "clean up", ensuring that once the screen is unlocked, there are no event handlers or tasks that will try to manipulate the above lock view.
0 commit comments