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

Commit ef8e6bed authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Invalidate D&D operations when destination DocInfo is null." into oc-dev

parents e97112e0 27436858
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -40,10 +40,16 @@ public final class DragAndDropHelper {
     * localState isn't carried over from one process to another.
     */
    public static boolean canCopyTo(Object dragLocalState, DocumentInfo dst) {
        if (dst == null) {
            if (DEBUG) Log.d(TAG, "Invalid destination. Ignoring.");
            return false;
        }

        if (dragLocalState == null || !(dragLocalState instanceof List<?>)) {
            if (DEBUG) Log.d(TAG, "Invalid local state object. Will allow copy.");
            return true;
        }

        List<?> src = (List<?>) dragLocalState;
        if (src.contains(dst)) {
            if (DEBUG) Log.d(TAG, "Drop target same as source. Ignoring.");
+1 −0
Original line number Diff line number Diff line
@@ -407,6 +407,7 @@ public class ActionHandlerTest {
        // DragEvent gets recycled in Android, so it is possible that by the time the callback is
        // called, event.getLocalState() and event.getClipData() returns null. This tests to ensure
        // our Clipper is getting the original CipData passed in.
        mEnv.docs.nextRootDocument = TestEnv.FOLDER_0;
        mHandler = new ActionHandler<>(
                mActivity,
                mEnv.state,