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

Commit 45e9e644 authored by William Leshner's avatar William Leshner Committed by Automerger Merge Worker
Browse files

Merge "Fix LnT icon not being removed from dream status bar." into udc-qpr-dev...

Merge "Fix LnT icon not being removed from dream status bar." into udc-qpr-dev am: e97c42cc am: eab6d998

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



Change-Id: Ib8a9b7c7a95c32f960c640f387782698553f6926
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b0f800e5 eab6d998
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();
    }