Skip to content Skip to sidebar Skip to footer

Aosp Automotive Orientation Change

I am building the automotive build from the AOSP project. I cannot seem to find a way to change the default SystemUI orientation from landscape to portrait. Help needed.

Solution 1:

By default the AOSP Automotive is locked to default orientation by declaring the following flag to be true PATH = /frameworks/base/core/res/res/values/config.xml

<bool name="config_forceDefaultOrientation">true</bool>

What that does is, it goes to the system and get the default orientation, which happens to be landscape mode and you cannot change that.

In order to allow portrait mode, you have to set the above flag to false. Then override the specific target build default screen dock rotation. For this case since we are building an automotive build, we declare our default dock state as follows.

  <integer name="config_carDockRotation">3</integer>

3 means portrait, and you can lookup the documentation for other rotation values. That's it. If you build the system image, it will have portrait orientation.

Solution 2:

An amendment to CodeDaily's answer:

I don't know if this is new or not, but in AOSP 10.0.0 config_carDockRotation is in degrees and must be multiple of 90. This is confirmed in frameworks/base/services in DisplayRotation.java

Post a Comment for "Aosp Automotive Orientation Change"