Merge "Improve handling of built-in keyboard." into jb-dev