Fix direct share target cells's visibility

Due to incorrect initialization of the visibility status array, direct
share target cells were never truly set invisible (they were not visible
due to lack of content) and thus were iterated over by a keyboard
navigation. Because those “invisible” items overlapped with other,
visible, elements, it created an effect of a correct keyboard navigation
but incorrect target launching.

Fix: 244476932
Test: Manual testing, debugging.
Change-Id: Ic413948fea94aa6c658fad12fe81be2783b5f509
This commit is contained in:
Andrey Epin
2022-08-31 19:27:26 -07:00
parent 1f8fded512
commit 9bef54f4aa

View File

@@ -141,6 +141,7 @@ import java.lang.annotation.RetentionPolicy;
import java.net.URISyntaxException;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -3693,6 +3694,7 @@ public class ChooserActivity extends ResolverActivity implements
this.mRows = rows;
this.mCellCountPerRow = cellCountPerRow;
this.mCellVisibility = new boolean[rows.size() * cellCountPerRow];
Arrays.fill(mCellVisibility, true);
this.mListAdapterSupplier = listAdapterSupplier;
}