Allow user control move/copy during drag and drop.

* Refactor some shared drag and drop logic into one single place.
* Add a workaround for updating badges across windows.
* Add unit tests for DragAndDropManager

Bug: 29581353
Change-Id: I2fcf950194457501e35e1bbc2e00ab68d7962666
diff --git a/src/com/android/documentsui/BaseActivity.java b/src/com/android/documentsui/BaseActivity.java
index cd3b57e..ded4621 100644
--- a/src/com/android/documentsui/BaseActivity.java
+++ b/src/com/android/documentsui/BaseActivity.java
@@ -443,11 +443,6 @@
         return mState;
     }
 
-    public DragShadowBuilder getShadowBuilder() {
-        throw new UnsupportedOperationException(
-                "Drag and drop not supported, can't get shadow builder");
-    }
-
     /**
      * Set internal storage visible based on explicit user action.
      */
@@ -578,6 +573,9 @@
         if (event.getAction() == KeyEvent.ACTION_DOWN) {
             mInjector.debugHelper.debugCheck(event.getDownTime(), event.getKeyCode());
         }
+
+        DocumentsApplication.getDragAndDropManager(this).onKeyEvent(event);
+
         return super.dispatchKeyEvent(event);
     }