Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2afc1fc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE when user swipes back in All Apps and no matching view found"...

Merge "Fix NPE when user swipes back in All Apps and no matching view found" into tm-dev am: a49ba253

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18821198



Change-Id: Ieb6f063e004f2521a4022ae5195d0667b01c40f7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3343ffa5 a49ba253
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2776,7 +2776,7 @@ public class Launcher extends StatefulActivity<LauncherState>
            View v = getFirstMatch(Collections.singletonList(activeRecyclerView),
                    preferredItem, packageAndUserAndApp);

            if (activeRecyclerView.getCurrentScrollY() > 0) {
            if (v != null && activeRecyclerView.getCurrentScrollY() > 0) {
                RectF locationBounds = new RectF();
                FloatingIconView.getLocationBoundsForView(this, v, false, locationBounds,
                        new Rect());
@@ -2804,6 +2804,7 @@ public class Launcher extends StatefulActivity<LauncherState>
     * @param containers List of ViewGroups to scan, in order of preference.
     * @param operators List of operators, in order starting from best matching operator.
     */
    @Nullable
    private static View getFirstMatch(Iterable<ViewGroup> containers,
            final Predicate<ItemInfo>... operators) {
        for (Predicate<ItemInfo> operator : operators) {
@@ -2821,6 +2822,7 @@ public class Launcher extends StatefulActivity<LauncherState>
     * Returns the first view matching the operator in the given ViewGroups, or null if none.
     * Forward iteration matters.
     */
    @Nullable
    private static View mapOverViewGroup(ViewGroup container, Predicate<ItemInfo> op) {
        final int itemCount = container.getChildCount();
        for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) {