1 /* 2 * Copyright (C) 2019 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.backgroundactivity.appa; 18 19 import android.content.ComponentName; 20 import android.server.wm.component.ComponentsBase; 21 22 public class Components extends ComponentsBase { 23 24 public static final ComponentName APP_A_BACKGROUND_ACTIVITY = 25 component(Components.class, "BackgroundActivity"); 26 public static final ComponentName APP_A_SECOND_BACKGROUND_ACTIVITY = 27 component(Components.class, "SecondBackgroundActivity"); 28 public static final ComponentName APP_A_FOREGROUND_ACTIVITY = 29 component(Components.class, "ForegroundActivity"); 30 public static final ComponentName APP_A_SEND_PENDING_INTENT_RECEIVER = 31 component(Components.class, "SendPendingIntentReceiver"); 32 public static final ComponentName APP_A_START_ACTIVITY_RECEIVER = 33 component(Components.class, "StartBackgroundActivityReceiver"); 34 public static final ComponentName APP_A_SIMPLE_ADMIN_RECEIVER = 35 component(Components.class, "SimpleAdminReceiver"); 36 37 /** Extra key constants for {@link #APP_A_FOREGROUND_ACTIVITY}. */ 38 public static class ForegroundActivity { 39 public static final String LAUNCH_BACKGROUND_ACTIVITY_EXTRA = 40 "LAUNCH_BACKGROUND_ACTIVITY_EXTRA"; 41 public static final String LAUNCH_SECOND_BACKGROUND_ACTIVITY_EXTRA = 42 "LAUNCH_SECOND_BACKGROUND_ACTIVITY_EXTRA"; 43 public static final String RELAUNCH_FOREGROUND_ACTIVITY_EXTRA = 44 "RELAUNCH_FOREGROUND_ACTIVITY_EXTRA"; 45 public static final String START_ACTIVITY_FROM_FG_ACTIVITY_DELAY_MS_EXTRA = 46 "START_ACTIVITY_FROM_FG_ACTIVITY_DELAY_MS_EXTRA"; 47 public static final String START_ACTIVITY_FROM_FG_ACTIVITY_NEW_TASK_EXTRA = 48 "START_ACTIVITY_FROM_FG_ACTIVITY_NEW_TASK_EXTRA"; 49 public static final String LAUNCH_INTENTS_EXTRA = "LAUNCH_INTENTS_EXTRA"; 50 51 public static final String ACTION_LAUNCH_BACKGROUND_ACTIVITIES = 52 Components.class.getPackage().getName() + ".ACTION_LAUNCH_BACKGROUND_ACTIVITIES"; 53 public static final String ACTION_FINISH_ACTIVITY = 54 Components.class.getPackage().getName() + ".ACTION_FINISH_ACTIVITY"; 55 } 56 57 /** Extra key constants for {@link #APP_A_SEND_PENDING_INTENT_RECEIVER} */ 58 public static class SendPendingIntentReceiver { 59 public static final String IS_BROADCAST_EXTRA = "IS_BROADCAST_EXTRA"; 60 } 61 62 /** Extra key constants for {@link #APP_A_START_ACTIVITY_RECEIVER} */ 63 public static class StartBackgroundActivityReceiver { 64 public static final String START_ACTIVITY_DELAY_MS_EXTRA = 65 "START_ACTIVITY_FROM_FG_ACTIVITY_DELAY_MS_EXTRA"; 66 } 67 68 } 69