Add support for live wallpaper tap and drop commands in Launcher.

DO NOT MERGE.
diff --git a/src/com/android/launcher/CellLayout.java b/src/com/android/launcher/CellLayout.java
index e53f2b3..6677bb8 100644
--- a/src/com/android/launcher/CellLayout.java
+++ b/src/com/android/launcher/CellLayout.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher;
 
+import android.app.WallpaperManager;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.content.res.Resources;
@@ -58,6 +59,9 @@
     private RectF mDragRect = new RectF();
 
     private boolean mDirtyTag;
+    private boolean mLastDownOnOccupiedCell = false;
+    
+    private final WallpaperManager mWallpaperManager;
 
     public CellLayout(Context context) {
         this(context, null);
@@ -97,6 +101,8 @@
                 mOccupied = new boolean[mLongAxisCells][mShortAxisCells];
             }
         }
+        
+        mWallpaperManager = WallpaperManager.getInstance(getContext());        
     }
 
     @Override
@@ -177,6 +183,8 @@
                 }
             }
 
+            mLastDownOnOccupiedCell = found;
+
             if (!found) {
                 int cellXY[] = mCellXY;
                 pointToCellExact(x, y, cellXY);
@@ -523,6 +531,16 @@
                 int childLeft = lp.x;
                 int childTop = lp.y;
                 child.layout(childLeft, childTop, childLeft + lp.width, childTop + lp.height);
+                
+                if (lp.dropped) {
+                    lp.dropped = false;
+
+                    final int[] cellXY = mCellXY;
+                    getLocationOnScreen(cellXY);
+                    mWallpaperManager.sendWallpaperCommand(getWindowToken(), "android.home.drop",
+                            cellXY[0] + childLeft + lp.width / 2,
+                            cellXY[1] + childTop + lp.height / 2, 0, null);
+                }
             }
         }
     }
@@ -611,6 +629,7 @@
             lp.cellX = targetXY[0];
             lp.cellY = targetXY[1];
             lp.isDragging = false;
+            lp.dropped = true;            
             mDragRect.setEmpty();
             child.requestLayout();
             invalidate();
@@ -742,6 +761,10 @@
             }
         }
     }
+    
+    public boolean lastDownOnOccupiedCell() {
+        return mLastDownOnOccupiedCell;
+    }
 
     @Override
     public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
@@ -794,8 +817,10 @@
         // Y coordinate of the view in the layout.
         @ViewDebug.ExportedProperty
         int y;
-
+        
         boolean regenerateId;
+        
+        boolean dropped;        
 
         public LayoutParams(Context c, AttributeSet attrs) {
             super(c, attrs);
diff --git a/src/com/android/launcher/Workspace.java b/src/com/android/launcher/Workspace.java
index b886e67..2e04311 100644
--- a/src/com/android/launcher/Workspace.java
+++ b/src/com/android/launcher/Workspace.java
@@ -646,6 +646,19 @@
 
             case MotionEvent.ACTION_CANCEL:
             case MotionEvent.ACTION_UP:
+
+                if (mTouchState != TOUCH_STATE_SCROLLING) {
+                    final CellLayout currentScreen = (CellLayout) getChildAt(mCurrentScreen);
+                    if (!currentScreen.lastDownOnOccupiedCell()) {
+                        getLocationOnScreen(mTempCell);
+                        // Send a tap to the wallpaper if the last down was on empty space
+                        mWallpaperManager.sendWallpaperCommand(getWindowToken(), 
+                                "android.wallpaper.tap",
+                                mTempCell[0] + (int) ev.getX(),
+                                mTempCell[1] + (int) ev.getY(), 0, null);
+                    }
+                }
+                
                 // Release the drag
                 clearChildrenCache();
                 mTouchState = TOUCH_STATE_REST;