From 497f4379084d19c2cbf7c02aef662675d0a51975 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 9 Jul 2019 11:33:50 -0700 Subject: [PATCH 1/2] Copy resume callbacks list prior to making callbacks - Starting a deferred activity can trigger a new callback to be added to the list while we are iterating it Bug: 136613192 Change-Id: I6690ab0695bb73f11bf343fb41e9fc86b4afec1b Merged-In: I6690ab0695bb73f11bf343fb41e9fc86b4afec1b (cherry picked from commit 940b0ac0157945a40d8b3b44d976da53aaeff81f) (cherry picked from commit a8971c1462f276b2b4d6daab6b18941b9dc9a94a) --- src/com/android/launcher3/Launcher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d9af4da8e8..bc3aa7ef40 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -952,10 +952,14 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, mHandler.removeCallbacks(mHandleDeferredResume); Utilities.postAsyncCallback(mHandler, mHandleDeferredResume); - for (OnResumeCallback cb : mOnResumeCallbacks) { - cb.onLauncherResume(); + if (!mOnResumeCallbacks.isEmpty()) { + final ArrayList resumeCallbacks = new ArrayList<>(mOnResumeCallbacks); + mOnResumeCallbacks.clear(); + for (int i = resumeCallbacks.size() - 1; i >= 0; i--) { + resumeCallbacks.get(i).onLauncherResume(); + } + resumeCallbacks.clear(); } - mOnResumeCallbacks.clear(); if (mLauncherCallbacks != null) { mLauncherCallbacks.onResume(); From 55ab9851a4af963d45344dc936eea62f540169c0 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 23 Jul 2019 15:22:30 -0700 Subject: [PATCH 2/2] Fix bug where rounded corners were being set despite being disabled. Bug: 138117089 Change-Id: Icb852e2e07d80c45ad3406ef432b89720887fccf (cherry picked from commit e734efba8dc58ea145dc0a620f18cbe2032f70ce) --- .../android/launcher3/QuickstepAppTransitionManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java index 44324cb2e4..b60a017dd8 100644 --- a/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/QuickstepAppTransitionManagerImpl.java @@ -32,6 +32,7 @@ import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_TRANSITIONS; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static com.android.quickstep.TaskUtils.taskIsATargetWithMode; import static com.android.systemui.shared.system.QuickStepContract.getWindowCornerRadius; +import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING; import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING; @@ -495,6 +496,8 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans endCrop = windowTargetBounds.height(); } + final float initialWindowRadius = supportsRoundedCornersOnWindows(mLauncher.getResources()) + ? startCrop / 2f : 0f; final float windowRadius = mDeviceProfile.isMultiWindowMode ? 0 : getWindowCornerRadius(mLauncher.getResources()); appAnimator.addUpdateListener(new MultiValueUpdateListener() { @@ -506,7 +509,7 @@ public abstract class QuickstepAppTransitionManagerImpl extends LauncherAppTrans alphaDuration, LINEAR); FloatProp mCroppedSize = new FloatProp(startCrop, endCrop, 0, CROP_DURATION, EXAGGERATED_EASE); - FloatProp mWindowRadius = new FloatProp(startCrop / 2f, windowRadius, 0, + FloatProp mWindowRadius = new FloatProp(initialWindowRadius, windowRadius, 0, RADIUS_DURATION, EXAGGERATED_EASE); @Override