Android4.4.2KK simple scheme of forcibly changing portrait screen to landscape Screen

Source: Internet
Author: User

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.

Related Article

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.