Android4.4.2KK simple scheme of forcibly changing portrait screen to landscape Screen
Solution:
Currently, this is a change based on the current problem scenario, that is, the forced change of the portrait screen to the landscape screen. It is basically the state defined by hardcode, and the total number of valid code lines is modified.5 rowsIf you have other requirements or require more flexible configuration of landscape and landscape screens, you can use the compile switch to generate system attributes, in the system, you can use attributes to determine the current screen status for flexible purposes. You can add conditions based on this modification to determine the purpose. The specific modification code is marked as a red circle.
1. Android Framework Java layer modification:
1. Modify the default Rotation of WindowManagerService:
2. The Rotation of PhoneWindowManager returns modification:
2. Modifications to the Android Framework Native (C/C ++) layer:
1. Modify the default orientation in DispalyDevice of SurfaceFlinger:
Change the width and height of the default frame rect:
2. Modify the width and height of the surface frame buffer applied in bootanimation:
Problem Background:
1. The current device is based on Android4.4.2KK
2. The Portrait screen is successfully replaced with the landscape screen.
3. After changing the screen, you cannot achieve the expected horizontal screen effect, including the boot animation, screen portrait switching animation, and screen lock interface.