Merge "Improve orientation sensing when waking up while flat." into gingerbread