diff options
| author | Philip P. Moltmann <moltmann@google.com> | 2017-03-14 21:59:34 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-03-14 21:59:39 +0000 |
| commit | 9b31b4eac838238ef3013cbfb1379cddbafa0f12 (patch) | |
| tree | ac949179dea06f0c4c8f8e45df8fa43ce67b9040 /core/java/android/widget/CompoundButton.java | |
| parent | d5f0bc3676204851fd42b80406718fa666624332 (diff) | |
| parent | 9668903731c272e51ce610598c052ef411c9d89f (diff) | |
Merge "Make it clear which type of AutoFillValue is set"
Diffstat (limited to 'core/java/android/widget/CompoundButton.java')
| -rw-r--r-- | core/java/android/widget/CompoundButton.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java index 08d8081f31f6..899a824489e3 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -28,6 +28,7 @@ import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; import android.util.AttributeSet; +import android.util.Log; import android.view.Gravity; import android.view.SoundEffectConstants; import android.view.ViewDebug; @@ -55,6 +56,7 @@ import com.android.internal.R; * </p> */ public abstract class CompoundButton extends Button implements Checkable { + private static final String LOG_TAG = CompoundButton.class.getSimpleName(); private boolean mChecked; private boolean mBroadcasting; @@ -585,7 +587,11 @@ public abstract class CompoundButton extends Button implements Checkable { public void autofill(AutofillValue value) { if (!isEnabled()) return; - setChecked(value.getToggleValue()); + if (value.isToggle()) { + setChecked(value.getToggleValue()); + } else { + Log.w(LOG_TAG, value + " could not be autofilled into " + this); + } } @Override |
