Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +2 −5 Original line number Original line Diff line number Diff line Loading @@ -159,8 +159,7 @@ public class KeyguardService extends Service { // Wrap Keyguard going away animation. // Wrap Keyguard going away animation. // Note: Also used for wrapping occlude by Dream animation. It works (with some redundancy). // Note: Also used for wrapping occlude by Dream animation. It works (with some redundancy). public static IRemoteTransition wrap(IRemoteAnimationRunner runner, public static IRemoteTransition wrap(IRemoteAnimationRunner runner) { boolean lockscreenLiveWallpaperEnabled) { return new IRemoteTransition.Stub() { return new IRemoteTransition.Stub() { private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); Loading Loading @@ -189,9 +188,7 @@ public class KeyguardService extends Service { } } } } initAlphaForAnimationTargets(t, apps); initAlphaForAnimationTargets(t, apps); if (lockscreenLiveWallpaperEnabled) { initAlphaForAnimationTargets(t, wallpapers); initAlphaForAnimationTargets(t, wallpapers); } t.apply(); t.apply(); mFinishCallback = finishCallback; mFinishCallback = finishCallback; runner.onAnimationStart( runner.onAnimationStart( Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +4 −8 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.keyguard import android.animation.Animator import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.animation.AnimatorListenerAdapter import android.animation.ValueAnimator import android.animation.ValueAnimator import android.app.WallpaperManager import android.content.Context import android.content.Context import android.graphics.Matrix import android.graphics.Matrix import android.graphics.Rect import android.graphics.Rect Loading Loading @@ -149,8 +148,7 @@ class KeyguardUnlockAnimationController @Inject constructor( private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val statusBarStateController: SysuiStatusBarStateController, private val statusBarStateController: SysuiStatusBarStateController, private val notificationShadeWindowController: NotificationShadeWindowController, private val notificationShadeWindowController: NotificationShadeWindowController, private val powerManager: PowerManager, private val powerManager: PowerManager private val wallpaperManager: WallpaperManager ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { interface KeyguardUnlockAnimationListener { interface KeyguardUnlockAnimationListener { Loading Loading @@ -681,10 +679,8 @@ class KeyguardUnlockAnimationController @Inject constructor( return@postDelayed return@postDelayed } } if ((wallpaperTargets?.isNotEmpty() == true) && if (wallpaperTargets != null) { wallpaperManager.isLockscreenLiveWallpaperEnabled()) { fadeInWallpaper() fadeInWallpaper() hideKeyguardViewAfterRemoteAnimation() } else { } else { keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation( keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation( false /* cancelled */) false /* cancelled */) Loading Loading @@ -958,7 +954,7 @@ class KeyguardUnlockAnimationController @Inject constructor( 0 /* fadeOutDuration */ 0 /* fadeOutDuration */ ) ) } else { } else { Log.i(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " + Log.e(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " + "showing. Ignoring...") "showing. Ignoring...") } } } } Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +4 −15 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.app.AlarmManager; import android.app.BroadcastOptions; import android.app.BroadcastOptions; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.StatusBarManager; import android.app.StatusBarManager; import android.app.WallpaperManager; import android.app.WindowConfiguration; import android.app.WindowConfiguration; import android.app.trust.TrustManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; Loading Loading @@ -281,7 +280,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private AlarmManager mAlarmManager; private AlarmManager mAlarmManager; private AudioManager mAudioManager; private AudioManager mAudioManager; private StatusBarManager mStatusBarManager; private StatusBarManager mStatusBarManager; private WallpaperManager mWallpaperManager; private final IStatusBarService mStatusBarService; private final IStatusBarService mStatusBarService; private final IBinder mStatusBarDisableToken = new Binder(); private final IBinder mStatusBarDisableToken = new Binder(); private final UserTracker mUserTracker; private final UserTracker mUserTracker; Loading Loading @@ -1352,12 +1350,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, setShowingLocked(false /* showing */, true /* forceCallbacks */); setShowingLocked(false /* showing */, true /* forceCallbacks */); } } boolean isLockscreenLwpEnabled = getWallpaperManager().isLockscreenLiveWallpaperEnabled(); mKeyguardTransitions.register( mKeyguardTransitions.register( KeyguardService.wrap(getExitAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getExitAnimationRunner()), KeyguardService.wrap(getOccludeAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getOccludeAnimationRunner()), KeyguardService.wrap(getOccludeByDreamAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getOccludeByDreamAnimationRunner()), KeyguardService.wrap(getUnoccludeAnimationRunner(), isLockscreenLwpEnabled)); KeyguardService.wrap(getUnoccludeAnimationRunner())); final ContentResolver cr = mContext.getContentResolver(); final ContentResolver cr = mContext.getContentResolver(); Loading Loading @@ -1403,14 +1400,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mWorkLockController = new WorkLockActivityController(mContext, mUserTracker); mWorkLockController = new WorkLockActivityController(mContext, mUserTracker); } } // TODO(b/273443374) remove, temporary util to get a feature flag private WallpaperManager getWallpaperManager() { if (mWallpaperManager == null) { mWallpaperManager = mContext.getSystemService(WallpaperManager.class); } return mWallpaperManager; } @Override @Override public void start() { public void start() { synchronized (this) { synchronized (this) { Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt +1 −5 Original line number Original line Diff line number Diff line package com.android.systemui.keyguard package com.android.systemui.keyguard import android.app.ActivityManager import android.app.ActivityManager import android.app.WallpaperManager import android.app.WindowConfiguration import android.app.WindowConfiguration import android.graphics.Point import android.graphics.Point import android.graphics.Rect import android.graphics.Rect Loading Loading @@ -65,8 +64,6 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { private lateinit var notificationShadeWindowController: NotificationShadeWindowController private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock @Mock private lateinit var powerManager: PowerManager private lateinit var powerManager: PowerManager @Mock private lateinit var wallpaperManager: WallpaperManager @Mock @Mock private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub Loading Loading @@ -97,14 +94,13 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { keyguardUnlockAnimationController = KeyguardUnlockAnimationController( keyguardUnlockAnimationController = KeyguardUnlockAnimationController( context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, featureFlags, { biometricUnlockController }, statusBarStateController, featureFlags, { biometricUnlockController }, statusBarStateController, notificationShadeWindowController, powerManager, wallpaperManager notificationShadeWindowController, powerManager ) ) keyguardUnlockAnimationController.setLauncherUnlockController( keyguardUnlockAnimationController.setLauncherUnlockController( launcherUnlockAnimationController) launcherUnlockAnimationController) whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) whenever(powerManager.isInteractive).thenReturn(true) whenever(powerManager.isInteractive).thenReturn(true) whenever(wallpaperManager.isLockscreenLiveWallpaperEnabled).thenReturn(false) // All of these fields are final, so we can't mock them, but are needed so that the surface // All of these fields are final, so we can't mock them, but are needed so that the surface // appear amount setter doesn't short circuit. // appear amount setter doesn't short circuit. Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +2 −5 Original line number Original line Diff line number Diff line Loading @@ -159,8 +159,7 @@ public class KeyguardService extends Service { // Wrap Keyguard going away animation. // Wrap Keyguard going away animation. // Note: Also used for wrapping occlude by Dream animation. It works (with some redundancy). // Note: Also used for wrapping occlude by Dream animation. It works (with some redundancy). public static IRemoteTransition wrap(IRemoteAnimationRunner runner, public static IRemoteTransition wrap(IRemoteAnimationRunner runner) { boolean lockscreenLiveWallpaperEnabled) { return new IRemoteTransition.Stub() { return new IRemoteTransition.Stub() { private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>(); Loading Loading @@ -189,9 +188,7 @@ public class KeyguardService extends Service { } } } } initAlphaForAnimationTargets(t, apps); initAlphaForAnimationTargets(t, apps); if (lockscreenLiveWallpaperEnabled) { initAlphaForAnimationTargets(t, wallpapers); initAlphaForAnimationTargets(t, wallpapers); } t.apply(); t.apply(); mFinishCallback = finishCallback; mFinishCallback = finishCallback; runner.onAnimationStart( runner.onAnimationStart( Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +4 −8 Original line number Original line Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.keyguard import android.animation.Animator import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.animation.AnimatorListenerAdapter import android.animation.ValueAnimator import android.animation.ValueAnimator import android.app.WallpaperManager import android.content.Context import android.content.Context import android.graphics.Matrix import android.graphics.Matrix import android.graphics.Rect import android.graphics.Rect Loading Loading @@ -149,8 +148,7 @@ class KeyguardUnlockAnimationController @Inject constructor( private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>, private val statusBarStateController: SysuiStatusBarStateController, private val statusBarStateController: SysuiStatusBarStateController, private val notificationShadeWindowController: NotificationShadeWindowController, private val notificationShadeWindowController: NotificationShadeWindowController, private val powerManager: PowerManager, private val powerManager: PowerManager private val wallpaperManager: WallpaperManager ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { ) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() { interface KeyguardUnlockAnimationListener { interface KeyguardUnlockAnimationListener { Loading Loading @@ -681,10 +679,8 @@ class KeyguardUnlockAnimationController @Inject constructor( return@postDelayed return@postDelayed } } if ((wallpaperTargets?.isNotEmpty() == true) && if (wallpaperTargets != null) { wallpaperManager.isLockscreenLiveWallpaperEnabled()) { fadeInWallpaper() fadeInWallpaper() hideKeyguardViewAfterRemoteAnimation() } else { } else { keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation( keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation( false /* cancelled */) false /* cancelled */) Loading Loading @@ -958,7 +954,7 @@ class KeyguardUnlockAnimationController @Inject constructor( 0 /* fadeOutDuration */ 0 /* fadeOutDuration */ ) ) } else { } else { Log.i(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " + Log.e(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " + "showing. Ignoring...") "showing. Ignoring...") } } } } Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +4 −15 Original line number Original line Diff line number Diff line Loading @@ -45,7 +45,6 @@ import android.app.AlarmManager; import android.app.BroadcastOptions; import android.app.BroadcastOptions; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.StatusBarManager; import android.app.StatusBarManager; import android.app.WallpaperManager; import android.app.WindowConfiguration; import android.app.WindowConfiguration; import android.app.trust.TrustManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; Loading Loading @@ -281,7 +280,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private AlarmManager mAlarmManager; private AlarmManager mAlarmManager; private AudioManager mAudioManager; private AudioManager mAudioManager; private StatusBarManager mStatusBarManager; private StatusBarManager mStatusBarManager; private WallpaperManager mWallpaperManager; private final IStatusBarService mStatusBarService; private final IStatusBarService mStatusBarService; private final IBinder mStatusBarDisableToken = new Binder(); private final IBinder mStatusBarDisableToken = new Binder(); private final UserTracker mUserTracker; private final UserTracker mUserTracker; Loading Loading @@ -1352,12 +1350,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, setShowingLocked(false /* showing */, true /* forceCallbacks */); setShowingLocked(false /* showing */, true /* forceCallbacks */); } } boolean isLockscreenLwpEnabled = getWallpaperManager().isLockscreenLiveWallpaperEnabled(); mKeyguardTransitions.register( mKeyguardTransitions.register( KeyguardService.wrap(getExitAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getExitAnimationRunner()), KeyguardService.wrap(getOccludeAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getOccludeAnimationRunner()), KeyguardService.wrap(getOccludeByDreamAnimationRunner(), isLockscreenLwpEnabled), KeyguardService.wrap(getOccludeByDreamAnimationRunner()), KeyguardService.wrap(getUnoccludeAnimationRunner(), isLockscreenLwpEnabled)); KeyguardService.wrap(getUnoccludeAnimationRunner())); final ContentResolver cr = mContext.getContentResolver(); final ContentResolver cr = mContext.getContentResolver(); Loading Loading @@ -1403,14 +1400,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mWorkLockController = new WorkLockActivityController(mContext, mUserTracker); mWorkLockController = new WorkLockActivityController(mContext, mUserTracker); } } // TODO(b/273443374) remove, temporary util to get a feature flag private WallpaperManager getWallpaperManager() { if (mWallpaperManager == null) { mWallpaperManager = mContext.getSystemService(WallpaperManager.class); } return mWallpaperManager; } @Override @Override public void start() { public void start() { synchronized (this) { synchronized (this) { Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt +1 −5 Original line number Original line Diff line number Diff line package com.android.systemui.keyguard package com.android.systemui.keyguard import android.app.ActivityManager import android.app.ActivityManager import android.app.WallpaperManager import android.app.WindowConfiguration import android.app.WindowConfiguration import android.graphics.Point import android.graphics.Point import android.graphics.Rect import android.graphics.Rect Loading Loading @@ -65,8 +64,6 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { private lateinit var notificationShadeWindowController: NotificationShadeWindowController private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock @Mock private lateinit var powerManager: PowerManager private lateinit var powerManager: PowerManager @Mock private lateinit var wallpaperManager: WallpaperManager @Mock @Mock private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub Loading Loading @@ -97,14 +94,13 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { keyguardUnlockAnimationController = KeyguardUnlockAnimationController( keyguardUnlockAnimationController = KeyguardUnlockAnimationController( context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, context, keyguardStateController, { keyguardViewMediator }, keyguardViewController, featureFlags, { biometricUnlockController }, statusBarStateController, featureFlags, { biometricUnlockController }, statusBarStateController, notificationShadeWindowController, powerManager, wallpaperManager notificationShadeWindowController, powerManager ) ) keyguardUnlockAnimationController.setLauncherUnlockController( keyguardUnlockAnimationController.setLauncherUnlockController( launcherUnlockAnimationController) launcherUnlockAnimationController) whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) whenever(powerManager.isInteractive).thenReturn(true) whenever(powerManager.isInteractive).thenReturn(true) whenever(wallpaperManager.isLockscreenLiveWallpaperEnabled).thenReturn(false) // All of these fields are final, so we can't mock them, but are needed so that the surface // All of these fields are final, so we can't mock them, but are needed so that the surface // appear amount setter doesn't short circuit. // appear amount setter doesn't short circuit. Loading