Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52bce9c4 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 5680 into donut

* changes:
  Fixes #1949502. Prevents an NPE in View.buildDrawingCache().
parents 9032ab8e e1123228
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5922,8 +5922,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            int height = mBottom - mTop;

            final AttachInfo attachInfo = mAttachInfo;
            final boolean scalingRequired = attachInfo != null && attachInfo.mScalingRequired;

            if (autoScale && attachInfo != null && attachInfo.mScalingRequired) {
            if (autoScale && scalingRequired) {
                width = (int) ((width * attachInfo.mApplicationScale) + 0.5f);
                height = (int) ((height * attachInfo.mApplicationScale) + 0.5f);
            }
@@ -6014,7 +6015,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            computeScroll();
            final int restoreCount = canvas.save();
            
            if (autoScale && attachInfo.mScalingRequired) {
            if (autoScale && scalingRequired) {
                final float scale = attachInfo.mApplicationScale;
                canvas.scale(scale, scale);
            }