From effd3e6c1bba8d5d5ce8047b9a1e455816fcd4b3 Mon Sep 17 00:00:00 2001 From: Andrey Yepin Date: Thu, 12 Dec 2024 10:28:25 -0800 Subject: A feature flag removal Remove 24Q4-released 'fix_missing_drawer_offset_calculation' feature flag. Bug: 347316548 Test: presubmits Flag: EXEMPT flag removal Change-Id: Id03271034a81015d77b6bd4164073671feb50e9b --- .../android/intentresolver/ChooserActivity.java | 55 +++++++++------------- 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java index c2c7dfab..92f366ea 100644 --- a/java/src/com/android/intentresolver/ChooserActivity.java +++ b/java/src/com/android/intentresolver/ChooserActivity.java @@ -23,7 +23,6 @@ import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTE import static androidx.lifecycle.LifecycleKt.getCoroutineScope; import static com.android.intentresolver.ChooserActionFactory.EDIT_SOURCE; -import static com.android.intentresolver.Flags.fixMissingDrawerOffsetCalculation; import static com.android.intentresolver.Flags.fixShortcutsFlashing; import static com.android.intentresolver.Flags.keyboardNavigationFix; import static com.android.intentresolver.Flags.rebuildAdaptersOnTargetPinning; @@ -2308,43 +2307,31 @@ public class ChooserActivity extends Hilt_ChooserActivity implements || recyclerView.getAdapter() == null || availableWidth != mCurrAvailableWidth; - boolean insetsChanged = !Objects.equals(mLastAppliedInsets, mSystemWindowInsets); - - if (isLayoutUpdated - || insetsChanged - || mLastNumberOfChildren != recyclerView.getChildCount() - || fixMissingDrawerOffsetCalculation()) { - mCurrAvailableWidth = availableWidth; - if (isLayoutUpdated) { - // It is very important we call setAdapter from here. Otherwise in some cases - // the resolver list doesn't get populated, such as b/150922090, b/150918223 - // and b/150936654 - recyclerView.setAdapter(gridAdapter); - ((GridLayoutManager) recyclerView.getLayoutManager()).setSpanCount( - mMaxTargetsPerRow); - - updateTabPadding(); - } + mCurrAvailableWidth = availableWidth; + if (isLayoutUpdated) { + // It is very important we call setAdapter from here. Otherwise in some cases + // the resolver list doesn't get populated, such as b/150922090, b/150918223 + // and b/150936654 + recyclerView.setAdapter(gridAdapter); + ((GridLayoutManager) recyclerView.getLayoutManager()).setSpanCount( + mMaxTargetsPerRow); - if (mChooserMultiProfilePagerAdapter.getActiveProfile() != mInitialProfile) { - return; - } + updateTabPadding(); + } + + if (mChooserMultiProfilePagerAdapter.getActiveProfile() != mInitialProfile) { + return; + } - if (mLastNumberOfChildren == recyclerView.getChildCount() && !insetsChanged - && !fixMissingDrawerOffsetCalculation()) { + getMainThreadHandler().post(() -> { + if (mResolverDrawerLayout == null || gridAdapter == null) { return; } - - getMainThreadHandler().post(() -> { - if (mResolverDrawerLayout == null || gridAdapter == null) { - return; - } - int offset = calculateDrawerOffset(top, bottom, recyclerView, gridAdapter); - mResolverDrawerLayout.setCollapsibleHeightReserved(offset); - mEnterTransitionAnimationDelegate.markOffsetCalculated(); - mLastAppliedInsets = mSystemWindowInsets; - }); - } + int offset = calculateDrawerOffset(top, bottom, recyclerView, gridAdapter); + mResolverDrawerLayout.setCollapsibleHeightReserved(offset); + mEnterTransitionAnimationDelegate.markOffsetCalculated(); + mLastAppliedInsets = mSystemWindowInsets; + }); } private int calculateDrawerOffset( -- cgit v1.2.3-59-g8ed1b