Loading core/java/android/app/assist/AssistStructure.java +8 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,14 @@ public class AssistStructure implements Parcelable { } pwriter.writeString(mClassName); out.writeInt(flags); int writtenFlags = flags; if ((flags&FLAGS_HAS_AUTO_FILL_DATA) != 0 && (mSanitized || !sanitizeOnWrite)) { // Remove 'checked' from sanitized auto-fill request. writtenFlags = flags & ~FLAGS_CHECKED; } out.writeInt(writtenFlags); if ((flags&FLAGS_HAS_ID) != 0) { out.writeInt(mId); if (mId != 0) { Loading core/java/android/widget/CompoundButton.java +14 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.view.Gravity; import android.view.SoundEffectConstants; import android.view.ViewDebug; import android.view.ViewHierarchyEncoder; import android.view.ViewStructure; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.autofill.AutoFillManager; Loading Loading @@ -68,6 +69,10 @@ public abstract class CompoundButton extends Button implements Checkable { private OnCheckedChangeListener mOnCheckedChangeListener; private OnCheckedChangeListener mOnCheckedChangeWidgetListener; // Indicates whether the toggle state was set from resources or dynamically, so it can be used // to sanitize auto-fill requests. private boolean mCheckedFromResource = false; private static final int[] CHECKED_STATE_SET = { R.attr.state_checked }; Loading Loading @@ -109,6 +114,7 @@ public abstract class CompoundButton extends Button implements Checkable { final boolean checked = a.getBoolean( com.android.internal.R.styleable.CompoundButton_checked, false); setChecked(checked); mCheckedFromResource = true; a.recycle(); Loading Loading @@ -148,6 +154,7 @@ public abstract class CompoundButton extends Button implements Checkable { @Override public void setChecked(boolean checked) { if (mChecked != checked) { mCheckedFromResource = false; mChecked = checked; refreshDrawableState(); notifyViewAccessibilityStateChangedIfNeeded( Loading Loading @@ -568,6 +575,13 @@ public abstract class CompoundButton extends Button implements Checkable { // TODO(b/33197203): add unit/CTS tests for auto-fill methods (and make sure they handle enable) @Override public void onProvideAutoFillStructure(ViewStructure structure, int flags) { super.onProvideAutoFillStructure(structure, flags); structure.setSanitized(mCheckedFromResource); } @Override public void autoFill(AutoFillValue value) { if (!isEnabled()) return; Loading core/java/android/widget/RadioGroup.java +12 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.ViewStructure; import android.view.autofill.AutoFillManager; import android.view.autofill.AutoFillType; import android.view.autofill.AutoFillValue; Loading Loading @@ -66,6 +67,10 @@ public class RadioGroup extends LinearLayout { private OnCheckedChangeListener mOnCheckedChangeListener; private PassThroughHierarchyChangeListener mPassThroughListener; // Indicates whether the child was set from resources or dynamically, so it can be used // to sanitize auto-fill requests. private int mInitialCheckedId = View.NO_ID; /** * {@inheritDoc} */ Loading @@ -89,8 +94,8 @@ public class RadioGroup extends LinearLayout { int value = attributes.getResourceId(R.styleable.RadioGroup_checkedButton, View.NO_ID); if (value != View.NO_ID) { mCheckedId = value; mInitialCheckedId = value; } final int index = attributes.getInt(com.android.internal.R.styleable.RadioGroup_orientation, VERTICAL); setOrientation(index); Loading Loading @@ -410,6 +415,12 @@ public class RadioGroup extends LinearLayout { // TODO(b/33197203): add unit/CTS tests for auto-fill methods (and make sure they handle enable) @Override public void onProvideAutoFillStructure(ViewStructure structure, int flags) { super.onProvideAutoFillStructure(structure, flags); structure.setSanitized(mCheckedId == mInitialCheckedId); } @Override public void autoFill(AutoFillValue value) { if (!isEnabled()) return; Loading core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -727,7 +727,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private boolean mHasPresetAutoSizeValues = false; // Indicates whether the text was set from resources or dynamically, so it can be used to // sanitize auto-fill request. // sanitize auto-fill requests. private boolean mTextFromResource = false; /** Loading Loading
core/java/android/app/assist/AssistStructure.java +8 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,14 @@ public class AssistStructure implements Parcelable { } pwriter.writeString(mClassName); out.writeInt(flags); int writtenFlags = flags; if ((flags&FLAGS_HAS_AUTO_FILL_DATA) != 0 && (mSanitized || !sanitizeOnWrite)) { // Remove 'checked' from sanitized auto-fill request. writtenFlags = flags & ~FLAGS_CHECKED; } out.writeInt(writtenFlags); if ((flags&FLAGS_HAS_ID) != 0) { out.writeInt(mId); if (mId != 0) { Loading
core/java/android/widget/CompoundButton.java +14 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.view.Gravity; import android.view.SoundEffectConstants; import android.view.ViewDebug; import android.view.ViewHierarchyEncoder; import android.view.ViewStructure; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.view.autofill.AutoFillManager; Loading Loading @@ -68,6 +69,10 @@ public abstract class CompoundButton extends Button implements Checkable { private OnCheckedChangeListener mOnCheckedChangeListener; private OnCheckedChangeListener mOnCheckedChangeWidgetListener; // Indicates whether the toggle state was set from resources or dynamically, so it can be used // to sanitize auto-fill requests. private boolean mCheckedFromResource = false; private static final int[] CHECKED_STATE_SET = { R.attr.state_checked }; Loading Loading @@ -109,6 +114,7 @@ public abstract class CompoundButton extends Button implements Checkable { final boolean checked = a.getBoolean( com.android.internal.R.styleable.CompoundButton_checked, false); setChecked(checked); mCheckedFromResource = true; a.recycle(); Loading Loading @@ -148,6 +154,7 @@ public abstract class CompoundButton extends Button implements Checkable { @Override public void setChecked(boolean checked) { if (mChecked != checked) { mCheckedFromResource = false; mChecked = checked; refreshDrawableState(); notifyViewAccessibilityStateChangedIfNeeded( Loading Loading @@ -568,6 +575,13 @@ public abstract class CompoundButton extends Button implements Checkable { // TODO(b/33197203): add unit/CTS tests for auto-fill methods (and make sure they handle enable) @Override public void onProvideAutoFillStructure(ViewStructure structure, int flags) { super.onProvideAutoFillStructure(structure, flags); structure.setSanitized(mCheckedFromResource); } @Override public void autoFill(AutoFillValue value) { if (!isEnabled()) return; Loading
core/java/android/widget/RadioGroup.java +12 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.ViewStructure; import android.view.autofill.AutoFillManager; import android.view.autofill.AutoFillType; import android.view.autofill.AutoFillValue; Loading Loading @@ -66,6 +67,10 @@ public class RadioGroup extends LinearLayout { private OnCheckedChangeListener mOnCheckedChangeListener; private PassThroughHierarchyChangeListener mPassThroughListener; // Indicates whether the child was set from resources or dynamically, so it can be used // to sanitize auto-fill requests. private int mInitialCheckedId = View.NO_ID; /** * {@inheritDoc} */ Loading @@ -89,8 +94,8 @@ public class RadioGroup extends LinearLayout { int value = attributes.getResourceId(R.styleable.RadioGroup_checkedButton, View.NO_ID); if (value != View.NO_ID) { mCheckedId = value; mInitialCheckedId = value; } final int index = attributes.getInt(com.android.internal.R.styleable.RadioGroup_orientation, VERTICAL); setOrientation(index); Loading Loading @@ -410,6 +415,12 @@ public class RadioGroup extends LinearLayout { // TODO(b/33197203): add unit/CTS tests for auto-fill methods (and make sure they handle enable) @Override public void onProvideAutoFillStructure(ViewStructure structure, int flags) { super.onProvideAutoFillStructure(structure, flags); structure.setSanitized(mCheckedId == mInitialCheckedId); } @Override public void autoFill(AutoFillValue value) { if (!isEnabled()) return; Loading
core/java/android/widget/TextView.java +1 −1 Original line number Diff line number Diff line Loading @@ -727,7 +727,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private boolean mHasPresetAutoSizeValues = false; // Indicates whether the text was set from resources or dynamically, so it can be used to // sanitize auto-fill request. // sanitize auto-fill requests. private boolean mTextFromResource = false; /** Loading