Setting natural rotation in Android Lollipop

345 views
Skip to first unread message

Martin Fuzzey

unread,
Oct 17, 2015, 5:49:13 PM10/17/15
to android-porting
Hi,

we are building two types of custom devices, both have identical 640x480 displays, but in one device the display is mounted in landscape orientation and the other in portrait orientation.

They are working fine under Android 4.1.1 using the "ro.sf.hwrotation" build property.

However, we are now upgrading to Android 5.1.1 and this property has been removed with the comment "get rid of ro.sf.hwrotation, it's not used anymore"

Setting the properties

persist.demo.remoterotation=portarait
persist.demo.rotationlock=true

Fixes it for the Android UI but the orientation is still wrong in the bootanimation
Furthermore, reading the code in frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java it would seem these are intended for remote displays.

So, what is the proper way of doing this?

Martin

Dave McLaughlin

unread,
May 26, 2020, 10:55:32 AM5/26/20
to android-porting
I know this is a very old post but I was wondering if you got it to work?

When the bootanimation starts, it is 90 deg out and after a few seconds, sorts itself out and in the correct landscape orientation. 

The LCD screen is orientated as LANDSCAPE during u-boot as the boot image is correct. 

I've checked though the source and cannot find any reason why the boot animation would seem to orientate to portrait on the initial boot.
Reply all
Reply to author
Forward
0 new messages