summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2019-04-17 16:50:58 -0700
committerLucas Dupin <dupin@google.com>2019-04-18 16:53:35 -0700
commit2e838ac0837a597f250a2b25073dc498def65364 (patch)
treefbb70e35eda5b67bab6bc0b479896461c696a982 /packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
parentdb44ba1e85fbba8ad9628d48af6948fb3757c0d9 (diff)
Move padlock to the top of the lock screen
Test: tap on notification on lock screen Test: tap on notification on shade locked Test: swipe down from the top expanding QS Test: swipe up from LS Test: switch between pin, pattern and password Test: add and remove locked sim card Test: atest KeyguardBottomAreaTest Test: atest KeyguardClockPositionAlgorithmTest Test: atest KeyguardMessageAreaTest Test: atest KeyguardIndicationControllerTest Test: atest StatusBarKeyguardViewManagerTest Test: atest KeyguardBouncerTest Test: atest KeyguardPatternViewTest Fixes: 130398499 Fixes: 130298363 Fixes: 129784068 Fixes: 130223966 Change-Id: Ib1706de259fa4b1f4ef13f654cbd931457733d82
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
index 112e06785bee..8899bd9ea9f2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
@@ -34,6 +34,7 @@ import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.LatencyTracker;
import com.android.internal.widget.LockPatternChecker;
import com.android.internal.widget.LockPatternUtils;
@@ -92,7 +93,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
};
private Rect mTempRect = new Rect();
- private KeyguardMessageArea mSecurityMessageDisplay;
+ @VisibleForTesting
+ KeyguardMessageArea mSecurityMessageDisplay;
private View mEcaView;
private ViewGroup mContainer;
private int mDisappearYTranslation;
@@ -151,8 +153,6 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
// vibrate mode will be the same for the life of this screen
mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());
- mSecurityMessageDisplay =
- (KeyguardMessageArea) KeyguardMessageArea.findSecurityMessageDisplay(this);
mEcaView = findViewById(R.id.keyguard_selector_fade_container);
mContainer = findViewById(R.id.container);
@@ -171,6 +171,12 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
@Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this);
+ }
+
+ @Override
public void onEmergencyButtonClickedWhenInCall() {
mCallback.reset();
}
@@ -201,6 +207,10 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
mLockPatternView.setEnabled(true);
mLockPatternView.clearPattern();
+ if (mSecurityMessageDisplay == null) {
+ return;
+ }
+
// if the user is currently locked out, enforce it.
long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
KeyguardUpdateMonitor.getCurrentUser());
@@ -212,7 +222,9 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
private void displayDefaultSecurityMessage() {
- mSecurityMessageDisplay.setMessage("");
+ if (mSecurityMessageDisplay != null) {
+ mSecurityMessageDisplay.setMessage("");
+ }
}
@Override