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 {
|
public final class Field {
|
||||||
|
method @Nullable public java.util.regex.Pattern getFilter();
|
||||||
method @Nullable public android.service.autofill.Presentations getPresentations();
|
method @Nullable public android.service.autofill.Presentations getPresentations();
|
||||||
method @Nullable public android.view.autofill.AutofillValue getValue();
|
method @Nullable public android.view.autofill.AutofillValue getValue();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -905,7 +905,7 @@ public final class Dataset implements Parcelable {
|
|||||||
if (field == null) {
|
if (field == null) {
|
||||||
setLifeTheUniverseAndEverything(id, null, null, null, null, null, null);
|
setLifeTheUniverseAndEverything(id, null, null, null, null, null, null);
|
||||||
} else {
|
} else {
|
||||||
final DatasetFieldFilter filter = field.getFilter();
|
final DatasetFieldFilter filter = field.getDatasetFieldFilter();
|
||||||
final Presentations presentations = field.getPresentations();
|
final Presentations presentations = field.getPresentations();
|
||||||
if (presentations == null) {
|
if (presentations == null) {
|
||||||
setLifeTheUniverseAndEverything(id, field.getValue(), null, null, null,
|
setLifeTheUniverseAndEverything(id, field.getValue(), null, null, null,
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package android.service.autofill;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.view.autofill.AutofillId;
|
import android.view.autofill.AutofillId;
|
||||||
import android.view.autofill.AutofillValue;
|
import android.view.autofill.AutofillValue;
|
||||||
|
|
||||||
@@ -86,10 +85,20 @@ public final class Field {
|
|||||||
* @see Dataset.DatasetFieldFilter
|
* @see Dataset.DatasetFieldFilter
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public @Nullable Dataset.DatasetFieldFilter getFilter() {
|
public @Nullable Dataset.DatasetFieldFilter getDatasetFieldFilter() {
|
||||||
return mFilter;
|
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.
|
* 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
|
* approach when {@code value} is not {@code null} and field contains sensitive data
|
||||||
* such as passwords).
|
* such as passwords).
|
||||||
*/
|
*/
|
||||||
@SuppressLint("MissingGetterMatchingBuilder")
|
|
||||||
public @NonNull Builder setFilter(@Nullable Pattern value) {
|
public @NonNull Builder setFilter(@Nullable Pattern value) {
|
||||||
checkNotUsed();
|
checkNotUsed();
|
||||||
mFilter = new Dataset.DatasetFieldFilter(value);
|
mFilter = new Dataset.DatasetFieldFilter(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user