Fix two crashes
- NPE: bug #4984219 - IllegalStateException: bug #4969695 Change-Id: Iaf02e669b26f9277388e0e7bffd532220ebf9bb1
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user