diff options
author | Adam Cohen <adamcohen@google.com> | 2010-12-09 11:46:38 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2010-12-09 11:47:59 -0800 |
commit | 696a67969d657d38eff33996633f08da0e21841f (patch) | |
tree | 02f88c0fa8f897d3d065b3b23948a8222be21f75 /src | |
parent | d3ef3065ab0941567c45e9aec98783138b623c68 (diff) | |
download | android_packages_apps_Trebuchet-696a67969d657d38eff33996633f08da0e21841f.tar.gz android_packages_apps_Trebuchet-696a67969d657d38eff33996633f08da0e21841f.tar.bz2 android_packages_apps_Trebuchet-696a67969d657d38eff33996633f08da0e21841f.zip |
Fixing stack overflow (issue #3270492)
Change-Id: I6a9c58d2c0843414fd844c8aa5bf0370da33108b
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index b58faed94..969fbd7cc 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -727,8 +727,14 @@ public class Workspace extends SmoothPagedView // if shrinkToBottom() is called on initialization, it has to be deferred // until after the first call to onLayout so that it has the correct width if (mWaitingToShrink) { - shrink(mWaitingToShrinkState, false); - mWaitingToShrink = false; + // shrink can trigger a synchronous onLayout call, so we + // post this to avoid a stack overflow / tangled onLayout calls + post(new Runnable() { + public void run() { + shrink(mWaitingToShrinkState, false); + mWaitingToShrink = false; + } + }); } if (LauncherApplication.isInPlaceRotationEnabled()) { @@ -753,7 +759,6 @@ public class Workspace extends SmoothPagedView mCustomizeTrayBackground.draw(canvas); } } - super.onDraw(canvas); } |