Merge "Break infinite recursion in RemoteInputView" into tm-dev am: 4e08c38184
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18487001 Change-Id: I8e8da68f62145cfaa75adde32907efc3e1694ec2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user