Android2.2 froyo portrait display

Source: Internet
Author: User

After implementation, we found that Google has improved a lot in the process from 1.5 to 2.2. It is troublesome to modify the portrait screen by 1.5, while 2.2 is

It's easy!
In fact, Google has basically improved the default portrait screen method of the previous version, and does not need to spend more effort on the screen.

By default, the above is switched horizontally and vertically.

1. You can still display the "a n d r o I d" on the kernel portrait screen.
Add fbcon = rotate: 1 to the startup parameters (0: normal screen; 1: instant clock to 90 degrees; 2: instant clock to 180 degrees; 3: instant clock to 270 degrees)

Degree ;)
The generated Autoconf. h contains similar items:
# Define config_cmdline "console = ttysac0, 115200 fbcon = rotate: 1"

This item is parsed in $ (kernel)/Drivers/Video/console/fbcon. c
Static int _ init fb_lele_setup (char * this_opt );
Only initialize the variable initial_rotation, and initial_rotation will be passed to other required structures.
Choose device drivers> graphics support> console display driver support.

Framebuffer console support-> framebuffer console Rotation
Note: For more information, see $ (kernel)/documentation/FB/fbcon.txt.

2. Android OS Rotating Screen
Froyo is already quite easy. You can modify only one of them:
Frameworks/base/libs/surfaceflinger. cpp
Void graphicplane: setdisplayhardware (displayhardware * HW)
{
Mhw = HW;

// Initialize the Display orientation transform.
// It's a constant that shoshould come from the display driver.
// Int displayorientation = isurfacecomposer: eorientationdefault;
Int displayorientation = isurfacecomposer: eorientation90; // Jeff.
...
}

Or add only one item in init. RC:
Setprop Ro. SF. hwrotation 90

With this simple modification, the whole screen can be displayed in portrait mode!

 

Http://blog.csdn.net/knock/archive/2010/11/11/6002771.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.