commit | cabd5d559259c69e6b5b86e2151876941fe2f5b2 | [log] [tgz] |
---|---|---|
author | Hongwei Wang <hwwang@google.com> | Thu Nov 17 17:22:26 2022 -0800 |
committer | Hongwei Wang <hwwang@google.com> | Thu Dec 08 12:26:39 2022 -0800 |
tree | 42aa098d82b89ac6b735275427e38c9ba5d1bc0e | |
parent | d7f99f6c63709099e959db57cb62cc196b9f0584 [diff] |
Ensure SysUI gets VIS callback when session's over There are chances that SysUI does not get the onVoiceSessionWindowVisibilityChanged(false) callback if the voice interaction window was visible then the connection is closed. This could cause issue for TaskBar since TaskBar relies on the callback to clear its intermediate state. Video: http://recall/-/b1EZhgUkQcpML5OwZekLBN/giEfwSaYA9saSOfGQwCAus Bug: 254070601 Test: follow the reproduce steps in bug, see also video Change-Id: I0222eea38179620c36253f47f332536ffb9e434c
diff --git a/core/java/com/android/internal/app/IVoiceInteractionSessionListener.aidl b/core/java/com/android/internal/app/IVoiceInteractionSessionListener.aidl index 6e40988..46f78e2 100644 --- a/core/java/com/android/internal/app/IVoiceInteractionSessionListener.aidl +++ b/core/java/com/android/internal/app/IVoiceInteractionSessionListener.aidl
@@ -31,6 +31,8 @@ /** * Called when a voice session window is shown/hidden. + * Caution that there could be duplicated visibility change callbacks, it's up to the listener + * to dedup those events. */ void onVoiceSessionWindowVisibilityChanged(boolean visible);
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java index f90fbb2..2f92bb3 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
@@ -880,5 +880,8 @@ @Override public void onSessionHidden(VoiceInteractionSessionConnection connection) { mServiceStub.onSessionHidden(); + // Notifies visibility change here can cause duplicate events, it is added to make sure + // client always get the callback even if session is unexpectedly closed. + mServiceStub.setSessionWindowVisible(connection.mToken, false); } }