blob: 7310d679268cd545f1e30de5d74e742716db014b [file] [log] [blame]
Jeff Brown13014b52014-04-07 19:45:27 -07001/*
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
17package android.app;
18
Jeff Brown061ea992015-04-17 19:55:47 -070019import android.annotation.NonNull;
Fyodor Kupolovb5013302015-04-17 17:59:14 -070020import android.content.ComponentName;
Amith Yamasani0af6fa72016-01-17 15:36:19 -080021import android.os.IBinder;
22import android.service.voice.IVoiceInteractionSession;
23
24import com.android.internal.app.IVoiceInteractor;
Jeff Brown061ea992015-04-17 19:55:47 -070025
Jeff Brown13014b52014-04-07 19:45:27 -070026/**
27 * Activity manager local system service interface.
28 *
29 * @hide Only for use within the system server.
30 */
31public abstract class ActivityManagerInternal {
Jorim Jaggi275561a2016-02-23 10:11:02 -050032
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 Brown13014b52014-04-07 19:45:27 -070057 // Called by the power manager.
Jeff Brownfbe96702014-11-19 18:30:58 -080058 public abstract void onWakefulnessChanged(int wakefulness);
59
Primiano Tucci810c0522014-07-25 18:03:16 +010060 public abstract int startIsolatedProcess(String entryPoint, String[] mainArgs,
61 String processName, String abiOverride, int uid, Runnable crashHandler);
Jeff Brown061ea992015-04-17 19:55:47 -070062
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 Jaggi275561a2016-02-23 10:11:02 -050076
Jeff Brown061ea992015-04-17 19:55:47 -070077 /**
78 * Releases the sleep token.
79 */
80 public abstract void release();
81 }
Fyodor Kupolovb5013302015-04-17 17:59:14 -070082
83 /**
84 * Returns home activity for the specified user.
Jorim Jaggi275561a2016-02-23 10:11:02 -050085 *
Fyodor Kupolovb5013302015-04-17 17:59:14 -070086 * @param userId ID of the user or {@link android.os.UserHandle#USER_ALL}
87 */
88 public abstract ComponentName getHomeActivityForUser(int userId);
Amith Yamasani515d4062015-09-28 11:30:06 -070089
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 Yamasani0af6fa72016-01-17 15:36:19 -080098
99 public abstract void onLocalVoiceInteractionStarted(IBinder callingActivity,
100 IVoiceInteractionSession mSession,
101 IVoiceInteractor mInteractor);
Jorim Jaggi275561a2016-02-23 10:11:02 -0500102
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 Brown13014b52014-04-07 19:45:27 -0700117}