Merge "Do not show lock icon on AOD"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index 21c506b..2e9d9bc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -19,7 +19,6 @@
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
-import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset;
import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_BUTTON;
import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK;
import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_RIGHT_BUTTON;
@@ -54,7 +53,6 @@
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
-import android.util.MathUtils;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
@@ -172,8 +170,6 @@
private boolean mDozing;
private int mIndicationBottomMargin;
private float mDarkAmount;
- private int mBurnInXOffset;
- private int mBurnInYOffset;
public KeyguardBottomAreaView(Context context) {
this(context, null);
@@ -250,8 +246,6 @@
mIndicationText = findViewById(R.id.keyguard_indication_text);
mIndicationBottomMargin = getResources().getDimensionPixelSize(
R.dimen.keyguard_indication_margin_bottom);
- mBurnInYOffset = getResources().getDimensionPixelSize(
- R.dimen.default_burn_in_prevention_offset);
updateCameraVisibility();
mUnlockMethodCache = UnlockMethodCache.getInstance(getContext());
mUnlockMethodCache.addListener(this);
@@ -322,8 +316,6 @@
super.onConfigurationChanged(newConfig);
mIndicationBottomMargin = getResources().getDimensionPixelSize(
R.dimen.keyguard_indication_margin_bottom);
- mBurnInYOffset = getResources().getDimensionPixelSize(
- R.dimen.default_burn_in_prevention_offset);
MarginLayoutParams mlp = (MarginLayoutParams) mIndicationArea.getLayoutParams();
if (mlp.bottomMargin != mIndicationBottomMargin) {
mlp.bottomMargin = mIndicationBottomMargin;
@@ -569,7 +561,15 @@
mDarkAmount = darkAmount;
mIndicationController.setDarkAmount(darkAmount);
mLockIcon.setDarkAmount(darkAmount);
- dozeTimeTick();
+ }
+
+ /**
+ * When keyguard is in pulsing (AOD2) state.
+ * @param pulsing {@code true} when pulsing.
+ * @param animated if transition should be animated.
+ */
+ public void setPulsing(boolean pulsing, boolean animated) {
+ mLockIcon.setPulsing(pulsing, animated);
}
private static boolean isSuccessfulLaunch(int result) {
@@ -830,6 +830,7 @@
updateCameraVisibility();
updateLeftAffordanceIcon();
+ mLockIcon.setDozing(dozing);
if (dozing) {
mOverlayContainer.setVisibility(INVISIBLE);
@@ -841,21 +842,6 @@
}
}
- public void dozeTimeTick() {
- // Move views every minute to avoid burn-in
- int burnInYOffset = -getBurnInOffset(mBurnInYOffset, false /* xAxis */);
- burnInYOffset = (int) MathUtils.lerp(0, burnInYOffset, mDarkAmount);
- mLockIcon.setTranslationY(burnInYOffset);
- }
-
- public void setBurnInXOffset(int burnInXOffset) {
- if (mBurnInXOffset == burnInXOffset) {
- return;
- }
- mBurnInXOffset = burnInXOffset;
- mLockIcon.setTranslationX(burnInXOffset);
- }
-
private class DefaultLeftButton implements IntentButton {
private IconState mIconState = new IconState();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index 4a194e0..d934d95 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -58,6 +58,8 @@
private boolean mHasFingerPrintIcon;
private boolean mHasFaceUnlockIcon;
private int mDensity;
+ private boolean mPulsing;
+ private boolean mDozing;
private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */);
private float mDarkAmount;
@@ -157,6 +159,7 @@
mLastScreenOn = mScreenOn;
}
+ setVisibility(mDozing && !mPulsing ? GONE : VISIBLE);
updateClickability();
}
@@ -269,6 +272,24 @@
updateDarkTint();
}
+ /**
+ * When keyguard is in pulsing (AOD2) state.
+ * @param pulsing {@code true} when pulsing.
+ * @param animated if transition should be animated.
+ */
+ public void setPulsing(boolean pulsing, boolean animated) {
+ mPulsing = pulsing;
+ update();
+ }
+
+ /**
+ * Sets the dozing state of the keyguard.
+ */
+ public void setDozing(boolean dozing) {
+ mDozing = dozing;
+ update();
+ }
+
private void updateDarkTint() {
Drawable drawable = getDrawable().mutate();
int color = ColorUtils.blendARGB(Color.TRANSPARENT, Color.WHITE, mDarkAmount);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 242573d..1b18c6c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -579,7 +579,6 @@
}
mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding);
mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX);
- mKeyguardBottomArea.setBurnInXOffset(mClockPositionResult.clockX);
mStackScrollerMeasuringPass++;
requestScrollerTopPaddingUpdate(animate);
@@ -2806,6 +2805,7 @@
}
mNotificationStackScroller.setPulsing(pulsing, animatePulse);
mKeyguardStatusView.setPulsing(pulsing, animatePulse);
+ mKeyguardBottomArea.setPulsing(pulsing, animatePulse);
}
public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
@@ -2818,7 +2818,6 @@
public void dozeTimeTick() {
mKeyguardStatusBar.dozeTimeTick();
mKeyguardStatusView.dozeTimeTick();
- mKeyguardBottomArea.dozeTimeTick();
if (mInterpolatedDarkAmount > 0) {
positionClockAndNotifications();
}