IApplicationThread.java revision 85d558cd486d195aabfc4b43cff8f338126f60a5
1/*
2 * Copyright (C) 2006 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
19import android.content.ComponentName;
20import android.content.Intent;
21import android.content.IIntentReceiver;
22import android.content.pm.ActivityInfo;
23import android.content.pm.ApplicationInfo;
24import android.content.pm.ProviderInfo;
25import android.content.pm.ServiceInfo;
26import android.content.res.CompatibilityInfo;
27import android.content.res.Configuration;
28import android.net.Uri;
29import android.os.Bundle;
30import android.os.Debug;
31import android.os.ParcelFileDescriptor;
32import android.os.PersistableBundle;
33import android.os.RemoteException;
34import android.os.IBinder;
35import android.os.IInterface;
36import android.service.voice.IVoiceInteractionSession;
37import com.android.internal.app.IVoiceInteractor;
38import com.android.internal.content.ReferrerIntent;
39
40import java.io.FileDescriptor;
41import java.util.List;
42import java.util.Map;
43
44/**
45 * System private API for communicating with the application.  This is given to
46 * the activity manager by an application  when it starts up, for the activity
47 * manager to tell the application about things it needs to do.
48 *
49 * {@hide}
50 */
51public interface IApplicationThread extends IInterface {
52    void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,
53            int configChanges, boolean dontReport) throws RemoteException;
54    void scheduleStopActivity(IBinder token, boolean showWindow,
55            int configChanges) throws RemoteException;
56    void scheduleWindowVisibility(IBinder token, boolean showWindow) throws RemoteException;
57    void scheduleSleeping(IBinder token, boolean sleeping) throws RemoteException;
58    void scheduleResumeActivity(IBinder token, int procState, boolean isForward, Bundle resumeArgs)
59            throws RemoteException;
60    void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException;
61    void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
62            ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo,
63            String referrer, IVoiceInteractor voiceInteractor, int procState, Bundle state,
64            PersistableBundle persistentState, List<ResultInfo> pendingResults,
65            List<ReferrerIntent> pendingNewIntents, boolean notResumed, boolean isForward,
66            ProfilerInfo profilerInfo) throws RemoteException;
67    void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
68            List<ReferrerIntent> pendingNewIntents, int configChanges,
69            boolean notResumed, Configuration config) throws RemoteException;
70    void scheduleNewIntent(List<ReferrerIntent> intent, IBinder token) throws RemoteException;
71    void scheduleDestroyActivity(IBinder token, boolean finished,
72            int configChanges) throws RemoteException;
73    void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo,
74            int resultCode, String data, Bundle extras, boolean sync,
75            int sendingUser, int processState) throws RemoteException;
76    static final int BACKUP_MODE_INCREMENTAL = 0;
77    static final int BACKUP_MODE_FULL = 1;
78    static final int BACKUP_MODE_RESTORE = 2;
79    static final int BACKUP_MODE_RESTORE_FULL = 3;
80    void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo,
81            int backupMode) throws RemoteException;
82    void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo)
83            throws RemoteException;
84    void scheduleCreateService(IBinder token, ServiceInfo info,
85            CompatibilityInfo compatInfo, int processState) throws RemoteException;
86    void scheduleBindService(IBinder token,
87            Intent intent, boolean rebind, int processState) throws RemoteException;
88    void scheduleUnbindService(IBinder token,
89            Intent intent) throws RemoteException;
90    void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
91            int flags, Intent args) throws RemoteException;
92    void scheduleStopService(IBinder token) throws RemoteException;
93    static final int DEBUG_OFF = 0;
94    static final int DEBUG_ON = 1;
95    static final int DEBUG_WAIT = 2;
96    void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
97            ComponentName testName, ProfilerInfo profilerInfo, Bundle testArguments,
98            IInstrumentationWatcher testWatcher, IUiAutomationConnection uiAutomationConnection,
99            int debugMode, boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
100            Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
101            Bundle coreSettings) throws RemoteException;
102    void scheduleExit() throws RemoteException;
103    void scheduleSuicide() throws RemoteException;
104    void scheduleConfigurationChanged(Configuration config) throws RemoteException;
105    void updateTimeZone() throws RemoteException;
106    void clearDnsCache() throws RemoteException;
107    void setHttpProxy(String proxy, String port, String exclList,
108            Uri pacFileUrl) throws RemoteException;
109    void processInBackground() throws RemoteException;
110    void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
111            throws RemoteException;
112    void dumpProvider(FileDescriptor fd, IBinder servicetoken, String[] args)
113            throws RemoteException;
114    void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
115            int resultCode, String data, Bundle extras, boolean ordered,
116            boolean sticky, int sendingUser, int processState) throws RemoteException;
117    void scheduleLowMemory() throws RemoteException;
118    void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
119    void profilerControl(boolean start, ProfilerInfo profilerInfo, int profileType)
120            throws RemoteException;
121    void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
122            throws RemoteException;
123    void setSchedulingGroup(int group) throws RemoteException;
124    static final int PACKAGE_REMOVED = 0;
125    static final int EXTERNAL_STORAGE_UNAVAILABLE = 1;
126    void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException;
127    void scheduleCrash(String msg) throws RemoteException;
128    void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args)
129            throws RemoteException;
130    void setCoreSettings(Bundle coreSettings) throws RemoteException;
131    void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException;
132    void scheduleTrimMemory(int level) throws RemoteException;
133    void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo,
134            boolean dumpDalvik, String[] args) throws RemoteException;
135    void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException;
136    void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException;
137    void unstableProviderDied(IBinder provider) throws RemoteException;
138    void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType)
139            throws RemoteException;
140    void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
141            throws RemoteException;
142    void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options)
143            throws RemoteException;
144    void setProcessState(int state) throws RemoteException;
145    void scheduleInstallProvider(ProviderInfo provider) throws RemoteException;
146    void updateTimePrefs(boolean is24Hour) throws RemoteException;
147    void scheduleCancelVisibleBehind(IBinder token) throws RemoteException;
148    void scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled) throws RemoteException;
149    void scheduleEnterAnimationComplete(IBinder token) throws RemoteException;
150
151    String descriptor = "android.app.IApplicationThread";
152
153    int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
154    int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
155    int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
156    int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
157    int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
158    int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
159    int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
160    int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
161    int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
162    int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
163    int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
164    int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
165    int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
166
167    int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
168    int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
169    int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
170    int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
171    int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
172    int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
173    int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
174    int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
175    int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
176    int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
177    int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
178    int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
179    int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
180    int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
181    int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
182    int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
183    int SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31;
184    int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
185    int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
186    int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
187    int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
188    int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
189    int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
190    int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38;
191    int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39;
192    int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40;
193    int SCHEDULE_TRIM_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41;
194    int DUMP_MEM_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42;
195    int DUMP_GFX_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43;
196    int DUMP_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+44;
197    int DUMP_DB_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+45;
198    int UNSTABLE_PROVIDER_DIED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+46;
199    int REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+47;
200    int SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+48;
201    int SET_PROCESS_STATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+49;
202    int SCHEDULE_INSTALL_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+50;
203    int UPDATE_TIME_PREFS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+51;
204    int CANCEL_VISIBLE_BEHIND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+52;
205    int BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+53;
206    int ENTER_ANIMATION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+54;
207}
208