unbind from HotwordDetectionService when all sessions are destroyed
Test: atest AlwaysOnHotwordDetectorTest Bug: 277392480 Change-Id: I15855ad174bebd97409e6baa7c0256d2b0440d1a
This commit is contained in:
@@ -913,8 +913,10 @@ final class HotwordDetectionConnection {
|
||||
}
|
||||
// Handle case where all hotword detector sessions are destroyed with only the visual
|
||||
// detector session left
|
||||
if (mDetectorSessions.size() == 1
|
||||
&& mDetectorSessions.get(0) instanceof VisualQueryDetectorSession) {
|
||||
boolean allHotwordDetectionServiceSessionsRemoved = mDetectorSessions.size() == 0
|
||||
|| (mDetectorSessions.size() == 1 && mDetectorSessions.get(0)
|
||||
instanceof VisualQueryDetectorSession);
|
||||
if (allHotwordDetectionServiceSessionsRemoved) {
|
||||
unbindHotwordDetectionService();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user