Cherrypick of #13578 to beta Moves responsibility for setting keyboard height preference into `applyKeyboardHeight()`