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

Commit 395bcfe3 authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Add stack/animation controller dumpsys.

Test: adb shell dumpsys activity service com.android.systemui | grep -A 100 BubbleController
Change-Id: I6fb09422930066cafe9811e2840f0b631f4c1b05
parent 70cba7bb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -662,6 +662,10 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        pw.println("BubbleController state:");
        mBubbleData.dump(fd, pw, args);
        pw.println();
        if (mStackView != null) {
            mStackView.dump(fd, pw, args);
        }
        pw.println();
    }

    static String formatBubblesString(List<Bubble> bubbles, Bubble selected) {
+14 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ import com.android.systemui.bubbles.animation.PhysicsAnimationLayout;
import com.android.systemui.bubbles.animation.StackAnimationController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
@@ -196,6 +198,18 @@ public class BubbleStackView extends FrameLayout {
    /** Whether a touch gesture, such as a stack/bubble drag or flyout drag, is in progress. */
    private boolean mIsGestureInProgress = false;

    /** Description of current animation controller state. */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("Stack view state:");
        pw.print("  gestureInProgress:    "); pw.println(mIsGestureInProgress);
        pw.print("  showingDismiss:       "); pw.println(mShowingDismiss);
        pw.print("  isExpansionAnimating: "); pw.println(mIsExpansionAnimating);
        pw.print("  draggingInDismiss:    "); pw.println(mDraggingInDismissTarget);
        pw.print("  animatingMagnet:      "); pw.println(mAnimatingMagnet);
        mStackAnimationController.dump(fd, pw, args);
        mExpandedAnimationController.dump(fd, pw, args);
    }

    private BubbleTouchHandler mTouchHandler;
    private BubbleController.BubbleExpandListener mExpandListener;

+12 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import com.android.systemui.R;

import com.google.android.collect.Sets;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Set;

/**
@@ -357,6 +359,16 @@ public class ExpandedAnimationController
                : 0);
    }

    /** Description of current animation controller state. */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("ExpandedAnimationController state:");
        pw.print("  isActive:          "); pw.println(isActiveController());
        pw.print("  animatingExpand:   "); pw.println(mAnimatingExpand);
        pw.print("  animatingCollapse: "); pw.println(mAnimatingCollapse);
        pw.print("  bubbleInDismiss:   "); pw.println(mIndividualBubbleWithinDismissTarget);
        pw.print("  springingBubble:   "); pw.println(mSpringingBubbleToTouch);
    }

    @Override
    void onActiveControllerForLayout(PhysicsAnimationLayout layout) {
        final Resources res = layout.getResources();
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class PhysicsAnimationLayout extends FrameLayout {

        /** Whether this controller is the currently active controller for its associated layout. */
        protected boolean isActiveController() {
            return this == mLayout.mController;
            return mLayout != null && this == mLayout.mController;
        }

        protected void setLayout(PhysicsAnimationLayout layout) {
+16 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.util.Log;
import android.view.View;
import android.view.WindowInsets;

import androidx.annotation.Nullable;
import androidx.dynamicanimation.animation.DynamicAnimation;
import androidx.dynamicanimation.animation.FlingAnimation;
import androidx.dynamicanimation.animation.FloatPropertyCompat;
@@ -33,6 +34,8 @@ import com.android.systemui.R;

import com.google.android.collect.Sets;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Set;

@@ -92,7 +95,7 @@ public class StackAnimationController extends
    private boolean mStackMovedToStartPosition = false;

    /** The most recent position in which the stack was resting on the edge of the screen. */
    private PointF mRestingStackPosition;
    @Nullable private PointF mRestingStackPosition;

    /** The height of the most recently visible IME. */
    private float mImeHeight = 0f;
@@ -306,6 +309,18 @@ public class StackAnimationController extends
        setStackPosition(new PointF(x, y));
    }

    /** Description of current animation controller state. */
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("StackAnimationController state:");
        pw.print("  isActive:             "); pw.println(isActiveController());
        pw.print("  restingStackPos:      ");
        pw.println(mRestingStackPosition != null ? mRestingStackPosition.toString() : "null");
        pw.print("  currentStackPos:      "); pw.println(mStackPosition.toString());
        pw.print("  isMovingFromFlinging: "); pw.println(mIsMovingFromFlinging);
        pw.print("  withinDismiss:        "); pw.println(mWithinDismissTarget);
        pw.print("  firstBubbleSpringing: "); pw.println(mFirstBubbleSpringingToTouch);
    }

    /**
     * Flings the first bubble along the given property's axis, using the provided configuration
     * values. When the animation ends - either by hitting the min/max, or by friction sufficiently