Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 011fcab5 authored by Ali K. Zadeh's avatar Ali K. Zadeh Committed by Automerger Merge Worker
Browse files

Merge "Revert "Hide keyguard earlier when exiting lockscreen"" into udc-dev am: 87e28c1f

parents a82688d8 87e28c1f
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -182,8 +182,7 @@ public class KeyguardService extends Service {

    // Wrap Keyguard going away animation.
    // Note: Also used for wrapping occlude by Dream animation. It works (with some redundancy).
    public static IRemoteTransition wrap(IRemoteAnimationRunner runner,
            boolean lockscreenLiveWallpaperEnabled) {
    public static IRemoteTransition wrap(IRemoteAnimationRunner runner) {
        return new IRemoteTransition.Stub() {

            private final ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = new ArrayMap<>();
@@ -214,9 +213,7 @@ public class KeyguardService extends Service {
                        }
                    }
                    initAlphaForAnimationTargets(t, apps);
                    if (lockscreenLiveWallpaperEnabled) {
                    initAlphaForAnimationTargets(t, wallpapers);
                    }
                    t.apply();
                    mFinishCallback = finishCallback;
                    runner.onAnimationStart(
+4 −8
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.systemui.keyguard
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.ValueAnimator
import android.app.WallpaperManager
import android.content.Context
import android.graphics.Matrix
import android.graphics.Rect
@@ -149,8 +148,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
    private val biometricUnlockControllerLazy: Lazy<BiometricUnlockController>,
    private val statusBarStateController: SysuiStatusBarStateController,
    private val notificationShadeWindowController: NotificationShadeWindowController,
    private val powerManager: PowerManager,
    private val wallpaperManager: WallpaperManager
    private val powerManager: PowerManager
) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() {

    interface KeyguardUnlockAnimationListener {
@@ -688,10 +686,8 @@ class KeyguardUnlockAnimationController @Inject constructor(
                return@postDelayed
            }

            if ((wallpaperTargets?.isNotEmpty() == true) &&
                    wallpaperManager.isLockscreenLiveWallpaperEnabled()) {
            if (wallpaperTargets != null) {
              fadeInWallpaper()
                hideKeyguardViewAfterRemoteAnimation()
            } else {
                keyguardViewMediator.get().exitKeyguardAndFinishSurfaceBehindRemoteAnimation(
                    false /* cancelled */)
@@ -965,7 +961,7 @@ class KeyguardUnlockAnimationController @Inject constructor(
                0 /* fadeOutDuration */
            )
        } else {
            Log.i(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
            Log.e(TAG, "#hideKeyguardViewAfterRemoteAnimation called when keyguard view is not " +
                    "showing. Ignoring...")
        }
    }
+4 −15
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import android.app.AlarmManager;
import android.app.BroadcastOptions;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.app.WallpaperManager;
import android.app.WindowConfiguration;
import android.app.trust.TrustManager;
import android.content.BroadcastReceiver;
@@ -281,7 +280,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    private AlarmManager mAlarmManager;
    private AudioManager mAudioManager;
    private StatusBarManager mStatusBarManager;
    private WallpaperManager mWallpaperManager;
    private final IStatusBarService mStatusBarService;
    private final IBinder mStatusBarDisableToken = new Binder();
    private final UserTracker mUserTracker;
@@ -1352,12 +1350,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            setShowingLocked(false /* showing */, true /* forceCallbacks */);
        }

        boolean isLockscreenLwpEnabled = getWallpaperManager().isLockscreenLiveWallpaperEnabled();
        mKeyguardTransitions.register(
                KeyguardService.wrap(getExitAnimationRunner(), isLockscreenLwpEnabled),
                KeyguardService.wrap(getOccludeAnimationRunner(), isLockscreenLwpEnabled),
                KeyguardService.wrap(getOccludeByDreamAnimationRunner(), isLockscreenLwpEnabled),
                KeyguardService.wrap(getUnoccludeAnimationRunner(), isLockscreenLwpEnabled));
                KeyguardService.wrap(getExitAnimationRunner()),
                KeyguardService.wrap(getOccludeAnimationRunner()),
                KeyguardService.wrap(getOccludeByDreamAnimationRunner()),
                KeyguardService.wrap(getUnoccludeAnimationRunner()));

        final ContentResolver cr = mContext.getContentResolver();

@@ -1403,14 +1400,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        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
    public void start() {
        synchronized (this) {
+1 −5
Original line number Diff line number Diff line
package com.android.systemui.keyguard

import android.app.ActivityManager
import android.app.WallpaperManager
import android.app.WindowConfiguration
import android.graphics.Point
import android.graphics.Rect
@@ -65,8 +64,6 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
    private lateinit var notificationShadeWindowController: NotificationShadeWindowController
    @Mock
    private lateinit var powerManager: PowerManager
    @Mock
    private lateinit var wallpaperManager: WallpaperManager

    @Mock
    private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub
@@ -97,14 +94,13 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
        keyguardUnlockAnimationController = KeyguardUnlockAnimationController(
            context, keyguardStateController, { keyguardViewMediator }, keyguardViewController,
            featureFlags, { biometricUnlockController }, statusBarStateController,
            notificationShadeWindowController, powerManager, wallpaperManager
            notificationShadeWindowController, powerManager
        )
        keyguardUnlockAnimationController.setLauncherUnlockController(
            launcherUnlockAnimationController)

        whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java))
        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
        // appear amount setter doesn't short circuit.