auto import from //branches/cupcake/...@137873
diff --git a/res/drawable/bg_gadget_error.9.png b/res/drawable/bg_appwidget_error.9.png
similarity index 100%
rename from res/drawable/bg_gadget_error.9.png
rename to res/drawable/bg_appwidget_error.9.png
Binary files differ
diff --git a/res/drawable/ic_launcher_gadget.png b/res/drawable/ic_launcher_appwidget.png
similarity index 100%
rename from res/drawable/ic_launcher_gadget.png
rename to res/drawable/ic_launcher_appwidget.png
Binary files differ
diff --git a/res/drawable/ic_search_gadget.png b/res/drawable/ic_search_widget.png
similarity index 100%
rename from res/drawable/ic_search_gadget.png
rename to res/drawable/ic_search_widget.png
Binary files differ
diff --git a/res/layout/gadget_error.xml b/res/layout/appwidget_error.xml
similarity index 91%
rename from res/layout/gadget_error.xml
rename to res/layout/appwidget_error.xml
index bde07af..03d4ae4 100644
--- a/res/layout/gadget_error.xml
+++ b/res/layout/appwidget_error.xml
@@ -22,8 +22,8 @@
     android:paddingLeft="20dip"
     android:paddingRight="20dip"
     android:gravity="center"
-    android:background="@drawable/bg_gadget_error"
+    android:background="@drawable/bg_appwidget_error"
     android:textAppearance="?android:attr/textAppearanceMediumInverse"
-    android:textColor="@color/gadget_error_color"
+    android:textColor="@color/appwidget_error_color"
     android:text="@string/gadget_error_text"
     />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 4a2aba3..5574944 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -23,5 +23,5 @@
     <color name="bubble_dark_background">#B2191919</color>
     <color name="delete_color_filter">#A5FF0000</color>
 
-    <color name="gadget_error_color">#fccc</color>
+    <color name="appwidget_error_color">#fccc</color>
 </resources>
diff --git a/src/com/android/launcher/AddAdapter.java b/src/com/android/launcher/AddAdapter.java
index 18b36d5..cbcb338 100644
--- a/src/com/android/launcher/AddAdapter.java
+++ b/src/com/android/launcher/AddAdapter.java
@@ -40,7 +40,7 @@
     public static final int ITEM_APPLICATION = 0;
     public static final int ITEM_SHORTCUT = 1;
     public static final int ITEM_SEARCH = 2;
-    public static final int ITEM_GADGET = 3;
+    public static final int ITEM_APPWIDGET = 3;
     public static final int ITEM_LIVE_FOLDER = 4;
     public static final int ITEM_FOLDER = 5;
     public static final int ITEM_WALLPAPER = 6;
@@ -80,10 +80,10 @@
                 R.drawable.ic_launcher_empty, ITEM_SHORTCUT));
         
         mItems.add(new ListItem(res, R.string.group_search,
-                R.drawable.ic_search_gadget, ITEM_SEARCH));
+                R.drawable.ic_search_widget, ITEM_SEARCH));
         
         mItems.add(new ListItem(res, R.string.group_widgets,
-                R.drawable.ic_launcher_gadget, ITEM_GADGET));
+                R.drawable.ic_launcher_appwidget, ITEM_APPWIDGET));
         
         mItems.add(new ListItem(res, R.string.group_live_folders,
                 R.drawable.ic_launcher_empty, ITEM_LIVE_FOLDER));
diff --git a/src/com/android/launcher/DeleteZone.java b/src/com/android/launcher/DeleteZone.java
index f31a206..7f92c23 100644
--- a/src/com/android/launcher/DeleteZone.java
+++ b/src/com/android/launcher/DeleteZone.java
@@ -85,8 +85,8 @@
 
         final LauncherModel model = Launcher.getModel();
         if (item.container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
-            if (item instanceof LauncherGadgetInfo) {
-                model.removeDesktopGadget((LauncherGadgetInfo) item);
+            if (item instanceof LauncherAppWidgetInfo) {
+                model.removeDesktopAppWidget((LauncherAppWidgetInfo) item);
             } else {
                 model.removeDesktopItem(item);
             }
@@ -101,11 +101,11 @@
             final UserFolderInfo userFolderInfo = (UserFolderInfo)item;
             LauncherModel.deleteUserFolderContentsFromDatabase(mLauncher, userFolderInfo);
             model.removeUserFolder(userFolderInfo);
-        } else if (item instanceof LauncherGadgetInfo) {
-            final LauncherGadgetInfo launcherGadgetInfo = (LauncherGadgetInfo)item;
-            final LauncherGadgetHost gadgetHost = mLauncher.getGadgetHost();
-            if (gadgetHost != null) {
-                gadgetHost.deleteGadgetId(launcherGadgetInfo.gadgetId);
+        } else if (item instanceof LauncherAppWidgetInfo) {
+            final LauncherAppWidgetInfo launcherAppWidgetInfo = (LauncherAppWidgetInfo) item;
+            final LauncherAppWidgetHost appWidgetHost = mLauncher.getAppWidgetHost();
+            if (appWidgetHost != null) {
+                appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
             }
         }
         LauncherModel.deleteItemFromDatabase(mLauncher, item);
diff --git a/src/com/android/launcher/ItemInfo.java b/src/com/android/launcher/ItemInfo.java
index 8899f44..51449a7 100644
--- a/src/com/android/launcher/ItemInfo.java
+++ b/src/com/android/launcher/ItemInfo.java
@@ -39,7 +39,7 @@
      * One of {@link LauncherSettings.Favorites#ITEM_TYPE_APPLICATION},
      * {@link LauncherSettings.Favorites#ITEM_TYPE_SHORTCUT},
      * {@link LauncherSettings.Favorites#ITEM_TYPE_USER_FOLDER}, or
-     * {@link LauncherSettings.Favorites#ITEM_TYPE_GADGET}.
+     * {@link LauncherSettings.Favorites#ITEM_TYPE_APPWIDGET}.
      */
     int itemType;
     
diff --git a/src/com/android/launcher/Launcher.java b/src/com/android/launcher/Launcher.java
index 9656983..99182f1 100644
--- a/src/com/android/launcher/Launcher.java
+++ b/src/com/android/launcher/Launcher.java
@@ -37,8 +37,6 @@
 import android.content.res.Resources;
 import android.content.res.Configuration;
 import android.database.ContentObserver;
-import android.gadget.GadgetProviderInfo;
-import android.gadget.GadgetManager;
 import android.graphics.Bitmap;
 import android.graphics.Rect;
 import android.graphics.drawable.BitmapDrawable;
@@ -78,6 +76,8 @@
 import android.widget.GridView;
 import android.widget.SlidingDrawer;
 import android.app.IWallpaperService;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
@@ -90,6 +90,7 @@
     static final boolean LOGD = false;
 
     private static final boolean PROFILE_STARTUP = false;
+    private static final boolean PROFILE_DRAWER = false;
     private static final boolean DEBUG_USER_INTERFACE = false;
 
     private static final int WALLPAPER_SCREENS_SPAN = 2;
@@ -103,11 +104,11 @@
 
     private static final int REQUEST_CREATE_SHORTCUT = 1;
     private static final int REQUEST_CREATE_LIVE_FOLDER = 4;
-    private static final int REQUEST_CREATE_GADGET = 5;
+    private static final int REQUEST_CREATE_APPWIDGET = 5;
     private static final int REQUEST_PICK_APPLICATION = 6;
     private static final int REQUEST_PICK_SHORTCUT = 7;
     private static final int REQUEST_PICK_LIVE_FOLDER = 8;
-    private static final int REQUEST_PICK_GADGET = 9;
+    private static final int REQUEST_PICK_APPWIDGET = 9;
 
     static final String EXTRA_SHORTCUT_DUPLICATE = "duplicate";
 
@@ -168,10 +169,10 @@
     private DragLayer mDragLayer;
     private Workspace mWorkspace;
     
-    private GadgetManager mGadgetManager;
-    private LauncherGadgetHost mGadgetHost;
+    private AppWidgetManager mAppWidgetManager;
+    private LauncherAppWidgetHost mAppWidgetHost;
     
-    static final int GADGET_HOST_ID = 1024;
+    static final int APPWIDGET_HOST_ID = 1024;
     
     private CellLayout.CellInfo mAddItemCellInfo;
     private CellLayout.CellInfo mMenuAddInfo;
@@ -180,6 +181,7 @@
 
     private SlidingDrawer mDrawer;
     private TransitionDrawable mHandleIcon;
+    private HandleView mHandleView;
     private AllAppsGridView mAllAppsGrid;
 
     private boolean mDesktopLocked = true;
@@ -200,10 +202,10 @@
         super.onCreate(savedInstanceState);
         mInflater = getLayoutInflater();
         
-        mGadgetManager = GadgetManager.getInstance(this);
+        mAppWidgetManager = AppWidgetManager.getInstance(this);
         
-        mGadgetHost = new LauncherGadgetHost(this, GADGET_HOST_ID);
-        mGadgetHost.startListening();
+        mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
+        mAppWidgetHost.startListening();
         
         if (PROFILE_STARTUP) {
             android.os.Debug.startMethodTracing("/sdcard/launcher");
@@ -317,19 +319,19 @@
                 case REQUEST_CREATE_LIVE_FOLDER:
                     completeAddLiveFolder(data, mAddItemCellInfo, !mDesktopLocked);
                     break;
-                case REQUEST_PICK_GADGET:
-                    addGadget(data);
+                case REQUEST_PICK_APPWIDGET:
+                    addAppWidget(data);
                     break;
-                case REQUEST_CREATE_GADGET:
-                    completeAddGadget(data, mAddItemCellInfo, !mDesktopLocked);
+                case REQUEST_CREATE_APPWIDGET:
+                    completeAddAppWidget(data, mAddItemCellInfo, !mDesktopLocked);
                     break;
             }
-        } else if (requestCode == REQUEST_PICK_GADGET &&
+        } else if (requestCode == REQUEST_PICK_APPWIDGET &&
                 resultCode == RESULT_CANCELED && data != null) {
-            // Clean up the gadgetId if we canceled
-            int gadgetId = data.getIntExtra(GadgetManager.EXTRA_GADGET_ID, -1);
-            if (gadgetId != -1) {
-                mGadgetHost.deleteGadgetId(gadgetId);
+            // Clean up the appWidgetId if we canceled
+            int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+            if (appWidgetId != -1) {
+                mAppWidgetHost.deleteAppWidgetId(appWidgetId);
             }
         }
         mWaitingForResult = false;
@@ -345,6 +347,12 @@
     }
 
     @Override
+    protected void onPause() {
+        super.onPause();
+        closeDrawer(false);        
+    }
+
+    @Override
     public boolean onKeyUp(int keyCode, KeyEvent event) {
         boolean handled = super.onKeyUp(keyCode, event);
         if (keyCode == KeyEvent.KEYCODE_SEARCH) {
@@ -463,9 +471,9 @@
 
         final DeleteZone deleteZone = (DeleteZone) dragLayer.findViewById(R.id.delete_zone);
 
-        final HandleView handleIcon = (HandleView) drawer.findViewById(R.id.all_apps);
-        handleIcon.setLauncher(this);
-        mHandleIcon = (TransitionDrawable) handleIcon.getDrawable();
+        mHandleView = (HandleView) drawer.findViewById(R.id.all_apps);
+        mHandleView.setLauncher(this);
+        mHandleIcon = (TransitionDrawable) mHandleView.getDrawable();
         mHandleIcon.setCrossFadeEnabled(true);
 
         drawer.lock();
@@ -485,7 +493,7 @@
 
         deleteZone.setLauncher(this);
         deleteZone.setDragController(dragLayer);
-        deleteZone.setHandle(handleIcon);
+        deleteZone.setHandle(mHandleView);
 
         dragLayer.setIgnoredDropTarget(grid);
         dragLayer.setDragScoller(workspace);
@@ -593,32 +601,31 @@
 
     
     /**
-     * Add a gadget to the workspace.
+     * Add a widget to the workspace.
      *
-     * @param data The intent describing the gadgetId.
-     * @param cellInfo The position on screen where to create the shortcut.
-     * @param insertAtFirst
+     * @param data The intent describing the appWidgetId.
+     * @param cellInfo The position on screen where to create the widget.
      */
-    private void completeAddGadget(Intent data, CellLayout.CellInfo cellInfo,
+    private void completeAddAppWidget(Intent data, CellLayout.CellInfo cellInfo,
             boolean insertAtFirst) {
 
         Bundle extras = data.getExtras();
-        int gadgetId = extras.getInt(GadgetManager.EXTRA_GADGET_ID, -1);
+        int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
         
         Log.d(LOG_TAG, "dumping extras content="+extras.toString());
         
-        GadgetProviderInfo gadgetInfo = mGadgetManager.getGadgetInfo(gadgetId);
+        AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
         
-        // Calculate the grid spans needed to fit this gadget
+        // Calculate the grid spans needed to fit this widget
         CellLayout layout = (CellLayout) mWorkspace.getChildAt(cellInfo.screen);
-        int[] spans = layout.rectToCell(gadgetInfo.minWidth, gadgetInfo.minHeight);
+        int[] spans = layout.rectToCell(appWidgetInfo.minWidth, appWidgetInfo.minHeight);
         
         // Try finding open space on Launcher screen
         final int[] xy = mCellCoordinates;
         if (!findSlot(cellInfo, xy, spans[0], spans[1])) return;
 
-        // Build Launcher-specific Gadget info and save to database
-        LauncherGadgetInfo launcherInfo = new LauncherGadgetInfo(gadgetId);
+        // Build Launcher-specific widget info and save to database
+        LauncherAppWidgetInfo launcherInfo = new LauncherAppWidgetInfo(appWidgetId);
         launcherInfo.spanX = spans[0];
         launcherInfo.spanY = spans[1];
         
@@ -627,23 +634,23 @@
                 mWorkspace.getCurrentScreen(), xy[0], xy[1], false);
 
         if (!mRestoring) {
-            sModel.addDesktopGadget(launcherInfo);
+            sModel.addDesktopAppWidget(launcherInfo);
             
             // Perform actual inflation because we're live
-            launcherInfo.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
+            launcherInfo.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
             
-            launcherInfo.hostView.setGadget(gadgetId, gadgetInfo);
+            launcherInfo.hostView.setAppWidget(appWidgetId, appWidgetInfo);
             launcherInfo.hostView.setTag(launcherInfo);
             
             mWorkspace.addInCurrentScreen(launcherInfo.hostView, xy[0], xy[1],
                     launcherInfo.spanX, launcherInfo.spanY, insertAtFirst);
         } else if (sModel.isDesktopLoaded()) {
-            sModel.addDesktopGadget(launcherInfo);
+            sModel.addDesktopAppWidget(launcherInfo);
         }
     }
     
-    public LauncherGadgetHost getGadgetHost() {
-        return mGadgetHost;
+    public LauncherAppWidgetHost getAppWidgetHost() {
+        return mAppWidgetHost;
     }
     
     static ApplicationInfo addShortcut(Context context, Intent data,
@@ -794,9 +801,9 @@
         super.onDestroy();
         
         try {
-            mGadgetHost.stopListening();
+            mAppWidgetHost.stopListening();
         } catch (NullPointerException ex) {
-            Log.w(LOG_TAG, "problem while stopping GadgetHost during Launcher destruction", ex);
+            Log.w(LOG_TAG, "problem while stopping AppWidgetHost during Launcher destruction", ex);
         }
 
         TextKeyListener.getInstance().release();
@@ -876,9 +883,9 @@
                 return true;
             case MENU_SEARCH:
                 if (mWorkspace.snapToSearch()) {
-                    closeDrawer(true);          // search gadget: get drawer out of the way
+                    closeDrawer(true);          // search widget: get drawer out of the way
                 } else {
-                    onSearchRequested();        // no search gadget: use system search UI
+                    onSearchRequested();        // no search widget: use system search UI
                 }
                 return true;
             case MENU_NOTIFICATIONS:
@@ -899,21 +906,21 @@
         }
     }
     
-    void addGadget(Intent data) {
-        // TODO: catch bad gadget exception when sent
-        int gadgetId = data.getIntExtra(GadgetManager.EXTRA_GADGET_ID, -1);
-        GadgetProviderInfo gadget = mGadgetManager.getGadgetInfo(gadgetId);
+    void addAppWidget(Intent data) {
+        // TODO: catch bad widget exception when sent
+        int appWidgetId = data.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
+        AppWidgetProviderInfo appWidget = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
 
-        if (gadget.configure != null) {
-            // Launch over to configure gadget, if needed
-            Intent intent = new Intent(GadgetManager.ACTION_GADGET_CONFIGURE);
-            intent.setComponent(gadget.configure);
-            intent.putExtra(GadgetManager.EXTRA_GADGET_ID, gadgetId);
+        if (appWidget.configure != null) {
+            // Launch over to configure widget, if needed
+            Intent intent = new Intent(AppWidgetManager.ACTION_APPWIDGET_CONFIGURE);
+            intent.setComponent(appWidget.configure);
+            intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
 
-            startActivityForResult(intent, REQUEST_CREATE_GADGET);
+            startActivityForResult(intent, REQUEST_CREATE_APPWIDGET);
         } else {
             // Otherwise just add it
-            onActivityResult(REQUEST_CREATE_GADGET, Activity.RESULT_OK, data);
+            onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data);
         }
     }
     
@@ -1169,8 +1176,8 @@
      */
     private void bindDesktopItems() {
         final ArrayList<ItemInfo> shortcuts = sModel.getDesktopItems();
-        final ArrayList<LauncherGadgetInfo> gadgets = sModel.getDesktopGadgets();
-        if (shortcuts == null || gadgets == null) {
+        final ArrayList<LauncherAppWidgetInfo> appWidgets = sModel.getDesktopAppWidgets();
+        if (shortcuts == null || appWidgets == null) {
             return;
         }
 
@@ -1192,7 +1199,7 @@
             });
         }
 
-        final DesktopBinder binder = new DesktopBinder(this, shortcuts, gadgets);
+        final DesktopBinder binder = new DesktopBinder(this, shortcuts, appWidgets);
         binder.startBindingItems();
     }
 
@@ -1246,7 +1253,7 @@
 
         if (end >= count) {
             finishBindDesktopItems();
-            binder.startBindingGadgets();
+            binder.startBindingAppWidgets();
         } else {
             binder.obtainMessage(DesktopBinder.MESSAGE_BIND_ITEMS, i, count).sendToTarget();
         }
@@ -1293,25 +1300,25 @@
         mDrawer.unlock();
     }
 
-    private void bindGadgets(Launcher.DesktopBinder binder,
-            ArrayList<LauncherGadgetInfo> gadgets, int start, int count) {
+    private void bindAppWidgets(Launcher.DesktopBinder binder,
+            ArrayList<LauncherAppWidgetInfo> appWidgets, int start, int count) {
 
         final Workspace workspace = mWorkspace;
         final boolean desktopLocked = mDesktopLocked;
 
-        final int end = Math.min(start + DesktopBinder.GADGETS_COUNT, count);
+        final int end = Math.min(start + DesktopBinder.APPWIDGETS_COUNT, count);
         int i = start;
 
         for ( ; i < end; i++) {
-            final LauncherGadgetInfo item = gadgets.get(i);
+            final LauncherAppWidgetInfo item = appWidgets.get(i);
                     
-            final int gadgetId = item.gadgetId;
-            final GadgetProviderInfo gadgetInfo = mGadgetManager.getGadgetInfo(gadgetId);
-            item.hostView = mGadgetHost.createView(this, gadgetId, gadgetInfo);
+            final int appWidgetId = item.appWidgetId;
+            final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
+            item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
             
-            if (LOGD) Log.d(LOG_TAG, String.format("about to setGadget for id=%d, info=%s", gadgetId, gadgetInfo));
+            if (LOGD) Log.d(LOG_TAG, String.format("about to setAppWidget for id=%d, info=%s", appWidgetId, appWidgetInfo));
             
-            item.hostView.setGadget(gadgetId, gadgetInfo);
+            item.hostView.setAppWidget(appWidgetId, appWidgetInfo);
             item.hostView.setTag(item);
             
             workspace.addInScreen(item.hostView, item.screen, item.cellX,
@@ -1321,13 +1328,13 @@
         workspace.requestLayout();
 
         if (end >= count) {
-            finishBindDesktopGadgets();
+            finishBindDesktopAppWidgets();
         } else {
-            binder.obtainMessage(DesktopBinder.MESSAGE_BIND_GADGETS, i, count).sendToTarget();
+            binder.obtainMessage(DesktopBinder.MESSAGE_BIND_APPWIDGETS, i, count).sendToTarget();
         }
     }
     
-    private void finishBindDesktopGadgets() {
+    private void finishBindDesktopAppWidgets() {
     }
     
     DragController getDragController() {
@@ -1480,6 +1487,10 @@
         mDrawer.close();
     }
 
+    View getDrawerHandle() {
+        return mHandleView;
+    }
+
     boolean isDrawerDown() {
         return !mDrawer.isMoving() && !mDrawer.isOpened();
     }
@@ -1488,6 +1499,10 @@
         return mDrawer.isOpened() && !mDrawer.isMoving();
     }
 
+    boolean isDrawerMoving() {
+        return mDrawer.isMoving();
+    }
+
     Workspace getWorkspace() {
         return mWorkspace;
     }
@@ -1686,12 +1701,12 @@
                         break;
                     }
                     
-                    case AddAdapter.ITEM_GADGET: {
-                        int gadgetId = Launcher.this.mGadgetHost.allocateGadgetId();
+                    case AddAdapter.ITEM_APPWIDGET: {
+                        int appWidgetId = Launcher.this.mAppWidgetHost.allocateAppWidgetId();
                         
-                        Intent pickIntent = new Intent(GadgetManager.ACTION_GADGET_PICK);
-                        pickIntent.putExtra(GadgetManager.EXTRA_GADGET_ID, gadgetId);
-                        startActivityForResult(pickIntent, REQUEST_PICK_GADGET);
+                        Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
+                        pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+                        startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
                         break;
                     }
                     
@@ -1805,62 +1820,75 @@
         public void onDrawerOpened() {
             if (!mOpen) {
                 mHandleIcon.reverseTransition(150);
+
                 final Rect bounds = mWorkspace.mDrawerBounds;
-
-                View view = mAllAppsGrid;
-                view.getDrawingRect(bounds);
-
-                while (view != mDragLayer) {
-                    bounds.offset(view.getLeft(), view.getTop());
-                    view = (View) view.getParent();
-                }
+                offsetBoundsToDragLayer(bounds, mAllAppsGrid);
 
                 mOpen = true;
             }
         }
 
+        private void offsetBoundsToDragLayer(Rect bounds, View view) {
+            view.getDrawingRect(bounds);
+
+            while (view != mDragLayer) {
+                bounds.offset(view.getLeft(), view.getTop());
+                view = (View) view.getParent();
+            }
+        }
+
         public void onDrawerClosed() {
             if (mOpen) {
                 mHandleIcon.reverseTransition(150);
                 mWorkspace.mDrawerBounds.setEmpty();
                 mOpen = false;
             }
+
             mAllAppsGrid.setSelection(0);
             mAllAppsGrid.clearTextFilter();
         }
 
         public void onScrollStarted() {
+            if (PROFILE_DRAWER) {
+                android.os.Debug.startMethodTracing("/sdcard/launcher-drawer");
+            }
+
+            mWorkspace.mDrawerContentWidth = mAllAppsGrid.getWidth();
+            mWorkspace.mDrawerContentHeight = mAllAppsGrid.getHeight();
         }
 
         public void onScrollEnded() {
+            if (PROFILE_DRAWER) {
+                android.os.Debug.stopMethodTracing();
+            }
         }
     }
 
     private static class DesktopBinder extends Handler {
         static final int MESSAGE_BIND_ITEMS = 0x1;
-        static final int MESSAGE_BIND_GADGETS = 0x2;
+        static final int MESSAGE_BIND_APPWIDGETS = 0x2;
         // Number of items to bind in every pass
         static final int ITEMS_COUNT = 6;
-        static final int GADGETS_COUNT = 1;
+        static final int APPWIDGETS_COUNT = 1;
 
         private final ArrayList<ItemInfo> mShortcuts;
-        private final ArrayList<LauncherGadgetInfo> mGadgets;
+        private final ArrayList<LauncherAppWidgetInfo> mAppWidgets;
         private final WeakReference<Launcher> mLauncher;
 
         DesktopBinder(Launcher launcher, ArrayList<ItemInfo> shortcuts,
-                ArrayList<LauncherGadgetInfo> gadgets) {
+                ArrayList<LauncherAppWidgetInfo> appWidgets) {
 
             mLauncher = new WeakReference<Launcher>(launcher);
             mShortcuts = shortcuts;
-            mGadgets = gadgets;
+            mAppWidgets = appWidgets;
         }
         
         public void startBindingItems() {
             obtainMessage(MESSAGE_BIND_ITEMS, 0, mShortcuts.size()).sendToTarget();
         }
 
-        public void startBindingGadgets() {
-            obtainMessage(MESSAGE_BIND_GADGETS, 0, mGadgets.size()).sendToTarget();
+        public void startBindingAppWidgets() {
+            obtainMessage(MESSAGE_BIND_APPWIDGETS, 0, mAppWidgets.size()).sendToTarget();
         }
         
         @Override
@@ -1875,8 +1903,8 @@
                     launcher.bindItems(this, mShortcuts, msg.arg1, msg.arg2);
                     break;
                 }
-                case MESSAGE_BIND_GADGETS: {
-                    launcher.bindGadgets(this, mGadgets, msg.arg1, msg.arg2);
+                case MESSAGE_BIND_APPWIDGETS: {
+                    launcher.bindAppWidgets(this, mAppWidgets, msg.arg1, msg.arg2);
                     break;
                 }
             }
diff --git a/src/com/android/launcher/LauncherAppWidgetHost.java b/src/com/android/launcher/LauncherAppWidgetHost.java
new file mode 100644
index 0000000..22fd5b6
--- /dev/null
+++ b/src/com/android/launcher/LauncherAppWidgetHost.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher;
+
+import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetHostView;
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.Context;
+
+/**
+ * Specific {@link AppWidgetHost} that creates our {@link LauncherAppWidgetHostView}
+ * which correctly captures all long-press events. This ensures that users can
+ * always pick up and move widgets.
+ */
+public class LauncherAppWidgetHost extends AppWidgetHost {
+    public LauncherAppWidgetHost(Context context, int hostId) {
+        super(context, hostId);
+    }
+    
+    @Override
+    protected AppWidgetHostView onCreateView(Context context, int appWidgetId,
+            AppWidgetProviderInfo appWidget) {
+        return new LauncherAppWidgetHostView(context);
+    }
+}
diff --git a/src/com/android/launcher/LauncherGadgetHostView.java b/src/com/android/launcher/LauncherAppWidgetHostView.java
similarity index 91%
rename from src/com/android/launcher/LauncherGadgetHostView.java
rename to src/com/android/launcher/LauncherAppWidgetHostView.java
index 2b5f7f7..1e21a19 100644
--- a/src/com/android/launcher/LauncherGadgetHostView.java
+++ b/src/com/android/launcher/LauncherAppWidgetHostView.java
@@ -16,8 +16,8 @@
 
 package com.android.launcher;
 
+import android.appwidget.AppWidgetHostView;
 import android.content.Context;
-import android.gadget.GadgetHostView;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -26,21 +26,21 @@
 /**
  * {@inheritDoc}
  */
-public class LauncherGadgetHostView extends GadgetHostView {
+public class LauncherAppWidgetHostView extends AppWidgetHostView {
     private boolean mHasPerformedLongPress;
     
     private CheckForLongPress mPendingCheckForLongPress;
     
     private LayoutInflater mInflater;
     
-    public LauncherGadgetHostView(Context context) {
+    public LauncherAppWidgetHostView(Context context) {
         super(context);
         mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     }
     
     @Override
     protected View getErrorView() {
-        return mInflater.inflate(R.layout.gadget_error, this, false);
+        return mInflater.inflate(R.layout.appwidget_error, this, false);
     }
 
     public boolean onInterceptTouchEvent(MotionEvent ev) {
@@ -51,7 +51,7 @@
         }
             
         // Watch for longpress events at this level to make sure
-        // users can always pick up this Gadget
+        // users can always pick up this widget
         switch (ev.getAction()) {
             case MotionEvent.ACTION_DOWN: {
                 postCheckForLongClick();
diff --git a/src/com/android/launcher/LauncherGadgetInfo.java b/src/com/android/launcher/LauncherAppWidgetInfo.java
similarity index 60%
rename from src/com/android/launcher/LauncherGadgetInfo.java
rename to src/com/android/launcher/LauncherAppWidgetInfo.java
index 65fa774..3b5f08e 100644
--- a/src/com/android/launcher/LauncherGadgetInfo.java
+++ b/src/com/android/launcher/LauncherAppWidgetInfo.java
@@ -16,38 +16,38 @@
 
 package com.android.launcher;
 
+import android.appwidget.AppWidgetHostView;
 import android.content.ContentValues;
-import android.gadget.GadgetHostView;
 
 /**
- * Represents a gadget, which just contains an identifier.
+ * Represents a widget, which just contains an identifier.
  */
-class LauncherGadgetInfo extends ItemInfo {
+class LauncherAppWidgetInfo extends ItemInfo {
 
     /**
-     * Identifier for this gadget when talking with {@link GadgetManager} for updates.
+     * Identifier for this widget when talking with {@link AppWidgetManager} for updates.
      */
-    int gadgetId;
+    int appWidgetId;
     
     /**
-     * View that holds this gadget after it's been created.  This view isn't created
+     * View that holds this widget after it's been created.  This view isn't created
      * until Launcher knows it's needed.
      */
-    GadgetHostView hostView = null;
+    AppWidgetHostView hostView = null;
 
-    LauncherGadgetInfo(int gadgetId) {
-        itemType = LauncherSettings.Favorites.ITEM_TYPE_GADGET;
-        this.gadgetId = gadgetId;
+    LauncherAppWidgetInfo(int appWidgetId) {
+        itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
+        this.appWidgetId = appWidgetId;
     }
     
     @Override
     void onAddToDatabase(ContentValues values) {
         super.onAddToDatabase(values);
-        values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
+        values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
     }
 
     @Override
     public String toString() {
-        return Integer.toString(gadgetId);
+        return Integer.toString(appWidgetId);
     }
 }
diff --git a/src/com/android/launcher/LauncherGadgetHost.java b/src/com/android/launcher/LauncherGadgetHost.java
deleted file mode 100644
index 9bb4f05..0000000
--- a/src/com/android/launcher/LauncherGadgetHost.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.launcher;
-
-import android.content.Context;
-import android.gadget.GadgetHost;
-import android.gadget.GadgetHostView;
-import android.gadget.GadgetProviderInfo;
-
-/**
- * Specific {@link GadgetHost} that creates our {@link LauncherGadgetHostView}
- * which correctly captures all long-press events. This ensures that users can
- * always pick up and move gadgets.
- */
-public class LauncherGadgetHost extends GadgetHost {
-    public LauncherGadgetHost(Context context, int hostId) {
-        super(context, hostId);
-    }
-    
-    protected GadgetHostView onCreateView(Context context, int gadgetId,
-            GadgetProviderInfo gadget) {
-        return new LauncherGadgetHostView(context);
-    }
-}
diff --git a/src/com/android/launcher/LauncherModel.java b/src/com/android/launcher/LauncherModel.java
index 87cb9ea..5266bdd 100644
--- a/src/com/android/launcher/LauncherModel.java
+++ b/src/com/android/launcher/LauncherModel.java
@@ -28,13 +28,11 @@
 import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
-import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.util.Log;
 import android.os.Process;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Comparator;
@@ -55,13 +53,13 @@
 
     private static final boolean DEBUG = false;
 
-    private final Collator sCollator = Collator.getInstance();
+    private static final Collator sCollator = Collator.getInstance();
 
     private boolean mApplicationsLoaded;
     private boolean mDesktopItemsLoaded;
 
     private ArrayList<ItemInfo> mDesktopItems;
-    private ArrayList<LauncherGadgetInfo> mDesktopGadgets;
+    private ArrayList<LauncherAppWidgetInfo> mDesktopAppWidgets;
     private HashMap<Long, FolderInfo> mFolders;
 
     private ArrayList<ApplicationInfo> mApplications;
@@ -170,14 +168,15 @@
                 final int count = apps.size();
                 final ApplicationsAdapter applicationList = mApplicationsAdapter;
 
-                ChangeNotifier action = new ChangeNotifier(applicationList);
+                final ChangeNotifier action = new ChangeNotifier(applicationList, launcher);
+                final HashMap<ComponentName, ApplicationInfo> appInfoCache = mAppInfoCache;
 
                 for (int i = 0; i < count && !mStopped; i++) {
                     ResolveInfo info = apps.get(i);
                     ComponentName componentName = new ComponentName(
                             info.activityInfo.applicationInfo.packageName,
                             info.activityInfo.name);
-                    ApplicationInfo application = mAppInfoCache.get(componentName);
+                    ApplicationInfo application = appInfoCache.get(componentName);
                     if (application == null) {
                         application = new ApplicationInfo();
                         application.title = info.loadLabel(manager);
@@ -192,21 +191,11 @@
                         if (DEBUG) {
                             Log.d(Launcher.LOG_TAG, "Loaded ApplicationInfo for " + componentName);
                         }
-                        mAppInfoCache.put(componentName, application);
+                        appInfoCache.put(componentName, application);
                     }
 
                     action.add(application);
                 }
-
-                action.sort(new Comparator<ApplicationInfo>() {
-                    public final int compare(ApplicationInfo a, ApplicationInfo b) {
-                        return sCollator.compare(a.title.toString(), b.title.toString());
-                    }
-                });
-
-                if (!mStopped) {
-                    launcher.runOnUiThread(action);
-                }
             }
 
             if (!mStopped) {
@@ -216,42 +205,62 @@
         }
     }
 
-    private static class ChangeNotifier implements Runnable {
+    private static class ChangeNotifier implements Runnable, Comparator<ApplicationInfo> {
         private final ApplicationsAdapter mApplicationList;
+        private final Launcher mLauncher;
         private final ArrayList<ApplicationInfo> mBuffer;
+        private final Object mLock = new Object();
 
-        ChangeNotifier(ApplicationsAdapter applicationList) {
+        private boolean mFirst = true;
+
+        ChangeNotifier(ApplicationsAdapter applicationList, Launcher launcher) {
             mApplicationList = applicationList;
+            mLauncher = launcher;
             mBuffer = new ArrayList<ApplicationInfo>(UI_NOTIFICATION_RATE);
         }
 
         public void run() {
-            final ArrayList<ApplicationInfo> buffer = mBuffer;
             final ApplicationsAdapter applicationList = mApplicationList;
-            final int count = buffer.size();
 
-            applicationList.setNotifyOnChange(false);
-            applicationList.clear();
-            for (int i = 0; i < count; i++) {
+            if (mFirst) {
                 applicationList.setNotifyOnChange(false);
-                applicationList.add(buffer.get(i));
+                applicationList.clear();
+                mFirst = false;
             }
 
+            synchronized (mLock) {
+                final ArrayList<ApplicationInfo> buffer = mBuffer;
+                final int count = buffer.size();
+
+                for (int i = 0; i < count; i++) {
+                    applicationList.setNotifyOnChange(false);
+                    applicationList.add(buffer.get(i));
+                }
+
+                buffer.clear();
+            }
+
+            applicationList.sort(this);
             applicationList.notifyDataSetChanged();
-            buffer.clear();
         }
 
-        void add(ApplicationInfo application) {
-            mBuffer.add(application);
+        synchronized void add(ApplicationInfo application) {
+            synchronized (mLock) {
+                final ArrayList<ApplicationInfo> buffer = mBuffer;
+                buffer.add(application);
+                if (buffer.size() >= UI_NOTIFICATION_RATE) {
+                    mLauncher.runOnUiThread(this);
+                }
+            }
         }
 
-        void sort(Comparator<ApplicationInfo> comparator) {
-            Collections.sort(mBuffer, comparator);
+        public final int compare(ApplicationInfo a, ApplicationInfo b) {
+            return sCollator.compare(a.title.toString(), b.title.toString());
         }
     }
 
     boolean isDesktopLoaded() {
-        return mDesktopItems != null && mDesktopGadgets != null && mDesktopItemsLoaded;
+        return mDesktopItems != null && mDesktopAppWidgets != null && mDesktopItemsLoaded;
     }
 
     /**
@@ -387,11 +396,11 @@
             }
 
             mDesktopItems = new ArrayList<ItemInfo>();
-            mDesktopGadgets = new ArrayList<LauncherGadgetInfo>();
+            mDesktopAppWidgets = new ArrayList<LauncherAppWidgetInfo>();
             mFolders = new HashMap<Long, FolderInfo>();
 
             final ArrayList<ItemInfo> desktopItems = mDesktopItems;
-            final ArrayList<LauncherGadgetInfo> desktopGadgets = mDesktopGadgets;
+            final ArrayList<LauncherAppWidgetInfo> desktopAppWidgets = mDesktopAppWidgets;
 
             final Cursor c = contentResolver.query(
                     LauncherSettings.Favorites.CONTENT_URI, null, null, null, null);
@@ -406,7 +415,7 @@
                 final int iconResourceIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_RESOURCE);
                 final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
                 final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
-                final int gadgetIdIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.GADGET_ID);
+                final int appWidgetIdIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.APPWIDGET_ID);
                 final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
                 final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
                 final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
@@ -418,7 +427,7 @@
                 ApplicationInfo info;
                 String intentDescription;
                 Widget widgetInfo;
-                LauncherGadgetInfo gadgetInfo;
+                LauncherAppWidgetInfo appWidgetInfo;
                 int container;
                 long id;
                 Intent intent;
@@ -548,26 +557,26 @@
 
                             desktopItems.add(widgetInfo);
                             break;
-                        case LauncherSettings.Favorites.ITEM_TYPE_GADGET:
-                            // Read all Launcher-specific gadget details
-                            int gadgetId = c.getInt(gadgetIdIndex);
-                            gadgetInfo = new LauncherGadgetInfo(gadgetId);
-                            gadgetInfo.id = c.getLong(idIndex);
-                            gadgetInfo.screen = c.getInt(screenIndex);
-                            gadgetInfo.cellX = c.getInt(cellXIndex);
-                            gadgetInfo.cellY = c.getInt(cellYIndex);
-                            gadgetInfo.spanX = c.getInt(spanXIndex);
-                            gadgetInfo.spanY = c.getInt(spanYIndex);
+                        case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
+                            // Read all Launcher-specific widget details
+                            int appWidgetId = c.getInt(appWidgetIdIndex);
+                            appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId);
+                            appWidgetInfo.id = c.getLong(idIndex);
+                            appWidgetInfo.screen = c.getInt(screenIndex);
+                            appWidgetInfo.cellX = c.getInt(cellXIndex);
+                            appWidgetInfo.cellY = c.getInt(cellYIndex);
+                            appWidgetInfo.spanX = c.getInt(spanXIndex);
+                            appWidgetInfo.spanY = c.getInt(spanYIndex);
 
                             container = c.getInt(containerIndex);
                             if (container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
-                                Log.e(Launcher.LOG_TAG, "Gadget found where container "
+                                Log.e(Launcher.LOG_TAG, "Widget found where container "
                                         + "!= CONTAINER_DESKTOP -- ignoring!");
                                 continue;
                             }
-                            gadgetInfo.container = c.getInt(containerIndex);
+                            appWidgetInfo.container = c.getInt(containerIndex);
 
-                            desktopGadgets.add(gadgetInfo);
+                            desktopAppWidgets.add(appWidgetInfo);
                             break;
                         }
                     } catch (Exception e) {
@@ -674,7 +683,7 @@
         mApplicationsAdapter = null;
         unbindAppDrawables(mApplications);
         unbindDrawables(mDesktopItems);
-        unbindGadgetHostViews(mDesktopGadgets);
+        unbindAppWidgetHostViews(mDesktopAppWidgets);
         unbindCachedIconDrawables();
     }
 
@@ -711,13 +720,13 @@
     }
 
     /**
-     * Remove any {@link LauncherGadgetHostView} references in our gadgets.
+     * Remove any {@link LauncherAppWidgetHostView} references in our widgets.
      */
-    private void unbindGadgetHostViews(ArrayList<LauncherGadgetInfo> gadgets) {
-        if (gadgets != null) {
-            final int count = gadgets.size();
+    private void unbindAppWidgetHostViews(ArrayList<LauncherAppWidgetInfo> appWidgets) {
+        if (appWidgets != null) {
+            final int count = appWidgets.size();
             for (int i = 0; i < count; i++) {
-                LauncherGadgetInfo launcherInfo = gadgets.get(i);
+                LauncherAppWidgetInfo launcherInfo = appWidgets.get(i);
                 launcherInfo.hostView = null;
             }
         }
@@ -757,8 +766,8 @@
     /**
      * @return The current list of desktop items
      */
-    public ArrayList<LauncherGadgetInfo> getDesktopGadgets() {
-        return mDesktopGadgets;
+    public ArrayList<LauncherAppWidgetInfo> getDesktopAppWidgets() {
+        return mDesktopAppWidgets;
     }
 
     /**
@@ -780,17 +789,17 @@
     }
 
     /**
-     * Add a gadget to the desktop
+     * Add a widget to the desktop
      */
-    public void addDesktopGadget(LauncherGadgetInfo info) {
-        mDesktopGadgets.add(info);
+    public void addDesktopAppWidget(LauncherAppWidgetInfo info) {
+        mDesktopAppWidgets.add(info);
     }
     
     /**
-     * Remove a gadget from the desktop
+     * Remove a widget from the desktop
      */
-    public void removeDesktopGadget(LauncherGadgetInfo info) {
-        mDesktopGadgets.remove(info);
+    public void removeDesktopAppWidget(LauncherAppWidgetInfo info) {
+        mDesktopAppWidgets.remove(info);
     }
 
     /**
diff --git a/src/com/android/launcher/LauncherProvider.java b/src/com/android/launcher/LauncherProvider.java
index 539d5ae..83f185e 100644
--- a/src/com/android/launcher/LauncherProvider.java
+++ b/src/com/android/launcher/LauncherProvider.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher;
 
+import android.appwidget.AppWidgetHost;
 import android.content.ContentProvider;
 import android.content.Context;
 import android.content.ContentValues;
@@ -30,7 +31,6 @@
 import android.database.sqlite.SQLiteQueryBuilder;
 import android.database.Cursor;
 import android.database.SQLException;
-import android.gadget.GadgetHost;
 import android.util.Log;
 import android.util.Xml;
 import android.net.Uri;
@@ -177,12 +177,12 @@
         private static final String ATTRIBUTE_Y = "y";
 
         private final Context mContext;
-        private final GadgetHost mGadgetHost;
+        private final AppWidgetHost mAppWidgetHost;
 
         DatabaseHelper(Context context) {
             super(context, DATABASE_NAME, null, DATABASE_VERSION);
             mContext = context;
-            mGadgetHost = new GadgetHost(context, Launcher.GADGET_HOST_ID);
+            mAppWidgetHost = new AppWidgetHost(context, Launcher.APPWIDGET_HOST_ID);
         }
 
         @Override
@@ -210,9 +210,9 @@
                     "displayMode INTEGER" +
                     ");");
 
-            // Database was just created, so wipe any previous gadgets
-            if (mGadgetHost != null) {
-                mGadgetHost.deleteHost();
+            // Database was just created, so wipe any previous widgets
+            if (mAppWidgetHost != null) {
+                mAppWidgetHost.deleteHost();
             }
             
             if (!convertDatabase(db)) {
@@ -250,7 +250,7 @@
             }
             
             if (converted) {
-                // Convert widgets from this import into gadgets
+                // Convert widgets from this import into widgets
                 if (LOGD) Log.d(LOG_TAG, "converted and now triggering widget upgrade");
                 convertWidgets(db);
             }
@@ -287,7 +287,7 @@
                 values.put(LauncherSettings.Favorites.ICON_RESOURCE, c.getString(iconResourceIndex));
                 values.put(LauncherSettings.Favorites.CONTAINER, c.getInt(containerIndex));
                 values.put(LauncherSettings.Favorites.ITEM_TYPE, c.getInt(itemTypeIndex));
-                values.put(LauncherSettings.Favorites.GADGET_ID, -1);
+                values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1);
                 values.put(LauncherSettings.Favorites.SCREEN, c.getInt(screenIndex));
                 values.put(LauncherSettings.Favorites.CELLX, c.getInt(cellXIndex));
                 values.put(LauncherSettings.Favorites.CELLY, c.getInt(cellYIndex));
@@ -321,10 +321,10 @@
             
             int version = oldVersion;
             if (version == 1) {
-                // upgrade 1 -> 2 added gadgetId column
+                // upgrade 1 -> 2 added appWidgetId column
                 db.beginTransaction();
                 try {
-                    // Insert new column for holding gadgetIds
+                    // Insert new column for holding appWidgetIds
                     db.execSQL("ALTER TABLE favorites " +
                         "ADD COLUMN gadgetId INTEGER NOT NULL DEFAULT -1;");
                     db.setTransactionSuccessful();
@@ -350,9 +350,9 @@
         }
         
         /**
-         * Upgrade existing clock and photo frame widgets into their new gadget
-         * equivalents. This method allocates gadgetIds, and then hands off to
-         * LauncherGadgetBinder to finish the actual binding.
+         * Upgrade existing clock and photo frame widgets into their new widget
+         * equivalents. This method allocates appWidgetIds, and then hands off to
+         * LauncherAppWidgetBinder to finish the actual binding.
          */
         private void convertWidgets(SQLiteDatabase db) {
             final int[] bindSources = new int[] {
@@ -362,14 +362,14 @@
             
             final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
             bindTargets.add(new ComponentName("com.android.alarmclock",
-                    "com.android.alarmclock.AnalogGadgetProvider"));
+                    "com.android.alarmclock.AnalogAppWidgetProvider"));
             bindTargets.add(new ComponentName("com.android.camera",
-                    "com.android.camera.PhotoGadgetProvider"));
+                    "com.android.camera.PhotoAppWidgetProvider"));
             
             final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
             
             Cursor c = null;
-            boolean allocatedGadgets = false;
+            boolean allocatedAppWidgets = false;
             
             db.beginTransaction();
             try {
@@ -383,14 +383,14 @@
                 while (c != null && c.moveToNext()) {
                     long favoriteId = c.getLong(0);
                     
-                    // Allocate and update database with new gadgetId
+                    // Allocate and update database with new appWidgetId
                     try {
-                        int gadgetId = mGadgetHost.allocateGadgetId();
+                        int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
                         
-                        if (LOGD) Log.d(LOG_TAG, "allocated gadgetId="+gadgetId+" for favoriteId="+favoriteId);
+                        if (LOGD) Log.d(LOG_TAG, "allocated appWidgetId="+appWidgetId+" for favoriteId="+favoriteId);
                         
                         values.clear();
-                        values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
+                        values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
                         
                         // Original widgets might not have valid spans when upgrading
                         values.put(LauncherSettings.Favorites.SPANX, 2);
@@ -399,15 +399,15 @@
                         String updateWhere = Favorites._ID + "=" + favoriteId;
                         db.update(TABLE_FAVORITES, values, updateWhere, null);
                         
-                        allocatedGadgets = true;
+                        allocatedAppWidgets = true;
                     } catch (RuntimeException ex) {
-                        Log.e(LOG_TAG, "Problem allocating gadgetId", ex);
+                        Log.e(LOG_TAG, "Problem allocating appWidgetId", ex);
                     }
                 }
                 
                 db.setTransactionSuccessful();
             } catch (SQLException ex) {
-                Log.w(LOG_TAG, "Problem while allocating gadgetIds for existing widgets", ex);
+                Log.w(LOG_TAG, "Problem while allocating appWidgetIds for existing widgets", ex);
             } finally {
                 db.endTransaction();
                 if (c != null) {
@@ -415,22 +415,22 @@
                 }
             }
             
-            // If any gadgetIds allocated, then launch over to binder
-            if (allocatedGadgets) {
-                launchGadgetBinder(bindSources, bindTargets);
+            // If any appWidgetIds allocated, then launch over to binder
+            if (allocatedAppWidgets) {
+                launchAppWidgetBinder(bindSources, bindTargets);
             }
         }
 
         /**
-         * Launch the gadget binder that walks through the Launcher database,
+         * Launch the widget binder that walks through the Launcher database,
          * binding any matching widgets to the corresponding targets. We can't
          * bind ourselves because our parent process can't obtain the
-         * BIND_GADGET permission.
+         * BIND_APPWIDGET permission.
          */
-        private void launchGadgetBinder(int[] bindSources, ArrayList<ComponentName> bindTargets) {
+        private void launchAppWidgetBinder(int[] bindSources, ArrayList<ComponentName> bindTargets) {
             final Intent intent = new Intent();
             intent.setComponent(new ComponentName("com.android.settings",
-                    "com.android.settings.LauncherGadgetBinder"));
+                    "com.android.settings.LauncherAppWidgetBinder"));
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             
             final Bundle extras = new Bundle();
@@ -533,13 +533,13 @@
             
             final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
             bindTargets.add(new ComponentName("com.android.alarmclock",
-                    "com.android.alarmclock.AnalogGadgetProvider"));
+                    "com.android.alarmclock.AnalogAppWidgetProvider"));
             
-            boolean allocatedGadgets = false;
+            boolean allocatedAppWidgets = false;
             
-            // Try binding to an analog clock gadget
+            // Try binding to an analog clock widget
             try {
-                int gadgetId = mGadgetHost.allocateGadgetId();
+                int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
                 
                 values.clear();
                 values.put(LauncherSettings.Favorites.CONTAINER,
@@ -551,17 +551,17 @@
                 values.put(LauncherSettings.Favorites.CELLY, 0);
                 values.put(LauncherSettings.Favorites.SPANX, 2);
                 values.put(LauncherSettings.Favorites.SPANY, 2);
-                values.put(LauncherSettings.Favorites.GADGET_ID, gadgetId);
+                values.put(LauncherSettings.Favorites.APPWIDGET_ID, appWidgetId);
                 db.insert(TABLE_FAVORITES, null, values);
                 
-                allocatedGadgets = true;
+                allocatedAppWidgets = true;
             } catch (RuntimeException ex) {
-                Log.e(LOG_TAG, "Problem allocating gadgetId", ex);
+                Log.e(LOG_TAG, "Problem allocating appWidgetId", ex);
             }
 
-            // If any gadgetIds allocated, then launch over to binder
-            if (allocatedGadgets) {
-                launchGadgetBinder(bindSources, bindTargets);
+            // If any appWidgetIds allocated, then launch over to binder
+            if (allocatedAppWidgets) {
+                launchAppWidgetBinder(bindSources, bindTargets);
             }
             
             return i;
diff --git a/src/com/android/launcher/LauncherSettings.java b/src/com/android/launcher/LauncherSettings.java
index 461cca4..ed35635 100644
--- a/src/com/android/launcher/LauncherSettings.java
+++ b/src/com/android/launcher/LauncherSettings.java
@@ -25,7 +25,7 @@
 class LauncherSettings {
     /**
      * Favorites. When changing these values, be sure to update
-     * {@link com.android.settings.LauncherGadgetBinder} as needed.
+     * {@link com.android.settings.LauncherAppWidgetBinder} as needed.
      */
     static final class Favorites implements BaseColumns {
         /**
@@ -148,9 +148,9 @@
         static final int ITEM_TYPE_LIVE_FOLDER = 3;
 
         /**
-         * The favorite is a gadget
+         * The favorite is a widget
          */
-        static final int ITEM_TYPE_GADGET = 4;
+        static final int ITEM_TYPE_APPWIDGET = 4;
 
         /**
          * The favorite is a clock
@@ -168,11 +168,11 @@
         static final int ITEM_TYPE_WIDGET_PHOTO_FRAME = 1002;
 
         /**
-         * The gadgetId of the gadget
+         * The appWidgetId of the widget
          *
          * <P>Type: INTEGER</P>
          */
-        static final String GADGET_ID = "gadgetId";
+        static final String APPWIDGET_ID = "gadgetId";
         
         /**
          * Indicates whether this favorite is an application-created shortcut or not.
diff --git a/src/com/android/launcher/Search.java b/src/com/android/launcher/Search.java
index 296b902..97dcd98 100644
--- a/src/com/android/launcher/Search.java
+++ b/src/com/android/launcher/Search.java
@@ -60,7 +60,7 @@
 public class Search extends LinearLayout implements OnClickListener, OnKeyListener,
         OnLongClickListener, TextWatcher, OnItemClickListener, OnItemSelectedListener {
 
-    private final String TAG = "SearchGadget";
+    private final String TAG = "SearchWidget";
 
     private AutoCompleteTextView mSearchText;
     private ImageButton mGoButton;
diff --git a/src/com/android/launcher/Workspace.java b/src/com/android/launcher/Workspace.java
index d834b8f..8a7baf5 100644
--- a/src/com/android/launcher/Workspace.java
+++ b/src/com/android/launcher/Workspace.java
@@ -25,6 +25,7 @@
 import android.graphics.Paint;
 import android.graphics.RectF;
 import android.graphics.Rect;
+import android.graphics.Region;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.view.VelocityTracker;
@@ -95,6 +96,8 @@
 
     final Rect mDrawerBounds = new Rect();
     final Rect mClipBounds = new Rect();
+    int mDrawerContentHeight;
+    int mDrawerContentWidth;
 
     /**
      * Used to inflate the Workspace from XML.
@@ -442,6 +445,8 @@
 
     @Override
     protected void dispatchDraw(Canvas canvas) {
+        boolean restore = false;
+
         // If the all apps drawer is open and the drawing region for the workspace
         // is contained within the drawer's bounds, we skip the drawing. This requires
         // the drawer to be fully opaque.
@@ -452,6 +457,15 @@
             if (mDrawerBounds.contains(clipBounds)) {
                 return;
             }
+        } else if (mLauncher.isDrawerMoving()) {
+            restore = true;
+            canvas.save(Canvas.CLIP_SAVE_FLAG);
+
+            final View view = mLauncher.getDrawerHandle();
+            final int top = view.getTop() + view.getHeight();
+
+            canvas.clipRect(mScrollX, top, mScrollX + mDrawerContentWidth,
+                    top + mDrawerContentHeight, Region.Op.DIFFERENCE);
         }
 
         float x = mScrollX * mWallpaperOffset;
@@ -485,6 +499,10 @@
                 }
             }
         }
+
+        if (restore) {
+            canvas.restore();
+        }
     }
 
     @Override
@@ -1215,8 +1233,8 @@
         }
     }
     
-    // TODO: remove gadgets when gadgetmanager tells us they're gone
-//    void removeGadgetsForProvider() {
+    // TODO: remove widgets when appwidgetmanager tells us they're gone
+//    void removeAppWidgetsForProvider() {
 //    }
 
     void moveToDefaultScreen() {