Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/draganddrop/DragAndDropConstants.java +7 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,11 @@ public class DragAndDropConstants { * An Intent extra that Launcher can use to specify the {@link android.content.pm.ShortcutInfo} */ public static final String EXTRA_SHORTCUT_INFO = "EXTRA_SHORTCUT_INFO"; //TODO(b/440373358) : remove once we properly handle dragging from notification /** * An Intent extra that Notification can use to specify that the drag was originated from the * notification. */ public static final String IS_FROM_NOTIFICATION = "IS_FROM_NOTIFICATION"; } libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java +7 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_LEFT; import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_RIGHT; import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_TOP; import static com.android.wm.shell.shared.draganddrop.DragAndDropConstants.IS_FROM_NOTIFICATION; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; Loading Loading @@ -124,6 +125,7 @@ public class DragLayout extends LinearLayout private boolean mIsShowing; private boolean mHasDropped; private boolean mAllowBubbleTarget; private DragSession mSession; // The last position that was handled by the drag layout private final Point mLastPosition = new Point(); Loading Loading @@ -340,7 +342,8 @@ public class DragLayout extends LinearLayout mSession = session; mHasDropped = false; mCurrentTarget = null; mAllowBubbleTarget = mSession.appData == null || !mSession.appData.getBooleanExtra(IS_FROM_NOTIFICATION, false); boolean alreadyInSplit = mSplitScreenController != null && mSplitScreenController.isSplitScreenVisible(); if (!alreadyInSplit) { Loading Loading @@ -549,7 +552,7 @@ public class DragLayout extends LinearLayout return; } // if event is over the bubble don't let split handle it if (interceptBubbleBarEvent(x, y)) { if (mAllowBubbleTarget && interceptBubbleBarEvent(x, y)) { mLastPosition.set(x, y); return; } Loading Loading @@ -663,7 +666,8 @@ public class DragLayout extends LinearLayout // Process the drop exclusive by DropTarget OR by the BubbleBar if (mCurrentTarget != null) { mPolicy.onDropped(mCurrentTarget, hideTaskToken); } else if (appData != null } else if (mAllowBubbleTarget && appData != null && mIsOverBubblesDropZone && BubbleAnythingFlagHelper.enableCreateAnyBubble()) { handleDropOnBubbleBar(appData, Objects.requireNonNull(mDragToBubbleController)); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragController.java +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.statusbar.notification.row; import static android.widget.Toast.LENGTH_SHORT; import static com.android.wm.shell.shared.draganddrop.DragAndDropConstants.IS_FROM_NOTIFICATION; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; Loading Loading @@ -52,8 +54,8 @@ import com.android.systemui.res.R; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeDisplayAware; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.notification.logging.NotificationPanelLogger; import com.android.systemui.statusbar.notification.headsup.HeadsUpManager; import com.android.systemui.statusbar.notification.logging.NotificationPanelLogger; import com.android.systemui.statusbar.notification.shared.NotificationBundleUi; import javax.inject.Inject; Loading Loading @@ -138,6 +140,7 @@ public class ExpandableNotificationRowDragController { ClipData.Item item = new ClipData.Item(dragIntent); InstanceId instanceId = new InstanceIdSequence(Integer.MAX_VALUE).newInstanceId(); item.getIntent().putExtra(ClipDescription.EXTRA_LOGGING_INSTANCE_ID, instanceId); item.getIntent().putExtra(IS_FROM_NOTIFICATION, true); ClipData dragData = new ClipData(clipDescription, item); View.DragShadowBuilder myShadow = new View.DragShadowBuilder(snapshot); view.setOnDragListener(getDraggedViewDragListener()); Loading Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/draganddrop/DragAndDropConstants.java +7 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,11 @@ public class DragAndDropConstants { * An Intent extra that Launcher can use to specify the {@link android.content.pm.ShortcutInfo} */ public static final String EXTRA_SHORTCUT_INFO = "EXTRA_SHORTCUT_INFO"; //TODO(b/440373358) : remove once we properly handle dragging from notification /** * An Intent extra that Notification can use to specify that the drag was originated from the * notification. */ public static final String IS_FROM_NOTIFICATION = "IS_FROM_NOTIFICATION"; }
libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java +7 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_LEFT; import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_RIGHT; import static com.android.wm.shell.draganddrop.SplitDragPolicy.Target.TYPE_SPLIT_TOP; import static com.android.wm.shell.shared.draganddrop.DragAndDropConstants.IS_FROM_NOTIFICATION; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; Loading Loading @@ -124,6 +125,7 @@ public class DragLayout extends LinearLayout private boolean mIsShowing; private boolean mHasDropped; private boolean mAllowBubbleTarget; private DragSession mSession; // The last position that was handled by the drag layout private final Point mLastPosition = new Point(); Loading Loading @@ -340,7 +342,8 @@ public class DragLayout extends LinearLayout mSession = session; mHasDropped = false; mCurrentTarget = null; mAllowBubbleTarget = mSession.appData == null || !mSession.appData.getBooleanExtra(IS_FROM_NOTIFICATION, false); boolean alreadyInSplit = mSplitScreenController != null && mSplitScreenController.isSplitScreenVisible(); if (!alreadyInSplit) { Loading Loading @@ -549,7 +552,7 @@ public class DragLayout extends LinearLayout return; } // if event is over the bubble don't let split handle it if (interceptBubbleBarEvent(x, y)) { if (mAllowBubbleTarget && interceptBubbleBarEvent(x, y)) { mLastPosition.set(x, y); return; } Loading Loading @@ -663,7 +666,8 @@ public class DragLayout extends LinearLayout // Process the drop exclusive by DropTarget OR by the BubbleBar if (mCurrentTarget != null) { mPolicy.onDropped(mCurrentTarget, hideTaskToken); } else if (appData != null } else if (mAllowBubbleTarget && appData != null && mIsOverBubblesDropZone && BubbleAnythingFlagHelper.enableCreateAnyBubble()) { handleDropOnBubbleBar(appData, Objects.requireNonNull(mDragToBubbleController)); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragController.java +4 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package com.android.systemui.statusbar.notification.row; import static android.widget.Toast.LENGTH_SHORT; import static com.android.wm.shell.shared.draganddrop.DragAndDropConstants.IS_FROM_NOTIFICATION; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; Loading Loading @@ -52,8 +54,8 @@ import com.android.systemui.res.R; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeDisplayAware; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.notification.logging.NotificationPanelLogger; import com.android.systemui.statusbar.notification.headsup.HeadsUpManager; import com.android.systemui.statusbar.notification.logging.NotificationPanelLogger; import com.android.systemui.statusbar.notification.shared.NotificationBundleUi; import javax.inject.Inject; Loading Loading @@ -138,6 +140,7 @@ public class ExpandableNotificationRowDragController { ClipData.Item item = new ClipData.Item(dragIntent); InstanceId instanceId = new InstanceIdSequence(Integer.MAX_VALUE).newInstanceId(); item.getIntent().putExtra(ClipDescription.EXTRA_LOGGING_INSTANCE_ID, instanceId); item.getIntent().putExtra(IS_FROM_NOTIFICATION, true); ClipData dragData = new ClipData(clipDescription, item); View.DragShadowBuilder myShadow = new View.DragShadowBuilder(snapshot); view.setOnDragListener(getDraggedViewDragListener()); Loading