1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.view.autofill;
18 
19 import android.annotation.SuppressLint;
20 import android.annotation.TestApi;
21 import android.provider.DeviceConfig;
22 import android.text.TextUtils;
23 import android.util.ArraySet;
24 import android.view.View;
25 
26 import com.android.internal.util.ArrayUtils;
27 
28 import java.util.Arrays;
29 import java.util.Set;
30 
31 /**
32  * Feature flags associated with autofill.
33  * @hide
34  */
35 @TestApi
36 public class AutofillFeatureFlags {
37 
38     /**
39      * {@code DeviceConfig} property used to set which Smart Suggestion modes for Augmented Autofill
40      * are available.
41      */
42     public static final String DEVICE_CONFIG_AUTOFILL_SMART_SUGGESTION_SUPPORTED_MODES =
43             "smart_suggestion_supported_modes";
44 
45     /**
46      * Sets how long (in ms) the augmented autofill service is bound while idle.
47      *
48      * <p>Use {@code 0} to keep it permanently bound.
49      *
50      * @hide
51      */
52     public static final String DEVICE_CONFIG_AUGMENTED_SERVICE_IDLE_UNBIND_TIMEOUT =
53             "augmented_service_idle_unbind_timeout";
54 
55     /**
56      * Sets how long (in ms) the augmented autofill service request is killed if not replied.
57      *
58      * @hide
59      */
60     public static final String DEVICE_CONFIG_AUGMENTED_SERVICE_REQUEST_TIMEOUT =
61             "augmented_service_request_timeout";
62 
63     /**
64      * Sets allowed list for the autofill compatibility mode.
65      *
66      * The list of packages is {@code ":"} colon delimited, and each entry has the name of the
67      * package and an optional list of url bar resource ids (the list is delimited by
68      * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
69      *
70      * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
71      * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
72      * have 2 ids {@code url_foo} and {@code url_bas}) would be
73      * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
74      */
75     public static final String DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
76             "compat_mode_allowed_packages";
77 
78     /**
79      * Indicates Fill dialog feature enabled or not.
80      */
81     public static final String DEVICE_CONFIG_AUTOFILL_DIALOG_ENABLED =
82             "autofill_dialog_enabled";
83 
84     /**
85      * Sets the autofill hints allowed list for the fields that can trigger the fill dialog
86      * feature at Activity starting.
87      *
88      * The list of autofill hints is {@code ":"} colon delimited.
89      *
90      *  <p>For example, a list with 3 hints {@code password}, {@code phone}, and
91      * { @code emailAddress}, would be {@code password:phone:emailAddress}
92      *
93      * Note: By default the password field is enabled even there is no password hint in the list
94      *
95      * @see View#setAutofillHints(String...)
96      * @hide
97      */
98     public static final String DEVICE_CONFIG_AUTOFILL_DIALOG_HINTS =
99             "autofill_dialog_hints";
100 
101     // START CREDENTIAL MANAGER FLAGS //
102     /**
103      * Indicates whether credential manager tagged views should be ignored from autofill structures.
104      * This flag is further gated by {@link #DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_ENABLED}
105      */
106     public static final String DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_IGNORE_VIEWS =
107             "autofill_credential_manager_ignore_views";
108 
109     /**
110      * Indicates CredentialManager feature enabled or not.
111      * This is the overall feature flag. Individual behavior of credential manager may be controlled
112      * via a different flag, but gated by this flag.
113      */
114     public static final String DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_ENABLED =
115             "autofill_credential_manager_enabled";
116 
117     /**
118      * Indicates whether credential manager tagged views should suppress fill and save dialog.
119      * This flag is further gated by {@link #DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_ENABLED}
120      *
121      * @hide
122      */
123     public static final String DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG =
124             "autofill_credential_manager_suppress_fill_and_save_dialog";
125     // END CREDENTIAL MANAGER FLAGS //
126 
127     // START AUTOFILL FOR ALL APPS FLAGS //
128     /**
129      * Sets the list of activities and packages denied for autofill
130      *
131      * The list is {@code ";"} colon delimited. Activities under a package is separated by
132      * {@code ","}. Each package name much be followed by a {@code ":"}. Each package entry must be
133      * ends with a {@code ";"}
134      *
135      * <p>For example, a list with only 1 package would be, {@code Package1:;}. A list with one
136      * denied activity {@code Activity1} under {@code Package1} and a full denied package
137      * {@code Package2} would be {@code Package1:Activity1;Package2:;}
138      */
139     public static final String DEVICE_CONFIG_PACKAGE_DENYLIST_FOR_UNIMPORTANT_VIEW =
140             "package_deny_list_for_unimportant_view";
141 
142     /**
143      * Sets the list of activities and packages allowed for autofill. The format is same with
144      * {@link #DEVICE_CONFIG_PACKAGE_DENYLIST_FOR_UNIMPORTANT_VIEW}
145      *
146      * @hide
147      */
148     public static final String DEVICE_CONFIG_PACKAGE_AND_ACTIVITY_ALLOWLIST_FOR_TRIGGERING_FILL_REQUEST =
149             "package_and_activity_allowlist_for_triggering_fill_request";
150 
151     /**
152      * Whether the heuristics check for view is enabled
153      */
154     public static final String DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_UNIMPORTANT_VIEW =
155             "trigger_fill_request_on_unimportant_view";
156 
157     /**
158      * Whether to apply heuristic check on important views.
159      *
160      * @hide
161      */
162     public static final String DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_FILTERED_IMPORTANT_VIEWS =
163             "trigger_fill_request_on_filtered_important_views";
164 
165     /**
166      * Continas imeAction ids that is irrelevant for autofill. For example, ime_action_search. We
167      * use this to avoid trigger fill request on unimportant views.
168      *
169      * The list is {@code ","} delimited.
170      *
171      * <p> For example, a imeAction list could be "2,3,4", corresponding to ime_action definition
172      * in {@link android.view.inputmethod.EditorInfo.java}</p>
173      */
174     @SuppressLint("IntentName")
175     public static final String DEVICE_CONFIG_NON_AUTOFILLABLE_IME_ACTION_IDS =
176             "non_autofillable_ime_action_ids";
177 
178     /**
179      * Whether to enable autofill on all view types (not just checkbox, spinner, datepicker etc...)
180      *
181      * @hide
182      */
183     public static final String DEVICE_CONFIG_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES =
184             "should_enable_autofill_on_all_view_types";
185 
186     /**
187      * Whether to enable multi-line filter when checking if view is autofillable
188      *
189      * @hide
190      */
191     public static final String DEVICE_CONFIG_MULTILINE_FILTER_ENABLED =
192             "multiline_filter_enabled";
193 
194     /**
195      * Whether include all autofill type not none views in assist structure
196      *
197      * @hide
198      */
199     public static final String
200         DEVICE_CONFIG_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE =
201             "include_all_autofill_type_not_none_views_in_assist_structure";
202 
203     /**
204      * Whether include all views in assist structure
205      *
206      * @hide
207      */
208     public static final String
209         DEVICE_CONFIG_INCLUDE_ALL_VIEWS_IN_ASSIST_STRUCTURE =
210             "include_all_views_in_assist_structure";
211 
212     /**
213      * Whether to always include WebView in assist structure. WebView is a container view that
214      * providers "virtual" views. We want to always include such a container view since it can
215      * contain arbitrary views in it, some of which could be fillable.
216      *
217      * @hide
218      */
219     public static final String
220             DEVICE_CONFIG_ALWAYS_INCLUDE_WEBVIEW_IN_ASSIST_STRUCTURE =
221             "always_include_webview_in_assist_structure";
222 
223     /**
224      * Whether to include invisible views in the assist structure. Including invisible views can fix
225      * some cases in which Session is destroyed earlier than it is suppose to.
226      *
227      * <p>See
228      * frameworks/base/services/autofill/bugfixes.aconfig#include_invisible_view_group_in_assist_structure
229      * for more information.
230      *
231      * @hide
232      */
233     public static final String DEVICE_CONFIG_INCLUDE_INVISIBLE_VIEW_GROUP_IN_ASSIST_STRUCTURE =
234             "include_invisible_view_group_in_assist_structure";
235 
236     /**
237      * Bugfix flag, Autofill should ignore views resetting to empty states.
238      *
239      * See frameworks/base/services/autofill/bugfixes.aconfig#ignore_view_state_reset_to_empty
240      * for more information.
241      *
242      * @hide
243      */
244     public static final String DEVICE_CONFIG_IGNORE_VIEW_STATE_RESET_TO_EMPTY =
245             "ignore_view_state_reset_to_empty";
246 
247     /**
248      * Bugfix flag, Autofill should ignore view updates if an Auth intent is showing.
249      *
250      * See frameworks/base/services/autofill/bugfixes.aconfig#relayout
251      * for more information.
252      *
253      * @hide
254      */
255     public static final String DEVICE_CONFIG_IGNORE_RELAYOUT_WHEN_AUTH_PENDING =
256             "ignore_relayout_auth_pending";
257 
258     /**
259      * Bugfix flag, Autofill should only fill in value from current session.
260      *
261      * See frameworks/base/services/autofill/bugfixes.aconfig#fill_fields_from_current_session_only
262      * for more information
263      *
264      * @hide
265      */
266     public static final String DEVICE_CONFIG_FILL_FIELDS_FROM_CURRENT_SESSION_ONLY =
267             "fill_fields_from_current_session_only";
268 
269     // END AUTOFILL FOR ALL APPS FLAGS //
270 
271 
272     // START AUTOFILL PCC CLASSIFICATION FLAGS
273 
274     /**
275      * Sets the fill dialog feature enabled or not.
276      */
277     public static final String DEVICE_CONFIG_AUTOFILL_PCC_CLASSIFICATION_ENABLED =
278             "pcc_classification_enabled";
279 
280     /**
281      * Give preference to autofill provider's detection.
282      * @hide
283      */
284     public static final String DEVICE_CONFIG_PREFER_PROVIDER_OVER_PCC = "prefer_provider_over_pcc";
285 
286     /**
287      * Indicates the Autofill Hints that would be requested by the service from the Autofill
288      * Provider.
289      */
290     public static final String DEVICE_CONFIG_AUTOFILL_PCC_FEATURE_PROVIDER_HINTS =
291             "pcc_classification_hints";
292 
293     /**
294      * Use data from secondary source if primary not present .
295      * For eg: if we prefer PCC over provider, and PCC detection didn't classify a field, however,
296      * autofill provider did, this flag would decide whether we use that result, and show some
297      * presentation for that particular field.
298      * @hide
299      */
300     public static final String DEVICE_CONFIG_PCC_USE_FALLBACK = "pcc_use_fallback";
301 
302     // END AUTOFILL PCC CLASSIFICATION FLAGS
303 
304     /**
305      * Define the max input length for autofill to show suggesiton UI
306      *
307      * E.g. if flag is set to 3, autofill will only show suggestions when user inputs less than 3
308      * characters
309      *
310      * @hide
311      */
312     public static final String DEVICE_CONFIG_MAX_INPUT_LENGTH_FOR_AUTOFILL =
313             "max_input_length_for_autofill";
314 
315     /**
316      * Sets a value of delay time to show up the inline tooltip view.
317      *
318      * @hide
319      */
320     public static final String DEVICE_CONFIG_AUTOFILL_TOOLTIP_SHOW_UP_DELAY =
321             "autofill_inline_tooltip_first_show_delay";
322 
323     private static final String DIALOG_HINTS_DELIMITER = ":";
324 
325     private static final boolean DEFAULT_HAS_FILL_DIALOG_UI_FEATURE = false;
326     private static final String DEFAULT_FILL_DIALOG_ENABLED_HINTS = "";
327 
328 
329     // CREDENTIAL MANAGER DEFAULTS
330     // Credential manager is enabled by default so as to allow testing by app developers
331     private static final boolean DEFAULT_CREDENTIAL_MANAGER_ENABLED = true;
332     private static final boolean DEFAULT_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG = true;
333     // END CREDENTIAL MANAGER DEFAULTS
334 
335 
336     // AUTOFILL PCC CLASSIFICATION FLAGS DEFAULTS
337     // Default for whether the pcc classification is enabled for autofill.
338     /** @hide */
339     public static final boolean DEFAULT_AUTOFILL_PCC_CLASSIFICATION_ENABLED = false;
340     // END AUTOFILL PCC CLASSIFICATION FLAGS DEFAULTS
341 
342     // AUTOFILL FOR ALL APPS DEFAULTS
343     private static final boolean DEFAULT_AFAA_ON_UNIMPORTANT_VIEW_ENABLED = true;
344     private static final boolean DEFAULT_AFAA_ON_IMPORTANT_VIEW_ENABLED = true;
345     private static final String DEFAULT_AFAA_DENYLIST = "";
346     private static final String DEFAULT_AFAA_ALLOWLIST = "";
347     private static final String DEFAULT_AFAA_NON_AUTOFILLABLE_IME_ACTIONS = "3,4";
348     private static final boolean DEFAULT_AFAA_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES = true;
349     private static final boolean DEFAULT_AFAA_SHOULD_ENABLE_MULTILINE_FILTER = true;
350     private static final boolean
351             DEFAULT_AFAA_SHOULD_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE = true;
352     // END AUTOFILL FOR ALL APPS DEFAULTS
353 
354     /**
355      * @hide
356      */
357     public static final int DEFAULT_MAX_INPUT_LENGTH_FOR_AUTOFILL = 3;
AutofillFeatureFlags()358     private AutofillFeatureFlags() {};
359 
360     /**
361      * Whether the fill dialog feature is enabled or not
362      *
363      * @hide
364      */
isFillDialogEnabled()365     public static boolean isFillDialogEnabled() {
366         return DeviceConfig.getBoolean(
367                 DeviceConfig.NAMESPACE_AUTOFILL,
368                 DEVICE_CONFIG_AUTOFILL_DIALOG_ENABLED,
369                 DEFAULT_HAS_FILL_DIALOG_UI_FEATURE);
370     }
371 
372     /**
373      * Gets fill dialog enabled hints.
374      *
375      * @hide
376      */
getFillDialogEnabledHints()377     public static String[] getFillDialogEnabledHints() {
378         final String dialogHints = DeviceConfig.getString(
379                 DeviceConfig.NAMESPACE_AUTOFILL,
380                 DEVICE_CONFIG_AUTOFILL_DIALOG_HINTS,
381                 DEFAULT_FILL_DIALOG_ENABLED_HINTS);
382         if (TextUtils.isEmpty(dialogHints)) {
383             return new String[0];
384         }
385 
386         return ArrayUtils.filter(dialogHints.split(DIALOG_HINTS_DELIMITER), String[]::new,
387                 (str) -> !TextUtils.isEmpty(str));
388     }
389 
390     /* starts credman flag getter function */
391     /**
392      * Whether the Credential Manager feature is enabled or not
393      *
394      * @hide
395      */
isCredentialManagerEnabled()396     public static boolean isCredentialManagerEnabled() {
397         return DeviceConfig.getBoolean(
398                 DeviceConfig.NAMESPACE_AUTOFILL,
399                 DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_ENABLED,
400                 DEFAULT_CREDENTIAL_MANAGER_ENABLED);
401     }
402 
403     /**
404      * Whether credential manager tagged views should not trigger fill dialog requests.
405      *
406      * @hide
407      */
isFillAndSaveDialogDisabledForCredentialManager()408     public static boolean isFillAndSaveDialogDisabledForCredentialManager() {
409         return isCredentialManagerEnabled() && DeviceConfig.getBoolean(
410                     DeviceConfig.NAMESPACE_AUTOFILL,
411                     DEVICE_CONFIG_AUTOFILL_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG,
412                     DEFAULT_CREDENTIAL_MANAGER_SUPPRESS_FILL_AND_SAVE_DIALOG);
413     }
414     /* ends credman flag getter function */
415 
416     /**
417      * Whether triggering fill request on unimportant view is enabled.
418      *
419      * @hide
420      */
isTriggerFillRequestOnUnimportantViewEnabled()421     public static boolean isTriggerFillRequestOnUnimportantViewEnabled() {
422         return DeviceConfig.getBoolean(
423             DeviceConfig.NAMESPACE_AUTOFILL,
424             DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_UNIMPORTANT_VIEW,
425             DEFAULT_AFAA_ON_UNIMPORTANT_VIEW_ENABLED);
426     }
427 
428     /**
429      * Whether to apply heuristic check on important views before triggering fill request
430      *
431      * @hide
432      */
isTriggerFillRequestOnFilteredImportantViewsEnabled()433     public static boolean isTriggerFillRequestOnFilteredImportantViewsEnabled() {
434         return DeviceConfig.getBoolean(
435             DeviceConfig.NAMESPACE_AUTOFILL,
436             DEVICE_CONFIG_TRIGGER_FILL_REQUEST_ON_FILTERED_IMPORTANT_VIEWS,
437             DEFAULT_AFAA_ON_IMPORTANT_VIEW_ENABLED);
438     }
439 
440     /**
441      * Whether to enable autofill on all view types.
442      *
443      * @hide
444      */
shouldEnableAutofillOnAllViewTypes()445     public static boolean shouldEnableAutofillOnAllViewTypes(){
446         return DeviceConfig.getBoolean(
447             DeviceConfig.NAMESPACE_AUTOFILL,
448             DEVICE_CONFIG_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES,
449             DEFAULT_AFAA_SHOULD_ENABLE_AUTOFILL_ON_ALL_VIEW_TYPES);
450     }
451 
452     /**
453      * Get the non-autofillable ime actions from flag. This will be used in filtering
454      * condition to trigger fill request.
455      *
456      * @hide
457      */
getNonAutofillableImeActionIdSetFromFlag()458     public static Set<String> getNonAutofillableImeActionIdSetFromFlag() {
459         final String mNonAutofillableImeActions = DeviceConfig.getString(
460                 DeviceConfig.NAMESPACE_AUTOFILL,
461                 DEVICE_CONFIG_NON_AUTOFILLABLE_IME_ACTION_IDS,
462                 DEFAULT_AFAA_NON_AUTOFILLABLE_IME_ACTIONS);
463         return new ArraySet<>(Arrays.asList(mNonAutofillableImeActions.split(",")));
464     }
465 
466     /**
467      * Get denylist string from flag.
468      *
469      * Note: This denylist works both on important view and not important views. The flag used here
470      * is legacy flag which will be replaced with soon.
471      *
472      * @hide
473      */
getDenylistStringFromFlag()474     public static String getDenylistStringFromFlag() {
475         return DeviceConfig.getString(
476             DeviceConfig.NAMESPACE_AUTOFILL,
477             DEVICE_CONFIG_PACKAGE_DENYLIST_FOR_UNIMPORTANT_VIEW,
478             DEFAULT_AFAA_DENYLIST);
479     }
480 
481     /**
482      * Get autofill allowlist from flag
483      *
484      * @hide
485      */
getAllowlistStringFromFlag()486     public static String getAllowlistStringFromFlag() {
487         return DeviceConfig.getString(
488             DeviceConfig.NAMESPACE_AUTOFILL,
489             DEVICE_CONFIG_PACKAGE_AND_ACTIVITY_ALLOWLIST_FOR_TRIGGERING_FILL_REQUEST,
490             DEFAULT_AFAA_ALLOWLIST);
491     }
492     /**
493      * Whether include all views that have autofill type not none in assist structure.
494      *
495      * @hide
496      */
shouldIncludeAllViewsAutofillTypeNotNoneInAssistStructrue()497     public static boolean shouldIncludeAllViewsAutofillTypeNotNoneInAssistStructrue() {
498         return DeviceConfig.getBoolean(
499             DeviceConfig.NAMESPACE_AUTOFILL,
500             DEVICE_CONFIG_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE,
501             DEFAULT_AFAA_SHOULD_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE);
502     }
503 
504     /**
505      * Whether include all views in assist structure.
506      *
507      * @hide
508      */
shouldIncludeAllChildrenViewInAssistStructure()509     public static boolean shouldIncludeAllChildrenViewInAssistStructure() {
510         return DeviceConfig.getBoolean(
511             DeviceConfig.NAMESPACE_AUTOFILL,
512             DEVICE_CONFIG_INCLUDE_ALL_VIEWS_IN_ASSIST_STRUCTURE, false);
513     }
514 
515     /** @hide */
shouldAlwaysIncludeWebviewInAssistStructure()516     public static boolean shouldAlwaysIncludeWebviewInAssistStructure() {
517         return DeviceConfig.getBoolean(
518             DeviceConfig.NAMESPACE_AUTOFILL,
519                 DEVICE_CONFIG_ALWAYS_INCLUDE_WEBVIEW_IN_ASSIST_STRUCTURE, true);
520     }
521 
522     /** @hide */
shouldIncludeInvisibleViewInAssistStructure()523     public static boolean shouldIncludeInvisibleViewInAssistStructure() {
524         return DeviceConfig.getBoolean(
525                 DeviceConfig.NAMESPACE_AUTOFILL,
526                 DEVICE_CONFIG_INCLUDE_INVISIBLE_VIEW_GROUP_IN_ASSIST_STRUCTURE,
527                 true);
528     }
529 
530     /** @hide */
shouldIgnoreViewStateResetToEmpty()531     public static boolean shouldIgnoreViewStateResetToEmpty() {
532         return DeviceConfig.getBoolean(
533                 DeviceConfig.NAMESPACE_AUTOFILL,
534                 DEVICE_CONFIG_IGNORE_VIEW_STATE_RESET_TO_EMPTY,
535                 true);
536     }
537 
538     /** @hide */
shouldIgnoreRelayoutWhenAuthPending()539     public static boolean shouldIgnoreRelayoutWhenAuthPending() {
540         return DeviceConfig.getBoolean(
541                 DeviceConfig.NAMESPACE_AUTOFILL,
542                 DEVICE_CONFIG_IGNORE_RELAYOUT_WHEN_AUTH_PENDING,
543                 false);
544     }
545 
546     /** @hide **/
shouldFillFieldsFromCurrentSessionOnly()547     public static boolean shouldFillFieldsFromCurrentSessionOnly() {
548         return DeviceConfig.getBoolean(
549                 DeviceConfig.NAMESPACE_AUTOFILL,
550                 DEVICE_CONFIG_FILL_FIELDS_FROM_CURRENT_SESSION_ONLY,
551                 true);
552     }
553 
554     /**
555      * Whether should enable multi-line filter
556      *
557      * @hide
558      */
shouldEnableMultilineFilter()559     public static boolean shouldEnableMultilineFilter() {
560         return DeviceConfig.getBoolean(
561             DeviceConfig.NAMESPACE_AUTOFILL,
562             DEVICE_CONFIG_MULTILINE_FILTER_ENABLED,
563             DEFAULT_AFAA_SHOULD_ENABLE_MULTILINE_FILTER);
564     }
565 
566     // START AUTOFILL PCC CLASSIFICATION FUNCTIONS
567 
568     /**
569      * Whether Autofill PCC Detection is enabled.
570      *
571      * @hide
572      */
isAutofillPccClassificationEnabled()573     public static boolean isAutofillPccClassificationEnabled() {
574         // TODO(b/266379948): Add condition for checking whether device has PCC first
575 
576         return DeviceConfig.getBoolean(
577                 DeviceConfig.NAMESPACE_AUTOFILL,
578                 DEVICE_CONFIG_AUTOFILL_PCC_CLASSIFICATION_ENABLED,
579                 DEFAULT_AUTOFILL_PCC_CLASSIFICATION_ENABLED);
580     }
581 
582     // END AUTOFILL PCC CLASSIFICATION FUNCTIONS
583 }
584