Merge "Fix the IndexOutOfBoundsException in AllAppsGridAdapter." into tm-dev

This commit is contained in:
Becky Qiu authored and Android (Google) Code Review committed 2022-05-10 17:27:31 +00:00
commit 05eac3ee27
1 file changed
+1 -1
@@ -118,7 +118,7 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends
List<AdapterItem> items = mApps.getAdapterItems();
adapterPosition = Math.max(adapterPosition, items.size() - 1);
int extraRows = 0;
for (int i = 0; i <= adapterPosition; i++) {
for (int i = 0; i <= adapterPosition && i < items.size(); i++) {
if (!isViewType(items.get(i).viewType, VIEW_TYPE_MASK_ICON)) {
extraRows++;
}