diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2023-01-06 18:11:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-01-06 18:11:15 +0000 |
commit | 3da648a80b5ecef2ff7c72cc88ecf44551d5564f (patch) | |
tree | 35e78036564ec72827b260e10ffe0e296f669f84 | |
parent | 485c8777cc62813cfeb70adf53c12c33709fe73f (diff) | |
parent | 3c2ee27a0141ff1cd1c9bcfbb43e361bde55ae80 (diff) |
Merge "Fixing work tab is not updated when work-mode changes" into tm-qpr-dev
-rw-r--r-- | src/com/android/launcher3/allapps/AlphabeticalAppsList.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index fc1b830aed..29767bf465 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -239,23 +239,24 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement mAdapterItems.addAll(mSearchResults); } else { int position = 0; + boolean addApps = true; if (mWorkProviderManager != null) { position += mWorkProviderManager.addWorkItems(mAdapterItems); - if (!mWorkProviderManager.shouldShowWorkApps()) { - return; - } + addApps = mWorkProviderManager.shouldShowWorkApps(); } - String lastSectionName = null; - for (AppInfo info : mApps) { - mAdapterItems.add(AdapterItem.asApp(info)); - - String sectionName = info.sectionName; - // Create a new section if the section names do not match - if (!sectionName.equals(lastSectionName)) { - lastSectionName = sectionName; - mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position)); + if (addApps) { + String lastSectionName = null; + for (AppInfo info : mApps) { + mAdapterItems.add(AdapterItem.asApp(info)); + + String sectionName = info.sectionName; + // Create a new section if the section names do not match + if (!sectionName.equals(lastSectionName)) { + lastSectionName = sectionName; + mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position)); + } + position++; } - position++; } } mAccessibilityResultsCount = (int) mAdapterItems.stream() |