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