Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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.app; |
| 18 | |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Fyodor Kupolov | b501330 | 2015-04-17 17:59:14 -0700 | [diff] [blame] | 20 | import android.content.ComponentName; |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 21 | import android.os.IBinder; |
| 22 | import android.service.voice.IVoiceInteractionSession; |
| 23 | |
| 24 | import com.android.internal.app.IVoiceInteractor; |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 25 | |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Activity manager local system service interface. |
| 28 | * |
| 29 | * @hide Only for use within the system server. |
| 30 | */ |
| 31 | public abstract class ActivityManagerInternal { |
Jorim Jaggi | 275561a | 2016-02-23 10:11:02 -0500 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * Type for {@link #notifyAppTransitionStarting}: The transition was started because we had |
| 35 | * the surface saved. |
| 36 | */ |
| 37 | public static final int APP_TRANSITION_SAVED_SURFACE = 0; |
| 38 | |
| 39 | /** |
| 40 | * Type for {@link #notifyAppTransitionStarting}: The transition was started because we drew |
| 41 | * the starting window. |
| 42 | */ |
| 43 | public static final int APP_TRANSITION_STARTING_WINDOW = 1; |
| 44 | |
| 45 | /** |
| 46 | * Type for {@link #notifyAppTransitionStarting}: The transition was started because we all |
| 47 | * app windows were drawn |
| 48 | */ |
| 49 | public static final int APP_TRANSITION_WINDOWS_DRAWN = 2; |
| 50 | |
| 51 | /** |
| 52 | * Type for {@link #notifyAppTransitionStarting}: The transition was started because of a |
| 53 | * timeout. |
| 54 | */ |
| 55 | public static final int APP_TRANSITION_TIMEOUT = 3; |
| 56 | |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 57 | // Called by the power manager. |
Jeff Brown | fbe9670 | 2014-11-19 18:30:58 -0800 | [diff] [blame] | 58 | public abstract void onWakefulnessChanged(int wakefulness); |
| 59 | |
Primiano Tucci | 810c052 | 2014-07-25 18:03:16 +0100 | [diff] [blame] | 60 | public abstract int startIsolatedProcess(String entryPoint, String[] mainArgs, |
| 61 | String processName, String abiOverride, int uid, Runnable crashHandler); |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 62 | |
| 63 | /** |
| 64 | * Acquires a sleep token with the specified tag. |
| 65 | * |
| 66 | * @param tag A string identifying the purpose of the token (eg. "Dream"). |
| 67 | */ |
| 68 | public abstract SleepToken acquireSleepToken(@NonNull String tag); |
| 69 | |
| 70 | /** |
| 71 | * Sleep tokens cause the activity manager to put the top activity to sleep. |
| 72 | * They are used by components such as dreams that may hide and block interaction |
| 73 | * with underlying activities. |
| 74 | */ |
| 75 | public static abstract class SleepToken { |
Jorim Jaggi | 275561a | 2016-02-23 10:11:02 -0500 | [diff] [blame] | 76 | |
Jeff Brown | 061ea99 | 2015-04-17 19:55:47 -0700 | [diff] [blame] | 77 | /** |
| 78 | * Releases the sleep token. |
| 79 | */ |
| 80 | public abstract void release(); |
| 81 | } |
Fyodor Kupolov | b501330 | 2015-04-17 17:59:14 -0700 | [diff] [blame] | 82 | |
| 83 | /** |
| 84 | * Returns home activity for the specified user. |
Jorim Jaggi | 275561a | 2016-02-23 10:11:02 -0500 | [diff] [blame] | 85 | * |
Fyodor Kupolov | b501330 | 2015-04-17 17:59:14 -0700 | [diff] [blame] | 86 | * @param userId ID of the user or {@link android.os.UserHandle#USER_ALL} |
| 87 | */ |
| 88 | public abstract ComponentName getHomeActivityForUser(int userId); |
Amith Yamasani | 515d406 | 2015-09-28 11:30:06 -0700 | [diff] [blame] | 89 | |
| 90 | /** |
| 91 | * Called when a user has been deleted. This can happen during normal device usage |
| 92 | * or just at startup, when partially removed users are purged. Any state persisted by the |
| 93 | * ActivityManager should be purged now. |
| 94 | * |
| 95 | * @param userId The user being cleaned up. |
| 96 | */ |
| 97 | public abstract void onUserRemoved(int userId); |
Amith Yamasani | 0af6fa7 | 2016-01-17 15:36:19 -0800 | [diff] [blame] | 98 | |
| 99 | public abstract void onLocalVoiceInteractionStarted(IBinder callingActivity, |
| 100 | IVoiceInteractionSession mSession, |
| 101 | IVoiceInteractor mInteractor); |
Jorim Jaggi | 275561a | 2016-02-23 10:11:02 -0500 | [diff] [blame] | 102 | |
| 103 | /** |
| 104 | * Callback for window manager to let activity manager know that the starting window has been |
| 105 | * drawn |
| 106 | */ |
| 107 | public abstract void notifyStartingWindowDrawn(); |
| 108 | |
| 109 | /** |
| 110 | * Callback for window manager to let activity manager know that we are finally starting the |
| 111 | * app transition; |
| 112 | * |
| 113 | * @param reason The reason why the app transition started. Must be one of the APP_TRANSITION_* |
| 114 | * values. |
| 115 | */ |
| 116 | public abstract void notifyAppTransitionStarting(int reason); |
Jeff Brown | 13014b5 | 2014-04-07 19:45:27 -0700 | [diff] [blame] | 117 | } |