This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Upside down rotation won't work (ro.sf.hwrotation=180)

Hi,

We're trying to set the screen upside down in our product running Android ICS 4.0.3 and it doesn't work. Basically we tied setting ro.sf.hwrotation to 180 and it does nothing. Setting it to 90 works. Someone got a solution for that?

Thanks

  • I found next posts about rotate.

    http://e2e.ti.com/support/omap/f/849/t/171722.aspx

    Next file have some default values that could affect in initial configuration,

    /mydroid/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
        int mLandscapeRotation = 0;  // default landscape rotation
        int mSeascapeRotation = 0;   // "other" landscape rotation, 180 degrees from mLandscapeRotation
        int mPortraitRotation = 0;   // default portrait rotation
        int mUpsideDownRotation = 0; // "other" portrait rotation

    This is a good point because it rotates all the sensor calculations too.

    Other option is to tell them to disabled the sensor rotation and check if your code works.

    Sensor rotation can be disabled in settings, or I found next file

    /4ai17/mydroid/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
        /** When not otherwise specified by the activity's screenOrientation, rotation should be
         * determined by the system (that is, using sensors). */
        public final int USER_ROTATION_FREE = 0;
        /** When not otherwise specified by the activity's screenOrientation, rotation is set by
         * the user. */
        public final int USER_ROTATION_LOCKED = 1;

  • Hi Manuel,

    I'm not sure what I should do with the information included in your post. One thing I tried is disabling automatic screen rotation from the settings panel and the screen is still at 0 degree rotation when I ask for 180. Even so, I'm running on the beaglebone without any accelerometer so it shouldn't impact the system. 

    Other than that, what do you suggest I try with the PhoneWindowManager.java and WindowManagerService.java files?

    Thanks

  • Right sorry, I missed that this post is for Android Forum. The information provided is for OMAP forum. Let me check it again.

  • I found the answer here: http://android.stackexchange.com/questions/10808/how-is-the-default-screen-orientation-in-android-specified

    Here's the information:

    su sqlite3 /data/data/com.android.providers.settings/databases/settings.db 
    insert into system (name,value) values('accelerometer_rotation',0); 
    insert into system (name,value) values('user_rotation',2); 
    .exit 
    • user_rotation 0 -> ROTATION_0
    • user_rotation 1 -> ROTATION_180
    • user_rotation 2 -> ROTATION_270
    • user_rotation 3 -> ROTATION_90
  • Thanks for sharing the information.