summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Will Leshner <wleshner@google.com> 2023-08-28 13:53:26 -0700
committer Will Leshner <wleshner@google.com> 2023-08-28 13:53:26 -0700
commit83be42c7366c90de16eae96451838d0f114fb594 (patch)
tree98ab847f3823909f238296758338f7fae53f293b
parentdc2ea290dd674d35343fbc9f8a8d408002601768 (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/assist/AssistManager.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
index 165bb6c6f68c..f26404cad02b 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -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();
}