Merge "Ensure SysUI gets VIS callback when session's over" into tm-qpr-dev am: 6dca005ed2 am: 5cb6f8c491

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20515205

Change-Id: I7246439b3dcdd7d22f98d7009de75b011293cac8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hongwei Wang
2022-12-15 09:57:38 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 0 deletions

View File

@@ -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);

View File

@@ -905,5 +905,8 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne
@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);
}
}