From 69e03dd082ca97f9b45f30f24523c03259ca240e Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 28 Feb 2019 20:36:37 -0800 Subject: [PATCH] Revert "Add remote animation for unlocking device." This reverts commit 55a32272be2e2369ec25bdca3ef0e5724430b9c5. Reverting until we can revisit this animation. Bug: 123906429 Change-Id: Ic2d6e5a8198900fb15abd60dd140091681f828dd --- .../QuickstepAppTransitionManagerImpl.java | 5 ---- .../graphics/WorkspaceAndHotseatScrim.java | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index ab5f479c97..9a7c194ec4 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -615,11 +615,6 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans WindowManagerWrapper.ACTIVITY_TYPE_STANDARD, new RemoteAnimationAdapterCompat(getWallpaperOpenRunner(false /* fromUnlock */), CLOSING_TRANSITION_DURATION_MS, 0 /* statusBarTransitionDelay */)); - - definition.addRemoteAnimation( - WindowManagerWrapper.TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER, - new RemoteAnimationAdapterCompat(getWallpaperOpenRunner(true /* fromUnlock */), - CLOSING_TRANSITION_DURATION_MS, 0 /* statusBarTransitionDelay */)); new ActivityCompat(mLauncher).registerRemoteAnimations(definition); } } diff --git a/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java b/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java index 6fac31e2e1..66f9dbfcdc 100644 --- a/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java +++ b/src/com/android/launcher3/graphics/WorkspaceAndHotseatScrim.java @@ -16,9 +16,16 @@ package com.android.launcher3.graphics; +import static android.content.Intent.ACTION_SCREEN_OFF; +import static android.content.Intent.ACTION_USER_PRESENT; + import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound; import android.animation.ObjectAnimator; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; @@ -89,6 +96,20 @@ public class WorkspaceAndHotseatScrim implements } }; + private final BroadcastReceiver mReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + final String action = intent.getAction(); + if (ACTION_SCREEN_OFF.equals(action)) { + mAnimateScrimOnNextDraw = true; + } else if (ACTION_USER_PRESENT.equals(action)) { + // ACTION_USER_PRESENT is sent after onStart/onResume. This covers the case where + // the user unlocked and the Launcher is not in the foreground. + mAnimateScrimOnNextDraw = false; + } + } + }; + private static final int DARK_SCRIM_COLOR = 0x55000000; private static final int MAX_HOTSEAT_SCRIM_ALPHA = 100; private static final int ALPHA_MASK_HEIGHT_DP = 500; @@ -204,11 +225,20 @@ public class WorkspaceAndHotseatScrim implements public void onViewAttachedToWindow(View view) { mWallpaperColorInfo.addOnChangeListener(this); onExtractedColorsChanged(mWallpaperColorInfo); + + if (mTopScrim != null) { + IntentFilter filter = new IntentFilter(ACTION_SCREEN_OFF); + filter.addAction(ACTION_USER_PRESENT); // When the device wakes up + keyguard is gone + mRoot.getContext().registerReceiver(mReceiver, filter); + } } @Override public void onViewDetachedFromWindow(View view) { mWallpaperColorInfo.removeOnChangeListener(this); + if (mTopScrim != null) { + mRoot.getContext().unregisterReceiver(mReceiver); + } } @Override