Merge "Preventing activity from rotating while the user is dragging an item. (Bug 6240922)" into jb-dev
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 40bc2ca..3936e59 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -706,7 +706,7 @@
 
         // Start the drag
         alphaClipPaint = null;
-        mLauncher.lockScreenOrientationOnLargeUI();
+        mLauncher.lockScreenOrientation();
         mLauncher.getWorkspace().onDragStartedWithItem(createItemInfo, outline, alphaClipPaint);
         mDragController.startDrag(image, preview, this, createItemInfo,
                 DragController.DRAG_ACTION_COPY, null, scale);
@@ -758,7 +758,7 @@
             // drop in Workspace
             mLauncher.exitSpringLoadedDragMode();
         }
-        mLauncher.unlockScreenOrientationOnLargeUI();
+        mLauncher.unlockScreenOrientation();
     }
 
     @Override
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 648791d..e5c62ad 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3316,20 +3316,16 @@
         return oriMap[(d.getRotation() + indexOffset) % 4];
     }
 
-    public void lockScreenOrientationOnLargeUI() {
-        if (LauncherApplication.isScreenLarge()) {
-            setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
-                    .getConfiguration().orientation));
-        }
+    public void lockScreenOrientation() {
+        setRequestedOrientation(mapConfigurationOriActivityInfoOri(getResources()
+                .getConfiguration().orientation));
     }
-    public void unlockScreenOrientationOnLargeUI() {
-        if (LauncherApplication.isScreenLarge()) {
-            mHandler.postDelayed(new Runnable() {
-                public void run() {
-                    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
-                }
-            }, mRestoreScreenOrientationDelay);
-        }
+    public void unlockScreenOrientation() {
+        mHandler.postDelayed(new Runnable() {
+            public void run() {
+                setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+            }
+        }, mRestoreScreenOrientationDelay);
     }
 
     /* Cling related */
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 29aea6f..892000d 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -375,13 +375,13 @@
     public void onDragStart(DragSource source, Object info, int dragAction) {
         mIsDragOccuring = true;
         updateChildrenLayersEnabled();
-        mLauncher.lockScreenOrientationOnLargeUI();
+        mLauncher.lockScreenOrientation();
     }
 
     public void onDragEnd() {
         mIsDragOccuring = false;
         updateChildrenLayersEnabled();
-        mLauncher.unlockScreenOrientationOnLargeUI();
+        mLauncher.unlockScreenOrientation();
     }
 
     /**