Make taskbar accessibility announcement when user is in app only.

Test: Manual
Bug: 265099829
Change-Id: I9d90ed7ae3479cf51b261bba63aedccf515bd2c5
diff --git a/quickstep/res/layout/transient_taskbar.xml b/quickstep/res/layout/transient_taskbar.xml
index 47d63e7..62c6933 100644
--- a/quickstep/res/layout/transient_taskbar.xml
+++ b/quickstep/res/layout/transient_taskbar.xml
@@ -26,6 +26,8 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:gravity="center"
+        android:focusable="true"
+        android:importantForAccessibility="yes"
         android:forceHasOverlappingRendering="false"
         android:layout_gravity="bottom"
         android:layout_marginBottom="@dimen/transient_taskbar_bottom_margin"
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 41d35cf..b98f172 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -600,7 +600,11 @@
                 if (!mIsStashed) {
                     tryStartTaskbarTimeout();
                 }
-                mControllers.taskbarViewController.announceForAccessibility();
+
+                // only announce if we are actually animating
+                if (duration > 0 && isInApp()) {
+                    mControllers.taskbarViewController.announceForAccessibility();
+                }
             }
         });
     }