OSDN Git Service

Fix some crashes in launcher2.
authorJoe Onorato <joeo@android.com>
Thu, 24 Sep 2009 01:20:54 +0000 (18:20 -0700)
committerJoe Onorato <joeo@android.com>
Thu, 24 Sep 2009 01:20:54 +0000 (18:20 -0700)
http://b/issue?id=2142064

src/com/android/launcher2/DeferredHandler.java
src/com/android/launcher2/Workspace.java

index 433bf55..ce60352 100644 (file)
@@ -40,6 +40,9 @@ public class DeferredHandler {
         public void handleMessage(Message msg) {
             Runnable r;
             synchronized (mQueue) {
+                if (mQueue.size() == 0) {
+                    return;
+                }
                 r = mQueue.removeFirst();
             }
             r.run();
index 9191bc6..37a2444 100644 (file)
@@ -266,18 +266,10 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
         clearVacantCache();
         mCurrentScreen = Math.max(0, Math.min(currentScreen, getChildCount() - 1));
         scrollTo(mCurrentScreen * getWidth(), 0);
-        updateWallpaperOffset();
         invalidate();
     }
 
     /**
-     * Shows the default screen (defined by the firstScreen attribute in XML.)
-     */
-    void showDefaultScreen() {
-        setCurrentScreen(mDefaultScreen);
-    }
-
-    /**
      * Adds the specified child in the current screen. The position and dimension of
      * the child are defined by x, y, spanX and spanY.
      *