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

Commit 4a298706 authored by sync_forks@e's avatar sync_forks@e
Browse files

Merge branch 'lineage-15.1' into v1-oreo

parents d9c81062 9188308e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -3568,6 +3568,23 @@ public final class Settings {
        @Deprecated
        public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;

        /**
         * Control the type of rotation which can be performed using the accelerometer
         * if ACCELEROMETER_ROTATION is enabled.
         * Value is a bitwise combination of
         * 1 = 0 degrees (portrait)
         * 2 = 90 degrees (left)
         * 4 = 180 degrees (inverted portrait)
         * 8 = 270 degrees (right)
         * Setting to 0 is effectively orientation lock
         * @hide
         */
        public static final String ACCELEROMETER_ROTATION_ANGLES = "accelerometer_rotation_angles";

        /** @hide */
        public static final Validator ACCELEROMETER_ROTATION_ANGLES_VALIDATOR =
                sNonNegativeIntegerValidator;

        /**
         * Control whether the accelerometer will be used to change screen
         * orientation.  If 0, it will not be used unless explicitly requested
@@ -4203,6 +4220,8 @@ public final class Settings {
            VALIDATORS.put(WIFI_STATIC_DNS1, WIFI_STATIC_DNS1_VALIDATOR);
            VALIDATORS.put(WIFI_STATIC_DNS2, WIFI_STATIC_DNS2_VALIDATOR);
            VALIDATORS.put(SHOW_BATTERY_PERCENT, SHOW_BATTERY_PERCENT_VALIDATOR);
            VALIDATORS.put(ACCELEROMETER_ROTATION_ANGLES,
                    ACCELEROMETER_ROTATION_ANGLES_VALIDATOR);
        }

        /**
+1 −1
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ public final class RotationPolicy {

    private static boolean isCurrentRotationAllowed(Context context) {
        int userRotationAngles = Settings.System.getInt(context.getContentResolver(),
                "accelerometer_rotation_angles", -1);
                Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1);
        boolean allowAllRotations = context.getResources().getBoolean(
                com.android.internal.R.bool.config_allowAllRotations);
        final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class RotationLockTile extends QSTileImpl<BooleanState> {
    @Override
    protected void handleClick() {
        if (mController == null) return;
        final boolean newState = !mState.value;
        final boolean newState = mController.isRotationLocked();
        mController.setRotationLocked(!newState);
        refreshState(newState);
    }
+4 −4
Original line number Diff line number Diff line
@@ -1085,8 +1085,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            resolver.registerContentObserver(Settings.Global.getUriFor(
                    Settings.Global.POLICY_CONTROL), false, this,
                    UserHandle.USER_ALL);
            resolver.registerContentObserver(LineageSettings.System.getUriFor(
                    LineageSettings.System.ACCELEROMETER_ROTATION_ANGLES), false, this,
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.ACCELEROMETER_ROTATION_ANGLES), false, this,
                    UserHandle.USER_ALL);
            resolver.registerContentObserver(LineageSettings.Global.getUriFor(
                    LineageSettings.Global.DEV_FORCE_SHOW_NAVBAR), false, this,
@@ -2757,8 +2757,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                updateOrientationListenerLp();
            }

            mUserRotationAngles = LineageSettings.System.getInt(resolver,
                    LineageSettings.System.ACCELEROMETER_ROTATION_ANGLES, -1);
            mUserRotationAngles = Settings.System.getInt(resolver,
                    Settings.System.ACCELEROMETER_ROTATION_ANGLES, -1);

            if (mSystemReady) {
                int pointerLocation = Settings.System.getIntForUser(resolver,