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

Commit 43d5e650 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Prevent crash in KeyboardView when the view is 0x0."

parents 870d81d0 46a61bb7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -620,7 +620,10 @@ public class KeyboardView extends View implements View.OnClickListener {
        if (mBuffer == null || mKeyboardChanged) {
            if (mBuffer == null || mKeyboardChanged &&
                    (mBuffer.getWidth() != getWidth() || mBuffer.getHeight() != getHeight())) {
                mBuffer = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
                // Make sure our bitmap is at least 1x1
                final int width = Math.max(1, getWidth());
                final int height = Math.max(1, getHeight());
                mBuffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
                mCanvas = new Canvas(mBuffer);
            }
            invalidateAllKeys();