Merge "Ensure SysUI gets VIS callback when session's over" into tm-qpr-dev

This commit is contained in:
Hongwei Wang
2022-12-14 21:38:33 +00:00
committed by Android (Google) Code Review
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

@@ -880,5 +880,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);
}
}