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

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jump to solution
1,824 Views
matthiasbloch
Contributor I

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

Labels (2)
0 Kudos
1 Solution
296 Views
matthiasbloch
Contributor I

After searching for one month.

I have the idea that work with me: use USER_ROTATION parameter.

- Change it in the Display Settings

     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

- Use USER_ROTATION in the frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java at the end of rotationForOrientationLw

BR.

Matthias

View solution in original post

0 Kudos
1 Reply
297 Views
matthiasbloch
Contributor I

After searching for one month.

I have the idea that work with me: use USER_ROTATION parameter.

- Change it in the Display Settings

     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

- Use USER_ROTATION in the frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java at the end of rotationForOrientationLw

BR.

Matthias

View solution in original post

0 Kudos