Loading core/java/android/provider/Settings.java +19 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } /** Loading core/java/com/android/internal/view/RotationPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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, Loading Loading
core/java/android/provider/Settings.java +19 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } /** Loading
core/java/com/android/internal/view/RotationPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -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, Loading Loading @@ -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, Loading