Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.os.AsyncTask.Status.FINISHED; 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_NOISY; import android.annotation.DimenRes; import android.annotation.Hide; Loading Loading @@ -711,6 +712,7 @@ public class Bubble implements BubbleViewProvider { * Sets the current bubble-transition that is coordinating a change in this bubble. */ void setPreparingTransition(BubbleTransitions.BubbleTransition transit) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "setPreparingTransition: transit=%s", transit); mPreparingTransition = transit; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +27 −0 Original line number Diff line number Diff line Loading @@ -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_USER_CHANGED; 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.NonNull; Loading Loading @@ -2530,6 +2531,8 @@ public class BubbleController implements ConfigurationChangeListener, private void showExpandedViewForBubbleBar() { BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble(); ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "Controller.showExpandedViewForBubbleBar: bubble=%s", selectedBubble); if (selectedBubble == null) return; if (selectedBubble instanceof Bubble) { final Bubble bubble = (Bubble) selectedBubble; Loading Loading @@ -2939,6 +2942,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override 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 .expandStackAndSelectBubble(info, location)); } Loading @@ -2946,23 +2951,29 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showAppBubble(Intent intent, UserHandle user, @Nullable BubbleBarLocation location) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showAppBubble: intent=%s user=%s loc=%s", intent, user, location); mMainExecutor.execute( () -> mController.expandStackAndSelectBubble(intent, user, location)); } @Override public void showBubble(String key, int topOnScreen) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showBubble: key=%s top=%d", key, topOnScreen); mMainExecutor.execute( () -> mController.expandStackAndSelectBubbleFromLauncher(key, topOnScreen)); } @Override public void removeAllBubbles() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.removeAllBubbles"); mMainExecutor.execute(() -> mController.removeAllBubbles(Bubbles.DISMISS_USER_GESTURE)); } @Override public void collapseBubbles() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.collapseBubbles"); mMainExecutor.execute(() -> { if (mBubbleData.getSelectedBubble() instanceof Bubble) { if (((Bubble) mBubbleData.getSelectedBubble()).getPreparingTransition() Loading @@ -2979,21 +2990,28 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void startBubbleDrag(String bubbleKey) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.startBubbleDrag: key=%s", bubbleKey); mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey)); } @Override 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)); } @Override 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)); } @Override public void showUserEducation(int positionX, int positionY) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showUserEducation: pos=[%d, %d]", positionX, positionY); mMainExecutor.execute(() -> mController.showUserEducation(new Point(positionX, positionY))); } Loading @@ -3001,12 +3019,16 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void setBubbleBarLocation(BubbleBarLocation location, @UpdateSource int source) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.setBubbleBarLocation: loc=%s src=%d", location, source); mMainExecutor.execute(() -> mController.setBubbleBarLocation(location, source)); } @Override public void updateBubbleBarTopOnScreen(int topOnScreen) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.updateBubbleBarTopOnScreen: top=%d", topOnScreen); mMainExecutor.execute(() -> { mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen); if (mLayerView != null) mLayerView.updateExpandedView(); Loading @@ -3015,6 +3037,7 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showExpandedView() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showExpandedView"); mMainExecutor.execute(() -> { if (mLayerView != null) { showExpandedViewForBubbleBar(); Loading @@ -3024,6 +3047,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showDropTarget(boolean show, BubbleBarLocation location) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showDropTarget: show=%b loc=%s", show, location); mMainExecutor.execute(() -> { if (show) { showBubbleBarExpandedViewDropTarget(location); Loading @@ -3035,6 +3060,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void moveDraggedBubbleToFullscreen(String key, Point dropLocation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.moveDraggedBubbleToFullscreen: key=%s " + "loc=%s", key, dropLocation); mMainExecutor.execute( () -> mController.moveDraggedBubbleToFullscreen(key, dropLocation)); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +8 −5 Original line number Diff line number Diff line Loading @@ -808,7 +808,8 @@ public class BubbleData { if (hasOverflowBubbleWithKey(key) && shouldRemoveHiddenBubble) { 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) { b.stopInflation(); } Loading @@ -822,7 +823,8 @@ public class BubbleData { } if (hasSuppressedBubbleWithKey(key) && shouldRemoveHiddenBubble) { 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) { mSuppressedBubbles.remove(b.getLocusId()); b.stopInflation(); Loading @@ -832,7 +834,7 @@ public class BubbleData { return; } 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(); overflowBubble(reason, bubbleToRemove); Loading Loading @@ -882,7 +884,8 @@ public class BubbleData { private void setNewSelectedIndex(int indexOfSelected) { 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; } // Move selection to the new bubble at the same position. Loading Loading @@ -937,7 +940,7 @@ public class BubbleData { || reason == Bubbles.DISMISS_RELOAD_FROM_DISK)) { 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); if (mOverflowBubbles.isEmpty()) { mStateChange.showOverflowChanged = true; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +6 −0 Original line number Diff line number Diff line Loading @@ -464,6 +464,8 @@ public class BubbleTransitions { BubbleBarLayerView layerView, BubbleIconFactory iconFactory, boolean inflateSync, IBinder transition, Consumer<TransitionHandler> onInflatedCallback) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble(): expanded=%s", layerView.isExpanded()); mBubble = bubble; mTransition = transition; mTransitionProgress = new TransitionProgress(bubble); Loading @@ -487,6 +489,7 @@ public class BubbleTransitions { @VisibleForTesting void onInflated(Bubble b) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble.onInflated()"); if (b != mBubble) { throw new IllegalArgumentException("inflate callback doesn't match bubble"); } Loading Loading @@ -717,6 +720,8 @@ public class BubbleTransitions { BubblePositioner positioner, BubbleStackView stackView, BubbleBarLayerView layerView, BubbleIconFactory iconFactory, boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert(): expanded=%s", layerView.isExpanded()); mBubble = bubble; mTransitionProgress = new TransitionProgress(bubble); mLayerView = layerView; Loading @@ -737,6 +742,7 @@ public class BubbleTransitions { @VisibleForTesting void onInflated(Bubble b) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert.onInflated()"); if (b != mBubble) { throw new IllegalArgumentException("inflate callback doesn't match bubble"); } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.os.AsyncTask.Status.FINISHED; 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_NOISY; import android.annotation.DimenRes; import android.annotation.Hide; Loading Loading @@ -711,6 +712,7 @@ public class Bubble implements BubbleViewProvider { * Sets the current bubble-transition that is coordinating a change in this bubble. */ void setPreparingTransition(BubbleTransitions.BubbleTransition transit) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "setPreparingTransition: transit=%s", transit); mPreparingTransition = transit; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +27 −0 Original line number Diff line number Diff line Loading @@ -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_USER_CHANGED; 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.NonNull; Loading Loading @@ -2530,6 +2531,8 @@ public class BubbleController implements ConfigurationChangeListener, private void showExpandedViewForBubbleBar() { BubbleViewProvider selectedBubble = mBubbleData.getSelectedBubble(); ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "Controller.showExpandedViewForBubbleBar: bubble=%s", selectedBubble); if (selectedBubble == null) return; if (selectedBubble instanceof Bubble) { final Bubble bubble = (Bubble) selectedBubble; Loading Loading @@ -2939,6 +2942,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override 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 .expandStackAndSelectBubble(info, location)); } Loading @@ -2946,23 +2951,29 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showAppBubble(Intent intent, UserHandle user, @Nullable BubbleBarLocation location) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showAppBubble: intent=%s user=%s loc=%s", intent, user, location); mMainExecutor.execute( () -> mController.expandStackAndSelectBubble(intent, user, location)); } @Override public void showBubble(String key, int topOnScreen) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showBubble: key=%s top=%d", key, topOnScreen); mMainExecutor.execute( () -> mController.expandStackAndSelectBubbleFromLauncher(key, topOnScreen)); } @Override public void removeAllBubbles() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.removeAllBubbles"); mMainExecutor.execute(() -> mController.removeAllBubbles(Bubbles.DISMISS_USER_GESTURE)); } @Override public void collapseBubbles() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.collapseBubbles"); mMainExecutor.execute(() -> { if (mBubbleData.getSelectedBubble() instanceof Bubble) { if (((Bubble) mBubbleData.getSelectedBubble()).getPreparingTransition() Loading @@ -2979,21 +2990,28 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void startBubbleDrag(String bubbleKey) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.startBubbleDrag: key=%s", bubbleKey); mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey)); } @Override 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)); } @Override 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)); } @Override public void showUserEducation(int positionX, int positionY) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showUserEducation: pos=[%d, %d]", positionX, positionY); mMainExecutor.execute(() -> mController.showUserEducation(new Point(positionX, positionY))); } Loading @@ -3001,12 +3019,16 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void setBubbleBarLocation(BubbleBarLocation location, @UpdateSource int source) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.setBubbleBarLocation: loc=%s src=%d", location, source); mMainExecutor.execute(() -> mController.setBubbleBarLocation(location, source)); } @Override public void updateBubbleBarTopOnScreen(int topOnScreen) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.updateBubbleBarTopOnScreen: top=%d", topOnScreen); mMainExecutor.execute(() -> { mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen); if (mLayerView != null) mLayerView.updateExpandedView(); Loading @@ -3015,6 +3037,7 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showExpandedView() { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showExpandedView"); mMainExecutor.execute(() -> { if (mLayerView != null) { showExpandedViewForBubbleBar(); Loading @@ -3024,6 +3047,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void showDropTarget(boolean show, BubbleBarLocation location) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.showDropTarget: show=%b loc=%s", show, location); mMainExecutor.execute(() -> { if (show) { showBubbleBarExpandedViewDropTarget(location); Loading @@ -3035,6 +3060,8 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void moveDraggedBubbleToFullscreen(String key, Point dropLocation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "IBubbles.moveDraggedBubbleToFullscreen: key=%s " + "loc=%s", key, dropLocation); mMainExecutor.execute( () -> mController.moveDraggedBubbleToFullscreen(key, dropLocation)); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +8 −5 Original line number Diff line number Diff line Loading @@ -808,7 +808,8 @@ public class BubbleData { if (hasOverflowBubbleWithKey(key) && shouldRemoveHiddenBubble) { 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) { b.stopInflation(); } Loading @@ -822,7 +823,8 @@ public class BubbleData { } if (hasSuppressedBubbleWithKey(key) && shouldRemoveHiddenBubble) { 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) { mSuppressedBubbles.remove(b.getLocusId()); b.stopInflation(); Loading @@ -832,7 +834,7 @@ public class BubbleData { return; } 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(); overflowBubble(reason, bubbleToRemove); Loading Loading @@ -882,7 +884,8 @@ public class BubbleData { private void setNewSelectedIndex(int indexOfSelected) { 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; } // Move selection to the new bubble at the same position. Loading Loading @@ -937,7 +940,7 @@ public class BubbleData { || reason == Bubbles.DISMISS_RELOAD_FROM_DISK)) { 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); if (mOverflowBubbles.isEmpty()) { mStateChange.showOverflowChanged = true; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleTransitions.java +6 −0 Original line number Diff line number Diff line Loading @@ -464,6 +464,8 @@ public class BubbleTransitions { BubbleBarLayerView layerView, BubbleIconFactory iconFactory, boolean inflateSync, IBinder transition, Consumer<TransitionHandler> onInflatedCallback) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble(): expanded=%s", layerView.isExpanded()); mBubble = bubble; mTransition = transition; mTransitionProgress = new TransitionProgress(bubble); Loading @@ -487,6 +489,7 @@ public class BubbleTransitions { @VisibleForTesting void onInflated(Bubble b) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchNewTaskBubble.onInflated()"); if (b != mBubble) { throw new IllegalArgumentException("inflate callback doesn't match bubble"); } Loading Loading @@ -717,6 +720,8 @@ public class BubbleTransitions { BubblePositioner positioner, BubbleStackView stackView, BubbleBarLayerView layerView, BubbleIconFactory iconFactory, boolean inflateSync, @Nullable BubbleBarLocation bubbleBarLocation) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert(): expanded=%s", layerView.isExpanded()); mBubble = bubble; mTransitionProgress = new TransitionProgress(bubble); mLayerView = layerView; Loading @@ -737,6 +742,7 @@ public class BubbleTransitions { @VisibleForTesting void onInflated(Bubble b) { ProtoLog.d(WM_SHELL_BUBBLES_NOISY, "LaunchOrConvert.onInflated()"); if (b != mBubble) { throw new IllegalArgumentException("inflate callback doesn't match bubble"); } Loading