Merge "Break infinite recursion in RemoteInputView" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-05-24 00:07:38 +00:00
committed by Android (Google) Code Review

View File

@@ -114,15 +114,18 @@ public class RemoteInputController {
public void addRemoteInput(NotificationEntry entry, Object token) { public void addRemoteInput(NotificationEntry entry, Object token) {
Objects.requireNonNull(entry); Objects.requireNonNull(entry);
Objects.requireNonNull(token); Objects.requireNonNull(token);
boolean isActive = isRemoteInputActive(entry);
boolean found = pruneWeakThenRemoveAndContains( boolean found = pruneWeakThenRemoveAndContains(
entry /* contains */, null /* remove */, token /* removeToken */); entry /* contains */, null /* remove */, token /* removeToken */);
if (!found) { if (!found) {
mOpen.add(new Pair<>(new WeakReference<>(entry), token)); 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); apply(entry);
} }
}
/** /**
* Removes a currently active remote input. * Removes a currently active remote input.