• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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.server.wm.app;
18 
19 import android.content.ComponentName;
20 import android.server.wm.TestJournalProvider;
21 import android.server.wm.component.ComponentsBase;
22 
23 public class Components extends ComponentsBase {
24     public static final ComponentName ALT_LAUNCHING_ACTIVITY = component("AltLaunchingActivity");
25     public static final ComponentName ALWAYS_FOCUSABLE_PIP_ACTIVITY =
26             component("AlwaysFocusablePipActivity");
27     public static final ComponentName ANIMATION_TEST_ACTIVITY = component("AnimationTestActivity");
28     public static final ComponentName ASSISTANT_ACTIVITY = component("AssistantActivity");
29     public static final ComponentName BOTTOM_ACTIVITY = component("BottomActivity");
30     public static final ComponentName BOTTOM_NON_RESIZABLE_ACTIVITY = component("BottomNonResizableActivity");
31     public static final ComponentName BOTTOM_LEFT_LAYOUT_ACTIVITY =
32             component("BottomLeftLayoutActivity");
33     public static final ComponentName BOTTOM_RIGHT_LAYOUT_ACTIVITY =
34             component("BottomRightLayoutActivity");
35     public static final ComponentName BROADCAST_RECEIVER_ACTIVITY =
36             component("BroadcastReceiverActivity");
37     public static final ComponentName DIALOG_WHEN_LARGE_ACTIVITY =
38             component("DialogWhenLargeActivity");
39     public static final ComponentName DISMISS_KEYGUARD_ACTIVITY =
40             component("DismissKeyguardActivity");
41     public static final ComponentName DISMISS_KEYGUARD_METHOD_ACTIVITY =
42             component("DismissKeyguardMethodActivity");
43     public static final ComponentName DOCKED_ACTIVITY = component("DockedActivity");
44     /**
45      * This activity is an alias activity pointing {@link TrampolineActivity}
46      * in AndroidManifest.xml
47      */
48     public static final ComponentName ENTRY_POINT_ALIAS_ACTIVITY =
49             component("EntryPointAliasActivity");
50     public static final ComponentName FONT_SCALE_ACTIVITY = component("FontScaleActivity");
51     public static final ComponentName FONT_SCALE_NO_RELAUNCH_ACTIVITY =
52             component("FontScaleNoRelaunchActivity");
53     public static final ComponentName FREEFORM_ACTIVITY = component("FreeformActivity");
54     public static final ComponentName HOST_ACTIVITY = component("HostActivity");
55     public static final ComponentName HIDE_OVERLAY_WINDOWS_ACTIVITY =
56             component("HideOverlayWindowsActivity");
57     public static final ComponentName KEYGUARD_LOCK_ACTIVITY = component("KeyguardLockActivity");
58     public static final ComponentName LANDSCAPE_ORIENTATION_ACTIVITY =
59             component("LandscapeOrientationActivity");
60     public static final ComponentName LAUNCH_ASSISTANT_ACTIVITY_FROM_SESSION =
61             component("LaunchAssistantActivityFromSession");
62     public static final ComponentName LAUNCH_ASSISTANT_ACTIVITY_INTO_STACK  =
63             component("LaunchAssistantActivityIntoAssistantStack");
64     public static final ComponentName LAUNCH_ENTER_PIP_ACTIVITY =
65             component("LaunchEnterPipActivity");
66     public static final ComponentName LAUNCH_INTO_PINNED_STACK_PIP_ACTIVITY =
67             component("LaunchIntoPinnedStackPipActivity");
68     public static final ComponentName LAUNCH_PIP_ON_PIP_ACTIVITY =
69             component("LaunchPipOnPipActivity");
70     public static final ComponentName LAUNCHING_ACTIVITY = component("LaunchingActivity");
71     public static final ComponentName LOG_CONFIGURATION_ACTIVITY =
72             component("LogConfigurationActivity");
73     public static final ComponentName MOVE_TASK_TO_BACK_ACTIVITY =
74             component("MoveTaskToBackActivity");
75     public static final ComponentName NIGHT_MODE_ACTIVITY = component("NightModeActivity");
76     public static final ComponentName NO_DISPLAY_ACTIVITY = component("NoDisplayActivity");
77     public static final ComponentName NO_HISTORY_ACTIVITY = component("NoHistoryActivity");
78     public static final ComponentName NO_HISTORY_ACTIVITY2 = component("NoHistoryActivity2");
79     public static final ComponentName NO_RELAUNCH_ACTIVITY = component("NoRelaunchActivity");
80     public static final ComponentName NON_RESIZEABLE_ACTIVITY = component("NonResizeableActivity");
81     public static final ComponentName PRESENTATION_ACTIVITY = component("PresentationActivity");
82     public static final ComponentName PIP_ACTIVITY = component("PipActivity");
83     public static final ComponentName PIP_ACTIVITY2 = component("PipActivity2");
84     public static final ComponentName PIP_ACTIVITY_WITH_MINIMAL_SIZE = component(
85             "PipActivityWithMinimalSize");
86     public static final ComponentName PIP_ACTIVITY_WITH_TINY_MINIMAL_SIZE = component(
87             "PipActivityWithTinyMinimalSize");
88     public static final ComponentName PIP_ACTIVITY_WITH_SAME_AFFINITY =
89             component("PipActivityWithSameAffinity");
90     public static final ComponentName PIP_ON_STOP_ACTIVITY = component("PipOnStopActivity");
91     public static final ComponentName LAUNCH_INTO_PIP_HOST_ACTIVITY =
92             component("LaunchIntoPipHostActivity");
93     public static final ComponentName LAUNCH_INTO_PIP_CONTAINER_ACTIVITY =
94             component("LaunchIntoPipContainerActivity");
95     public static final ComponentName PORTRAIT_ORIENTATION_ACTIVITY =
96             component("PortraitOrientationActivity");
97     public static final ComponentName RECURSIVE_ACTIVITY = component("RecursiveActivity");
98     public static final ComponentName REPORT_FULLY_DRAWN_ACTIVITY =
99             component("ReportFullyDrawnActivity");
100     public static final ComponentName RESIZEABLE_ACTIVITY = component("ResizeableActivity");
101     public static final ComponentName RESUME_WHILE_PAUSING_ACTIVITY =
102             component("ResumeWhilePausingActivity");
103     public static final ComponentName SHOW_WHEN_LOCKED_ACTIVITY =
104             component("ShowWhenLockedActivity");
105     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_IME_ACTIVITY =
106             component("ShowWhenLockedAttrImeActivity");
107     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_ACTIVITY =
108             component("ShowWhenLockedAttrActivity");
109     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_ROTATION_ACTIVITY =
110             component("ShowWhenLockedAttrRotationActivity");
111     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_REMOVE_ATTR_ACTIVITY =
112             component("ShowWhenLockedAttrRemoveAttrActivity");
113     public static final ComponentName INHERIT_SHOW_WHEN_LOCKED_ADD_ACTIVITY =
114             component("InheritShowWhenLockedAddActivity");
115     public static final ComponentName INHERIT_SHOW_WHEN_LOCKED_ATTR_ACTIVITY =
116             component("InheritShowWhenLockedAttrActivity");
117     public static final ComponentName INHERIT_SHOW_WHEN_LOCKED_REMOVE_ACTIVITY =
118             component("InheritShowWhenLockedRemoveActivity");
119     public static final ComponentName NO_INHERIT_SHOW_WHEN_LOCKED_ATTR_ACTIVITY =
120             component("NoInheritShowWhenLockedAttrActivity");
121     public static final ComponentName SHOW_WHEN_LOCKED_DIALOG_ACTIVITY =
122             component("ShowWhenLockedDialogActivity");
123     public static final ComponentName SHOW_WHEN_LOCKED_TRANSLUCENT_ACTIVITY =
124             component("ShowWhenLockedTranslucentActivity");
125     public static final ComponentName SHOW_WHEN_LOCKED_WITH_DIALOG_ACTIVITY =
126             component("ShowWhenLockedWithDialogActivity");
127     public static final ComponentName SINGLE_INSTANCE_ACTIVITY =
128             component("SingleInstanceActivity");
129     public static final ComponentName HOME_ACTIVITY = component("HomeActivity");
130     public static final ComponentName SECONDARY_HOME_ACTIVITY = component("SecondaryHomeActivity");
131     public static final ComponentName UI_SCALING_TEST_ACTIVITY =
132             component("UiScalingTestActivity");
133     public static final ComponentName SINGLE_HOME_ACTIVITY = component("SingleHomeActivity");
134     public static final ComponentName SINGLE_SECONDARY_HOME_ACTIVITY =
135             component("SingleSecondaryHomeActivity");
136     public static final ComponentName SINGLE_TASK_ACTIVITY = component("SingleTaskActivity");
137     public static final ComponentName SINGLE_TOP_ACTIVITY = component("SingleTopActivity");
138     public static final ComponentName SLOW_CREATE_ACTIVITY = component("SlowCreateActivity");
139     public static final ComponentName SPLASHSCREEN_ACTIVITY = component("SplashscreenActivity");
140     public static final ComponentName DISABLE_PREVIEW_ACTIVITY =
141             component("DisablePreviewActivity");
142     public static final ComponentName SHOW_WHEN_LOCKED_NO_PREVIEW_ACTIVITY =
143             component("ShowWhenLockedNoPreviewActivity");
144     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_NO_PREVIEW_ACTIVITY =
145             component("ShowWhenLockedAttrNoPreviewActivity");
146     public static final ComponentName SHOW_WHEN_LOCKED_ATTR_REMOVE_ATTR_NO_PREVIEW_ACTIVITY =
147             component("ShowWhenLockedAttrRemoveAttrNoPreviewActivity");
148     public static final ComponentName SHOW_WHEN_LOCKED_WITH_DIALOG_NO_PREVIEW_ACTIVITY =
149             component("ShowWhenLockedWithDialogNoPreviewActivity");
150 
151     public static final ComponentName TEST_ACTIVITY = component("TestActivity");
152     public static final ComponentName TOAST_ACTIVITY = component("ToastActivity");
153     public static final ComponentName TOP_ACTIVITY = component("TopActivity");
154     public static final ComponentName TOP_NON_RESIZABLE_ACTIVITY = component("TopNonResizableActivity");
155     public static final ComponentName TOP_NON_RESIZABLE_WALLPAPER_ACTIVITY = component("TopNonResizableWallpaperActivity");
156     public static final ComponentName TOP_WALLPAPER_ACTIVITY = component("TopWallpaperActivity");
157     public static final ComponentName TEST_ACTIVITY_WITH_SAME_AFFINITY =
158             component("TestActivityWithSameAffinity");
159     public static final ComponentName TEST_LIVE_WALLPAPER_SERVICE = component("LiveWallpaper");
160     public static final ComponentName TOP_LEFT_LAYOUT_ACTIVITY = component("TopLeftLayoutActivity");
161     public static final ComponentName TOP_RIGHT_LAYOUT_ACTIVITY =
162             component("TopRightLayoutActivity");
163     public static final ComponentName TRANSLUCENT_ACTIVITY = component("TranslucentActivity");
164     public static final ComponentName TRANSLUCENT_ASSISTANT_ACTIVITY =
165             component("TranslucentAssistantActivity");
166     public static final ComponentName TRANSLUCENT_TOP_ACTIVITY =
167             component("TranslucentTopActivity");
168     public static final ComponentName TRANSLUCENT_TOP_WALLPAPER_ACTIVITY =
169             component("TranslucentTopWallpaperActivity");
170     public static final ComponentName TRANSLUCENT_TOP_NON_RESIZABLE_ACTIVITY =
171         component("TranslucentTopNonResizableActivity");
172     public static final ComponentName TRANSLUCENT_TEST_ACTIVITY =
173             component("TranslucentTestActivity");
174     public static final ComponentName TURN_SCREEN_ON_ACTIVITY = component("TurnScreenOnActivity");
175     public static final ComponentName TURN_SCREEN_ON_ATTR_ACTIVITY =
176             component("TurnScreenOnAttrActivity");
177     public static final ComponentName TURN_SCREEN_ON_ATTR_DISMISS_KEYGUARD_ACTIVITY =
178             component("TurnScreenOnAttrDismissKeyguardActivity");
179     public static final ComponentName TURN_SCREEN_ON_ATTR_REMOVE_ATTR_ACTIVITY =
180             component("TurnScreenOnAttrRemoveAttrActivity");
181     public static final ComponentName TURN_SCREEN_ON_DISMISS_KEYGUARD_ACTIVITY =
182             component("TurnScreenOnDismissKeyguardActivity");
183     public static final ComponentName TURN_SCREEN_ON_SHOW_ON_LOCK_ACTIVITY =
184             component("TurnScreenOnShowOnLockActivity");
185     public static final ComponentName TURN_SCREEN_ON_SINGLE_TASK_ACTIVITY =
186             component("TurnScreenOnSingleTaskActivity");
187     public static final ComponentName TURN_SCREEN_ON_WITH_RELAYOUT_ACTIVITY =
188             component("TurnScreenOnWithRelayoutActivity");
189     public static final ComponentName UNRESPONSIVE_ACTIVITY = component("UnresponsiveActivity");
190     public static final ComponentName VIRTUAL_DISPLAY_ACTIVITY =
191             component("VirtualDisplayActivity");
192     public static final ComponentName VR_TEST_ACTIVITY = component("VrTestActivity");
193     public static final ComponentName WALLPAPAER_ACTIVITY = component("WallpaperActivity");
194     public static final ComponentName LAUNCH_TEST_ON_DESTROY_ACTIVITY = component(
195             "LaunchTestOnDestroyActivity");
196     public static final ComponentName ALIAS_TEST_ACTIVITY = component("AliasTestActivity");
197     public static final ComponentName DISPLAY_ACCESS_CHECK_EMBEDDING_ACTIVITY = component(
198             "DisplayAccessCheckEmbeddingActivity");
199     public static final ComponentName MAX_ASPECT_RATIO_ACTIVITY =
200             component("MaxAspectRatioActivity");
201     public static final ComponentName MAX_ASPECT_RATIO_RESIZABLE_ACTIVITY =
202             component("MaxAspectRatioResizableActivity");
203     public static final ComponentName MAX_ASPECT_RATIO_UNSET_ACTIVITY =
204             component("MaxAspectRatioUnsetActivity");
205     public static final ComponentName META_DATA_MAX_ASPECT_RATIO_ACTIVITY =
206             component("MetaDataMaxAspectRatioActivity");
207     public static final ComponentName MIN_ASPECT_RATIO_ACTIVITY =
208             component("MinAspectRatioActivity");
209     public static final ComponentName MIN_ASPECT_RATIO_LANDSCAPE_ACTIVITY =
210             component("MinAspectRatioLandscapeActivity");
211     public static final ComponentName MIN_ASPECT_RATIO_PORTRAIT_ACTIVITY =
212             component("MinAspectRatioPortraitActivity");
213     public static final ComponentName MIN_ASPECT_RATIO_UNSET_ACTIVITY =
214             component("MinAspectRatioUnsetActivity");
215 
216     public static final ComponentName ASSISTANT_VOICE_INTERACTION_SERVICE =
217             component("AssistantVoiceInteractionService");
218 
219     public static final ComponentName LAUNCH_BROADCAST_RECEIVER =
220             component("LaunchBroadcastReceiver");
221 
222     public static final ComponentName CLICKABLE_TOAST_ACTIVITY =
223             component("ClickableToastActivity");
224 
225     public static class LaunchBroadcastReceiver {
226         public static final String LAUNCH_BROADCAST_ACTION =
227                 "android.server.wm.app.LAUNCH_BROADCAST_ACTION";
228 
229         public static final String ACTION_TEST_ACTIVITY_START =
230                 "android.server.wm.app.ACTION_TEST_ACTIVITY_START";
231         public static final String EXTRA_COMPONENT_NAME = "component_name";
232         public static final String EXTRA_TARGET_DISPLAY = "target_display";
233     }
234 
235     public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY =
236             component("SingleTaskInstanceDisplayActivity");
237     public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY2 =
238             component("SingleTaskInstanceDisplayActivity2");
239     public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY3 =
240             component("SingleTaskInstanceDisplayActivity3");
241 
242     public static final ComponentName MPP_ACTIVITY =
243             component("MinimalPostProcessingActivity");
244 
245     public static final ComponentName MPP_ACTIVITY2 =
246             component("MinimalPostProcessingActivity2");
247 
248     public static final ComponentName MPP_ACTIVITY3 =
249             component("MinimalPostProcessingManifestActivity");
250 
251     public static final ComponentName POPUP_MPP_ACTIVITY =
252             component("PopupMinimalPostProcessingActivity");
253 
254     public static final ComponentName CRASHING_ACTIVITY =
255             component("CrashingActivity");
256 
257     public static final ComponentName HANDLE_SPLASH_SCREEN_EXIT_ACTIVITY =
258             component("HandleSplashScreenExitActivity");
259     public static final ComponentName SPLASH_SCREEN_REPLACE_ICON_ACTIVITY =
260             component("SplashScreenReplaceIconActivity");
261     public static final ComponentName SPLASH_SCREEN_REPLACE_THEME_ACTIVITY =
262             component("SplashScreenReplaceThemeActivity");
263     public static final ComponentName SPLASH_SCREEN_STYLE_THEME_ACTIVITY =
264             component("SplashScreenStyleThemeActivity");
265 
266     public static final ComponentName TEST_DREAM_SERVICE =
267             component("TestDream");
268 
269     public static final ComponentName TEST_STUBBORN_DREAM_SERVICE =
270             component("TestStubbornDream");
271 
272     public static final ComponentName OVERLAY_TEST_SERVICE =
273             component("OverlayTestService");
274 
275     public static final ComponentName BACKGROUND_IMAGE_ACTIVITY =
276             component("BackgroundImageActivity");
277 
278     public static final ComponentName BLUR_ACTIVITY =
279             component("BlurActivity");
280 
281     public static final ComponentName BLUR_ATTRIBUTES_ACTIVITY =
282             component("BlurAttributesActivity");
283 
284     public static final ComponentName BAD_BLUR_ACTIVITY =
285             component("BadBlurActivity");
286 
287     public static final ComponentName KEEP_CLEAR_RECTS_ACTIVITY =
288             component("KeepClearRectsActivity");
289 
290     public static final ComponentName KEEP_CLEAR_RECTS_ACTIVITY2 =
291             component("KeepClearRectsActivity2");
292 
293     /**
294      * The keys are used for {@link TestJournalProvider} when testing starting window.
295      */
296     public static class TestStartingWindowKeys {
297         public static final String HANDLE_SPLASH_SCREEN_EXIT = "HandleSplashScreenExitActivity";
298         public static final String REPLACE_ICON_EXIT = "SplashScreenReplaceIconActivity";
299         public static final String RECEIVE_SPLASH_SCREEN_EXIT = "receive_splash_screen_exit";
300         public static final String CONTAINS_CENTER_VIEW = "contains_center_view";
301         public static final String CONTAINS_BRANDING_VIEW = "contains_branding_view";
302         public static final String ICON_BACKGROUND_COLOR = "icon_background_color";
303         public static final String ICON_ANIMATION_DURATION = "icon_animation_duration";
304         public static final String ICON_ANIMATION_START = "icon_animation_start";
305         public static final String CENTER_VIEW_IS_SURFACE_VIEW = "center_view_is_surface_view";
306 
307         public static final String REQUEST_HANDLE_EXIT_ON_CREATE = "handle_exit_onCreate";
308         public static final String REQUEST_HANDLE_EXIT_ON_RESUME = "handle_exit_onResume";
309         public static final String CANCEL_HANDLE_EXIT = "cancel_handle_exit";
310 
311         public static final String REQUEST_SET_NIGHT_MODE_ON_CREATE = "night_mode_onCreate";
312         public static final String GET_NIGHT_MODE_ACTIVITY_CHANGED = "get_night_mode_activity";
313         public static final String DELAY_RESUME = "delay_resume";
314         public static final String OVERRIDE_THEME_ENABLED = "override_theme_enabled";
315         public static final String OVERRIDE_THEME_COLOR = "override_theme_color";
316         public static final String OVERRIDE_THEME_COMPONENT = "override_theme_component";
317         public static final String STYLE_THEME_COMPONENT = "style_theme_component";
318     }
319 
320     /**
321      * The keys are used for {@link TestJournalProvider} when testing wallpaper
322      * component.
323      */
324     public static class TestLiveWallpaperKeys {
325         public static final String COMPONENT = "LiveWallpaper";
326         public static final String ENGINE_CREATED = "engine_created";
327         public static final String ENGINE_DISPLAY_ID = "engine_display_Id";
328     }
329 
330     /**
331      * Action and extra key constants for {@link #TEST_ACTIVITY}.
332      *
333      * TODO(b/73346885): These constants should be in {@link android.server.wm.app.TestActivity}
334      * once the activity is moved to test APK.
335      */
336     public static class TestActivity {
337         // Finishes the activity
338         public static final String TEST_ACTIVITY_ACTION_FINISH_SELF =
339                 "android.server.wm.app.TestActivity.finish_self";
340         // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation}
341         public static final String EXTRA_FIXED_ORIENTATION = "fixed_orientation";
342         public static final String EXTRA_CONFIGURATION = "configuration";
343         public static final String EXTRA_CONFIG_ASSETS_SEQ = "config_assets_seq";
344         public static final String EXTRA_INTENT = "intent";
345         public static final String EXTRA_INTENTS = "intents";
346         public static final String EXTRA_NO_IDLE = "no_idle";
347         public static final String COMMAND_NAVIGATE_UP_TO = "navigate_up_to";
348         public static final String COMMAND_START_ACTIVITY = "start_activity";
349         public static final String COMMAND_START_ACTIVITIES = "start_activities";
350         public static final String EXTRA_OPTION = "option";
351     }
352 
353     /**
354      * Extra key constants for {@link #LAUNCH_ASSISTANT_ACTIVITY_INTO_STACK} and
355      * {@link #LAUNCH_ASSISTANT_ACTIVITY_FROM_SESSION}.
356      *
357      * TODO(b/73346885): These constants should be in
358      * {@link android.server.wm.app.AssistantActivity} once the activity is moved to test APK.
359      */
360     public static class AssistantActivity {
361         // Launches the given activity in onResume
362         public static final String EXTRA_ASSISTANT_LAUNCH_NEW_TASK = "launch_new_task";
363         // Finishes this activity in onResume, this happens after EXTRA_ASSISTANT_LAUNCH_NEW_TASK
364         public static final String EXTRA_ASSISTANT_FINISH_SELF = "finish_self";
365         // Attempts to enter picture-in-picture in onResume
366         public static final String EXTRA_ASSISTANT_ENTER_PIP = "enter_pip";
367         // Display on which Assistant runs
368         public static final String EXTRA_ASSISTANT_DISPLAY_ID = "assistant_display_id";
369     }
370 
371     /**
372      * Extra key constants for {@link android.server.wm.app.BottomActivity}.
373      *
374      * TODO(b/73346885): These constants should be in {@link android.server.wm.app.BottomActivity}
375      * once the activity is moved to test APK.
376      */
377     public static class BottomActivity {
378         public static final String EXTRA_BOTTOM_WALLPAPER = "USE_WALLPAPER";
379         public static final String EXTRA_STOP_DELAY = "STOP_DELAY";
380     }
381 
382     /**
383      * Extra key constants for {@link android.server.wm.app.BroadcastReceiverActivity}.
384      *
385      * TODO(b/73346885): These constants should be in
386      * {@link android.server.wm.app.BroadcastReceiverActivity} once the activity is moved to test APK.
387      */
388     public static class BroadcastReceiverActivity {
389         public static final String ACTION_TRIGGER_BROADCAST = "trigger_broadcast";
390         public static final String EXTRA_DISMISS_KEYGUARD = "dismissKeyguard";
391         public static final String EXTRA_DISMISS_KEYGUARD_METHOD = "dismissKeyguardMethod";
392         public static final String EXTRA_FINISH_BROADCAST = "finish";
393         public static final String EXTRA_MOVE_BROADCAST_TO_BACK = "moveToBack";
394         public static final String EXTRA_BROADCAST_ORIENTATION = "orientation";
395         public static final String EXTRA_CUTOUT_EXISTS = "cutoutExists";
396     }
397 
398     /** Extra key constants for {@link android.server.wm.app.LandscapeOrientationActivity}. */
399     public static class LandscapeOrientationActivity {
400         public static final String EXTRA_APP_CONFIG_INFO = "app_config_info";
401         public static final String EXTRA_CONFIG_INFO_IN_ON_CREATE = "config_info_in_on_create";
402         public static final String EXTRA_DISPLAY_REAL_SIZE = "display_real_size";
403         public static final String EXTRA_SYSTEM_RESOURCES_CONFIG_INFO = "sys_config_info";
404     }
405 
406     /** Extra key constants for {@link android.server.wm.app.FontScaleActivity}. */
407     public static class FontScaleActivity {
408         public static final String EXTRA_FONT_PIXEL_SIZE = "fontPixelSize";
409         public static final String EXTRA_FONT_ACTIVITY_DPI = "fontActivityDpi";
410     }
411 
412     /** Extra key constants for {@link android.server.wm.app.NoHistoryActivity}. */
413     public static class NoHistoryActivity {
414         public static final String EXTRA_SHOW_WHEN_LOCKED = "showWhenLocked";
415     }
416 
417     /** Extra key constants for {@link android.server.wm.app.TurnScreenOnActivity}. */
418     public static class TurnScreenOnActivity {
419         // Turn on screen by window flags or APIs.
420         public static final String EXTRA_USE_WINDOW_FLAGS = "useWindowFlags";
421         public static final String EXTRA_SHOW_WHEN_LOCKED = "useShowWhenLocked";
422         public static final String EXTRA_SLEEP_MS_IN_ON_CREATE = "sleepMsInOnCreate";
423     }
424 
425     /** Extra key constants for {@link android.server.wm.app.MinimalPostProcessingActivity}. */
426     public static class MinimalPostProcessingActivity {
427         // Turn on minimal post processing (if available).
428         public static final String EXTRA_PREFER_MPP = "preferMinimalPostProcessing";
429     }
430 
431     /**
432      *  Logging constants for {@link android.server.wm.app.KeyguardDismissLoggerCallback}.
433      *
434      * TODO(b/73346885): These constants should be in
435      * {@link android.server.wm.app.KeyguardDismissLoggerCallback} once the class is moved to test APK.
436      */
437     public static class KeyguardDismissLoggerCallback {
438         public static final String KEYGUARD_DISMISS_LOG_TAG = "KeyguardDismissLoggerCallback";
439         public static final String ENTRY_ON_DISMISS_CANCELLED = "onDismissCancelled";
440         public static final String ENTRY_ON_DISMISS_ERROR = "onDismissError";
441         public static final String ENTRY_ON_DISMISS_SUCCEEDED = "onDismissSucceeded";
442     }
443 
444     /**
445      * Extra key constants for {@link #LAUNCH_ASSISTANT_ACTIVITY_INTO_STACK}.
446      *
447      * TODO(b/73346885): These constants should be in
448      * {@link android.server.wm.app.LaunchAssistantActivityIntoAssistantStack} once the activity is
449      * moved to test APK.
450      */
451     public static class LaunchAssistantActivityIntoAssistantStack {
452         // Launches the translucent assist activity
453         public static final String EXTRA_ASSISTANT_IS_TRANSLUCENT = "is_translucent";
454     }
455 
456     /**
457      * Extra constants for {@link android.server.wm.app.MoveTaskToBackActivity}.
458      *
459      * TODO(b/73346885): These constants should be in
460      * {@link android.server.wm.app.MoveTaskToBackActivity} once the activity is moved to test APK.
461      */
462     public static class MoveTaskToBackActivity {
463         public static final String EXTRA_FINISH_POINT = "finish_point";
464         public static final String FINISH_POINT_ON_PAUSE = "on_pause";
465         public static final String FINISH_POINT_ON_STOP = "on_stop";
466     }
467 
468     /**
469      * Extra constants for {@link android.server.wm.app.BlurActivity}.
470      */
471     public static class BlurActivity {
472         public static final String EXTRA_NO_BLUR_BACKGROUND_COLOR = "no_blur_background_color";
473         public static final String EXTRA_BACKGROUND_BLUR_RADIUS_PX = "background_blur_radius";
474         public static final String EXTRA_BLUR_BEHIND_RADIUS_PX = "blur_behind_radius";
475     }
476 
477     /**
478      * Action and extra key constants for {@link android.server.wm.app.PipActivity}.
479      *
480      * TODO(b/73346885): These constants should be in {@link android.server.wm.app.PipActivity}
481      * once the activity is moved to test APK.
482      */
483     public static class PipActivity {
484         // Intent action that this activity dynamically registers to enter picture-in-picture
485         public static final String ACTION_ENTER_PIP = "android.server.wm.app.PipActivity.enter_pip";
486         // Intent action that this activity dynamically registers to move itself to the back
487         public static final String ACTION_MOVE_TO_BACK =
488                 "android.server.wm.app.PipActivity.move_to_back";
489         // Intent action that this activity dynamically registers to expand itself.
490         // If EXTRA_SET_ASPECT_RATIO_WITH_DELAY is set, it will also attempt to apply the aspect
491         // ratio after a short delay.
492         public static final String ACTION_EXPAND_PIP =
493                 "android.server.wm.app.PipActivity.expand_pip";
494         // Intent action that this activity dynamically registers to receive update callback.
495         // If EXTRA_SET_PIP_STASH is set, then onPictureInPictureStateChanged will be called
496         // with the value.
497         public static final String ACTION_UPDATE_PIP_STATE =
498                 "android.server.wm.app.PipActivity.update_pip_state";
499         // Intent action that this activity dynamically registers to set requested orientation.
500         // Will apply the orientation to the value set in the EXTRA_FIXED_ORIENTATION extra.
501         public static final String ACTION_SET_REQUESTED_ORIENTATION =
502                 "android.server.wm.app.PipActivity.set_requested_orientation";
503         // Intent action that will finish this activity
504         public static final String ACTION_FINISH = "android.server.wm.app.PipActivity.finish";
505         // Intent action that will request that the activity enters picture-in-picture.
506         public static final String ACTION_ON_PIP_REQUESTED =
507                 "android.server.wm.app.PipActivity.on_pip_requested";
508         // Intent action that will request that the activity initiates launch-into-pip
509         public static final String ACTION_START_LAUNCH_INTO_PIP_CONTAINER =
510                 "android.server.wm.app.LaunchIntoPip.start_container_activity";
511         // Intent action that will request the host activity of launch-into-pip to finish itself
512         public static final String ACTION_FINISH_LAUNCH_INTO_PIP_HOST =
513                 "android.server.wm.app.LaunchIntoPip.finish_host_activity";
514         // Intent action that will request the activity to change the PiP aspect ratio
515         public static final String ACTION_CHANGE_ASPECT_RATIO =
516                 "android.server.wm.app.LaunchIntoPip.change_aspect_ratio";
517         // Intent action that will request the activity to start a new translucent activity
518         public static final String ACTION_LAUNCH_TRANSLUCENT_ACTIVITY =
519                 "android.server.wm.app.LaunchIntoPip.launch_translucent_activity";
520 
521         // Adds an assertion that we do not ever get onStop() before we enter picture in picture
522         public static final String EXTRA_ASSERT_NO_ON_STOP_BEFORE_PIP =
523                 "assert_no_on_stop_before_pip";
524         // Calls enterPictureInPicture() on creation
525         public static final String EXTRA_ENTER_PIP = "enter_pip";
526         // Used with EXTRA_AUTO_ENTER_PIP, value specifies the aspect ratio to enter PIP with
527         public static final String EXTRA_ENTER_PIP_ASPECT_RATIO_NUMERATOR =
528                 "enter_pip_aspect_ratio_numerator";
529         // Used with EXTRA_AUTO_ENTER_PIP, value specifies the aspect ratio to enter PIP with
530         public static final String EXTRA_ENTER_PIP_ASPECT_RATIO_DENOMINATOR =
531                 "enter_pip_aspect_ratio_denominator";
532         // Calls requestAutoEnterPictureInPicture() with the value provided
533         public static final String EXTRA_ENTER_PIP_ON_PAUSE = "enter_pip_on_pause";
534         // Calls requestAutoEnterPictureInPicture() with the value provided
535         public static final String EXTRA_ENTER_PIP_ON_USER_LEAVE_HINT =
536                 "enter_pip_on_user_leave_hint";
537         // Calls requestAutoEnterPictureInPicture() with the value provided
538         public static final String EXTRA_ENTER_PIP_ON_PIP_REQUESTED =
539                 "enter_pip_on_pip_requested";
540         // Calls enterPictureInPictureMode when activity receives onBackPressed
541         public static final String EXTRA_ENTER_PIP_ON_BACK_PRESSED =
542                 "enter_pip_on_back_pressed";
543         public static final String EXTRA_EXPANDED_PIP_ASPECT_RATIO_NUMERATOR =
544                 "expanded_pip_numerator";
545         public static final String EXTRA_EXPANDED_PIP_ASPECT_RATIO_DENOMINATOR =
546                 "expanded_pip_denomenator";
547         // Sets auto PIP allowed on the activity picture-in-picture params.
548         public static final String EXTRA_ALLOW_AUTO_PIP = "enter_pip_auto_pip_allowed";
549         // Sets seamless resize enabled on the activity picture-in-picture params.
550         public static final String EXTRA_IS_SEAMLESS_RESIZE_ENABLED =
551                 "enter_pip_is_seamless_resize_enabled";
552         // Sets the given title on the activity picture-in-picture params.
553         public static final String EXTRA_TITLE = "set_pip_title";
554         // Sets the given subtitle on the activity picture-in-picture params.
555         public static final String EXTRA_SUBTITLE = "set_pip_subtitle";
556         // Finishes the activity at the end of onResume (after EXTRA_START_ACTIVITY is handled)
557         public static final String EXTRA_FINISH_SELF_ON_RESUME = "finish_self_on_resume";
558         // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation}
559         public static final String EXTRA_PIP_ORIENTATION = "fixed_orientation";
560         // The amount to delay to artificially introduce in onPause()
561         // (before EXTRA_ENTER_PIP_ON_PAUSE is processed)
562         public static final String EXTRA_ON_PAUSE_DELAY = "on_pause_delay";
563         // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value
564         public static final String EXTRA_SET_ASPECT_RATIO_DENOMINATOR =
565                 "set_aspect_ratio_denominator";
566         // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value
567         public static final String EXTRA_SET_ASPECT_RATIO_NUMERATOR = "set_aspect_ratio_numerator";
568         // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value with a
569         // fixed delay
570         public static final String EXTRA_SET_ASPECT_RATIO_WITH_DELAY_NUMERATOR =
571                 "set_aspect_ratio_with_delay_numerator";
572         // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value with a
573         // fixed delay
574         public static final String EXTRA_SET_ASPECT_RATIO_WITH_DELAY_DENOMINATOR =
575                 "set_aspect_ratio_with_delay_denominator";
576         // Calls onPictureInPictureStateChange with the state specified in the value
577         public static final String EXTRA_SET_PIP_STASHED = "set_pip_stashed";
578         // Shows this activity over the keyguard
579         public static final String EXTRA_SHOW_OVER_KEYGUARD = "show_over_keyguard";
580         // Starts the activity (component name) provided by the value at the end of onCreate
581         public static final String EXTRA_START_ACTIVITY = "start_activity";
582         // Adds a click listener to finish this activity when it is clicked
583         public static final String EXTRA_TAP_TO_FINISH = "tap_to_finish";
584         // Dismiss keyguard when activity show.
585         public static final String EXTRA_DISMISS_KEYGUARD = "dismiss_keyguard";
586         // Number of custom actions should be set onto PictureInPictureParams
587         public static final String EXTRA_NUMBER_OF_CUSTOM_ACTIONS = "number_of_custom_actions";
588         // Whether a custom close action should be set in the PictureInPictureParams.
589         public static final String EXTRA_CLOSE_ACTION = "set_pip_close_action";
590         // Supplied when a callback is expected for pip
591         public static final String EXTRA_SET_PIP_CALLBACK = "set_pip_callback";
592         // Result key for obtaining the PictureInPictureUiState#isStashed result
593         public static final String UI_STATE_STASHED_RESULT = "ui_state_stashed_result";
594     }
595 
596     /**
597      * Extra key constants for {@link android.server.wm.app.TopActivity} and
598      * {@link TranslucentTopActivity}.
599      *
600      * TODO(b/73346885): These constants should be in {@link android.server.wm.app.TopActivity}
601      * once the activity is moved to test APK.
602      */
603     public static class TopActivity {
604         public static final String EXTRA_FINISH_DELAY = "FINISH_DELAY";
605         public static final String EXTRA_FINISH_IN_ON_CREATE = "FINISH_IN_ON_CREATE";
606         public static final String ACTION_CONVERT_TO_TRANSLUCENT = "convert_to_translucent";
607         public static final String ACTION_CONVERT_FROM_TRANSLUCENT = "convert_from_translucent";
608     }
609 
610     public static class UnresponsiveActivity {
611         public static final String EXTRA_ON_CREATE_DELAY_MS = "ON_CREATE_DELAY_MS";
612         public static final String EXTRA_DELAY_UI_THREAD_MS = "DELAY_UI_THREAD_MS";
613         public static final String EXTRA_ON_KEYDOWN_DELAY_MS = "ON_KEYDOWN_DELAY_MS";
614         public static final String EXTRA_ON_MOTIONEVENT_DELAY_MS = "ON_MOTIONEVENT_DELAY_MS";
615         public static final String PROCESS_NAME = ".unresponsive_activity_process";
616     }
617 
618     public static class RenderService {
619         public static final String PROCESS_NAME = ".render_process";
620         public static final String EXTRAS_BUNDLE = "EXTRAS_BUNDLE";
621         public static final String EXTRAS_DISPLAY_ID = "EXTRAS_DISPLAY_ID";
622         public static final String EXTRAS_HOST_TOKEN = "EXTRAS_HOST_TOKEN";
623         public static final String BROADCAST_EMBED_CONTENT =
624                 "android.server.wm.app.RenderService.EMBED_CONTENT";
625         public static final String EXTRAS_SURFACE_PACKAGE = "surfacePackage";
626     }
627 
628     /**
629      * Extra key constants for {@link android.server.wm.app.VirtualDisplayActivity}.
630      *
631      * TODO(b/73346885): These constants should be in
632      * {@link android.server.wm.app.VirtualDisplayActivity} once the activity is moved to test APK.
633      */
634     public static class VirtualDisplayActivity {
635         public static final String VIRTUAL_DISPLAY_PREFIX = "HostedVirtualDisplay";
636         public static final String KEY_CAN_SHOW_WITH_INSECURE_KEYGUARD =
637                 "can_show_with_insecure_keyguard";
638         public static final String KEY_COMMAND = "command";
639         public static final String KEY_COUNT = "count";
640         public static final String KEY_DENSITY_DPI = "density_dpi";
641         public static final String KEY_PUBLIC_DISPLAY = "public_display";
642         public static final String KEY_RESIZE_DISPLAY = "resize_display";
643         public static final String KEY_SHOW_SYSTEM_DECORATIONS = "show_system_decorations";
644         public static final String KEY_PRESENTATION_DISPLAY = "presentation_display";
645         // Value constants of {@link #KEY_COMMAND}.
646         public static final String COMMAND_CREATE_DISPLAY = "create_display";
647         public static final String COMMAND_DESTROY_DISPLAY = "destroy_display";
648         public static final String COMMAND_RESIZE_DISPLAY = "resize_display";
649     }
650 
651     public static class ClickableToastActivity {
652         public static final String ACTION_TOAST_DISPLAYED = "toast_displayed";
653         public static final String ACTION_TOAST_TAP_DETECTED = "toast_tap_detected";
654     }
655 
656     public static class PresentationActivity {
657         public static final String KEY_DISPLAY_ID = "display_id";
658     }
659 
660     public static class LaunchingActivity {
661         public static final String KEY_FINISH_BEFORE_LAUNCH = "finish_before_launch";
662     }
663 
664     public static class OverlayTestService {
665         public static final String EXTRA_LAYOUT_PARAMS = "layout_params";
666     }
667 
668     public static class Notifications {
669         public static final String CHANNEL_MAIN = "main";
670         public static final int ID_OVERLAY_TEST_SERVICE = 1;
671     }
672 
673     public static class HideOverlayWindowsActivity {
674         public static final String ACTION = "hide_action";
675         public static final String PONG = "pong_action";
676         public static final String SHOULD_HIDE = "should_hide";
677     }
678 
679     public static class BackgroundActivityTransition {
680         public static final String TRANSITION_REQUESTED = "transition_requested";
681     }
682 
683     /**
684      * Extra constants for {@link android.server.wm.app.KeepClearRectsActivity}.
685      */
686     public static class KeepClearRectsActivity {
687         public static final String EXTRA_KEEP_CLEAR_RECTS = "keep_clear_rects";
688     }
689 
component(String className)690     private static ComponentName component(String className) {
691         return component(Components.class, className);
692     }
693 
getPackageName()694     public static String getPackageName() {
695         return getPackageName(Components.class);
696     }
697 }
698