blob: 1ea9d877bca73083953045bdb147250953bb0706 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070021import android.content.IIntentReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.pm.ActivityInfo;
23import android.content.pm.ApplicationInfo;
24import android.content.pm.ProviderInfo;
25import android.content.pm.ServiceInfo;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040026import android.content.res.CompatibilityInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import android.content.res.Configuration;
28import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070029import android.os.Debug;
Dianne Hackborn9c8dd552009-06-23 19:22:52 -070030import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.os.RemoteException;
32import android.os.IBinder;
33import android.os.IInterface;
34
35import java.io.FileDescriptor;
36import java.util.List;
37import java.util.Map;
38
39/**
40 * System private API for communicating with the application. This is given to
41 * the activity manager by an application when it starts up, for the activity
42 * manager to tell the application about things it needs to do.
43 *
44 * {@hide}
45 */
46public interface IApplicationThread extends IInterface {
47 void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,
48 int configChanges) throws RemoteException;
49 void scheduleStopActivity(IBinder token, boolean showWindow,
50 int configChanges) throws RemoteException;
51 void scheduleWindowVisibility(IBinder token, boolean showWindow) throws RemoteException;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -080052 void scheduleSleeping(IBinder token, boolean sleeping) throws RemoteException;
Adam Powellcfbe9be2013-11-06 14:58:58 -080053 void scheduleResumeActivity(IBinder token, int procState, boolean isForward, Bundle resumeArgs)
Dianne Hackborna413dc02013-07-12 12:02:55 -070054 throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055 void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException;
Dianne Hackbornb06ea702009-07-13 13:07:51 -070056 void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
Dianne Hackborn58f42a52011-10-10 13:46:34 -070057 ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo,
Dianne Hackborna413dc02013-07-12 12:02:55 -070058 int procState, Bundle state, List<ResultInfo> pendingResults,
Adam Powellcfbe9be2013-11-06 14:58:58 -080059 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward,
60 String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler,
61 Bundle resumeArgs)
62 throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
64 List<Intent> pendingNewIntents, int configChanges,
Dianne Hackborn871ecdc2009-12-11 15:24:33 -080065 boolean notResumed, Configuration config) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException;
67 void scheduleDestroyActivity(IBinder token, boolean finished,
68 int configChanges) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040069 void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo,
Dianne Hackborn20e80982012-08-31 19:00:44 -070070 int resultCode, String data, Bundle extras, boolean sync,
Dianne Hackborna413dc02013-07-12 12:02:55 -070071 int sendingUser, int processState) throws RemoteException;
Christopher Tate181fafa2009-05-14 11:12:14 -070072 static final int BACKUP_MODE_INCREMENTAL = 0;
73 static final int BACKUP_MODE_FULL = 1;
74 static final int BACKUP_MODE_RESTORE = 2;
Christopher Tate75a99702011-05-18 16:28:19 -070075 static final int BACKUP_MODE_RESTORE_FULL = 3;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040076 void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo,
77 int backupMode) throws RemoteException;
78 void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo)
79 throws RemoteException;
80 void scheduleCreateService(IBinder token, ServiceInfo info,
Dianne Hackborna413dc02013-07-12 12:02:55 -070081 CompatibilityInfo compatInfo, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 void scheduleBindService(IBinder token,
Dianne Hackborna413dc02013-07-12 12:02:55 -070083 Intent intent, boolean rebind, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084 void scheduleUnbindService(IBinder token,
85 Intent intent) throws RemoteException;
Dianne Hackborn0c5001d2011-04-12 18:16:08 -070086 void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
87 int flags, Intent args) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088 void scheduleStopService(IBinder token) throws RemoteException;
89 static final int DEBUG_OFF = 0;
90 static final int DEBUG_ON = 1;
91 static final int DEBUG_WAIT = 2;
92 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
Dianne Hackborn62f20ec2011-08-15 17:40:28 -070093 ComponentName testName, String profileName, ParcelFileDescriptor profileFd,
Dianne Hackborn5d927c22011-09-02 12:22:18 -070094 boolean autoStopProfiler, Bundle testArguments, IInstrumentationWatcher testWatcher,
Svetoslav Ganov80943d82013-01-02 10:25:37 -080095 IUiAutomationConnection uiAutomationConnection, int debugMode,
96 boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
Dianne Hackborne2515ee2011-04-27 18:52:56 -040097 Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080098 Bundle coreSettings) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 void scheduleExit() throws RemoteException;
Christopher Tate5e1ab332009-09-01 20:32:49 -0700100 void scheduleSuicide() throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800101 void requestThumbnail(IBinder token) throws RemoteException;
102 void scheduleConfigurationChanged(Configuration config) throws RemoteException;
103 void updateTimeZone() throws RemoteException;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700104 void clearDnsCache() throws RemoteException;
Jason Monk602b2322013-07-03 17:04:33 -0400105 void setHttpProxy(String proxy, String port, String exclList,
106 String pacFileUrl) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800107 void processInBackground() throws RemoteException;
108 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
109 throws RemoteException;
Marco Nelissen18cb2872011-11-15 11:19:53 -0800110 void dumpProvider(FileDescriptor fd, IBinder servicetoken, String[] args)
111 throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn20e80982012-08-31 19:00:44 -0700113 int resultCode, String data, Bundle extras, boolean ordered,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700114 boolean sticky, int sendingUser, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800115 void scheduleLowMemory() throws RemoteException;
116 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
Romain Guy7eabe552011-07-21 14:56:34 -0700117 void profilerControl(boolean start, String path, ParcelFileDescriptor fd, int profileType)
Dianne Hackborn9c8dd552009-06-23 19:22:52 -0700118 throws RemoteException;
Andy McFadden824c5102010-07-09 16:26:57 -0700119 void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
120 throws RemoteException;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700121 void setSchedulingGroup(int group) throws RemoteException;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700122 static final int PACKAGE_REMOVED = 0;
123 static final int EXTERNAL_STORAGE_UNAVAILABLE = 1;
124 void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700125 void scheduleCrash(String msg) throws RemoteException;
Dianne Hackborn30d71892010-12-11 10:37:55 -0800126 void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -0700127 throws RemoteException;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800128 void setCoreSettings(Bundle coreSettings) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400129 void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700130 void scheduleTrimMemory(int level) throws RemoteException;
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -0700131 void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo,
Dianne Hackborn64770d12013-05-23 17:51:19 -0700132 boolean dumpDalvik, String[] args) throws RemoteException;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700133 void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException;
Jeff Brown6754ba22011-12-14 20:20:01 -0800134 void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException;
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700135 void unstableProviderDied(IBinder provider) throws RemoteException;
Adam Skory7140a252013-09-11 12:04:58 +0100136 void requestAssistContextExtras(IBinder activityToken, IBinder requestToken, int requestType)
137 throws RemoteException;
Craig Mautner5eda9b32013-07-02 11:58:16 -0700138 void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
139 throws RemoteException;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700140 void setProcessState(int state) throws RemoteException;
Jeff Sharkeydd97f422013-10-08 17:01:30 -0700141 void scheduleInstallProvider(ProviderInfo provider) throws RemoteException;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700142
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143 String descriptor = "android.app.IApplicationThread";
144
145 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
146 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
147 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
148 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
149 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
150 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
151 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
152 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
153 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
154 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
155 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
156 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
157 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
158 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
159 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
160 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
161 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
162 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
163 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
164 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
165 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
166 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
167 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
168 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
169 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800170 int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800171 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700172 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
Christopher Tate181fafa2009-05-14 11:12:14 -0700173 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
174 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -0700175
Christopher Tate5e1ab332009-09-01 20:32:49 -0700176 int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700177 int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700178 int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
Andy McFadden824c5102010-07-09 16:26:57 -0700179 int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700180 int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700181 int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
Robert Greenwalt434203a2010-10-11 16:00:27 -0700182 int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400183 int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39;
184 int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700185 int SCHEDULE_TRIM_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700186 int DUMP_MEM_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42;
187 int DUMP_GFX_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43;
Marco Nelissen18cb2872011-11-15 11:19:53 -0800188 int DUMP_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+44;
Jeff Brown6754ba22011-12-14 20:20:01 -0800189 int DUMP_DB_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+45;
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700190 int UNSTABLE_PROVIDER_DIED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+46;
Adam Skorydfc7fd72013-08-05 19:23:41 -0700191 int REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+47;
Craig Mautner5eda9b32013-07-02 11:58:16 -0700192 int SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+48;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700193 int SET_PROCESS_STATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+49;
Jeff Sharkeydd97f422013-10-08 17:01:30 -0700194 int SCHEDULE_INSTALL_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+50;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195}