blob: 8e882df40ad21d7b30378ac28cbe589500ee9155 [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;
Dianne Hackborna413dc02013-07-12 12:02:55 -070053 void scheduleResumeActivity(IBinder token, int procState, boolean isForward)
54 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,
Dianne Hackborn58f42a52011-10-10 13:46:34 -070059 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward,
60 String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 throws RemoteException;
62 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
63 List<Intent> pendingNewIntents, int configChanges,
Dianne Hackborn871ecdc2009-12-11 15:24:33 -080064 boolean notResumed, Configuration config) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException;
66 void scheduleDestroyActivity(IBinder token, boolean finished,
67 int configChanges) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040068 void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo,
Dianne Hackborn20e80982012-08-31 19:00:44 -070069 int resultCode, String data, Bundle extras, boolean sync,
Dianne Hackborna413dc02013-07-12 12:02:55 -070070 int sendingUser, int processState) throws RemoteException;
Christopher Tate181fafa2009-05-14 11:12:14 -070071 static final int BACKUP_MODE_INCREMENTAL = 0;
72 static final int BACKUP_MODE_FULL = 1;
73 static final int BACKUP_MODE_RESTORE = 2;
Christopher Tate75a99702011-05-18 16:28:19 -070074 static final int BACKUP_MODE_RESTORE_FULL = 3;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040075 void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo,
76 int backupMode) throws RemoteException;
77 void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo)
78 throws RemoteException;
79 void scheduleCreateService(IBinder token, ServiceInfo info,
Dianne Hackborna413dc02013-07-12 12:02:55 -070080 CompatibilityInfo compatInfo, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080081 void scheduleBindService(IBinder token,
Dianne Hackborna413dc02013-07-12 12:02:55 -070082 Intent intent, boolean rebind, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 void scheduleUnbindService(IBinder token,
84 Intent intent) throws RemoteException;
Dianne Hackborn0c5001d2011-04-12 18:16:08 -070085 void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
86 int flags, Intent args) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 void scheduleStopService(IBinder token) throws RemoteException;
88 static final int DEBUG_OFF = 0;
89 static final int DEBUG_ON = 1;
90 static final int DEBUG_WAIT = 2;
91 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
Dianne Hackborn62f20ec2011-08-15 17:40:28 -070092 ComponentName testName, String profileName, ParcelFileDescriptor profileFd,
Dianne Hackborn5d927c22011-09-02 12:22:18 -070093 boolean autoStopProfiler, Bundle testArguments, IInstrumentationWatcher testWatcher,
Svetoslav Ganov80943d82013-01-02 10:25:37 -080094 IUiAutomationConnection uiAutomationConnection, int debugMode,
95 boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
Dianne Hackborne2515ee2011-04-27 18:52:56 -040096 Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080097 Bundle coreSettings) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 void scheduleExit() throws RemoteException;
Christopher Tate5e1ab332009-09-01 20:32:49 -070099 void scheduleSuicide() throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 void requestThumbnail(IBinder token) throws RemoteException;
101 void scheduleConfigurationChanged(Configuration config) throws RemoteException;
102 void updateTimeZone() throws RemoteException;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700103 void clearDnsCache() throws RemoteException;
Robert Greenwalt434203a2010-10-11 16:00:27 -0700104 void setHttpProxy(String proxy, String port, String exclList) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 void processInBackground() throws RemoteException;
106 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
107 throws RemoteException;
Marco Nelissen18cb2872011-11-15 11:19:53 -0800108 void dumpProvider(FileDescriptor fd, IBinder servicetoken, String[] args)
109 throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn20e80982012-08-31 19:00:44 -0700111 int resultCode, String data, Bundle extras, boolean ordered,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700112 boolean sticky, int sendingUser, int processState) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 void scheduleLowMemory() throws RemoteException;
114 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
Romain Guy7eabe552011-07-21 14:56:34 -0700115 void profilerControl(boolean start, String path, ParcelFileDescriptor fd, int profileType)
Dianne Hackborn9c8dd552009-06-23 19:22:52 -0700116 throws RemoteException;
Andy McFadden824c5102010-07-09 16:26:57 -0700117 void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
118 throws RemoteException;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700119 void setSchedulingGroup(int group) throws RemoteException;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700120 void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700121 static final int PACKAGE_REMOVED = 0;
122 static final int EXTERNAL_STORAGE_UNAVAILABLE = 1;
123 void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700124 void scheduleCrash(String msg) throws RemoteException;
Dianne Hackborn30d71892010-12-11 10:37:55 -0800125 void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -0700126 throws RemoteException;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800127 void setCoreSettings(Bundle coreSettings) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400128 void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700129 void scheduleTrimMemory(int level) throws RemoteException;
Dianne Hackborn64770d12013-05-23 17:51:19 -0700130 Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean dumpInfo,
131 boolean dumpDalvik, String[] args) throws RemoteException;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700132 void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException;
Jeff Brown6754ba22011-12-14 20:20:01 -0800133 void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException;
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700134 void unstableProviderDied(IBinder provider) throws RemoteException;
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800135 void requestActivityExtras(IBinder activityToken, IBinder requestToken, int requestType)
136 throws RemoteException;
Craig Mautner5eda9b32013-07-02 11:58:16 -0700137 void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
138 throws RemoteException;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700139 void setProcessState(int state) throws RemoteException;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700140
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 String descriptor = "android.app.IApplicationThread";
142
143 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
144 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
145 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
146 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
147 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
148 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
149 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
150 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
151 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
152 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
153 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
154 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
155 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
156 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
157 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
158 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
159 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
160 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
161 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
162 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
163 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
164 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
165 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
166 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
167 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800168 int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800169 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700170 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
Christopher Tate181fafa2009-05-14 11:12:14 -0700171 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
172 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700173 int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31;
Christopher Tate5e1ab332009-09-01 20:32:49 -0700174 int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700175 int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700176 int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
Andy McFadden824c5102010-07-09 16:26:57 -0700177 int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700178 int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700179 int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
Robert Greenwalt434203a2010-10-11 16:00:27 -0700180 int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400181 int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39;
182 int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700183 int SCHEDULE_TRIM_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700184 int DUMP_MEM_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42;
185 int DUMP_GFX_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43;
Marco Nelissen18cb2872011-11-15 11:19:53 -0800186 int DUMP_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+44;
Jeff Brown6754ba22011-12-14 20:20:01 -0800187 int DUMP_DB_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+45;
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700188 int UNSTABLE_PROVIDER_DIED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+46;
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800189 int REQUEST_ACTIVITY_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+47;
Craig Mautner5eda9b32013-07-02 11:58:16 -0700190 int SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+48;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700191 int SET_PROCESS_STATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+49;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192}