From 32007e05cd7947f3830e20d732cf41bae5b4c9b9 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Fri, 27 Sep 2024 11:32:51 -0700 Subject: [PATCH] Don't call onAppsUpdated() when in testHarness Suspect that the jump in these flakes where it cannot find the private space container is due to this calculateDiff call when onAppsUpdate() is called bug: 355466672 Test: tapl presubmit and vid: https://drive.google.com/file/d/1hshI6g7oqvi45EiO92Rl4e-gaXfDVe_b/view?usp=sharing Flag: NONE trying to fix flake Change-Id: I0bff416624c5b9e2cb7a4fe32834f9d521507922 --- src/com/android/launcher3/allapps/PrivateProfileManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java index e215cabcd7..6a401215f1 100644 --- a/src/com/android/launcher3/allapps/PrivateProfileManager.java +++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java @@ -66,6 +66,7 @@ import com.android.launcher3.BuildConfig; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Flags; import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedPropertySetter; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.icons.BitmapInfo; @@ -699,7 +700,9 @@ public class PrivateProfileManager extends UserProfileManager { mAllApps.mAH.get(MAIN).mRecyclerView.removeItemDecoration( mPrivateAppsSectionDecorator); // Call onAppsUpdated() because it may be canceled when this animation occurs. - mAllApps.getPersonalAppList().onAppsUpdated(); + if (!Utilities.isRunningInTestHarness()) { + mAllApps.getPersonalAppList().onAppsUpdated(); + } if (isPrivateSpaceHidden()) { // TODO (b/325455879): Figure out if we can avoid this. getMainRecyclerView().getAdapter().notifyDataSetChanged();