Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aef17248 authored by Nicholas Ambur's avatar Nicholas Ambur
Browse files

unbind from HotwordDetectionService when all sessions are destroyed

Test: atest AlwaysOnHotwordDetectorTest
Bug: 277392480
Change-Id: I15855ad174bebd97409e6baa7c0256d2b0440d1a
parent b3096501
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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();
        }
    }