Loading libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragUtils.java +4 −1 Original line number Diff line number Diff line Loading @@ -107,8 +107,11 @@ public class DragUtils { /** * Returns a list of the mime types provided in the clip description. */ public static String getMimeTypesConcatenated(ClipDescription description) { public static String getMimeTypesConcatenated(@Nullable ClipDescription description) { String mimeTypes = ""; if (description == null) { return mimeTypes; } for (int i = 0; i < description.getMimeTypeCount(); i++) { if (i > 0) { mimeTypes += ", "; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -152,17 +152,16 @@ public class DragAndDropControllerTest extends ShellTestCase { } @Test public void testOnDragStarted_withNoClipData() { public void testOnDragStarted_withNoClipDataOrDescription() { final View dragLayout = mock(View.class); final Display display = mock(Display.class); doReturn(display).when(dragLayout).getDisplay(); doReturn(DEFAULT_DISPLAY).when(display).getDisplayId(); final ClipData clipData = createAppClipData(MIMETYPE_APPLICATION_SHORTCUT); final DragEvent event = mock(DragEvent.class); doReturn(ACTION_DRAG_STARTED).when(event).getAction(); doReturn(null).when(event).getClipData(); doReturn(clipData.getDescription()).when(event).getClipDescription(); doReturn(null).when(event).getClipDescription(); // Ensure there's a target so that onDrag will execute mController.addDisplayDropTarget(0, mContext, mock(WindowManager.class), Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragUtils.java +4 −1 Original line number Diff line number Diff line Loading @@ -107,8 +107,11 @@ public class DragUtils { /** * Returns a list of the mime types provided in the clip description. */ public static String getMimeTypesConcatenated(ClipDescription description) { public static String getMimeTypesConcatenated(@Nullable ClipDescription description) { String mimeTypes = ""; if (description == null) { return mimeTypes; } for (int i = 0; i < description.getMimeTypeCount(); i++) { if (i > 0) { mimeTypes += ", "; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java +2 −3 Original line number Diff line number Diff line Loading @@ -152,17 +152,16 @@ public class DragAndDropControllerTest extends ShellTestCase { } @Test public void testOnDragStarted_withNoClipData() { public void testOnDragStarted_withNoClipDataOrDescription() { final View dragLayout = mock(View.class); final Display display = mock(Display.class); doReturn(display).when(dragLayout).getDisplay(); doReturn(DEFAULT_DISPLAY).when(display).getDisplayId(); final ClipData clipData = createAppClipData(MIMETYPE_APPLICATION_SHORTCUT); final DragEvent event = mock(DragEvent.class); doReturn(ACTION_DRAG_STARTED).when(event).getAction(); doReturn(null).when(event).getClipData(); doReturn(clipData.getDescription()).when(event).getClipDescription(); doReturn(null).when(event).getClipDescription(); // Ensure there's a target so that onDrag will execute mController.addDisplayDropTarget(0, mContext, mock(WindowManager.class), Loading