From 65e373912b2eec9d2da12932fdef36c1a37f66f3 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Thu, 21 Mar 2024 10:59:28 -0700 Subject: [PATCH] Remove applyBackground param in decorator - This applyBackground() internally calls setBackground which is something that should not be done in onDraw. Not needed anymore since privateprofile doesn't use the recyclerViewAnimationController anymore. If it is still needed, when applyingBackground it should be done probably during onBind(). - When setBackground() is called during onDraw() there's a cyclic situation that ends up blocking the thread and thats why you cannot see the privatespace be deleted. bug: 329317904 Test: manual: before: https://drive.google.com/file/d/1vAaA_juK8Bg2QB3oHhRmtiZxcHzEHHP1/view?usp=sharing after: https://drive.google.com/file/d/1vAR6Okw17uskruHre8RrhsKa7-GiqE6k/view?usp=sharing Flag: None Change-Id: I06d31abb31496994d12b96fe6c0ca8cb26c93f69 --- .../launcher3/allapps/PrivateAppsSectionDecorator.java | 2 +- .../android/launcher3/allapps/SectionDecorationHandler.java | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/allapps/PrivateAppsSectionDecorator.java b/src/com/android/launcher3/allapps/PrivateAppsSectionDecorator.java index 8712b8468f..18175b6add 100644 --- a/src/com/android/launcher3/allapps/PrivateAppsSectionDecorator.java +++ b/src/com/android/launcher3/allapps/PrivateAppsSectionDecorator.java @@ -56,7 +56,7 @@ public class PrivateAppsSectionDecorator extends RecyclerView.ItemDecoration { new SectionDecorationHandler.UnionDecorationHandler( decorationHandler, parent.getPaddingLeft(), parent.getPaddingRight())); - unionHandler.addChild(decorationHandler, view, true /* applyBackground */); + unionHandler.addChild(decorationHandler, view); deferredDecorations.put(PRIVATE_APP_SECTION, unionHandler); } else { decorationHandler.onFocusDraw(c, view); diff --git a/src/com/android/launcher3/allapps/SectionDecorationHandler.java b/src/com/android/launcher3/allapps/SectionDecorationHandler.java index f79b82cebb..ac9b146f12 100644 --- a/src/com/android/launcher3/allapps/SectionDecorationHandler.java +++ b/src/com/android/launcher3/allapps/SectionDecorationHandler.java @@ -176,13 +176,10 @@ public class SectionDecorationHandler { /** * Expands decoration bounds to include child {@link PrivateAppsSectionDecorator} */ - public void addChild(SectionDecorationHandler child, View view, boolean applyBackground) { + public void addChild(SectionDecorationHandler child, View view) { int scaledHeight = (int) (view.getHeight() * view.getScaleY()); mBounds.union(view.getLeft(), view.getY(), view.getRight(), view.getY() + scaledHeight); - if (applyBackground) { - applyBackground(view, mContext, null, false); - } mIsBottomRound |= child.mIsBottomRound; mIsBottomLeftRound |= child.mIsBottomLeftRound; mIsBottomRightRound |= child.mIsBottomRightRound;