summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_password_motion_layout.xml2
-rw-r--r--packages/SystemUI/res-keyguard/layout/keyguard_pin_motion_layout.xml1
-rw-r--r--packages/SystemUI/res-keyguard/xml/keyguard_pin_scene.xml8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java4
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java23
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java15
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java3
-rw-r--r--packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt1
8 files changed, 25 insertions, 32 deletions
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_password_motion_layout.xml b/packages/SystemUI/res-keyguard/layout/keyguard_password_motion_layout.xml
index 7abf9aebc686..173d57b335f0 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_password_motion_layout.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_password_motion_layout.xml
@@ -26,7 +26,6 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- androidprv:layout_maxWidth="@dimen/keyguard_security_width"
android:layout_gravity="center_horizontal|bottom"
android:gravity="bottom">
@@ -36,6 +35,7 @@
android:id="@+id/password_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:maxWidth="@dimen/keyguard_security_width"
android:layout_gravity="center_horizontal"
android:clipChildren="false"
android:clipToPadding="false"
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_motion_layout.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_motion_layout.xml
index 6835d59658d4..6c79d5a6095a 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_motion_layout.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_pin_motion_layout.xml
@@ -34,6 +34,7 @@
android:id="@+id/pin_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:maxWidth="@dimen/keyguard_security_width"
android:clipChildren="false"
android:clipToPadding="false"
android:layoutDirection="ltr"
diff --git a/packages/SystemUI/res-keyguard/xml/keyguard_pin_scene.xml b/packages/SystemUI/res-keyguard/xml/keyguard_pin_scene.xml
index 44af9efffbf8..2a1270c80b75 100644
--- a/packages/SystemUI/res-keyguard/xml/keyguard_pin_scene.xml
+++ b/packages/SystemUI/res-keyguard/xml/keyguard_pin_scene.xml
@@ -26,12 +26,10 @@
motion:constraintSetStart="@id/single_constraints"
motion:constraintSetEnd="@+id/split_constraints"
motion:duration="0"
- motion:autoTransition="none">
- </Transition>
+ motion:autoTransition="none"/>
- <ConstraintSet android:id="@+id/single_constraints">
- <!-- No changes to default layout -->
- </ConstraintSet>
+ <!-- No changes to default layout -->
+ <ConstraintSet android:id="@+id/single_constraints"/>
<ConstraintSet android:id="@+id/split_constraints">
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
index bfd43dc258c8..abd1563ecc43 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
@@ -16,8 +16,6 @@
package com.android.keyguard;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
-
import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -259,8 +257,6 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>
mFalsingCollector, mKeyguardViewController,
mDevicePostureController, mFeatureFlags);
} else if (keyguardInputView instanceof KeyguardPINView) {
- ((KeyguardPINView) keyguardInputView).setIsLockScreenLandscapeEnabled(
- mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE));
return new KeyguardPinViewController((KeyguardPINView) keyguardInputView,
mKeyguardUpdateMonitor, securityMode, mLockPatternUtils,
keyguardSecurityCallback, mMessageAreaControllerFactory, mLatencyTracker,
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
index bb3e759dc157..72b4ae568397 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
@@ -17,6 +17,7 @@
package com.android.keyguard;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
+
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_PIN_APPEAR;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_LOCKSCREEN_PIN_DISAPPEAR;
import static com.android.systemui.statusbar.policy.DevicePostureController.DEVICE_POSTURE_CLOSED;
@@ -105,21 +106,21 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
}
void onDevicePostureChanged(@DevicePostureInt int posture) {
- if (mLastDevicePosture != posture) {
- mLastDevicePosture = posture;
+ if (mLastDevicePosture == posture) return;
+ mLastDevicePosture = posture;
- if (mIsLockScreenLandscapeEnabled) {
- boolean useSplitBouncerAfterFold =
- mLastDevicePosture == DEVICE_POSTURE_CLOSED
- && getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE;
+ if (mIsLockScreenLandscapeEnabled) {
+ boolean useSplitBouncerAfterFold =
+ mLastDevicePosture == DEVICE_POSTURE_CLOSED
+ && getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE
+ && getResources().getBoolean(R.bool.update_bouncer_constraints);
- if (mAlreadyUsingSplitBouncer != useSplitBouncerAfterFold) {
- updateConstraints(useSplitBouncerAfterFold);
- }
+ if (mAlreadyUsingSplitBouncer != useSplitBouncerAfterFold) {
+ updateConstraints(useSplitBouncerAfterFold);
}
-
- updateMargins();
}
+
+ updateMargins();
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
index d30f4971f8de..8d5fc0467e3b 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -158,7 +158,8 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
if (mIsLockScreenLandscapeEnabled) {
boolean useSplitBouncerAfterFold =
mLastDevicePosture == DEVICE_POSTURE_CLOSED
- && getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE;
+ && getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE
+ && getResources().getBoolean(R.bool.update_bouncer_constraints);
if (mAlreadyUsingSplitBouncer != useSplitBouncerAfterFold) {
updateConstraints(useSplitBouncerAfterFold);
@@ -170,20 +171,14 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView {
@Override
protected void updateConstraints(boolean useSplitBouncer) {
mAlreadyUsingSplitBouncer = useSplitBouncer;
- KeyguardSecurityViewFlipper.LayoutParams params =
- (KeyguardSecurityViewFlipper.LayoutParams) getLayoutParams();
-
if (useSplitBouncer) {
- if (mContainerMotionLayout == null) return;
mContainerMotionLayout.jumpToState(R.id.split_constraints);
- params.maxWidth = Integer.MAX_VALUE;
+ mContainerMotionLayout.setMaxWidth(Integer.MAX_VALUE);
} else {
mContainerMotionLayout.jumpToState(R.id.single_constraints);
- params.maxWidth = getResources()
- .getDimensionPixelSize(R.dimen.keyguard_security_width);
+ mContainerMotionLayout.setMaxWidth(getResources()
+ .getDimensionPixelSize(R.dimen.keyguard_security_width));
}
-
- setLayoutParams(params);
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
index 574a0591bd51..0af803fc84fe 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
@@ -16,6 +16,8 @@
package com.android.keyguard;
+import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
+
import android.view.View;
import com.android.internal.util.LatencyTracker;
@@ -61,6 +63,7 @@ public class KeyguardPinViewController
mPostureController = postureController;
mLockPatternUtils = lockPatternUtils;
mFeatureFlags = featureFlags;
+ view.setIsLockScreenLandscapeEnabled(mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE));
mBackspaceKey = view.findViewById(R.id.delete_button);
mPinLength = mLockPatternUtils.getPinLength(KeyguardUpdateMonitor.getCurrentUser());
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
index 33d40976a2e4..a9f044ccd144 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
@@ -123,7 +123,6 @@ class KeyguardPinViewControllerTest : SysuiTestCase() {
private fun constructPinViewController(
mKeyguardPinView: KeyguardPINView
): KeyguardPinViewController {
- mKeyguardPinView.setIsLockScreenLandscapeEnabled(false)
return KeyguardPinViewController(
mKeyguardPinView,
keyguardUpdateMonitor,