Adds OnBackPressedOnTaskRoot

This allows Bubbles to be collapsed instead of finished
when there is only one activity in the stack.

Bug: 126852149
Test: launch activity, press back
Change-Id: Iad8db0549853e3f385d54fc6b6cea5e502d37139
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index cff03c9..7d189b2 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -719,6 +719,13 @@
                 mBubbleData.setExpanded(false);
             }
         }
+
+        @Override
+        public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) {
+            if (mStackView != null && taskInfo.displayId == getExpandedDisplayId(mContext)) {
+                mBubbleData.setExpanded(false);
+            }
+        }
     }
 
     private static boolean shouldAutoBubbleMessages(Context context) {