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

Commit 83be42c7 authored by Will Leshner's avatar Will Leshner
Browse files

Fix LnT icon not being removed from dream status bar.

Under certain situations the look-and-talk status icon can be stuck "on"
in a dream's status bar even when look-and-talk isn't currently active.
This change fixes that issue.

Test: manually
Bug: 297889198
Change-Id: I9e701ab566046bc9f3448a3bdd04ec4b92ab7012
parent dc2ea290
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -154,12 +154,12 @@ public class AssistManager {
            new IVisualQueryDetectionAttentionListener.Stub() {
        @Override
        public void onAttentionGained() {
            mVisualQueryAttentionListeners.forEach(VisualQueryAttentionListener::onAttentionGained);
            handleVisualAttentionChanged(true);
        }

        @Override
        public void onAttentionLost() {
            mVisualQueryAttentionListeners.forEach(VisualQueryAttentionListener::onAttentionLost);
            handleVisualAttentionChanged(false);
        }
    };

@@ -433,11 +433,21 @@ public class AssistManager {

                    @Override
                    public void onStopPerceiving() {
                        // Treat this as a signal that attention has been lost (and inform listeners
                        // accordingly).
                        handleVisualAttentionChanged(false);
                        mAssistUtils.disableVisualQueryDetection();
                    }
                });
    }

    private void handleVisualAttentionChanged(boolean attentionGained) {
        mVisualQueryAttentionListeners.forEach(
                attentionGained
                        ? VisualQueryAttentionListener::onAttentionGained
                        : VisualQueryAttentionListener::onAttentionLost);
    }

    public void launchVoiceAssistFromKeyguard() {
        mAssistUtils.launchVoiceAssistFromKeyguard();
    }