Android screen flips on usb keyboard connection

213 views Asked by At

I am using a portrait (native) display in landscape mode by using setprop ro.sf.hwrotation 90 in KitKat and it is working well. The problem is that the screen momentarily flips/twists before going to the correct orientation when a USB keyboard is connected or disconnected. The aspect ratio is momentarily distorted as well (e.g. clock becomes an oval). The distortion only persists for a moment - but something is not correct.

This twist doesn't occur unless the ro.sf.hwrotation property is used - so I'm thinking that someplace in the Android source that needs to take it into account isn't.

Thanks in advance,

1

There are 1 answers

1
Buddy On

You can try handling the keyboard configuration change yourself, and that'll stop the activity from being recreated and causing the momentary distortion (see docs here)