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     // Flags related to screenshot intelligence
51 
52     /**
53      * (bool) Whether to enable smart actions in screenshot notifications.
54      */
55     public static final String ENABLE_SCREENSHOT_NOTIFICATION_SMART_ACTIONS =
56             "enable_screenshot_notification_smart_actions";
57 
58     /**
59      * (int) Timeout value in ms to get smart actions for screenshot notification.
60      */
61     public static final String SCREENSHOT_NOTIFICATION_SMART_ACTIONS_TIMEOUT_MS =
62             "screenshot_notification_smart_actions_timeout_ms";
63 
64     // Flags related to Smart Suggestions - these are read in SmartReplyConstants.
65 
66     /** (boolean) Whether to enable smart suggestions in notifications. */
67     public static final String SSIN_ENABLED = "ssin_enabled";
68 
69     /**
70      * (boolean) Whether apps need to target at least P to provide their own smart replies (this
71      * doesn't apply to actions!).
72      */
73     public static final String SSIN_REQUIRES_TARGETING_P = "ssin_requires_targeting_p";
74 
75     /**
76      * (int) The number of times we'll try to find a better line-break for double-line smart
77      * suggestion buttons.
78      */
79     public static final String SSIN_MAX_SQUEEZE_REMEASURE_ATTEMPTS =
80             "ssin_max_squeeze_remeasure_attempts";
81 
82     /** (boolean) Whether to let the user edit smart replies before sending. */
83     public static final String SSIN_EDIT_CHOICES_BEFORE_SENDING =
84             "ssin_edit_choices_before_sending";
85 
86     /** (boolean) Whether smart suggestions should be enabled in heads-up notifications. */
87     public static final String SSIN_SHOW_IN_HEADS_UP = "ssin_show_in_heads_up";
88 
89     /** (int) Minimum number of system generated replies to show in a notification. */
90     public static final String SSIN_MIN_NUM_SYSTEM_GENERATED_REPLIES =
91             "ssin_min_num_system_generated_replies";
92 
93     /**
94      * (int) Maximum number of actions to show in a notification, -1 if there shouldn't be a limit
95      */
96     public static final String SSIN_MAX_NUM_ACTIONS = "ssin_max_num_actions";
97 
98     /**
99      * (int) The amount of time (ms) before smart suggestions are clickable, since the suggestions
100      * were added.
101      */
102     public static final String SSIN_ONCLICK_INIT_DELAY = "ssin_onclick_init_delay";
103 
104     /**
105      * The default component of
106      * {@link android.service.notification.NotificationAssistantService}.
107      */
108     public static final String NAS_DEFAULT_SERVICE = "nas_default_service";
109 
110     // Flags related to media notifications
111 
112     /**
113      * (boolean) If {@code true}, enables the seekbar in compact media notifications.
114      */
115     public static final String COMPACT_MEDIA_SEEKBAR_ENABLED =
116             "compact_media_notification_seekbar_enabled";
117 
118     /**
119      * (int) Maximum number of days to retain the salt for hashing direct share targets in logging
120      */
121     public static final String HASH_SALT_MAX_DAYS = "hash_salt_max_days";
122 
123     // Flags related to Assistant
124 
125     /**
126      * (String) Which behavior mode for the Assistant Handles to use.
127      */
128     public static final String ASSIST_HANDLES_BEHAVIOR_MODE = "assist_handles_behavior_mode";
129 
130     /**
131      * (long) How long, in milliseconds, to display Assist Handles when showing them temporarily.
132      */
133     public static final String ASSIST_HANDLES_SHOW_AND_GO_DURATION_MS =
134             "assist_handles_show_and_go_duration_ms";
135 
136     /**
137      * (long) How long, in milliseconds, to wait before showing the Assist Handles temporarily when
138      * performing a short delayed show.
139      */
140     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAYED_SHORT_DELAY_MS =
141             "assist_handles_show_and_go_delayed_short_delay_ms";
142 
143     /**
144      * (long) How long, in milliseconds, to wait before showing the Assist Handles temporarily when
145      * performing a long delayed show.
146      */
147     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAYED_LONG_DELAY_MS =
148             "assist_handles_show_and_go_delayed_long_delay_ms";
149 
150     /**
151      * (long) How long, in milliseconds, to wait before resetting delayed show delay times.
152      */
153     public static final String ASSIST_HANDLES_SHOW_AND_GO_DELAY_RESET_TIMEOUT_MS =
154             "assist_handles_show_and_go_delay_reset_timeout_ms";
155 
156     /**
157      * (long) How long, in milliseconds, to wait before displaying Assist Handles temporarily after
158      * hiding them.
159      */
160     public static final String ASSIST_HANDLES_SHOWN_FREQUENCY_THRESHOLD_MS =
161             "assist_handles_shown_frequency_threshold_ms";
162 
163     /**
164      * (long) How long, in milliseconds, for teaching behaviors to wait before considering the user
165      * taught.
166      */
167     public static final String ASSIST_HANDLES_LEARN_TIME_MS = "assist_handles_learn_time_ms";
168 
169     /**
170      * (int) How many times for teaching behaviors to see the user perform an action to consider it
171      * taught.
172      */
173     public static final String ASSIST_HANDLES_LEARN_COUNT = "assist_handles_learn_count";
174 
175     /**
176      * (bool) Whether to suppress handles on lockscreen."
177      */
178     public static final String ASSIST_HANDLES_SUPPRESS_ON_LOCKSCREEN =
179             "assist_handles_suppress_on_lockscreen";
180 
181     /**
182      * (bool) Whether to suppress handles on launcher."
183      */
184     public static final String ASSIST_HANDLES_SUPPRESS_ON_LAUNCHER =
185             "assist_handles_suppress_on_launcher";
186 
187     /**
188      * (bool) Whether to suppress handles on apps."
189      */
190     public static final String ASSIST_HANDLES_SUPPRESS_ON_APPS =
191             "assist_handles_suppress_on_apps";
192 
193     /**
194      * Allow touch passthrough above assist area during a session.
195      */
196     public static final String ASSIST_TAP_PASSTHROUGH = "assist_tap_passthrough";
197 
198     /**
199      * (bool) Whether to show handles when taught.
200      */
201     public static final String ASSIST_HANDLES_SHOW_WHEN_TAUGHT = "assist_handles_show_when_taught";
202 
203     /**
204      * (long) Duration per pixel, in milliseconds, of scrolling text at fast speed.
205      */
206     public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_FAST =
207             "assist_transcription_duration_per_px_fast";
208 
209     /**
210      * (long) Duration per pixel, in milliseconds, of scrolling text at regular speed.
211      */
212     public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_REGULAR =
213             "assist_transcription_duration_per_px_regular";
214 
215     /**
216      * (long) Duration, in milliseconds, over which text fades in.
217      */
218     public static final String ASSIST_TRANSCRIPTION_FADE_IN_DURATION =
219             "assist_transcription_fade_in_duration";
220 
221     /**
222      * (long) Maximum total duration, in milliseconds, for a given transcription.
223      */
224     public static final String ASSIST_TRANSCRIPTION_MAX_DURATION =
225             "assist_transcription_max_duration";
226 
227     /**
228      * (long) Minimum total duration, in milliseconds, for a given transcription.
229      */
230     public static final String ASSIST_TRANSCRIPTION_MIN_DURATION =
231             "assist_transcription_min_duration";
232 
233     /**
234      * (boolean) Whether or not to enable an extra section in the notification shade which
235      * filters for "people" related messages.
236      */
237     public static final String NOTIFICATIONS_USE_PEOPLE_FILTERING =
238             "notifications_use_people_filtering";
239 
240     /**
241      * (boolean) Whether or not to enable user dismissing of foreground service notifications
242      * into a new section at the bottom of the notification shade.
243      */
244     public static final String NOTIFICATIONS_ALLOW_FGS_DISMISSAL =
245             "notifications_allow_fgs_dismissal";
246 
247     // Flags related to brightline falsing
248 
249     /**
250      * (bool) Whether to use the new BrightLineFalsingManager.
251      */
252     public static final String BRIGHTLINE_FALSING_MANAGER_ENABLED =
253             "brightline_falsing_manager_enabled";
254     /**
255      * (float) Maximum fraction of the screen required to qualify as a real swipe.
256      */
257     public static final String BRIGHTLINE_FALSING_DISTANCE_SCREEN_FRACTION_MAX_DISTANCE =
258             "brightline_falsing_distance_screen_fraction_max_distance";
259 
260     /**
261      * (float) Multiplier for swipe velocity to convert it to pixels for a fling.
262      */
263     public static final String BRIGHTLINE_FALSING_DISTANCE_VELOCITY_TO_DISTANCE =
264             "brightline_falsing_distance_velcoity_to_distance";
265 
266     /**
267      * (float) How far, in inches, must a fling travel horizontally to qualify as intentional.
268      */
269     public static final String BRIGHTLINE_FALSING_DISTANCE_HORIZONTAL_FLING_THRESHOLD_IN =
270             "brightline_falsing_distance_horizontal_fling_threshold_in";
271 
272     /**
273      * (float) Maximum fraction of the screen required to qualify as a real swipe.
274      */
275     public static final String BRIGHTLINE_FALSING_DISTANCE_VERTICAL_FLING_THRESHOLD_IN =
276             "brightline_falsing_distance_vertical_fling_threshold_in";
277 
278     /**
279      * (float) How far, in inches, must a continuous swipe travel horizontally to be intentional.
280      */
281     public static final String BRIGHTLINE_FALSING_DISTANCE_HORIZONTAL_SWIPE_THRESHOLD_IN =
282             "brightline_falsing_distance_horizontal_swipe_threshold_in";
283 
284     /**
285      * (float) How far, in inches, must a continuous swipe travel vertically to be intentional.
286      */
287     public static final String BRIGHTLINE_FALSING_DISTANCE_VERTICAL_SWIPE_THRESHOLD_IN =
288             "brightline_falsing_distance_horizontal_swipe_threshold_in";
289 
290     /**
291      * (float) Percentage of swipe with the proximity sensor covered that triggers a higher
292      * swipe distance requirement.
293      */
294     public static final String BRIGHTLINE_FALSING_PROXIMITY_PERCENT_COVERED_THRESHOLD =
295             "brightline_falsing_proximity_percent_covered_threshold";
296 
297     /**
298      * (float) Angle, in radians, that a swipe can vary from horizontal and sill be intentional.
299      */
300     public static final String BRIGHTLINE_FALSING_DIAGONAL_HORIZONTAL_ANGLE_RANGE =
301             "brightline_falsing_diagonal_horizontal_angle_range";
302 
303     /**
304      * (float) Angle, in radians, that a swipe can vary from vertical and sill be intentional.
305      */
306     public static final String BRIGHTLINE_FALSING_DIAGONAL_VERTICAL_ANGLE_RANGE =
307             "brightline_falsing_diagonal_horizontal_angle_range";
308 
309     /**
310      * (float) Distance, in inches, that a swipe is allowed to vary in the horizontal direction for
311      * horizontal swipes.
312      */
313     public static final String BRIGHTLINE_FALSING_ZIGZAG_X_PRIMARY_DEVIANCE =
314             "brightline_falsing_zigzag_x_primary_deviance";
315 
316     /**
317      * (float) Distance, in inches, that a swipe is allowed to vary in the vertical direction for
318      * vertical swipes.
319      */
320     public static final String BRIGHTLINE_FALSING_ZIGZAG_Y_PRIMARY_DEVIANCE =
321             "brightline_falsing_zigzag_y_primary_deviance";
322 
323     /**
324      * (float) Distance, in inches, that a swipe is allowed to vary in the horizontal direction for
325      * horizontal swipes.
326      */
327     public static final String BRIGHTLINE_FALSING_ZIGZAG_X_SECONDARY_DEVIANCE =
328             "brightline_falsing_zigzag_x_secondary_deviance";
329 
330     /**
331      * (float) Distance, in inches, that a swipe is allowed to vary in the vertical direction for
332      * vertical swipes.
333      */
334     public static final String BRIGHTLINE_FALSING_ZIGZAG_Y_SECONDARY_DEVIANCE =
335             "brightline_falsing_zigzag_y_secondary_deviance";
336 
337 
338     // Flags related to screenshots
339 
340     /**
341      * (boolean) Whether screenshot flow going to the corner (instead of shown in a notification)
342      * is enabled.
343      */
344     public static final String SCREENSHOT_CORNER_FLOW = "enable_screenshot_corner_flow";
345 
346     /**
347      * (boolean) Whether scrolling screenshots are enabled.
348      */
349     public static final String SCREENSHOT_SCROLLING_ENABLED = "enable_screenshot_scrolling";
350 
351     // Flags related to Nav Bar
352 
353     /**
354      * (boolean) Whether to force the Nav Bar handle to remain opaque.
355      */
356     public static final String NAV_BAR_HANDLE_FORCE_OPAQUE = "nav_bar_handle_force_opaque";
357 
358     /**
359      * (boolean) Whether to force the Nav Bar handle to remain visible over the lockscreen.
360      */
361     public static final String NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN =
362             "nav_bar_handle_show_over_lockscreen";
363 
364     /**
365      * (int) Timeout threshold, in millisecond, that Sharesheet waits for direct share targets.
366      */
367     public static final String SHARE_SHEET_DIRECT_SHARE_TIMEOUT =
368             "share_sheet_direct_share_timeout";
369 
370     /**
371      * (boolean) Whether append direct share on Sharesheet is enabled.
372      */
373     public static final String APPEND_DIRECT_SHARE_ENABLED = "append_direct_share_enabled";
374 
375     /**
376      * (boolean) Whether ChooserTargets ranking on Sharesheet is enabled.
377      */
378     public static final String CHOOSER_TARGET_RANKING_ENABLED = "chooser_target_ranking_enabled";
379 
380     /**
381      * (boolean) Whether to enable user-drag resizing for PIP.
382      */
383     public static final String PIP_USER_RESIZE = "pip_user_resize";
384 
385     /**
386      * (float) Bottom height in DP for Back Gesture.
387      */
388     public static final String BACK_GESTURE_BOTTOM_HEIGHT = "back_gesture_bottom_height";
389 
390     /**
391      * (float) Edge width in DP where touch down is allowed for Back Gesture.
392      */
393     public static final String BACK_GESTURE_EDGE_WIDTH = "back_gesture_edge_width";
394 
395     /**
396      * (float) Slop multiplier for Back Gesture.
397      */
398     public static final String BACK_GESTURE_SLOP_MULTIPLIER = "back_gesture_slop_multiplier";
399 
SystemUiDeviceConfigFlags()400     private SystemUiDeviceConfigFlags() {
401     }
402 }
403