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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,390 次查看
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

标签 (2)
0 项奖励
1 解答
862 次查看
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

在原帖中查看解决方案

0 项奖励
1 回复
863 次查看
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

0 项奖励