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

Unverified Commit b3cb1a51 authored by Tom Pratt's avatar Tom Pratt Committed by Michael Bestas
Browse files

Check ACCELEROMETER_ROTATION_ANGLES for current user

Fixes a bug where secondary users get the rotation angle settings from user0 instead of their own settings.

Change-Id: I5e76d000a28756b70efc1ab3723edaec4d3714dc
parent c01cd9d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -168,8 +168,8 @@ public final class RotationPolicy {
    }

    private static boolean isCurrentRotationAllowed(Context context) {
        int userRotationAngles = Settings.System.getInt(context.getContentResolver(),
                Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1);
        int userRotationAngles = Settings.System.getIntForUser(context.getContentResolver(),
                Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1, UserHandle.USER_CURRENT);
        boolean allowAllRotations = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowAllRotations);
        final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
+2 −2
Original line number Diff line number Diff line
@@ -1469,8 +1469,8 @@ public class DisplayRotation {
                shouldUpdateRotation = true;
            }

            final int userRotationAngles = Settings.System.getInt(resolver,
                    Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1);
            final int userRotationAngles = Settings.System.getIntForUser(resolver,
                    Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1, UserHandle.USER_CURRENT);
            if (mUserRotationAngles != userRotationAngles) {
                mUserRotationAngles = userRotationAngles;
                shouldUpdateRotation = true;