AnsweredAssumed Answered

Display Settings Orientation when the device has no Accelero/Gyro ?

Question asked by Matthias Bloch on Jul 18, 2013
Latest reply on Aug 1, 2013 by Matthias Bloch

Dear All,

 

I have a question.

I customized Android 4.0 (based Freescale 13.4.1) on a device that has no Accelero/Gyro. This device is used by customer as a Digital Signage Player and thus can be used as Landscape, Portrait, Reverse Landscape, Reverse Portrait, that can be configured. The thing is no to compile again Android to change the orientation.

 

In the Android Display Settings, there is the Auto-Rotate Screen that lock or release the rotation. What happened if I want to setup the orientation/rotation by another menu ?

 

To be honest I tried without any success. I tried to copy of Font Size settings.

For the moment, I did:

In ~/myandroid/packages/apps/Settings

     - res/values/arrays.xml & res/values/strings.xml Add string names and values for the 4 orientations I want.

     - res/xml/display_settings.xml The menu itself

     - src/com/android/settings/DisplaySettings.java copy on Font Size Settings

 

Based on that, the configuration is changing but no orientation occured. There is something missing between the menu and the action itself.

I tried also try to make a rotation by using Auto-Rotate parameter hack. No luck.

     - The Auto-Rotate used freezeRotation and ThawRotation (

./frameworks/base/services/java/com/android/server/wm/WindowManagerService.java)

     and there is also rotationForOrientationLw

(frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

 

)

 

Do you have any idea how to do this ?

Thanks.

BR

Matthias

Outcomes