Loading packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +4 −9 Original line number Original line Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { if (mController == null) return; if (mController == null) return; MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); final boolean newState = !mState.value; final boolean newState = !mState.value; mController.setRotationLocked(newState); mController.setRotationLocked(!newState); refreshState(newState); refreshState(newState); } } Loading @@ -89,15 +89,10 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { @Override @Override protected void handleUpdateState(BooleanState state, Object arg) { protected void handleUpdateState(BooleanState state, Object arg) { if (mController == null) return; if (mController == null) return; final boolean rotationLocked = arg != null ? (Boolean) arg final boolean rotationLocked = mController.isRotationLocked(); : mController.isRotationLocked(); // TODO: Handle accessibility rotation lock and whatnot. // TODO: Handle accessibility rotation lock and whatnot. // state.visible = mController.isRotationLockAffordanceVisible(); if (state.value == rotationLocked && state.contentDescription != null) { state.value = !rotationLocked; // No change and initialized, no need to update all the values. return; } state.value = rotationLocked; final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext); final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext); if (rotationLocked) { if (rotationLocked) { final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +4 −9 Original line number Original line Diff line number Diff line Loading @@ -77,7 +77,7 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { if (mController == null) return; if (mController == null) return; MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); final boolean newState = !mState.value; final boolean newState = !mState.value; mController.setRotationLocked(newState); mController.setRotationLocked(!newState); refreshState(newState); refreshState(newState); } } Loading @@ -89,15 +89,10 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { @Override @Override protected void handleUpdateState(BooleanState state, Object arg) { protected void handleUpdateState(BooleanState state, Object arg) { if (mController == null) return; if (mController == null) return; final boolean rotationLocked = arg != null ? (Boolean) arg final boolean rotationLocked = mController.isRotationLocked(); : mController.isRotationLocked(); // TODO: Handle accessibility rotation lock and whatnot. // TODO: Handle accessibility rotation lock and whatnot. // state.visible = mController.isRotationLockAffordanceVisible(); if (state.value == rotationLocked && state.contentDescription != null) { state.value = !rotationLocked; // No change and initialized, no need to update all the values. return; } state.value = rotationLocked; final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext); final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext); if (rotationLocked) { if (rotationLocked) { final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label Loading