Commit 1f3ac513 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Fixed terms & conditions radio buttons initially not...

[Autofill Assistant] Fixed terms & conditions radio buttons initially not triggering the listener notification.

This is a hotfix for b/130205250. A proper fix is part of the larger PR refactoring: http://crrev/c/1538294

Bug: b/130205250
Change-Id: I3f28085b568dd73889ad989551b04a570226f2ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1564151Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Cr-Commit-Position: refs/heads/master@{#649827}
parent b2ebecac
...@@ -294,15 +294,12 @@ public class AssistantChoiceList extends GridLayout { ...@@ -294,15 +294,12 @@ public class AssistantChoiceList extends GridLayout {
} }
private void setCheckedItem(Item item) { private void setCheckedItem(Item item) {
boolean changed = false;
for (int i = 0; i < mItems.size(); i++) { for (int i = 0; i < mItems.size(); i++) {
RadioButton radioButton = mItems.get(i).mRadioButton; RadioButton radioButton = mItems.get(i).mRadioButton;
boolean isItem = mItems.get(i) == item; radioButton.setChecked(mItems.get(i) == item);
changed |= isItem && !radioButton.isChecked();
radioButton.setChecked(isItem);
} }
if (changed && mItemSelectedListener != null) { if (mItemSelectedListener != null) {
mItemSelectedListener.onResult(item.mContent); mItemSelectedListener.onResult(item.mContent);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment