Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +10 −24 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; 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_BUTTON; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_RIGHT_BUTTON; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_RIGHT_BUTTON; Loading Loading @@ -54,7 +53,6 @@ import android.telecom.TelecomManager; import android.text.TextUtils; import android.text.TextUtils; import android.util.AttributeSet; import android.util.AttributeSet; import android.util.Log; import android.util.Log; import android.util.MathUtils; import android.util.TypedValue; import android.util.TypedValue; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; Loading Loading @@ -172,8 +170,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private boolean mDozing; private boolean mDozing; private int mIndicationBottomMargin; private int mIndicationBottomMargin; private float mDarkAmount; private float mDarkAmount; private int mBurnInXOffset; private int mBurnInYOffset; public KeyguardBottomAreaView(Context context) { public KeyguardBottomAreaView(Context context) { this(context, null); this(context, null); Loading Loading @@ -250,8 +246,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mIndicationText = findViewById(R.id.keyguard_indication_text); mIndicationText = findViewById(R.id.keyguard_indication_text); mIndicationBottomMargin = getResources().getDimensionPixelSize( mIndicationBottomMargin = getResources().getDimensionPixelSize( R.dimen.keyguard_indication_margin_bottom); R.dimen.keyguard_indication_margin_bottom); mBurnInYOffset = getResources().getDimensionPixelSize( R.dimen.default_burn_in_prevention_offset); updateCameraVisibility(); updateCameraVisibility(); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache.addListener(this); mUnlockMethodCache.addListener(this); Loading Loading @@ -322,8 +316,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); mIndicationBottomMargin = getResources().getDimensionPixelSize( mIndicationBottomMargin = getResources().getDimensionPixelSize( R.dimen.keyguard_indication_margin_bottom); R.dimen.keyguard_indication_margin_bottom); mBurnInYOffset = getResources().getDimensionPixelSize( R.dimen.default_burn_in_prevention_offset); MarginLayoutParams mlp = (MarginLayoutParams) mIndicationArea.getLayoutParams(); MarginLayoutParams mlp = (MarginLayoutParams) mIndicationArea.getLayoutParams(); if (mlp.bottomMargin != mIndicationBottomMargin) { if (mlp.bottomMargin != mIndicationBottomMargin) { mlp.bottomMargin = mIndicationBottomMargin; mlp.bottomMargin = mIndicationBottomMargin; Loading Loading @@ -569,7 +561,15 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mDarkAmount = darkAmount; mDarkAmount = darkAmount; mIndicationController.setDarkAmount(darkAmount); mIndicationController.setDarkAmount(darkAmount); mLockIcon.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) { private static boolean isSuccessfulLaunch(int result) { Loading Loading @@ -830,6 +830,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL updateCameraVisibility(); updateCameraVisibility(); updateLeftAffordanceIcon(); updateLeftAffordanceIcon(); mLockIcon.setDozing(dozing); if (dozing) { if (dozing) { mOverlayContainer.setVisibility(INVISIBLE); mOverlayContainer.setVisibility(INVISIBLE); Loading @@ -841,21 +842,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } } } } 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 class DefaultLeftButton implements IntentButton { private IconState mIconState = new IconState(); private IconState mIconState = new IconState(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange private boolean mHasFingerPrintIcon; private boolean mHasFingerPrintIcon; private boolean mHasFaceUnlockIcon; private boolean mHasFaceUnlockIcon; private int mDensity; private int mDensity; private boolean mPulsing; private boolean mDozing; private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */); private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */); private float mDarkAmount; private float mDarkAmount; Loading Loading @@ -157,6 +159,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange mLastScreenOn = mScreenOn; mLastScreenOn = mScreenOn; } } setVisibility(mDozing && !mPulsing ? GONE : VISIBLE); updateClickability(); updateClickability(); } } Loading Loading @@ -269,6 +272,24 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange updateDarkTint(); 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() { private void updateDarkTint() { Drawable drawable = getDrawable().mutate(); Drawable drawable = getDrawable().mutate(); int color = ColorUtils.blendARGB(Color.TRANSPARENT, Color.WHITE, mDarkAmount); int color = ColorUtils.blendARGB(Color.TRANSPARENT, Color.WHITE, mDarkAmount); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -579,7 +579,6 @@ public class NotificationPanelView extends PanelView implements } } mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding); mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding); mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX); mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX); mKeyguardBottomArea.setBurnInXOffset(mClockPositionResult.clockX); mStackScrollerMeasuringPass++; mStackScrollerMeasuringPass++; requestScrollerTopPaddingUpdate(animate); requestScrollerTopPaddingUpdate(animate); Loading Loading @@ -2806,6 +2805,7 @@ public class NotificationPanelView extends PanelView implements } } mNotificationStackScroller.setPulsing(pulsing, animatePulse); mNotificationStackScroller.setPulsing(pulsing, animatePulse); mKeyguardStatusView.setPulsing(pulsing, animatePulse); mKeyguardStatusView.setPulsing(pulsing, animatePulse); mKeyguardBottomArea.setPulsing(pulsing, animatePulse); } } public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) { public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) { Loading @@ -2818,7 +2818,6 @@ public class NotificationPanelView extends PanelView implements public void dozeTimeTick() { public void dozeTimeTick() { mKeyguardStatusBar.dozeTimeTick(); mKeyguardStatusBar.dozeTimeTick(); mKeyguardStatusView.dozeTimeTick(); mKeyguardStatusView.dozeTimeTick(); mKeyguardBottomArea.dozeTimeTick(); if (mInterpolatedDarkAmount > 0) { if (mInterpolatedDarkAmount > 0) { positionClockAndNotifications(); positionClockAndNotifications(); } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +10 −24 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK; import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; 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_BUTTON; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_RIGHT_BUTTON; import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_RIGHT_BUTTON; Loading Loading @@ -54,7 +53,6 @@ import android.telecom.TelecomManager; import android.text.TextUtils; import android.text.TextUtils; import android.util.AttributeSet; import android.util.AttributeSet; import android.util.Log; import android.util.Log; import android.util.MathUtils; import android.util.TypedValue; import android.util.TypedValue; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; Loading Loading @@ -172,8 +170,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private boolean mDozing; private boolean mDozing; private int mIndicationBottomMargin; private int mIndicationBottomMargin; private float mDarkAmount; private float mDarkAmount; private int mBurnInXOffset; private int mBurnInYOffset; public KeyguardBottomAreaView(Context context) { public KeyguardBottomAreaView(Context context) { this(context, null); this(context, null); Loading Loading @@ -250,8 +246,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mIndicationText = findViewById(R.id.keyguard_indication_text); mIndicationText = findViewById(R.id.keyguard_indication_text); mIndicationBottomMargin = getResources().getDimensionPixelSize( mIndicationBottomMargin = getResources().getDimensionPixelSize( R.dimen.keyguard_indication_margin_bottom); R.dimen.keyguard_indication_margin_bottom); mBurnInYOffset = getResources().getDimensionPixelSize( R.dimen.default_burn_in_prevention_offset); updateCameraVisibility(); updateCameraVisibility(); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache.addListener(this); mUnlockMethodCache.addListener(this); Loading Loading @@ -322,8 +316,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); mIndicationBottomMargin = getResources().getDimensionPixelSize( mIndicationBottomMargin = getResources().getDimensionPixelSize( R.dimen.keyguard_indication_margin_bottom); R.dimen.keyguard_indication_margin_bottom); mBurnInYOffset = getResources().getDimensionPixelSize( R.dimen.default_burn_in_prevention_offset); MarginLayoutParams mlp = (MarginLayoutParams) mIndicationArea.getLayoutParams(); MarginLayoutParams mlp = (MarginLayoutParams) mIndicationArea.getLayoutParams(); if (mlp.bottomMargin != mIndicationBottomMargin) { if (mlp.bottomMargin != mIndicationBottomMargin) { mlp.bottomMargin = mIndicationBottomMargin; mlp.bottomMargin = mIndicationBottomMargin; Loading Loading @@ -569,7 +561,15 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mDarkAmount = darkAmount; mDarkAmount = darkAmount; mIndicationController.setDarkAmount(darkAmount); mIndicationController.setDarkAmount(darkAmount); mLockIcon.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) { private static boolean isSuccessfulLaunch(int result) { Loading Loading @@ -830,6 +830,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL updateCameraVisibility(); updateCameraVisibility(); updateLeftAffordanceIcon(); updateLeftAffordanceIcon(); mLockIcon.setDozing(dozing); if (dozing) { if (dozing) { mOverlayContainer.setVisibility(INVISIBLE); mOverlayContainer.setVisibility(INVISIBLE); Loading @@ -841,21 +842,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } } } } 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 class DefaultLeftButton implements IntentButton { private IconState mIconState = new IconState(); private IconState mIconState = new IconState(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,8 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange private boolean mHasFingerPrintIcon; private boolean mHasFingerPrintIcon; private boolean mHasFaceUnlockIcon; private boolean mHasFaceUnlockIcon; private int mDensity; private int mDensity; private boolean mPulsing; private boolean mDozing; private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */); private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */); private float mDarkAmount; private float mDarkAmount; Loading Loading @@ -157,6 +159,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange mLastScreenOn = mScreenOn; mLastScreenOn = mScreenOn; } } setVisibility(mDozing && !mPulsing ? GONE : VISIBLE); updateClickability(); updateClickability(); } } Loading Loading @@ -269,6 +272,24 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange updateDarkTint(); 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() { private void updateDarkTint() { Drawable drawable = getDrawable().mutate(); Drawable drawable = getDrawable().mutate(); int color = ColorUtils.blendARGB(Color.TRANSPARENT, Color.WHITE, mDarkAmount); int color = ColorUtils.blendARGB(Color.TRANSPARENT, Color.WHITE, mDarkAmount); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +1 −2 Original line number Original line Diff line number Diff line Loading @@ -579,7 +579,6 @@ public class NotificationPanelView extends PanelView implements } } mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding); mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding); mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX); mNotificationStackScroller.setAntiBurnInOffsetX(mClockPositionResult.clockX); mKeyguardBottomArea.setBurnInXOffset(mClockPositionResult.clockX); mStackScrollerMeasuringPass++; mStackScrollerMeasuringPass++; requestScrollerTopPaddingUpdate(animate); requestScrollerTopPaddingUpdate(animate); Loading Loading @@ -2806,6 +2805,7 @@ public class NotificationPanelView extends PanelView implements } } mNotificationStackScroller.setPulsing(pulsing, animatePulse); mNotificationStackScroller.setPulsing(pulsing, animatePulse); mKeyguardStatusView.setPulsing(pulsing, animatePulse); mKeyguardStatusView.setPulsing(pulsing, animatePulse); mKeyguardBottomArea.setPulsing(pulsing, animatePulse); } } public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) { public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) { Loading @@ -2818,7 +2818,6 @@ public class NotificationPanelView extends PanelView implements public void dozeTimeTick() { public void dozeTimeTick() { mKeyguardStatusBar.dozeTimeTick(); mKeyguardStatusBar.dozeTimeTick(); mKeyguardStatusView.dozeTimeTick(); mKeyguardStatusView.dozeTimeTick(); mKeyguardBottomArea.dozeTimeTick(); if (mInterpolatedDarkAmount > 0) { if (mInterpolatedDarkAmount > 0) { positionClockAndNotifications(); positionClockAndNotifications(); } } Loading