OSDN Git Service

libmedia_jni.so doesn't need libjhead.so am: 9a4a34afd8 -s ours am: 398d50feeb ...
[android-x86/frameworks-base.git] / core / java / android / app / ActivityManagerInternal.java
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
19 import android.annotation.NonNull;
20 import android.content.ComponentName;
21 import android.content.IIntentSender;
22 import android.content.Intent;
23 import android.content.res.Configuration;
24 import android.os.Bundle;
25 import android.os.IBinder;
26 import android.service.voice.IVoiceInteractionSession;
27
28 import com.android.internal.app.IVoiceInteractor;
29
30 import java.util.List;
31
32 /**
33  * Activity manager local system service interface.
34  *
35  * @hide Only for use within the system server.
36  */
37 public abstract class ActivityManagerInternal {
38
39     /**
40      * Type for {@link #notifyAppTransitionStarting}: The transition was started because we had
41      * the surface saved.
42      */
43     public static final int APP_TRANSITION_SAVED_SURFACE = 0;
44
45     /**
46      * Type for {@link #notifyAppTransitionStarting}: The transition was started because we drew
47      * the starting window.
48      */
49     public static final int APP_TRANSITION_STARTING_WINDOW = 1;
50
51     /**
52      * Type for {@link #notifyAppTransitionStarting}: The transition was started because we all
53      * app windows were drawn
54      */
55     public static final int APP_TRANSITION_WINDOWS_DRAWN = 2;
56
57     /**
58      * Type for {@link #notifyAppTransitionStarting}: The transition was started because of a
59      * timeout.
60      */
61     public static final int APP_TRANSITION_TIMEOUT = 3;
62
63     /**
64      * Grant Uri permissions from one app to another. This method only extends
65      * permission grants if {@code callingUid} has permission to them.
66      */
67     public abstract void grantUriPermissionFromIntent(int callingUid, String targetPkg,
68             Intent intent, int targetUserId);
69
70     /**
71      * Verify that calling app has access to the given provider.
72      */
73     public abstract String checkContentProviderAccess(String authority, int userId);
74
75     // Called by the power manager.
76     public abstract void onWakefulnessChanged(int wakefulness);
77
78     public abstract int startIsolatedProcess(String entryPoint, String[] mainArgs,
79             String processName, String abiOverride, int uid, Runnable crashHandler);
80
81     /**
82      * Acquires a sleep token with the specified tag.
83      *
84      * @param tag A string identifying the purpose of the token (eg. "Dream").
85      */
86     public abstract SleepToken acquireSleepToken(@NonNull String tag);
87
88     /**
89      * Sleep tokens cause the activity manager to put the top activity to sleep.
90      * They are used by components such as dreams that may hide and block interaction
91      * with underlying activities.
92      */
93     public static abstract class SleepToken {
94
95         /**
96          * Releases the sleep token.
97          */
98         public abstract void release();
99     }
100
101     /**
102      * Returns home activity for the specified user.
103      *
104      * @param userId ID of the user or {@link android.os.UserHandle#USER_ALL}
105      */
106     public abstract ComponentName getHomeActivityForUser(int userId);
107
108     /**
109      * Called when a user has been deleted. This can happen during normal device usage
110      * or just at startup, when partially removed users are purged. Any state persisted by the
111      * ActivityManager should be purged now.
112      *
113      * @param userId The user being cleaned up.
114      */
115     public abstract void onUserRemoved(int userId);
116
117     public abstract void onLocalVoiceInteractionStarted(IBinder callingActivity,
118             IVoiceInteractionSession mSession,
119             IVoiceInteractor mInteractor);
120
121     /**
122      * Callback for window manager to let activity manager know that the starting window has been
123      * drawn
124      */
125     public abstract void notifyStartingWindowDrawn();
126
127     /**
128      * Callback for window manager to let activity manager know that we are finally starting the
129      * app transition;
130      *
131      * @param reason The reason why the app transition started. Must be one of the APP_TRANSITION_*
132      *               values.
133      */
134     public abstract void notifyAppTransitionStarting(int reason);
135
136     /**
137      * Callback for window manager to let activity manager know that the app transition was
138      * cancelled.
139      */
140     public abstract void notifyAppTransitionCancelled();
141
142     /**
143      * Callback for window manager to let activity manager know that the app transition is finished.
144      */
145     public abstract void notifyAppTransitionFinished();
146
147     /**
148      * Returns the top activity from each of the currently visible stacks. The first entry will be
149      * the focused activity.
150      */
151     public abstract List<IBinder> getTopVisibleActivities();
152
153     /**
154      * Callback for window manager to let activity manager know that docked stack changes its
155      * minimized state.
156      */
157     public abstract void notifyDockedStackMinimizedChanged(boolean minimized);
158
159     /**
160      * Kill foreground apps from the specified user.
161      */
162     public abstract void killForegroundAppsForUser(int userHandle);
163
164     /**
165      *  Sets how long a {@link PendingIntent} can be temporarily whitelist to by bypass restrictions
166      *  such as Power Save mode.
167      */
168     public abstract void setPendingIntentWhitelistDuration(IIntentSender target, long duration);
169
170     /**
171      * Updates and persists the {@link Configuration} for a given user.
172      *
173      * @param values the configuration to update
174      * @param userId the user to update the configuration for
175      */
176     public abstract void updatePersistentConfigurationForUser(@NonNull Configuration values,
177             int userId);
178
179     /**
180      * Start activity {@code intents} as if {@code packageName} on user {@code userId} did it.
181      *
182      * @return error codes used by {@link IActivityManager#startActivity} and its siblings.
183      */
184     public abstract int startActivitiesAsPackage(String packageName,
185             int userId, Intent[] intents, Bundle bOptions);
186
187     /**
188      * Get the procstate for the UID.  The return value will be between
189      * {@link ActivityManager#MIN_PROCESS_STATE} and {@link ActivityManager#MAX_PROCESS_STATE}.
190      * Note if the UID doesn't exist, it'll return {@link ActivityManager#PROCESS_STATE_NONEXISTENT}
191      * (-1).
192      */
193     public abstract int getUidProcessState(int uid);
194 }