Merge "Do not run hint animation during aod=>ls transition" into tm-dev am: b1c3543491
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17766073 Change-Id: I3fdf20650861b35849f9e4b904776eae29a74136 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3210,7 +3210,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUnlockHintAnimation() {
|
protected void startUnlockHintAnimation() {
|
||||||
if (mPowerManager.isPowerSaveMode()) {
|
if (mPowerManager.isPowerSaveMode() || mAmbientState.getDozeAmount() > 0f) {
|
||||||
onUnlockHintStarted();
|
onUnlockHintStarted();
|
||||||
onUnlockHintFinished();
|
onUnlockHintFinished();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ import com.android.keyguard.dagger.KeyguardQsUserSwitchComponent;
|
|||||||
import com.android.keyguard.dagger.KeyguardStatusBarViewComponent;
|
import com.android.keyguard.dagger.KeyguardStatusBarViewComponent;
|
||||||
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
|
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
|
||||||
import com.android.keyguard.dagger.KeyguardUserSwitcherComponent;
|
import com.android.keyguard.dagger.KeyguardUserSwitcherComponent;
|
||||||
|
import com.android.systemui.DejankUtils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.biometrics.AuthController;
|
import com.android.systemui.biometrics.AuthController;
|
||||||
@@ -352,6 +353,7 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
mKeyguardStatusView = new KeyguardStatusView(mContext);
|
mKeyguardStatusView = new KeyguardStatusView(mContext);
|
||||||
mKeyguardStatusView.setId(R.id.keyguard_status_view);
|
mKeyguardStatusView.setId(R.id.keyguard_status_view);
|
||||||
|
DejankUtils.setImmediate(true);
|
||||||
|
|
||||||
when(mAuthController.isUdfpsEnrolled(anyInt())).thenReturn(false);
|
when(mAuthController.isUdfpsEnrolled(anyInt())).thenReturn(false);
|
||||||
when(mHeadsUpCallback.getContext()).thenReturn(mContext);
|
when(mHeadsUpCallback.getContext()).thenReturn(mContext);
|
||||||
@@ -941,6 +943,29 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
|||||||
verify(mScrimController).setExpansionAffectsAlpha(true);
|
verify(mScrimController).setExpansionAffectsAlpha(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnlockHintAnimation_runs_whenNotInPowerSaveMode_andDozeAmountIsZero() {
|
||||||
|
when(mPowerManager.isPowerSaveMode()).thenReturn(false);
|
||||||
|
when(mAmbientState.getDozeAmount()).thenReturn(0f);
|
||||||
|
mNotificationPanelViewController.startUnlockHintAnimation();
|
||||||
|
assertThat(mNotificationPanelViewController.mHintAnimationRunning).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnlockHintAnimation_doesNotRun_inPowerSaveMode() {
|
||||||
|
when(mPowerManager.isPowerSaveMode()).thenReturn(true);
|
||||||
|
mNotificationPanelViewController.startUnlockHintAnimation();
|
||||||
|
assertThat(mNotificationPanelViewController.mHintAnimationRunning).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnlockHintAnimation_doesNotRun_whenDozeAmountNotZero() {
|
||||||
|
when(mPowerManager.isPowerSaveMode()).thenReturn(false);
|
||||||
|
when(mAmbientState.getDozeAmount()).thenReturn(0.5f);
|
||||||
|
mNotificationPanelViewController.startUnlockHintAnimation();
|
||||||
|
assertThat(mNotificationPanelViewController.mHintAnimationRunning).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setKeyguardStatusBarAlpha_setsAlphaOnKeyguardStatusBarController() {
|
public void setKeyguardStatusBarAlpha_setsAlphaOnKeyguardStatusBarController() {
|
||||||
float statusBarAlpha = 0.5f;
|
float statusBarAlpha = 0.5f;
|
||||||
|
|||||||
Reference in New Issue
Block a user