From f7640c8bba304ba99c99afcd7393893eccc9a0d9 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 28 Feb 2011 13:47:29 -0800 Subject: [PATCH] Fixing strict mode issues. Change-Id: Ia4fb1f76e608ba1944b79e520444e229802f275a --- src/com/android/launcher2/Launcher.java | 13 +++++++++++-- src/com/android/launcher2/Workspace.java | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 261569ef64..b95feaf5e6 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1223,7 +1223,7 @@ public final class Launcher extends Activity * @param appWidgetId The app widget id * @param cellInfo The position on screen where to create the widget. */ - private void completeAddAppWidget(int appWidgetId, int screen) { + private void completeAddAppWidget(final int appWidgetId, int screen) { AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId); // Calculate the grid spans needed to fit this widget @@ -1253,7 +1253,16 @@ public final class Launcher extends Activity } if (!foundCellSpan) { - if (appWidgetId != -1) mAppWidgetHost.deleteAppWidgetId(appWidgetId); + if (appWidgetId != -1) { + // Deleting an app widget ID is a void call but writes to disk before returning + // to the caller... + final LauncherAppWidgetHost appWidgetHost = mAppWidgetHost; + new Thread("deleteAppWidgetId") { + public void run() { + mAppWidgetHost.deleteAppWidgetId(appWidgetId); + } + }.start(); + } showOutOfSpaceMessage(); return; } diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 699f2b40c0..809d550a30 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -690,7 +690,11 @@ public class Workspace extends SmoothPagedView // parallax effects mWallpaperWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim)); mWallpaperHeight = (int)(maxDim * wallpaperTravelToScreenHeightRatio(maxDim, minDim)); - mWallpaperManager.suggestDesiredDimensions(mWallpaperWidth, mWallpaperHeight); + new Thread("setWallpaperDimension") { + public void run() { + mWallpaperManager.suggestDesiredDimensions(mWallpaperWidth, mWallpaperHeight); + } + }.start(); } public void setVerticalWallpaperOffset(float offset) {