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