Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e55c40e authored by Brett Chabot's avatar Brett Chabot
Browse files

Fix PhoneWindowManager#getUserRotationMode

This method should be reading from the ACCELEROMETER_ROTATION instead
of the USER_ROTATION setting.

Needed for uiautomator to properly restore the current auto rotation
setting after test run finishes.

Bug 8985351

Change-Id: I50f100117c0590dd65a646b584d027751ad5d3ce
parent 02ea97b5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -4369,8 +4369,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    public int getUserRotationMode() {
        return Settings.System.getIntForUser(mContext.getContentResolver(),
                Settings.System.USER_ROTATION, WindowManagerPolicy.USER_ROTATION_FREE,
                UserHandle.USER_CURRENT);
                Settings.System.ACCELEROMETER_ROTATION, 0, UserHandle.USER_CURRENT) != 0 ?
                        WindowManagerPolicy.USER_ROTATION_FREE :
                                WindowManagerPolicy.USER_ROTATION_LOCKED;
    }

    // User rotation: to be used when all else fails in assigning an orientation to the device