1 /**
2  * Copyright (C) 2019 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 com.android.internal.config.sysui;
18 
19 /**
20  * Keeps the flags related to the SystemUI namespace in {@link DeviceConfig}.
21  *
22  * @hide
23  */
24 public final class SystemUiDeviceConfigFlags {
25 
26     // Flags related to NotificationAssistant
27 
28     /**
29      * Whether the Notification Assistant should generate replies for notifications.
30      */
31     public static final String NAS_GENERATE_REPLIES = "nas_generate_replies";
32 
33     /**
34      * Whether the Notification Assistant should generate contextual actions for notifications.
35      */
36     public static final String NAS_GENERATE_ACTIONS = "nas_generate_actions";
37 
38     /**
39      * The maximum number of messages the Notification Assistant should extract from a
40      * conversation when constructing responses for that conversation.
41      */
42     public static final String NAS_MAX_MESSAGES_TO_EXTRACT = "nas_max_messages_to_extract";
43 
44     /**
45      * The maximum number of suggestions the Notification Assistant should provide for a
46      * messaging conversation.
47      */
48     public static final String NAS_MAX_SUGGESTIONS = "nas_max_suggestions";
49 
50     /**
51      * Whether to enable feedback UI for Notification Assistant
52      */
53     public static final String ENABLE_NAS_FEEDBACK = "enable_nas_feedback";
54 
55     // Flags related to screenshot intelligence
56 
57     /**
58      * (bool) Whether to enable smart actions in screenshot notifications.
59      */
60     public static final String ENABLE_SCREENSHOT_NOTIFICATION_SMART_ACTIONS =
61             "enable_screenshot_notification_smart_actions";
62 
63     /**
64      * (int) Timeout value in ms to get smart actions for screenshot notification.
65      */
66     public static final String SCREENSHOT_NOTIFICATION_SMART_ACTIONS_TIMEOUT_MS =
67             "screenshot_notification_smart_actions_timeout_ms";
68 
69     /**
70      * (int) Timeout value in ms to get Quick Share actions for screenshot notification.
71      */
72     public static final String SCREENSHOT_NOTIFICATION_QUICK_SHARE_ACTIONS_TIMEOUT_MS =
73             "screenshot_notification_quick_share_actions_timeout_ms";
74 
75     // Flags related to Smart Suggestions - these are read in SmartReplyConstants.
76 
77     /** (boolean) Whether to enable smart suggestions in notifications. */
78     public static final String SSIN_ENABLED = "ssin_enabled";
79 
80     /**
81      * (boolean) Whether apps need to target at least P to provide their own smart replies (this
82      * doesn't apply to actions!).
83      */
84     public static final String SSIN_REQUIRES_TARGETING_P = "ssin_requires_targeting_p";
85 
86     /**
87      * (int) The number of times we'll try to find a better line-break for double-line smart
88      * suggestion buttons.
89      */
90     public static final String SSIN_MAX_SQUEEZE_REMEASURE_ATTEMPTS =
91             "ssin_max_squeeze_remeasure_attempts";
92 
93     /** (boolean) Whether to let the user edit smart replies before sending. */
94     public static final String SSIN_EDIT_CHOICES_BEFORE_SENDING =
95             "ssin_edit_choices_before_sending";
96 
97     /** (boolean) Whether smart suggestions should be enabled in heads-up notifications. */
98     public static final String SSIN_SHOW_IN_HEADS_UP = "ssin_show_in_heads_up";
99 
100     /** (int) Minimum number of system generated replies to show in a notification. */
101     public static final String SSIN_MIN_NUM_SYSTEM_GENERATED_REPLIES =
102             "ssin_min_num_system_generated_replies";
103 
104     /**
105      * (int) Maximum number of actions to show in a notification, -1 if there shouldn't be a limit
106      */
107     public static final String SSIN_MAX_NUM_ACTIONS = "ssin_max_num_actions";
108 
109     /**
110      * (int) The amount of time (ms) before smart suggestions are clickable, since the suggestions
111      * were added.
112      */
113     public static final String SSIN_ONCLICK_INIT_DELAY = "ssin_onclick_init_delay";
114 
115     /**
116      * The default component of
117      * {@link android.service.notification.NotificationAssistantService}.
118      */
119     public static final String NAS_DEFAULT_SERVICE = "nas_default_service";
120 
121     /** (boolean) Whether notify() calls to NMS should acquire and hold WakeLocks. */
122     public static final String NOTIFY_WAKELOCK = "nms_notify_wakelock";
123 
124     // Flags related to media notifications
125 
126     /**
127      * (int) Maximum number of days to retain the salt for hashing direct share targets in logging
128      */
129     public static final String HASH_SALT_MAX_DAYS = "hash_salt_max_days";
130 
131     // Flag related to Privacy Indicators
132 
133     /**
134      * Whether to show the complete ongoing app ops chip.
135      */
136     public static final String PROPERTY_PERMISSIONS_HUB_ENABLED = "permissions_hub_2_enabled";
137 
138     /**
139      * Whether to show app ops chip for just microphone + camera.
140      */
141     public static final String PROPERTY_MIC_CAMERA_ENABLED = "camera_mic_icons_enabled";
142 
143     /**
144      * Whether to show app ops chip for location.
145      */
146     public static final String PROPERTY_LOCATION_INDICATORS_ENABLED = "location_indicators_enabled";
147 
148     /**
149      * Whether to show privacy chip for media projection.
150      */
151     public static final String PROPERTY_MEDIA_PROJECTION_INDICATORS_ENABLED =
152             "media_projection_indicators_enabled";
153 
154     /**
155      * Whether to show old location indicator on all location accesses.
156      */
157     public static final String PROPERTY_LOCATION_INDICATORS_SMALL_ENABLED =
158             "location_indicators_small_enabled";
159 
160     /**
161      * Whether to show the location indicator for system apps.
162      */
163     public static final String PROPERTY_LOCATION_INDICATORS_SHOW_SYSTEM =
164             "location_indicators_show_system";
165 
166     // Flags related to Assistant
167 
168     /**
169      * (String) Which behavior mode for the Assistant Handles to use.
170      */
171     public static final String ASSIST_HANDLES_BEHAVIOR_MODE = "assist_handles_behavior_mode";
172 
173     /**
174      * (long) How long, in milliseconds, to display Assist Handles when showing them temporarily.
175      */
176     public static final String ASSIST_HANDLES_SHOW_AND_GO_DURATION_MS =
177             "assist_handles_show_and_go_duration_ms";
178 
179     /**
180      * (long) How long, in milliseconds, to wait before showing the Assist Handles temporarily when
181      * performing a short delayed show.
182      */
183     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAYED_SHORT_DELAY_MS =
184             "assist_handles_show_and_go_delayed_short_delay_ms";
185 
186     /**
187      * (long) How long, in milliseconds, to wait before showing the Assist Handles temporarily when
188      * performing a long delayed show.
189      */
190     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAYED_LONG_DELAY_MS =
191             "assist_handles_show_and_go_delayed_long_delay_ms";
192 
193     /**
194      * (long) How long, in milliseconds, to wait before resetting delayed show delay times.
195      */
196     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAY_RESET_TIMEOUT_MS =
197             "assist_handles_show_and_go_delay_reset_timeout_ms";
198 
199     /**
200      * (long) How long, in milliseconds, to wait before displaying Assist Handles temporarily after
201      * hiding them.
202      */
203     public static final String ASSIST_HANDLES_SHOWN_FREQUENCY_THRESHOLD_MS =
204             "assist_handles_shown_frequency_threshold_ms";
205 
206     /**
207      * (long) How long, in milliseconds, for teaching behaviors to wait before considering the user
208      * taught.
209      */
210     public static final String ASSIST_HANDLES_LEARN_TIME_MS = "assist_handles_learn_time_ms";
211 
212     /**
213      * (int) How many times for teaching behaviors to see the user perform an action to consider it
214      * taught.
215      */
216     public static final String ASSIST_HANDLES_LEARN_COUNT = "assist_handles_learn_count";
217 
218     /**
219      * (bool) Whether to suppress handles on lockscreen."
220      */
221     public static final String ASSIST_HANDLES_SUPPRESS_ON_LOCKSCREEN =
222             "assist_handles_suppress_on_lockscreen";
223 
224     /**
225      * (bool) Whether to suppress handles on launcher."
226      */
227     public static final String ASSIST_HANDLES_SUPPRESS_ON_LAUNCHER =
228             "assist_handles_suppress_on_launcher";
229 
230     /**
231      * (bool) Whether to suppress handles on apps."
232      */
233     public static final String ASSIST_HANDLES_SUPPRESS_ON_APPS =
234             "assist_handles_suppress_on_apps";
235 
236     /**
237      * Allow touch passthrough above assist area during a session.
238      */
239     public static final String ASSIST_TAP_PASSTHROUGH = "assist_tap_passthrough";
240 
241     /**
242      * (bool) Whether to show handles when taught.
243      */
244     public static final String ASSIST_HANDLES_SHOW_WHEN_TAUGHT = "assist_handles_show_when_taught";
245 
246     /**
247      * (long) Duration per pixel, in milliseconds, of scrolling text at fast speed.
248      */
249     public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_FAST =
250             "assist_transcription_duration_per_px_fast";
251 
252     /**
253      * (long) Duration per pixel, in milliseconds, of scrolling text at regular speed.
254      */
255     public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_REGULAR =
256             "assist_transcription_duration_per_px_regular";
257 
258     /**
259      * (long) Duration, in milliseconds, over which text fades in.
260      */
261     public static final String ASSIST_TRANSCRIPTION_FADE_IN_DURATION =
262             "assist_transcription_fade_in_duration";
263 
264     /**
265      * (long) Maximum total duration, in milliseconds, for a given transcription.
266      */
267     public static final String ASSIST_TRANSCRIPTION_MAX_DURATION =
268             "assist_transcription_max_duration";
269 
270     /**
271      * (long) Minimum total duration, in milliseconds, for a given transcription.
272      */
273     public static final String ASSIST_TRANSCRIPTION_MIN_DURATION =
274             "assist_transcription_min_duration";
275 
276     /**
277      * (boolean) Whether or not to enable an extra section in the notification shade which
278      * filters for "people" related messages.
279      */
280     public static final String NOTIFICATIONS_USE_PEOPLE_FILTERING =
281             "notifications_use_people_filtering";
282 
283     /**
284      * (boolean) Whether or not to enable user dismissing of foreground service notifications
285      * into a new section at the bottom of the notification shade.
286      */
287     public static final String NOTIFICATIONS_ALLOW_FGS_DISMISSAL =
288             "notifications_allow_fgs_dismissal";
289 
290     // Flags related to brightline falsing
291 
292     /**
293      * (bool) Whether to use the new BrightLineFalsingManager.
294      */
295     public static final String BRIGHTLINE_FALSING_MANAGER_ENABLED =
296             "brightline_falsing_manager_enabled";
297     /**
298      * (float) Maximum fraction of the screen required to qualify as a real swipe.
299      */
300     public static final String BRIGHTLINE_FALSING_DISTANCE_SCREEN_FRACTION_MAX_DISTANCE =
301             "brightline_falsing_distance_screen_fraction_max_distance";
302 
303     /**
304      * (float) Multiplier for swipe velocity to convert it to pixels for a fling.
305      */
306     public static final String BRIGHTLINE_FALSING_DISTANCE_VELOCITY_TO_DISTANCE =
307             "brightline_falsing_distance_velcoity_to_distance";
308 
309     /**
310      * (float) How far, in inches, must a fling travel horizontally to qualify as intentional.
311      */
312     public static final String BRIGHTLINE_FALSING_DISTANCE_HORIZONTAL_FLING_THRESHOLD_IN =
313             "brightline_falsing_distance_horizontal_fling_threshold_in";
314 
315     /**
316      * (float) Maximum fraction of the screen required to qualify as a real swipe.
317      */
318     public static final String BRIGHTLINE_FALSING_DISTANCE_VERTICAL_FLING_THRESHOLD_IN =
319             "brightline_falsing_distance_vertical_fling_threshold_in";
320 
321     /**
322      * (float) How far, in inches, must a continuous swipe travel horizontally to be intentional.
323      */
324     public static final String BRIGHTLINE_FALSING_DISTANCE_HORIZONTAL_SWIPE_THRESHOLD_IN =
325             "brightline_falsing_distance_horizontal_swipe_threshold_in";
326 
327     /**
328      * (float) How far, in inches, must a continuous swipe travel vertically to be intentional.
329      */
330     public static final String BRIGHTLINE_FALSING_DISTANCE_VERTICAL_SWIPE_THRESHOLD_IN =
331             "brightline_falsing_distance_horizontal_swipe_threshold_in";
332 
333     /**
334      * (float) Percentage of swipe with the proximity sensor covered that triggers a higher
335      * swipe distance requirement.
336      */
337     public static final String BRIGHTLINE_FALSING_PROXIMITY_PERCENT_COVERED_THRESHOLD =
338             "brightline_falsing_proximity_percent_covered_threshold";
339 
340     /**
341      * (float) Angle, in radians, that a swipe can vary from horizontal and sill be intentional.
342      */
343     public static final String BRIGHTLINE_FALSING_DIAGONAL_HORIZONTAL_ANGLE_RANGE =
344             "brightline_falsing_diagonal_horizontal_angle_range";
345 
346     /**
347      * (float) Angle, in radians, that a swipe can vary from vertical and sill be intentional.
348      */
349     public static final String BRIGHTLINE_FALSING_DIAGONAL_VERTICAL_ANGLE_RANGE =
350             "brightline_falsing_diagonal_horizontal_angle_range";
351 
352     /**
353      * (float) Distance, in inches, that a swipe is allowed to vary in the horizontal direction for
354      * horizontal swipes.
355      */
356     public static final String BRIGHTLINE_FALSING_ZIGZAG_X_PRIMARY_DEVIANCE =
357             "brightline_falsing_zigzag_x_primary_deviance";
358 
359     /**
360      * (float) Distance, in inches, that a swipe is allowed to vary in the vertical direction for
361      * vertical swipes.
362      */
363     public static final String BRIGHTLINE_FALSING_ZIGZAG_Y_PRIMARY_DEVIANCE =
364             "brightline_falsing_zigzag_y_primary_deviance";
365 
366     /**
367      * (float) Distance, in inches, that a swipe is allowed to vary in the horizontal direction for
368      * horizontal swipes.
369      */
370     public static final String BRIGHTLINE_FALSING_ZIGZAG_X_SECONDARY_DEVIANCE =
371             "brightline_falsing_zigzag_x_secondary_deviance";
372 
373     /**
374      * (float) Distance, in inches, that a swipe is allowed to vary in the vertical direction for
375      * vertical swipes.
376      */
377     public static final String BRIGHTLINE_FALSING_ZIGZAG_Y_SECONDARY_DEVIANCE =
378             "brightline_falsing_zigzag_y_secondary_deviance";
379 
380 
381     // Flags related to screenshots
382 
383     /**
384      * (boolean) Whether screenshot flow going to the corner (instead of shown in a notification)
385      * is enabled.
386      */
387     public static final String SCREENSHOT_CORNER_FLOW = "enable_screenshot_corner_flow";
388 
389     // Flags related to Nav Bar
390 
391     /**
392      * (boolean) Whether to force the Nav Bar handle to remain opaque.
393      */
394     public static final String NAV_BAR_HANDLE_FORCE_OPAQUE = "nav_bar_handle_force_opaque";
395 
396     /**
397      * (boolean) Whether to force the Nav Bar handle to remain visible over the lockscreen.
398      */
399     public static final String NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN =
400             "nav_bar_handle_show_over_lockscreen";
401 
402     /**
403      * (int) Timeout threshold, in millisecond, that Sharesheet waits for direct share targets.
404      */
405     public static final String SHARE_SHEET_DIRECT_SHARE_TIMEOUT =
406             "share_sheet_direct_share_timeout";
407 
408     /**
409      * (boolean) Whether append direct share on Sharesheet is enabled.
410      */
411     public static final String APPEND_DIRECT_SHARE_ENABLED = "append_direct_share_enabled";
412 
413     /**
414      * (boolean) Whether ChooserTargets ranking on Sharesheet is enabled.
415      */
416     public static final String CHOOSER_TARGET_RANKING_ENABLED = "chooser_target_ranking_enabled";
417 
418     /**
419      * (boolean) Whether dark launch of remote prediction service is enabled.
420      */
421     public static final String DARK_LAUNCH_REMOTE_PREDICTION_SERVICE_ENABLED =
422             "dark_launch_remote_prediction_service_enabled";
423 
424     /**
425      * (boolean) Whether to enable pinch resizing for PIP.
426      */
427     public static final String PIP_PINCH_RESIZE = "pip_pinch_resize";
428 
429     /**
430      * (boolean) Whether to enable stashing for PIP.
431      */
432     public static final String PIP_STASHING = "pip_stashing";
433 
434     /**
435      * (float) The threshold velocity to cause PiP to be stashed when flinging from one edge to the
436      * other.
437      */
438     public static final String PIP_STASH_MINIMUM_VELOCITY_THRESHOLD = "pip_velocity_threshold";
439 
440     /**
441      * (float) Bottom height in DP for Back Gesture.
442      */
443     public static final String BACK_GESTURE_BOTTOM_HEIGHT = "back_gesture_bottom_height";
444 
445     /**
446      * (float) Edge width in DP where touch down is allowed for Back Gesture.
447      */
448     public static final String BACK_GESTURE_EDGE_WIDTH = "back_gesture_edge_width";
449 
450     /**
451      * (float) Slop multiplier for Back Gesture.
452      */
453     public static final String BACK_GESTURE_SLOP_MULTIPLIER = "back_gesture_slop_multiplier";
454 
455     /**
456      * (long) Screenshot keychord delay (how long the buttons must be pressed), in ms
457      */
458     public static final String SCREENSHOT_KEYCHORD_DELAY = "screenshot_keychord_delay";
459 
460     /**
461      * (boolean) Whether to use an ML model for the Back Gesture.
462      */
463     public static final String USE_BACK_GESTURE_ML_MODEL = "use_back_gesture_ml_model";
464 
465     /**
466      * (string) The name of the ML model for Back Gesture.
467      */
468     public static final String BACK_GESTURE_ML_MODEL_NAME = "back_gesture_ml_model_name";
469 
470     /**
471      * (float) Threshold for Back Gesture ML model prediction.
472      */
473     public static final String BACK_GESTURE_ML_MODEL_THRESHOLD = "back_gesture_ml_model_threshold";
474 
475     /**
476      * (boolean) Sharesheet - Whether to use the deprecated
477      * {@link android.service.chooser.ChooserTargetService} API for
478      *  direct share targets. If true, both CTS and Shortcuts will be used to find Direct
479      *  Share targets. If false, only Shortcuts will be used.
480      */
481     public static final String SHARE_USE_SERVICE_TARGETS = "share_use_service_targets";
482 
483     /**
484      * (boolean) If true, SysUI provides guardrails for app usage of Direct Share by enforcing
485      * limits on number of targets per app & adjusting scores for apps providing many targets. If
486      * false, this step is skipped. This should be true unless the ranking provider configured by
487      * [some other flag] is expected to manage these incentives.
488      */
489     public static final String APPLY_SHARING_APP_LIMITS_IN_SYSUI =
490             "apply_sharing_app_limits_in_sysui";
491 
492     /*
493      * (long) The duration that the home button must be pressed before triggering Assist
494      */
495     public static final String HOME_BUTTON_LONG_PRESS_DURATION_MS =
496             "home_button_long_press_duration_ms";
497 
498     /**
499      * (boolean) Whether shortcut integration over app search service is enabled.
500      */
501     public static final String SHORTCUT_APPSEARCH_INTEGRATION =
502             "shortcut_appsearch_integration";
503 
504     /**
505      * (boolean) Whether nearby share should be the first target in ranked apps.
506      */
507     public static final String IS_NEARBY_SHARE_FIRST_TARGET_IN_RANKED_APP =
508             "is_nearby_share_first_target_in_ranked_app";
509 
510     /**
511      * (boolean) Whether to enable the new unbundled sharesheet
512      * (com.android.intentresolver.ChooserActivity).
513      */
514     public static final String USE_UNBUNDLED_SHARESHEET = "use_unbundled_sharesheet";
515 
516     /**
517      * (int) The delay (in ms) before refreshing the Sharesheet UI after a change to the share
518      * target data model. For more info see go/sharesheet-list-view-update-delay.
519      */
520     public static final String SHARESHEET_LIST_VIEW_UPDATE_DELAY =
521             "sharesheet_list_view_update_delay";
522 
523     /**
524      * (string) Name of the default QR code scanner activity. On the eligible devices this activity
525      * is provided by GMS core.
526      */
527     public static final String DEFAULT_QR_CODE_SCANNER = "default_qr_code_scanner";
528 
529     /**
530      * (boolean) Whether the task manager should show an attention grabbing dot when tasks changed.
531      */
532     public static final String TASK_MANAGER_SHOW_FOOTER_DOT = "task_manager_show_footer_dot";
533 
534     /**
535      * (boolean) Whether to enable the adapter conversion in RemoteViews
536      */
537     public static final String REMOTEVIEWS_ADAPTER_CONVERSION =
538             "CursorControlFeature__remoteviews_adapter_conversion";
539 
540     /**
541      * The key name used in app core settings for {@link #REMOTEVIEWS_ADAPTER_CONVERSION}
542      */
543     public static final String KEY_REMOTEVIEWS_ADAPTER_CONVERSION =
544             "systemui__remoteviews_adapter_conversion";
545 
546     /**
547      * Default value for whether the adapter conversion is enabled or not. This is set for
548      * RemoteViews and should not be a common practice.
549      */
550     public static final boolean REMOTEVIEWS_ADAPTER_CONVERSION_DEFAULT = false;
551 
552     /**
553      * (boolean) Whether the task manager should show a stop button if the app is allowlisted
554      * by the user.
555      */
556     public static final String TASK_MANAGER_SHOW_STOP_BUTTON_FOR_USER_ALLOWLISTED_APPS =
557             "show_stop_button_for_user_allowlisted_apps";
558 
559     /**
560      * (boolean) Whether the task manager should show apps running user-visible jobs.
561      */
562     public static final String TASK_MANAGER_SHOW_USER_VISIBLE_JOBS =
563             "task_manager_show_user_visible_jobs";
564 
565     /**
566      * (boolean) Whether the task manager should tell JobScheduler it's about to ask for an
567      * app stop.
568      */
569     public static final String TASK_MANAGER_INFORM_JOB_SCHEDULER_OF_PENDING_APP_STOP =
570             "task_manager_inform_job_scheduler_of_pending_app_stop";
571 
572     /**
573      * (boolean) Whether widget provider info would be saved to / loaded from system persistence
574      * layer as opposed to individual manifests in respective apps.
575      */
576     public static final String PERSISTS_WIDGET_PROVIDER_INFO = "persists_widget_provider_info";
577 
578     /**
579      * (boolean) Whether to show smart chips (based on TextClassifier) in the clipboard overlay.
580      */
581     public static final String CLIPBOARD_OVERLAY_SHOW_ACTIONS = "clipboard_overlay_show_actions";
582 
583     /**
584      * (boolean) Whether to ignore the source package for determining whether to use remote copy
585      * behavior in the clipboard UI.
586      */
587     public static final String CLIPBOARD_IGNORE_REMOTE_COPY_SOURCE =
588             "clipboard_ignore_remote_copy_source";
589 
590     /**
591      * (boolean) Whether to combine the broadcasts APPWIDGET_ENABLED and APPWIDGET_UPDATE
592      */
593     public static final String COMBINED_BROADCAST_ENABLED = "combined_broadcast_enabled";
594 
595     /**
596      * (boolean) Whether to allow cursor hover states for certain elements.
597      */
598     public static final String CURSOR_HOVER_STATES_ENABLED = "cursor_hover_states_enabled";
599 
SystemUiDeviceConfigFlags()600     private SystemUiDeviceConfigFlags() {
601     }
602 }
603