Merge "Improve the input policy handling a bit." into gingerbread