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 com.android.server.wm.flicker.testapp;
18 
19 import android.content.ComponentName;
20 
21 public class ActivityOptions {
22     public static final String FLICKER_APP_PACKAGE = "com.android.server.wm.flicker.testapp";
23 
24     public static class SimpleActivity {
25         public static final String LABEL = "SimpleActivity";
26         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
27                 FLICKER_APP_PACKAGE + ".SimpleActivity");
28     }
29 
30     public static class SeamlessRotation {
31         public static final String LABEL = "SeamlessRotationActivity";
32         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
33                 FLICKER_APP_PACKAGE + ".SeamlessRotationActivity");
34 
35         public static final String EXTRA_STARVE_UI_THREAD = "StarveUiThread";
36     }
37 
38     public static class Ime {
39         public static class Default {
40             public static final String LABEL = "ImeActivity";
41             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
42                     FLICKER_APP_PACKAGE + ".ImeActivity");
43 
44             /** Intent action used to finish the test activity. */
45             public static final String ACTION_FINISH_ACTIVITY =
46                     FLICKER_APP_PACKAGE + ".ImeActivity.FINISH_ACTIVITY";
47 
48             /** Intent action used to start a {@link DialogThemedActivity}. */
49             public static final String ACTION_START_DIALOG_THEMED_ACTIVITY =
50                     FLICKER_APP_PACKAGE + ".ImeActivity.START_DIALOG_THEMED_ACTIVITY";
51 
52             /** Intent action used to toggle activity orientation. */
53             public static final String ACTION_TOGGLE_ORIENTATION =
54                     FLICKER_APP_PACKAGE + ".ImeActivity.TOGGLE_ORIENTATION";
55         }
56 
57         public static class AutoFocusActivity {
58             public static final String LABEL = "ImeAppAutoFocus";
59             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
60                     FLICKER_APP_PACKAGE + ".ImeActivityAutoFocus");
61         }
62 
63         public static class StateInitializeActivity {
64             public static final String LABEL = "ImeStateInitializeActivity";
65             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
66                     FLICKER_APP_PACKAGE + ".ImeStateInitializeActivity");
67         }
68 
69         public static class EditorPopupDialogActivity {
70             public static final String LABEL = "ImeEditorPopupDialogActivity";
71             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
72                     FLICKER_APP_PACKAGE + ".ImeEditorPopupDialogActivity");
73         }
74     }
75 
76     public static class NonResizeableActivity {
77         public static final String LABEL = "NonResizeableActivity";
78         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
79                 FLICKER_APP_PACKAGE + ".NonResizeableActivity");
80     }
81 
82     public static class NonResizeablePortraitActivity {
83         public static final String LABEL = "NonResizeablePortraitActivity";
84         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
85                 FLICKER_APP_PACKAGE + ".NonResizeablePortraitActivity");
86     }
87 
88     public static class NonResizeableFixedAspectRatioPortraitActivity {
89         public static final String LABEL = "NonResizeableFixedAspectRatioPortraitActivity";
90         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
91                 FLICKER_APP_PACKAGE + ".NonResizeableFixedAspectRatioPortraitActivity");
92     }
93 
94     public static class StartMediaProjectionActivity {
95         public static final String LABEL = "StartMediaProjectionActivity";
96         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
97                 FLICKER_APP_PACKAGE + ".StartMediaProjectionActivity");
98     }
99 
100     public static class PortraitImmersiveActivity {
101         public static final String LABEL = "PortraitImmersiveActivity";
102         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
103                 FLICKER_APP_PACKAGE + ".PortraitImmersiveActivity");
104     }
105 
106     public static class TransparentActivity {
107         public static final String LABEL = "TransparentActivity";
108         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
109                 FLICKER_APP_PACKAGE + ".TransparentActivity");
110     }
111 
112     public static class LaunchTransparentActivity {
113         public static final String LABEL = "LaunchTransparentActivity";
114         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
115                 FLICKER_APP_PACKAGE + ".LaunchTransparentActivity");
116     }
117 
118     public static class DialogThemedActivity {
119         public static final String LABEL = "DialogThemedActivity";
120         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
121                 FLICKER_APP_PACKAGE + ".DialogThemedActivity");
122     }
123 
124     public static class PortraitOnlyActivity {
125         public static final String LABEL = "PortraitOnlyActivity";
126         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
127                 FLICKER_APP_PACKAGE + ".PortraitOnlyActivity");
128         public static final String EXTRA_FIXED_ORIENTATION = "fixed_orientation";
129     }
130 
131     public static class ActivityEmbedding {
132         public static class MainActivity {
133             public static final String LABEL = "ActivityEmbeddingMainActivity";
134             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
135                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingMainActivity");
136         }
137 
138         public static class SecondaryActivity {
139             public static final String LABEL = "ActivityEmbeddingSecondaryActivity";
140             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
141                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingSecondaryActivity");
142         }
143 
144         public static class ThirdActivity {
145             public static final String LABEL = "ActivityEmbeddingThirdActivity";
146             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
147                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingThirdActivity");
148         }
149 
150         public static class AlwaysExpandActivity {
151             public static final String LABEL = "ActivityEmbeddingAlwaysExpandActivity";
152             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
153                 FLICKER_APP_PACKAGE + ".ActivityEmbeddingAlwaysExpandActivity");
154         }
155 
156         public static class PlaceholderPrimaryActivity {
157             public static final String LABEL = "ActivityEmbeddingPlaceholderPrimaryActivity";
158             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
159                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingPlaceholderPrimaryActivity");
160         }
161 
162         public static class PlaceholderSecondaryActivity {
163             public static final String LABEL = "ActivityEmbeddingPlaceholderSecondaryActivity";
164             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
165                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingPlaceholderSecondaryActivity");
166         }
167 
168         public static class TrampolineActivity {
169             public static final String LABEL = "ActivityEmbeddingTrampolineActivity";
170             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
171                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingTrampolineActivity");
172         }
173     }
174 
175     public static class Notification {
176         public static final String LABEL = "NotificationActivity";
177         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
178                 FLICKER_APP_PACKAGE + ".NotificationActivity");
179     }
180 
181     public static class Mail {
182         public static final String LABEL = "MailActivity";
183         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
184                 FLICKER_APP_PACKAGE + ".MailActivity");
185     }
186 
187     public static class ShowWhenLockedActivity {
188         public static final String LABEL = "ShowWhenLockedActivity";
189         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
190                 FLICKER_APP_PACKAGE + ".ShowWhenLockedActivity");
191     }
192 
193     public static class LaunchNewTask {
194         public static final String LABEL = "LaunchNewTaskActivity";
195         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
196                 FLICKER_APP_PACKAGE + ".LaunchNewTaskActivity");
197     }
198 
199     public static class Game {
200         public static final String LABEL = "GameActivity";
201         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
202                 FLICKER_APP_PACKAGE + ".GameActivity");
203     }
204 
205     public static class LaunchNewActivity {
206         public static final String LABEL = "LaunchNewActivity";
207         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
208                 FLICKER_APP_PACKAGE + ".LaunchNewActivity");
209     }
210 
211     public static class TransferSplashscreenActivity {
212         public static final String LABEL = "TransferSplashscreenActivity";
213         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
214                 FLICKER_APP_PACKAGE + ".TransferSplashscreenActivity");
215     }
216 
217     public static class Pip {
218         // Test App > Pip Activity
219         public static final String LABEL = "PipActivity";
220         public static final String MENU_ACTION_NO_OP = "No-Op";
221         public static final String MENU_ACTION_ON = "On";
222         public static final String MENU_ACTION_OFF = "Off";
223         public static final String MENU_ACTION_CLEAR = "Clear";
224 
225         // Intent action that this activity dynamically registers to enter picture-in-picture
226         public static final String ACTION_ENTER_PIP =
227                 FLICKER_APP_PACKAGE + ".PipActivity.ENTER_PIP";
228         // Intent action that this activity dynamically registers to set requested orientation.
229         // Will apply the oriention to the value set in the EXTRA_FIXED_ORIENTATION extra.
230         public static final String ACTION_SET_REQUESTED_ORIENTATION =
231                 FLICKER_APP_PACKAGE + ".PipActivity.SET_REQUESTED_ORIENTATION";
232 
233         // Calls enterPictureInPicture() on creation
234         public static final String EXTRA_ENTER_PIP = "enter_pip";
235         // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation}
236         public static final String EXTRA_PIP_ORIENTATION = "fixed_orientation";
237         // Adds a click listener to finish this activity when it is clicked
238         public static final String EXTRA_TAP_TO_FINISH = "tap_to_finish";
239 
240         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
241                 FLICKER_APP_PACKAGE + ".PipActivity");
242     }
243 
244     public static class BottomHalfPip {
245         public static final String LAUNCHING_APP_LABEL = "BottomHalfPipLaunchingActivity";
246         // Test App > Bottom Half PIP Activity
247         public static final String LABEL = "BottomHalfPipActivity";
248 
249         // Use the bottom half layout for PIP Activity
250         public static final String EXTRA_BOTTOM_HALF_LAYOUT = "bottom_half";
251 
252         public static final ComponentName LAUNCHING_APP_COMPONENT = new ComponentName(
253                 FLICKER_APP_PACKAGE, FLICKER_APP_PACKAGE + ".BottomHalfPipLaunchingActivity");
254 
255         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
256                 FLICKER_APP_PACKAGE + ".BottomHalfPipActivity");
257     }
258 
259     public static class SplitScreen {
260         public static class Primary {
261             public static final String LABEL = "SplitScreenPrimaryActivity";
262             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
263                     FLICKER_APP_PACKAGE + ".SplitScreenActivity");
264 
265             public static final String EXTRA_LAUNCH_ADJACENT = "launch_adjacent";
266         }
267 
268         public static class Secondary {
269             public static final String LABEL = "SplitScreenSecondaryActivity";
270             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
271                     FLICKER_APP_PACKAGE + ".SplitScreenSecondaryActivity");
272         }
273     }
274 
275     public static class Bubbles {
276         public static class LaunchBubble {
277             public static final String LABEL = "LaunchBubbleActivity";
278             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
279                     FLICKER_APP_PACKAGE + ".LaunchBubbleActivity");
280         }
281 
282         public static class BubbleActivity {
283             public static final String LABEL = "BubbleActivity";
284             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
285                     FLICKER_APP_PACKAGE + ".BubbleActivity");
286         }
287     }
288 
289     public static final String GAME_ACTIVITY_LAUNCHER_NAME = "GameApp";
290     public static final ComponentName GAME_ACTIVITY_COMPONENT_NAME =
291             new ComponentName(FLICKER_APP_PACKAGE, FLICKER_APP_PACKAGE + ".GameActivity");
292 
293     public static final ComponentName ASSISTANT_SERVICE_COMPONENT_NAME =
294             new ComponentName(
295                     FLICKER_APP_PACKAGE, FLICKER_APP_PACKAGE + ".AssistantInteractionService");
296 }
297