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

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

Merge "Break infinite recursion in RemoteInputView" into tm-dev am: 4e08c381

parents d6b51eb6 4e08c381
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -114,15 +114,18 @@ public class RemoteInputController {
    public void addRemoteInput(NotificationEntry entry, Object token) {
        Objects.requireNonNull(entry);
        Objects.requireNonNull(token);

        boolean isActive = isRemoteInputActive(entry);
        boolean found = pruneWeakThenRemoveAndContains(
                entry /* contains */, null /* remove */, token /* removeToken */);
        if (!found) {
            mOpen.add(new Pair<>(new WeakReference<>(entry), token));
        }

        // If the remote input focus is being transferred between different notification layouts
        // (ex: Expanded->Contracted), then we don't want to re-apply.
        if (!isActive) {
            apply(entry);
        }
    }

    /**
     * Removes a currently active remote input.