Merge "Add getter for filter in Field" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
91e92eb085
@@ -38080,6 +38080,7 @@ package android.service.autofill {
|
||||
}
|
||||
|
||||
public final class Field {
|
||||
method @Nullable public java.util.regex.Pattern getFilter();
|
||||
method @Nullable public android.service.autofill.Presentations getPresentations();
|
||||
method @Nullable public android.view.autofill.AutofillValue getValue();
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ public final class Dataset implements Parcelable {
|
||||
if (field == null) {
|
||||
setLifeTheUniverseAndEverything(id, null, null, null, null, null, null);
|
||||
} else {
|
||||
final DatasetFieldFilter filter = field.getFilter();
|
||||
final DatasetFieldFilter filter = field.getDatasetFieldFilter();
|
||||
final Presentations presentations = field.getPresentations();
|
||||
if (presentations == null) {
|
||||
setLifeTheUniverseAndEverything(id, field.getValue(), null, null, null,
|
||||
|
||||
@@ -18,7 +18,6 @@ package android.service.autofill;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.view.autofill.AutofillId;
|
||||
import android.view.autofill.AutofillValue;
|
||||
|
||||
@@ -86,10 +85,20 @@ public final class Field {
|
||||
* @see Dataset.DatasetFieldFilter
|
||||
* @hide
|
||||
*/
|
||||
public @Nullable Dataset.DatasetFieldFilter getFilter() {
|
||||
public @Nullable Dataset.DatasetFieldFilter getDatasetFieldFilter() {
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex used to determine if the dataset should be shown in the autofill UI;
|
||||
* when {@code null}, it disables filtering on that dataset (this is the recommended
|
||||
* approach when {@code value} is not {@code null} and field contains sensitive data
|
||||
* such as passwords).
|
||||
*/
|
||||
public @Nullable Pattern getFilter() {
|
||||
return mFilter == null ? null : mFilter.pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* The presentations used to visualize this field in Autofill UI.
|
||||
*/
|
||||
@@ -127,7 +136,6 @@ public final class Field {
|
||||
* approach when {@code value} is not {@code null} and field contains sensitive data
|
||||
* such as passwords).
|
||||
*/
|
||||
@SuppressLint("MissingGetterMatchingBuilder")
|
||||
public @NonNull Builder setFilter(@Nullable Pattern value) {
|
||||
checkNotUsed();
|
||||
mFilter = new Dataset.DatasetFieldFilter(value);
|
||||
|
||||
Reference in New Issue
Block a user