Shell command to rotate screen from portrait to landscape

856 views
Skip to first unread message

SR

unread,
May 7, 2010, 2:54:18 PM5/7/10
to android-platform
I need to rotate screen from portrait to landscape. I found in the
past
that the following two shell commands might have worked:

change the screen to landscape:
# service call window 18 i32 1
change the screen to portrait:
# service call window 18 i32 0

However, they do not work for me on Android 2.1 image.

Should these commands work? If not, are there any other ways to do so?

Also, can someone explain, from the framebuffer and graphic driver
point of view, how rotation works?

Thanks,
S.R.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

Dianne Hackborn

unread,
May 7, 2010, 5:03:29 PM5/7/10
to android-...@googlegroups.com
There isn't a formal way to do this.  Depending on how the device is configured, the window manager will look at the lid state and accelerometer to decide to rotate (if an activity isn't overriding that).  The API you are using is an internal func that doesn't really do what you think, and conflicts with the normal behavior of the window manager.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

w wylhistory

unread,
May 7, 2010, 9:49:26 PM5/7/10
to android-platform
as far as I know:
the rotation occur before the data be written to the framebuffer,
so it has nothing to do with the driver;
surfaceflinger will remember the rotation degree, then pass to the layer,
then each layer will do the rotation,either by the copybit or by the opengl itself;


2010/5/8 SR <scu...@gmail.com>
Reply all
Reply to author
Forward
0 new messages