diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-08-01 20:28:06 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-08-01 20:28:06 +0000 |
| commit | 0c499ab71f577d10fe751801bd538df30e629878 (patch) | |
| tree | fadb7dc23d074c7fe7942c8f01723f025fc4548e /core/java/android | |
| parent | 834ed33fe5fe4c4bea9777fd4ccc7909eb5ff140 (diff) | |
| parent | cfa0d49be5eba1b878c1eab06a1fb53bdf1a9100 (diff) | |
Merge "Fixed FieldClassificationStrategy that gets data from the package info."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/service/autofill/AutofillFieldClassificationService.java | 20 | ||||
| -rw-r--r-- | core/java/android/view/autofill/AutofillManager.java | 5 |
2 files changed, 23 insertions, 2 deletions
diff --git a/core/java/android/service/autofill/AutofillFieldClassificationService.java b/core/java/android/service/autofill/AutofillFieldClassificationService.java index 1cd76d2e9ec9..e5e1c926fbcd 100644 --- a/core/java/android/service/autofill/AutofillFieldClassificationService.java +++ b/core/java/android/service/autofill/AutofillFieldClassificationService.java @@ -65,16 +65,36 @@ public abstract class AutofillFieldClassificationService extends Service { /** * Manifest metadata key for the resource string containing the name of the default field * classification algorithm. + * + * @deprecated Use {@link #RESOURCE_DEFAULT_ALGORITHM} instead. */ + @Deprecated public static final String SERVICE_META_DATA_KEY_DEFAULT_ALGORITHM = "android.autofill.field_classification.default_algorithm"; + /** * Manifest metadata key for the resource string array containing the names of all field * classification algorithms provided by the service. + * + * @deprecated Use {@link #RESOURCE_AVAILABLE_ALGORITHMS} instead. */ + @Deprecated public static final String SERVICE_META_DATA_KEY_AVAILABLE_ALGORITHMS = "android.autofill.field_classification.available_algorithms"; + /** + * Name of the resource string containing the name of the default field + * classification algorithm. + */ + public static final String RESOURCE_DEFAULT_ALGORITHM = + "autofill_field_classification_default_algorithm"; + + /** + * Name of the resource string array containing the names of all field + * classification algorithms provided by the service. + */ + public static final String RESOURCE_AVAILABLE_ALGORITHMS = + "autofill_field_classification_available_algorithms"; /** {@hide} **/ public static final String EXTRA_SCORES = "scores"; diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index b5c736480215..32b2f63f4e59 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -1405,7 +1405,8 @@ public final class AutofillManager { final SyncResultReceiver receiver = new SyncResultReceiver(); try { mService.getAvailableFieldClassificationAlgorithms(receiver); - final String[] algorithms = receiver.getObjectResult(SyncResultReceiver.TYPE_STRING); + final String[] algorithms = receiver + .getObjectResult(SyncResultReceiver.TYPE_STRING_ARRAY); return algorithms != null ? Arrays.asList(algorithms) : Collections.emptyList(); } catch (RemoteException e) { e.rethrowFromSystemServer(); @@ -2906,7 +2907,7 @@ public final class AutofillManager { case TYPE_STRING: return (T) mBundle.getString(EXTRA); case TYPE_STRING_ARRAY: - return (T) mBundle.getString(EXTRA); + return (T) mBundle.getStringArray(EXTRA); case TYPE_PARCELABLE: return (T) mBundle.getParcelable(EXTRA); default: |
