diff options
author | Michael Jurka <mikejurka@google.com> | 2011-07-25 13:38:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-25 13:38:58 -0700 |
commit | 126038c4d4b826e33ccbe6a0a5be9a71cfc99ede (patch) | |
tree | e7a4cdb0636d9590c2b80be855d7c440ea1b45a4 /src/com | |
parent | f4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5 (diff) | |
parent | 19e0fc53c43a7746d7ae3d7c6027166bded33f0f (diff) | |
download | android_packages_apps_Trebuchet-126038c4d4b826e33ccbe6a0a5be9a71cfc99ede.tar.gz android_packages_apps_Trebuchet-126038c4d4b826e33ccbe6a0a5be9a71cfc99ede.tar.bz2 android_packages_apps_Trebuchet-126038c4d4b826e33ccbe6a0a5be9a71cfc99ede.zip |
Merge "Fix two crashes"
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index ed408df48..d3215f093 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -207,7 +207,10 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona /* LauncherTransitionable overrides */ @Override public void onLauncherTransitionStart(Animator animation) { - if (animation != null) { + // isHardwareAccelerated() checks if we're attached to a window and if that + // window is HW accelerated-- we were sometimes not attached to a window + // and buildLayer was throwing an IllegalStateException + if (animation != null && isHardwareAccelerated()) { // Turn on hardware layers for performance setLayerType(LAYER_TYPE_HARDWARE, null); diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index af8d986b9..e318960f8 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2593,14 +2593,18 @@ public final class Launcher extends Activity ImageView button = (ImageView) findViewById(buttonId); Drawable toolbarIcon = getExternalPackageToolbarIcon(activityName); - // If we were unable to find the icon via the meta-data, use a generic one - if (toolbarIcon == null) { - button.setImageResource(fallbackDrawableId); - return null; - } else { - button.setImageDrawable(toolbarIcon); - return toolbarIcon.getConstantState(); + if (button != null) { + // If we were unable to find the icon via the meta-data, use a + // generic one + if (toolbarIcon == null) { + button.setImageResource(fallbackDrawableId); + } else { + button.setImageDrawable(toolbarIcon); + } } + + return toolbarIcon != null ? toolbarIcon.getConstantState() : null; + } private void updateTextButtonWithDrawable(int buttonId, Drawable.ConstantState d) { |