diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java index 58c5e835c9..0645972eb5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java @@ -282,6 +282,11 @@ public class TaskbarControllers { } uiController.dumpLogs(prefix + "\t", pw); rotationButtonController.dumpLogs(prefix + "\t", pw); + if (bubbleControllers.isPresent()) { + bubbleControllers.get().dump(pw); + } else { + pw.println(String.format("%s\t%s", prefix, "Bubble controllers are empty.")); + } } /** diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index 402b0916f6..d9fae59634 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -49,6 +49,8 @@ import com.android.launcher3.util.DisplayController; import com.android.wm.shell.Flags; import com.android.wm.shell.common.bubbles.BubbleBarLocation; +import java.io.PrintWriter; +import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; @@ -1309,6 +1311,37 @@ public class BubbleBarView extends FrameLayout { }); } + /** Dumps the current state of BubbleBarView. */ + public void dump(PrintWriter pw) { + pw.println("BubbleBarView state:"); + pw.println(" visibility: " + getVisibility()); + pw.println(" translation Y: " + getTranslationY()); + pw.println(" bubbles in bar (childCount = " + getChildCount() + ")"); + for (BubbleView bubbleView: getBubbles()) { + BubbleBarItem bubble = bubbleView.getBubble(); + String key = bubble == null ? "null" : bubble.getKey(); + pw.println(" bubble key: " + key); + } + pw.println(" isExpanded: " + isExpanded()); + pw.println(" mIsAnimatingNewBubble: " + mIsAnimatingNewBubble); + if (mBubbleAnimator != null) { + pw.println(" mBubbleAnimator.isRunning(): " + mBubbleAnimator.isRunning()); + pw.println(" mBubbleAnimator is null"); + } + pw.println(" mDragging: " + mDragging); + } + + private List getBubbles() { + List bubbles = new ArrayList<>(); + for (int i = 0; i < getChildCount(); i++) { + View child = getChildAt(i); + if (child instanceof BubbleView bubble) { + bubbles.add(bubble); + } + } + return bubbles; + } + /** Interface for BubbleBarView to communicate with its controller. */ interface Controller { diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index 40e5b6435f..d7c8a8adb1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -43,6 +43,7 @@ import com.android.launcher3.util.MultiValueAlpha; import com.android.quickstep.SystemUiProxy; import com.android.wm.shell.common.bubbles.BubbleBarLocation; +import java.io.PrintWriter; import java.util.List; import java.util.Objects; import java.util.function.Consumer; @@ -598,4 +599,19 @@ public class BubbleBarViewController { /** Called when bounds have changed */ void onBoundsChanged(); } + + /** Dumps the state of BubbleBarViewController. */ + public void dump(PrintWriter pw) { + pw.println("Bubble bar view controller state:"); + pw.println(" mHiddenForSysui: " + mHiddenForSysui); + pw.println(" mHiddenForNoBubbles: " + mHiddenForNoBubbles); + pw.println(" mShouldShowEducation: " + mShouldShowEducation); + pw.println(" mBubbleBarTranslationY.value: " + mBubbleBarTranslationY.value); + pw.println(" mBubbleBarSwipeUpTranslationY: " + mBubbleBarSwipeUpTranslationY); + if (mBarView != null) { + mBarView.dump(pw); + } else { + pw.println(" Bubble bar view is null!"); + } + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java index 32d6375462..03140fec9a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java @@ -18,6 +18,8 @@ package com.android.launcher3.taskbar.bubbles; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.util.RunnableList; +import java.io.PrintWriter; + /** * Hosts various bubble controllers to facilitate passing between one another. */ @@ -94,4 +96,9 @@ public class BubbleControllers { bubbleStashedHandleViewController.onDestroy(); bubbleBarController.onDestroy(); } + + /** Dumps bubble controllers state. */ + public void dump(PrintWriter pw) { + bubbleBarViewController.dump(pw); + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java index 185f85f469..74f58ac33d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java @@ -36,6 +36,8 @@ import com.android.launcher3.util.MultiPropertyFactory; import com.android.wm.shell.common.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.animation.PhysicsAnimator; +import java.io.PrintWriter; + /** * Coordinates between controllers such as BubbleBarView and BubbleHandleViewController to * create a cohesive animation between stashed/unstashed states. @@ -456,4 +458,13 @@ public class BubbleStashController { public void setHandleTranslationY(float ty) { mHandleViewController.setTranslationYForSwipe(ty); } + + /** Dumps the state of BubbleStashController. */ + public void dump(PrintWriter pw) { + pw.println("Bubble stash controller state:"); + pw.println(" mIsStashed: " + mIsStashed); + pw.println(" mBubblesShowingOnOverview: " + mBubblesShowingOnOverview); + pw.println(" mBubblesShowingOnHome: " + mBubblesShowingOnHome); + pw.println(" mIsSysuiLocked: " + mIsSysuiLocked); + } }