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

Commit 93508697 authored by Winson Chung's avatar Winson Chung
Browse files

Add some more noisy logs to track layer view expansion

Bug: 411271022
Flags: EXEMPT log only update
Test: Just adding logs
Change-Id: I609772cab4f6278ddfc0b001ae2ae76e856efa3e
parent 82e454bf
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.os.AsyncTask.Status.FINISHED;


import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY;


import android.annotation.DimenRes;
import android.annotation.DimenRes;
import android.annotation.Hide;
import android.annotation.Hide;
@@ -711,6 +712,7 @@ public class Bubble implements BubbleViewProvider {
     * Sets the current bubble-transition that is coordinating a change in this bubble.
     * Sets the current bubble-transition that is coordinating a change in this bubble.
     */
     */
    void setPreparingTransition(BubbleTransitions.BubbleTransition transit) {
    void setPreparingTransition(BubbleTransitions.BubbleTransition transit) {
        ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "setPreparingTransition: transit=%s", transit);
        mPreparingTransition = transit;
        mPreparingTransition = transit;
    }
    }


+27 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import static com.android.wm.shell.bubbles.Bubbles.DISMISS_PACKAGE_REMOVED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_SHORTCUT_REMOVED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_SHORTCUT_REMOVED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_USER_CHANGED;
import static com.android.wm.shell.bubbles.Bubbles.DISMISS_USER_CHANGED;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES_NOISY;


import android.annotation.BinderThread;
import android.annotation.BinderThread;
import android.annotation.NonNull;
import android.annotation.NonNull;
@@ -2530,6 +2531,8 @@ public class BubbleController implements ConfigurationChangeListener,


    private void showExpandedViewForBubbleBar() {
    private void showExpandedViewForBubbleBar() {
        BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble();
        BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble();
        ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "Controller.showExpandedViewForBubbleBar: bubble=%s",
                selectedBubble);
        if (selectedBubble == null) return;
        if (selectedBubble == null) return;
        if (selectedBubble instanceof Bubble) {
        if (selectedBubble instanceof Bubble) {
            final Bubble bubble = (Bubble) selectedBubble;
            final Bubble bubble = (Bubble) selectedBubble;
@@ -2939,6 +2942,8 @@ public class BubbleController implements ConfigurationChangeListener,


        @Override
        @Override
        public void showShortcutBubble(ShortcutInfo info, @Nullable BubbleBarLocation location) {
        public void showShortcutBubble(ShortcutInfo info, @Nullable BubbleBarLocation location) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showShortcutBubble: info=%s loc=%s",
                    info, location);
            mMainExecutor.execute(() -> mController
            mMainExecutor.execute(() -> mController
                    .expandStackAndSelectBubble(info, location));
                    .expandStackAndSelectBubble(info, location));
        }
        }
@@ -2946,23 +2951,29 @@ public class BubbleController implements ConfigurationChangeListener,
        @Override
        @Override
        public void showAppBubble(Intent intent, UserHandle user,
        public void showAppBubble(Intent intent, UserHandle user,
                @Nullable BubbleBarLocation location) {
                @Nullable BubbleBarLocation location) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showAppBubble: intent=%s user=%s loc=%s",
                    intent, user, location);
            mMainExecutor.execute(
            mMainExecutor.execute(
                    () -> mController.expandStackAndSelectBubble(intent, user, location));
                    () -> mController.expandStackAndSelectBubble(intent, user, location));
        }
        }


        @Override
        @Override
        public void showBubble(String key, int topOnScreen) {
        public void showBubble(String key, int topOnScreen) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showBubble: key=%s top=%d",
                    key, topOnScreen);
            mMainExecutor.execute(
            mMainExecutor.execute(
                    () -> mController.expandStackAndSelectBubbleFromLauncher(key, topOnScreen));
                    () -> mController.expandStackAndSelectBubbleFromLauncher(key, topOnScreen));
        }
        }


        @Override
        @Override
        public void removeAllBubbles() {
        public void removeAllBubbles() {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.removeAllBubbles");
            mMainExecutor.execute(() -> mController.removeAllBubbles(Bubbles.DISMISS_USER_GESTURE));
            mMainExecutor.execute(() -> mController.removeAllBubbles(Bubbles.DISMISS_USER_GESTURE));
        }
        }


        @Override
        @Override
        public void collapseBubbles() {
        public void collapseBubbles() {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.collapseBubbles");
            mMainExecutor.execute(() -> {
            mMainExecutor.execute(() -> {
                if (mBubbleData.getSelectedBubble() instanceof Bubble) {
                if (mBubbleData.getSelectedBubble() instanceof Bubble) {
                    if (((Bubble) mBubbleData.getSelectedBubble()).getPreparingTransition()
                    if (((Bubble) mBubbleData.getSelectedBubble()).getPreparingTransition()
@@ -2979,21 +2990,28 @@ public class BubbleController implements ConfigurationChangeListener,


        @Override
        @Override
        public void startBubbleDrag(String bubbleKey) {
        public void startBubbleDrag(String bubbleKey) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.startBubbleDrag: key=%s", bubbleKey);
            mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey));
            mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey));
        }
        }


        @Override
        @Override
        public void stopBubbleDrag(BubbleBarLocation location, int topOnScreen) {
        public void stopBubbleDrag(BubbleBarLocation location, int topOnScreen) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.stopBubbleDrag: log=%s top=%d",
                    location, topOnScreen);
            mMainExecutor.execute(() -> mController.stopBubbleDrag(location, topOnScreen));
            mMainExecutor.execute(() -> mController.stopBubbleDrag(location, topOnScreen));
        }
        }


        @Override
        @Override
        public void dragBubbleToDismiss(String key, long timestamp) {
        public void dragBubbleToDismiss(String key, long timestamp) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.dragBubbleToDismiss: key=%s time=%d",
                    key, timestamp);
            mMainExecutor.execute(() -> mController.dragBubbleToDismiss(key, timestamp));
            mMainExecutor.execute(() -> mController.dragBubbleToDismiss(key, timestamp));
        }
        }


        @Override
        @Override
        public void showUserEducation(int positionX, int positionY) {
        public void showUserEducation(int positionX, int positionY) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showUserEducation: pos=[%d, %d]",
                    positionX, positionY);
            mMainExecutor.execute(() ->
            mMainExecutor.execute(() ->
                    mController.showUserEducation(new Point(positionX, positionY)));
                    mController.showUserEducation(new Point(positionX, positionY)));
        }
        }
@@ -3001,12 +3019,16 @@ public class BubbleController implements ConfigurationChangeListener,
        @Override
        @Override
        public void setBubbleBarLocation(BubbleBarLocation location,
        public void setBubbleBarLocation(BubbleBarLocation location,
                @UpdateSource int source) {
                @UpdateSource int source) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.setBubbleBarLocation: loc=%s src=%d",
                    location, source);
            mMainExecutor.execute(() ->
            mMainExecutor.execute(() ->
                    mController.setBubbleBarLocation(location, source));
                    mController.setBubbleBarLocation(location, source));
        }
        }


        @Override
        @Override
        public void updateBubbleBarTopOnScreen(int topOnScreen) {
        public void updateBubbleBarTopOnScreen(int topOnScreen) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.updateBubbleBarTopOnScreen: top=%d",
                    topOnScreen);
            mMainExecutor.execute(() -> {
            mMainExecutor.execute(() -> {
                mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen);
                mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen);
                if (mLayerView != null) mLayerView.updateExpandedView();
                if (mLayerView != null) mLayerView.updateExpandedView();
@@ -3015,6 +3037,7 @@ public class BubbleController implements ConfigurationChangeListener,


        @Override
        @Override
        public void showExpandedView() {
        public void showExpandedView() {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showExpandedView");
            mMainExecutor.execute(() -> {
            mMainExecutor.execute(() -> {
                if (mLayerView != null) {
                if (mLayerView != null) {
                    showExpandedViewForBubbleBar();
                    showExpandedViewForBubbleBar();
@@ -3024,6 +3047,8 @@ public class BubbleController implements ConfigurationChangeListener,


        @Override
        @Override
        public void showDropTarget(boolean show, BubbleBarLocation location) {
        public void showDropTarget(boolean show, BubbleBarLocation location) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showDropTarget: show=%b loc=%s",
                    show, location);
            mMainExecutor.execute(() -> {
            mMainExecutor.execute(() -> {
                if (show) {
                if (show) {
                    showBubbleBarExpandedViewDropTarget(location);
                    showBubbleBarExpandedViewDropTarget(location);
@@ -3035,6 +3060,8 @@ public class BubbleController implements ConfigurationChangeListener,


        @Override
        @Override
        public void moveDraggedBubbleToFullscreen(String key, Point dropLocation) {
        public void moveDraggedBubbleToFullscreen(String key, Point dropLocation) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.moveDraggedBubbleToFullscreen: key=%s "
                            + "loc=%s", key, dropLocation);
            mMainExecutor.execute(
            mMainExecutor.execute(
                    () -> mController.moveDraggedBubbleToFullscreen(key, dropLocation));
                    () -> mController.moveDraggedBubbleToFullscreen(key, dropLocation));
        }
        }
+8 −5
Original line number Original line Diff line number Diff line
@@ -808,7 +808,8 @@ public class BubbleData {
            if (hasOverflowBubbleWithKey(key)
            if (hasOverflowBubbleWithKey(key)
                    && shouldRemoveHiddenBubble) {
                    && shouldRemoveHiddenBubble) {
                Bubble b = getOverflowBubbleWithKey(key);
                Bubble b = getOverflowBubbleWithKey(key);
                ProtoLog.d(WM_SHELL_BUBBLES, "doRemove - cancel overflow bubble=%s", key);
                ProtoLog.d(WM_SHELL_BUBBLES, "doRemove - cancel overflow bubble=%s reason=%d",
                        key, reason);
                if (b != null) {
                if (b != null) {
                    b.stopInflation();
                    b.stopInflation();
                }
                }
@@ -822,7 +823,8 @@ public class BubbleData {
            }
            }
            if (hasSuppressedBubbleWithKey(key) && shouldRemoveHiddenBubble) {
            if (hasSuppressedBubbleWithKey(key) && shouldRemoveHiddenBubble) {
                Bubble b = getSuppressedBubbleWithKey(key);
                Bubble b = getSuppressedBubbleWithKey(key);
                ProtoLog.d(WM_SHELL_BUBBLES, "doRemove - cancel suppressed bubble=%s", key);
                ProtoLog.d(WM_SHELL_BUBBLES, "doRemove - cancel suppressed bubble=%s reason=%d",
                        key, reason);
                if (b != null) {
                if (b != null) {
                    mSuppressedBubbles.remove(b.getLocusId());
                    mSuppressedBubbles.remove(b.getLocusId());
                    b.stopInflation();
                    b.stopInflation();
@@ -832,7 +834,7 @@ public class BubbleData {
            return;
            return;
        }
        }
        Bubble bubbleToRemove = mBubbles.get(indexToRemove);
        Bubble bubbleToRemove = mBubbles.get(indexToRemove);
        ProtoLog.d(WM_SHELL_BUBBLES, "doRemove=%s", bubbleToRemove.getKey());
        ProtoLog.d(WM_SHELL_BUBBLES, "doRemove=%s reason=%d", bubbleToRemove.getKey(), reason);
        bubbleToRemove.stopInflation();
        bubbleToRemove.stopInflation();
        overflowBubble(reason, bubbleToRemove);
        overflowBubble(reason, bubbleToRemove);


@@ -882,7 +884,8 @@ public class BubbleData {


    private void setNewSelectedIndex(int indexOfSelected) {
    private void setNewSelectedIndex(int indexOfSelected) {
        if (mBubbles.isEmpty()) {
        if (mBubbles.isEmpty()) {
            Log.w(TAG, "Bubbles list empty when attempting to select index: " + indexOfSelected);
            Log.w(TAG, "Bubbles list empty when attempting to select index: "
                    + indexOfSelected);
            return;
            return;
        }
        }
        // Move selection to the new bubble at the same position.
        // Move selection to the new bubble at the same position.
@@ -937,7 +940,7 @@ public class BubbleData {
                || reason == Bubbles.DISMISS_RELOAD_FROM_DISK)) {
                || reason == Bubbles.DISMISS_RELOAD_FROM_DISK)) {
            return;
            return;
        }
        }
        ProtoLog.d(WM_SHELL_BUBBLES, "overflowBubble=%s", bubble.getKey());
        ProtoLog.d(WM_SHELL_BUBBLES, "overflowBubble=%s reason=%d", bubble.getKey(), reason);
        mLogger.logOverflowAdd(bubble, mPositioner.isShowingInBubbleBar(), reason);
        mLogger.logOverflowAdd(bubble, mPositioner.isShowingInBubbleBar(), reason);
        if (mOverflowBubbles.isEmpty()) {
        if (mOverflowBubbles.isEmpty()) {
            mStateChange.showOverflowChanged = true;
            mStateChange.showOverflowChanged = true;
+6 −0
Original line number Original line Diff line number Diff line
@@ -464,6 +464,8 @@ public class BubbleTransitions {
                BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
                BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
                boolean inflateSync, IBinder transition,
                boolean inflateSync, IBinder transition,
                Consumer<TransitionHandler> onInflatedCallback) {
                Consumer<TransitionHandler> onInflatedCallback) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble(): expanded=%s",
                    layerView.isExpanded());
            mBubble = bubble;
            mBubble = bubble;
            mTransition = transition;
            mTransition = transition;
            mTransitionProgress = new TransitionProgress(bubble);
            mTransitionProgress = new TransitionProgress(bubble);
@@ -487,6 +489,7 @@ public class BubbleTransitions {


        @VisibleForTesting
        @VisibleForTesting
        void onInflated(Bubble b) {
        void onInflated(Bubble b) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble.onInflated()");
            if (b != mBubble) {
            if (b != mBubble) {
                throw new IllegalArgumentException("inflate callback doesn't match bubble");
                throw new IllegalArgumentException("inflate callback doesn't match bubble");
            }
            }
@@ -717,6 +720,8 @@ public class BubbleTransitions {
                BubblePositioner positioner, BubbleStackView stackView,
                BubblePositioner positioner, BubbleStackView stackView,
                BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
                BubbleBarLayerView layerView, BubbleIconFactory iconFactory,
                boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) {
                boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert(): expanded=%s",
                    layerView.isExpanded());
            mBubble = bubble;
            mBubble = bubble;
            mTransitionProgress = new TransitionProgress(bubble);
            mTransitionProgress = new TransitionProgress(bubble);
            mLayerView = layerView;
            mLayerView = layerView;
@@ -737,6 +742,7 @@ public class BubbleTransitions {


        @VisibleForTesting
        @VisibleForTesting
        void onInflated(Bubble b) {
        void onInflated(Bubble b) {
            ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert.onInflated()");
            if (b != mBubble) {
            if (b != mBubble) {
                throw new IllegalArgumentException("inflate callback doesn't match bubble");
                throw new IllegalArgumentException("inflate callback doesn't match bubble");
            }
            }