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 196 public static final ComponentName ASSISTANT_VOICE_INTERACTION_SERVICE = 197 component("AssistantVoiceInteractionService"); 198 199 public static final ComponentName LAUNCH_BROADCAST_RECEIVER = 200 component("LaunchBroadcastReceiver"); 201 202 public static final ComponentName CLICKABLE_TOAST_ACTIVITY = 203 component("ClickableToastActivity"); 204 205 public static class LaunchBroadcastReceiver { 206 public static final String LAUNCH_BROADCAST_ACTION = 207 "android.server.wm.app.LAUNCH_BROADCAST_ACTION"; 208 209 public static final String ACTION_TEST_ACTIVITY_START = 210 "android.server.wm.app.ACTION_TEST_ACTIVITY_START"; 211 public static final String EXTRA_COMPONENT_NAME = "component_name"; 212 public static final String EXTRA_TARGET_DISPLAY = "target_display"; 213 } 214 215 public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY = 216 component("SingleTaskInstanceDisplayActivity"); 217 public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY2 = 218 component("SingleTaskInstanceDisplayActivity2"); 219 public static final ComponentName SINGLE_TASK_INSTANCE_DISPLAY_ACTIVITY3 = 220 component("SingleTaskInstanceDisplayActivity3"); 221 222 public static final ComponentName MPP_ACTIVITY = 223 component("MinimalPostProcessingActivity"); 224 225 public static final ComponentName MPP_ACTIVITY2 = 226 component("MinimalPostProcessingActivity2"); 227 228 public static final ComponentName MPP_ACTIVITY3 = 229 component("MinimalPostProcessingManifestActivity"); 230 231 public static final ComponentName POPUP_MPP_ACTIVITY = 232 component("PopupMinimalPostProcessingActivity"); 233 234 public static final ComponentName CRASHING_ACTIVITY = 235 component("CrashingActivity"); 236 237 public static final ComponentName HANDLE_SPLASH_SCREEN_EXIT_ACTIVITY = 238 component("HandleSplashScreenExitActivity"); 239 public static final ComponentName SPLASH_SCREEN_REPLACE_ICON_ACTIVITY = 240 component("SplashScreenReplaceIconActivity"); 241 public static final ComponentName SPLASH_SCREEN_REPLACE_THEME_ACTIVITY = 242 component("SplashScreenReplaceThemeActivity"); 243 244 public static final ComponentName TEST_DREAM_SERVICE = 245 component("TestDream"); 246 247 public static final ComponentName TEST_STUBBORN_DREAM_SERVICE = 248 component("TestStubbornDream"); 249 250 public static final ComponentName OVERLAY_TEST_SERVICE = 251 component("OverlayTestService"); 252 253 public static final ComponentName BACKGROUND_IMAGE_ACTIVITY = 254 component("BackgroundImageActivity"); 255 256 public static final ComponentName BLUR_ACTIVITY = 257 component("BlurActivity"); 258 259 public static final ComponentName BLUR_ATTRIBUTES_ACTIVITY = 260 component("BlurAttributesActivity"); 261 262 public static final ComponentName BAD_BLUR_ACTIVITY = 263 component("BadBlurActivity"); 264 265 /** 266 * The keys are used for {@link TestJournalProvider} when testing starting window. 267 */ 268 public static class TestStartingWindowKeys { 269 public static final String HANDLE_SPLASH_SCREEN_EXIT = "HandleSplashScreenExitActivity"; 270 public static final String REPLACE_ICON_EXIT = "SplashScreenReplaceIconActivity"; 271 public static final String RECEIVE_SPLASH_SCREEN_EXIT = "receive_splash_screen_exit"; 272 public static final String CONTAINS_CENTER_VIEW = "contains_center_view"; 273 public static final String CONTAINS_BRANDING_VIEW = "contains_branding_view"; 274 public static final String ICON_BACKGROUND_COLOR = "icon_background_color"; 275 public static final String ICON_ANIMATION_DURATION = "icon_animation_duration"; 276 public static final String ICON_ANIMATION_START = "icon_animation_start"; 277 public static final String CENTER_VIEW_IS_SURFACE_VIEW = "center_view_is_surface_view"; 278 279 public static final String REQUEST_HANDLE_EXIT_ON_CREATE = "handle_exit_onCreate"; 280 public static final String REQUEST_HANDLE_EXIT_ON_RESUME = "handle_exit_onResume"; 281 public static final String CANCEL_HANDLE_EXIT = "cancel_handle_exit"; 282 283 public static final String REQUEST_SET_NIGHT_MODE_ON_CREATE = "night_mode_onCreate"; 284 public static final String GET_NIGHT_MODE_ACTIVITY_CHANGED = "get_night_mode_activity"; 285 public static final String DELAY_RESUME = "delay_resume"; 286 public static final String OVERRIDE_THEME_ENABLED = "override_theme_enabled"; 287 public static final String OVERRIDE_THEME_COLOR = "override_theme_color"; 288 public static final String OVERRIDE_THEME_COMPONENT = "override_theme_component"; 289 290 } 291 292 /** 293 * The keys are used for {@link TestJournalProvider} when testing wallpaper 294 * component. 295 */ 296 public static class TestLiveWallpaperKeys { 297 public static final String COMPONENT = "LiveWallpaper"; 298 public static final String ENGINE_CREATED = "engine_created"; 299 public static final String ENGINE_DISPLAY_ID = "engine_display_Id"; 300 } 301 302 /** 303 * Action and extra key constants for {@link #TEST_ACTIVITY}. 304 * 305 * TODO(b/73346885): These constants should be in {@link android.server.wm.app.TestActivity} 306 * once the activity is moved to test APK. 307 */ 308 public static class TestActivity { 309 // Finishes the activity 310 public static final String TEST_ACTIVITY_ACTION_FINISH_SELF = 311 "android.server.wm.app.TestActivity.finish_self"; 312 // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation} 313 public static final String EXTRA_FIXED_ORIENTATION = "fixed_orientation"; 314 public static final String EXTRA_CONFIGURATION = "configuration"; 315 public static final String EXTRA_CONFIG_ASSETS_SEQ = "config_assets_seq"; 316 public static final String EXTRA_INTENT = "intent"; 317 public static final String EXTRA_INTENTS = "intents"; 318 public static final String EXTRA_NO_IDLE = "no_idle"; 319 public static final String COMMAND_NAVIGATE_UP_TO = "navigate_up_to"; 320 public static final String COMMAND_START_ACTIVITY = "start_activity"; 321 public static final String COMMAND_START_ACTIVITIES = "start_activities"; 322 } 323 324 /** 325 * Extra key constants for {@link #LAUNCH_ASSISTANT_ACTIVITY_INTO_STACK} and 326 * {@link #LAUNCH_ASSISTANT_ACTIVITY_FROM_SESSION}. 327 * 328 * TODO(b/73346885): These constants should be in 329 * {@link android.server.wm.app.AssistantActivity} once the activity is moved to test APK. 330 */ 331 public static class AssistantActivity { 332 // Launches the given activity in onResume 333 public static final String EXTRA_ASSISTANT_LAUNCH_NEW_TASK = "launch_new_task"; 334 // Finishes this activity in onResume, this happens after EXTRA_ASSISTANT_LAUNCH_NEW_TASK 335 public static final String EXTRA_ASSISTANT_FINISH_SELF = "finish_self"; 336 // Attempts to enter picture-in-picture in onResume 337 public static final String EXTRA_ASSISTANT_ENTER_PIP = "enter_pip"; 338 // Display on which Assistant runs 339 public static final String EXTRA_ASSISTANT_DISPLAY_ID = "assistant_display_id"; 340 } 341 342 /** 343 * Extra key constants for {@link android.server.wm.app.BottomActivity}. 344 * 345 * TODO(b/73346885): These constants should be in {@link android.server.wm.app.BottomActivity} 346 * once the activity is moved to test APK. 347 */ 348 public static class BottomActivity { 349 public static final String EXTRA_BOTTOM_WALLPAPER = "USE_WALLPAPER"; 350 public static final String EXTRA_STOP_DELAY = "STOP_DELAY"; 351 } 352 353 /** 354 * Extra key constants for {@link android.server.wm.app.BroadcastReceiverActivity}. 355 * 356 * TODO(b/73346885): These constants should be in 357 * {@link android.server.wm.app.BroadcastReceiverActivity} once the activity is moved to test APK. 358 */ 359 public static class BroadcastReceiverActivity { 360 public static final String ACTION_TRIGGER_BROADCAST = "trigger_broadcast"; 361 public static final String EXTRA_DISMISS_KEYGUARD = "dismissKeyguard"; 362 public static final String EXTRA_DISMISS_KEYGUARD_METHOD = "dismissKeyguardMethod"; 363 public static final String EXTRA_FINISH_BROADCAST = "finish"; 364 public static final String EXTRA_MOVE_BROADCAST_TO_BACK = "moveToBack"; 365 public static final String EXTRA_BROADCAST_ORIENTATION = "orientation"; 366 public static final String EXTRA_CUTOUT_EXISTS = "cutoutExists"; 367 } 368 369 /** Extra key constants for {@link android.server.wm.app.LandscapeOrientationActivity}. */ 370 public static class LandscapeOrientationActivity { 371 public static final String EXTRA_APP_CONFIG_INFO = "app_config_info"; 372 public static final String EXTRA_CONFIG_INFO_IN_ON_CREATE = "config_info_in_on_create"; 373 public static final String EXTRA_DISPLAY_REAL_SIZE = "display_real_size"; 374 public static final String EXTRA_SYSTEM_RESOURCES_CONFIG_INFO = "sys_config_info"; 375 } 376 377 /** Extra key constants for {@link android.server.wm.app.FontScaleActivity}. */ 378 public static class FontScaleActivity { 379 public static final String EXTRA_FONT_PIXEL_SIZE = "fontPixelSize"; 380 public static final String EXTRA_FONT_ACTIVITY_DPI = "fontActivityDpi"; 381 } 382 383 /** Extra key constants for {@link android.server.wm.app.NoHistoryActivity}. */ 384 public static class NoHistoryActivity { 385 public static final String EXTRA_SHOW_WHEN_LOCKED = "showWhenLocked"; 386 } 387 388 /** Extra key constants for {@link android.server.wm.app.TurnScreenOnActivity}. */ 389 public static class TurnScreenOnActivity { 390 // Turn on screen by window flags or APIs. 391 public static final String EXTRA_USE_WINDOW_FLAGS = "useWindowFlags"; 392 public static final String EXTRA_SHOW_WHEN_LOCKED = "useShowWhenLocked"; 393 public static final String EXTRA_SLEEP_MS_IN_ON_CREATE = "sleepMsInOnCreate"; 394 } 395 396 /** Extra key constants for {@link android.server.wm.app.MinimalPostProcessingActivity}. */ 397 public static class MinimalPostProcessingActivity { 398 // Turn on minimal post processing (if available). 399 public static final String EXTRA_PREFER_MPP = "preferMinimalPostProcessing"; 400 } 401 402 /** 403 * Logging constants for {@link android.server.wm.app.KeyguardDismissLoggerCallback}. 404 * 405 * TODO(b/73346885): These constants should be in 406 * {@link android.server.wm.app.KeyguardDismissLoggerCallback} once the class is moved to test APK. 407 */ 408 public static class KeyguardDismissLoggerCallback { 409 public static final String KEYGUARD_DISMISS_LOG_TAG = "KeyguardDismissLoggerCallback"; 410 public static final String ENTRY_ON_DISMISS_CANCELLED = "onDismissCancelled"; 411 public static final String ENTRY_ON_DISMISS_ERROR = "onDismissError"; 412 public static final String ENTRY_ON_DISMISS_SUCCEEDED = "onDismissSucceeded"; 413 } 414 415 /** 416 * Extra key constants for {@link #LAUNCH_ASSISTANT_ACTIVITY_INTO_STACK}. 417 * 418 * TODO(b/73346885): These constants should be in 419 * {@link android.server.wm.app.LaunchAssistantActivityIntoAssistantStack} once the activity is 420 * moved to test APK. 421 */ 422 public static class LaunchAssistantActivityIntoAssistantStack { 423 // Launches the translucent assist activity 424 public static final String EXTRA_ASSISTANT_IS_TRANSLUCENT = "is_translucent"; 425 } 426 427 /** 428 * Extra constants for {@link android.server.wm.app.MoveTaskToBackActivity}. 429 * 430 * TODO(b/73346885): These constants should be in 431 * {@link android.server.wm.app.MoveTaskToBackActivity} once the activity is moved to test APK. 432 */ 433 public static class MoveTaskToBackActivity { 434 public static final String EXTRA_FINISH_POINT = "finish_point"; 435 public static final String FINISH_POINT_ON_PAUSE = "on_pause"; 436 public static final String FINISH_POINT_ON_STOP = "on_stop"; 437 } 438 439 /** 440 * Extra constants for {@link android.server.wm.app.BlurActivity}. 441 */ 442 public static class BlurActivity { 443 public static final String EXTRA_NO_BLUR_BACKGROUND_COLOR = "no_blur_background_color"; 444 public static final String EXTRA_BACKGROUND_BLUR_RADIUS_PX = "background_blur_radius"; 445 public static final String EXTRA_BLUR_BEHIND_RADIUS_PX = "blur_behind_radius"; 446 } 447 448 /** 449 * Action and extra key constants for {@link android.server.wm.app.PipActivity}. 450 * 451 * TODO(b/73346885): These constants should be in {@link android.server.wm.app.PipActivity} 452 * once the activity is moved to test APK. 453 */ 454 public static class PipActivity { 455 // Intent action that this activity dynamically registers to enter picture-in-picture 456 public static final String ACTION_ENTER_PIP = "android.server.wm.app.PipActivity.enter_pip"; 457 // Intent action that this activity dynamically registers to move itself to the back 458 public static final String ACTION_MOVE_TO_BACK = 459 "android.server.wm.app.PipActivity.move_to_back"; 460 // Intent action that this activity dynamically registers to expand itself. 461 // If EXTRA_SET_ASPECT_RATIO_WITH_DELAY is set, it will also attempt to apply the aspect 462 // ratio after a short delay. 463 public static final String ACTION_EXPAND_PIP = 464 "android.server.wm.app.PipActivity.expand_pip"; 465 // Intent action that this activity dynamically registers to receive update callback. 466 // If EXTRA_SET_PIP_STASH is set, then onPictureInPictureStateChanged will be called 467 // with the value. 468 public static final String ACTION_UPDATE_PIP_STATE = 469 "android.server.wm.app.PipActivity.update_pip_state"; 470 // Intent action that this activity dynamically registers to set requested orientation. 471 // Will apply the orientation to the value set in the EXTRA_FIXED_ORIENTATION extra. 472 public static final String ACTION_SET_REQUESTED_ORIENTATION = 473 "android.server.wm.app.PipActivity.set_requested_orientation"; 474 // Intent action that will finish this activity 475 public static final String ACTION_FINISH = "android.server.wm.app.PipActivity.finish"; 476 // Intent action that will request that the activity enters picture-in-picture. 477 public static final String ACTION_ON_PIP_REQUESTED = 478 "android.server.wm.app.PipActivity.on_pip_requested"; 479 480 // Adds an assertion that we do not ever get onStop() before we enter picture in picture 481 public static final String EXTRA_ASSERT_NO_ON_STOP_BEFORE_PIP = 482 "assert_no_on_stop_before_pip"; 483 // Calls enterPictureInPicture() on creation 484 public static final String EXTRA_ENTER_PIP = "enter_pip"; 485 // Used with EXTRA_AUTO_ENTER_PIP, value specifies the aspect ratio to enter PIP with 486 public static final String EXTRA_ENTER_PIP_ASPECT_RATIO_NUMERATOR = 487 "enter_pip_aspect_ratio_numerator"; 488 // Used with EXTRA_AUTO_ENTER_PIP, value specifies the aspect ratio to enter PIP with 489 public static final String EXTRA_ENTER_PIP_ASPECT_RATIO_DENOMINATOR = 490 "enter_pip_aspect_ratio_denominator"; 491 // Calls requestAutoEnterPictureInPicture() with the value provided 492 public static final String EXTRA_ENTER_PIP_ON_PAUSE = "enter_pip_on_pause"; 493 // Calls requestAutoEnterPictureInPicture() with the value provided 494 public static final String EXTRA_ENTER_PIP_ON_USER_LEAVE_HINT = 495 "enter_pip_on_user_leave_hint"; 496 // Calls requestAutoEnterPictureInPicture() with the value provided 497 public static final String EXTRA_ENTER_PIP_ON_PIP_REQUESTED = 498 "enter_pip_on_pip_requested"; 499 // Sets auto PIP allowed on the activity picture-in-picture params. 500 public static final String EXTRA_ALLOW_AUTO_PIP = "enter_pip_auto_pip_allowed"; 501 // Sets seamless resize enabled on the activity picture-in-picture params. 502 public static final String EXTRA_IS_SEAMLESS_RESIZE_ENABLED = 503 "enter_pip_is_seamless_resize_enabled"; 504 // Finishes the activity at the end of onResume (after EXTRA_START_ACTIVITY is handled) 505 public static final String EXTRA_FINISH_SELF_ON_RESUME = "finish_self_on_resume"; 506 // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation} 507 public static final String EXTRA_PIP_ORIENTATION = "fixed_orientation"; 508 // The amount to delay to artificially introduce in onPause() 509 // (before EXTRA_ENTER_PIP_ON_PAUSE is processed) 510 public static final String EXTRA_ON_PAUSE_DELAY = "on_pause_delay"; 511 // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value 512 public static final String EXTRA_SET_ASPECT_RATIO_DENOMINATOR = 513 "set_aspect_ratio_denominator"; 514 // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value 515 public static final String EXTRA_SET_ASPECT_RATIO_NUMERATOR = "set_aspect_ratio_numerator"; 516 // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value with a 517 // fixed delay 518 public static final String EXTRA_SET_ASPECT_RATIO_WITH_DELAY_NUMERATOR = 519 "set_aspect_ratio_with_delay_numerator"; 520 // Calls setPictureInPictureAspectRatio with the aspect ratio specified in the value with a 521 // fixed delay 522 public static final String EXTRA_SET_ASPECT_RATIO_WITH_DELAY_DENOMINATOR = 523 "set_aspect_ratio_with_delay_denominator"; 524 // Calls onPictureInPictureStateChange with the state specified in the value 525 public static final String EXTRA_SET_PIP_STASHED = "set_pip_stashed"; 526 // Shows this activity over the keyguard 527 public static final String EXTRA_SHOW_OVER_KEYGUARD = "show_over_keyguard"; 528 // Starts the activity (component name) provided by the value at the end of onCreate 529 public static final String EXTRA_START_ACTIVITY = "start_activity"; 530 // Adds a click listener to finish this activity when it is clicked 531 public static final String EXTRA_TAP_TO_FINISH = "tap_to_finish"; 532 // Dismiss keyguard when activity show. 533 public static final String EXTRA_DISMISS_KEYGUARD = "dismiss_keyguard"; 534 // Number of custom actions should be set onto PictureInPictureParams 535 public static final String EXTRA_NUMBER_OF_CUSTOM_ACTIONS = "number_of_custom_actions"; 536 // Supplied when a callback is expected for pip 537 public static final String EXTRA_SET_PIP_CALLBACK = "set_pip_callback"; 538 // Key for obtaining the callback's results 539 public static final String PIP_CALLBACK_RESULT_KEY = "pip_callback_result_key"; 540 } 541 542 /** 543 * Extra key constants for {@link android.server.wm.app.TopActivity} and 544 * {@link TranslucentTopActivity}. 545 * 546 * TODO(b/73346885): These constants should be in {@link android.server.wm.app.TopActivity} 547 * once the activity is moved to test APK. 548 */ 549 public static class TopActivity { 550 public static final String EXTRA_FINISH_DELAY = "FINISH_DELAY"; 551 public static final String EXTRA_FINISH_IN_ON_CREATE = "FINISH_IN_ON_CREATE"; 552 public static final String ACTION_CONVERT_TO_TRANSLUCENT = "convert_to_translucent"; 553 public static final String ACTION_CONVERT_FROM_TRANSLUCENT = "convert_from_translucent"; 554 } 555 556 public static class UnresponsiveActivity { 557 public static final String EXTRA_ON_CREATE_DELAY_MS = "ON_CREATE_DELAY_MS"; 558 public static final String EXTRA_DELAY_UI_THREAD_MS = "DELAY_UI_THREAD_MS"; 559 public static final String EXTRA_ON_KEYDOWN_DELAY_MS = "ON_KEYDOWN_DELAY_MS"; 560 public static final String EXTRA_ON_MOTIONEVENT_DELAY_MS = "ON_MOTIONEVENT_DELAY_MS"; 561 public static final String PROCESS_NAME = ".unresponsive_activity_process"; 562 } 563 564 public static class RenderService { 565 public static final String PROCESS_NAME = ".render_process"; 566 } 567 568 /** 569 * Extra key constants for {@link android.server.wm.app.VirtualDisplayActivity}. 570 * 571 * TODO(b/73346885): These constants should be in 572 * {@link android.server.wm.app.VirtualDisplayActivity} once the activity is moved to test APK. 573 */ 574 public static class VirtualDisplayActivity { 575 public static final String VIRTUAL_DISPLAY_PREFIX = "HostedVirtualDisplay"; 576 public static final String KEY_CAN_SHOW_WITH_INSECURE_KEYGUARD = 577 "can_show_with_insecure_keyguard"; 578 public static final String KEY_COMMAND = "command"; 579 public static final String KEY_COUNT = "count"; 580 public static final String KEY_DENSITY_DPI = "density_dpi"; 581 public static final String KEY_PUBLIC_DISPLAY = "public_display"; 582 public static final String KEY_RESIZE_DISPLAY = "resize_display"; 583 public static final String KEY_SHOW_SYSTEM_DECORATIONS = "show_system_decorations"; 584 public static final String KEY_PRESENTATION_DISPLAY = "presentation_display"; 585 // Value constants of {@link #KEY_COMMAND}. 586 public static final String COMMAND_CREATE_DISPLAY = "create_display"; 587 public static final String COMMAND_DESTROY_DISPLAY = "destroy_display"; 588 public static final String COMMAND_RESIZE_DISPLAY = "resize_display"; 589 } 590 591 public static class ClickableToastActivity { 592 public static final String ACTION_TOAST_DISPLAYED = "toast_displayed"; 593 public static final String ACTION_TOAST_TAP_DETECTED = "toast_tap_detected"; 594 } 595 596 public static class PresentationActivity { 597 public static final String KEY_DISPLAY_ID = "display_id"; 598 } 599 600 public static class LaunchingActivity { 601 public static final String KEY_FINISH_BEFORE_LAUNCH = "finish_before_launch"; 602 } 603 604 public static class OverlayTestService { 605 public static final String EXTRA_LAYOUT_PARAMS = "layout_params"; 606 } 607 608 public static class Notifications { 609 public static final String CHANNEL_MAIN = "main"; 610 public static final int ID_OVERLAY_TEST_SERVICE = 1; 611 } 612 613 public static class HideOverlayWindowsActivity { 614 public static final String ACTION = "hide_action"; 615 public static final String PONG = "pong_action"; 616 public static final String SHOULD_HIDE = "should_hide"; 617 } 618 component(String className)619 private static ComponentName component(String className) { 620 return component(Components.class, className); 621 } 622 getPackageName()623 public static String getPackageName() { 624 return getPackageName(Components.class); 625 } 626 } 627