Merge "Prevent NPE for onKeyDown and onKeyUp" into tm-dev