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