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 
45         public static class AutoFocusActivity {
46             public static final String LABEL = "ImeAppAutoFocus";
47             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
48                     FLICKER_APP_PACKAGE + ".ImeActivityAutoFocus");
49         }
50 
51         public static class StateInitializeActivity {
52             public static final String LABEL = "ImeStateInitializeActivity";
53             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
54                     FLICKER_APP_PACKAGE + ".ImeStateInitializeActivity");
55         }
56 
57         public static class EditorPopupDialogActivity {
58             public static final String LABEL = "ImeEditorPopupDialogActivity";
59             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
60                     FLICKER_APP_PACKAGE + ".ImeEditorPopupDialogActivity");
61         }
62     }
63 
64     public static class NonResizeableActivity {
65         public static final String LABEL = "NonResizeableActivity";
66         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
67                 FLICKER_APP_PACKAGE + ".NonResizeableActivity");
68     }
69 
70     public static class NonResizeablePortraitActivity {
71         public static final String LABEL = "NonResizeablePortraitActivity";
72         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
73                 FLICKER_APP_PACKAGE + ".NonResizeablePortraitActivity");
74     }
75 
76     public static class TransparentActivity {
77         public static final String LABEL = "TransparentActivity";
78         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
79                 FLICKER_APP_PACKAGE + ".TransparentActivity");
80     }
81 
82     public static class LaunchTransparentActivity {
83         public static final String LABEL = "LaunchTransparentActivity";
84         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
85                 FLICKER_APP_PACKAGE + ".LaunchTransparentActivity");
86     }
87 
88     public static class DialogThemedActivity {
89         public static final String LABEL = "DialogThemedActivity";
90         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
91                 FLICKER_APP_PACKAGE + ".DialogThemedActivity");
92     }
93 
94     public static class PortraitOnlyActivity {
95         public static final String LABEL = "PortraitOnlyActivity";
96         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
97                 FLICKER_APP_PACKAGE + ".PortraitOnlyActivity");
98         public static final String EXTRA_FIXED_ORIENTATION = "fixed_orientation";
99     }
100 
101     public static class ActivityEmbedding {
102         public static class MainActivity {
103             public static final String LABEL = "ActivityEmbeddingMainActivity";
104             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
105                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingMainActivity");
106         }
107 
108         public static class SecondaryActivity {
109             public static final String LABEL = "ActivityEmbeddingSecondaryActivity";
110             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
111                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingSecondaryActivity");
112         }
113 
114         public static class ThirdActivity {
115             public static final String LABEL = "ActivityEmbeddingThirdActivity";
116             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
117                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingThirdActivity");
118         }
119 
120         public static class AlwaysExpandActivity {
121             public static final String LABEL = "ActivityEmbeddingAlwaysExpandActivity";
122             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
123                 FLICKER_APP_PACKAGE + ".ActivityEmbeddingAlwaysExpandActivity");
124         }
125 
126         public static class PlaceholderPrimaryActivity {
127             public static final String LABEL = "ActivityEmbeddingPlaceholderPrimaryActivity";
128             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
129                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingPlaceholderPrimaryActivity");
130         }
131 
132         public static class PlaceholderSecondaryActivity {
133             public static final String LABEL = "ActivityEmbeddingPlaceholderSecondaryActivity";
134             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
135                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingPlaceholderSecondaryActivity");
136         }
137 
138         public static class TrampolineActivity {
139             public static final String LABEL = "ActivityEmbeddingTrampolineActivity";
140             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
141                     FLICKER_APP_PACKAGE + ".ActivityEmbeddingTrampolineActivity");
142         }
143     }
144 
145     public static class Notification {
146         public static final String LABEL = "NotificationActivity";
147         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
148                 FLICKER_APP_PACKAGE + ".NotificationActivity");
149     }
150 
151     public static class Mail {
152         public static final String LABEL = "MailActivity";
153         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
154                 FLICKER_APP_PACKAGE + ".MailActivity");
155     }
156 
157     public static class ShowWhenLockedActivity {
158         public static final String LABEL = "ShowWhenLockedActivity";
159         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
160                 FLICKER_APP_PACKAGE + ".ShowWhenLockedActivity");
161     }
162 
163     public static class LaunchNewTask {
164         public static final String LABEL = "LaunchNewTaskActivity";
165         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
166                 FLICKER_APP_PACKAGE + ".LaunchNewTaskActivity");
167     }
168 
169     public static class Game {
170         public static final String LABEL = "GameActivity";
171         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
172                 FLICKER_APP_PACKAGE + ".GameActivity");
173     }
174 
175     public static class LaunchNewActivity {
176         public static final String LABEL = "LaunchNewActivity";
177         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
178                 FLICKER_APP_PACKAGE + ".LaunchNewActivity");
179     }
180 
181     public static class Pip {
182         // Test App > Pip Activity
183         public static final String LABEL = "PipActivity";
184         public static final String MENU_ACTION_NO_OP = "No-Op";
185         public static final String MENU_ACTION_ON = "On";
186         public static final String MENU_ACTION_OFF = "Off";
187         public static final String MENU_ACTION_CLEAR = "Clear";
188 
189         // Intent action that this activity dynamically registers to enter picture-in-picture
190         public static final String ACTION_ENTER_PIP =
191                 FLICKER_APP_PACKAGE + ".PipActivity.ENTER_PIP";
192         // Intent action that this activity dynamically registers to set requested orientation.
193         // Will apply the oriention to the value set in the EXTRA_FIXED_ORIENTATION extra.
194         public static final String ACTION_SET_REQUESTED_ORIENTATION =
195                 FLICKER_APP_PACKAGE + ".PipActivity.SET_REQUESTED_ORIENTATION";
196 
197         // Calls enterPictureInPicture() on creation
198         public static final String EXTRA_ENTER_PIP = "enter_pip";
199         // Sets the fixed orientation (can be one of {@link ActivityInfo.ScreenOrientation}
200         public static final String EXTRA_PIP_ORIENTATION = "fixed_orientation";
201         // Adds a click listener to finish this activity when it is clicked
202         public static final String EXTRA_TAP_TO_FINISH = "tap_to_finish";
203 
204         public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
205                 FLICKER_APP_PACKAGE + ".PipActivity");
206     }
207 
208     public static class SplitScreen {
209         public static class Primary {
210             public static final String LABEL = "SplitScreenPrimaryActivity";
211             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
212                     FLICKER_APP_PACKAGE + ".SplitScreenActivity");
213 
214             public static final String EXTRA_LAUNCH_ADJACENT = "launch_adjacent";
215         }
216 
217         public static class Secondary {
218             public static final String LABEL = "SplitScreenSecondaryActivity";
219             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
220                     FLICKER_APP_PACKAGE + ".SplitScreenSecondaryActivity");
221         }
222     }
223 
224     public static class Bubbles {
225         public static class LaunchBubble {
226             public static final String LABEL = "LaunchBubbleActivity";
227             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
228                     FLICKER_APP_PACKAGE + ".LaunchBubbleActivity");
229         }
230 
231         public static class BubbleActivity {
232             public static final String LABEL = "BubbleActivity";
233             public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
234                     FLICKER_APP_PACKAGE + ".BubbleActivity");
235         }
236     }
237 
238     public static final String GAME_ACTIVITY_LAUNCHER_NAME = "GameApp";
239     public static final ComponentName GAME_ACTIVITY_COMPONENT_NAME =
240             new ComponentName(FLICKER_APP_PACKAGE, FLICKER_APP_PACKAGE + ".GameActivity");
241 
242     public static final ComponentName ASSISTANT_SERVICE_COMPONENT_NAME =
243             new ComponentName(
244                     FLICKER_APP_PACKAGE, FLICKER_APP_PACKAGE + ".AssistantInteractionService");
245 }
246