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