blob: d0607d09040d5fd1a52ee391ccae9c072346e6d1 [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053 void scheduleResumeActivity(IBinder token, boolean isForward) throws RemoteException;
54 void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException;
Dianne Hackbornb06ea702009-07-13 13:07:51 -070055 void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
Dianne Hackborne2515ee2011-04-27 18:52:56 -040056 ActivityInfo info, CompatibilityInfo compatInfo, Bundle state,
57 List<ResultInfo> pendingResults,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward)
59 throws RemoteException;
60 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
61 List<Intent> pendingNewIntents, int configChanges,
Dianne Hackborn871ecdc2009-12-11 15:24:33 -080062 boolean notResumed, Configuration config) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080063 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException;
64 void scheduleDestroyActivity(IBinder token, boolean finished,
65 int configChanges) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040066 void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo,
67 int resultCode, String data, Bundle extras, boolean sync) throws RemoteException;
Christopher Tate181fafa2009-05-14 11:12:14 -070068 static final int BACKUP_MODE_INCREMENTAL = 0;
69 static final int BACKUP_MODE_FULL = 1;
70 static final int BACKUP_MODE_RESTORE = 2;
Christopher Tate75a99702011-05-18 16:28:19 -070071 static final int BACKUP_MODE_RESTORE_FULL = 3;
Dianne Hackborne2515ee2011-04-27 18:52:56 -040072 void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo,
73 int backupMode) throws RemoteException;
74 void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo)
75 throws RemoteException;
76 void scheduleCreateService(IBinder token, ServiceInfo info,
77 CompatibilityInfo compatInfo) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 void scheduleBindService(IBinder token,
79 Intent intent, boolean rebind) throws RemoteException;
80 void scheduleUnbindService(IBinder token,
81 Intent intent) throws RemoteException;
Dianne Hackborn0c5001d2011-04-12 18:16:08 -070082 void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
83 int flags, Intent args) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084 void scheduleStopService(IBinder token) throws RemoteException;
85 static final int DEBUG_OFF = 0;
86 static final int DEBUG_ON = 1;
87 static final int DEBUG_WAIT = 2;
88 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
89 ComponentName testName, String profileName, Bundle testArguments,
Christopher Tate181fafa2009-05-14 11:12:14 -070090 IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode,
Dianne Hackborne2515ee2011-04-27 18:52:56 -040091 Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080092 Bundle coreSettings) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 void scheduleExit() throws RemoteException;
Christopher Tate5e1ab332009-09-01 20:32:49 -070094 void scheduleSuicide() throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 void requestThumbnail(IBinder token) throws RemoteException;
96 void scheduleConfigurationChanged(Configuration config) throws RemoteException;
97 void updateTimeZone() throws RemoteException;
Robert Greenwalt03595d02010-11-02 14:08:23 -070098 void clearDnsCache() throws RemoteException;
Robert Greenwalt434203a2010-10-11 16:00:27 -070099 void setHttpProxy(String proxy, String port, String exclList) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 void processInBackground() throws RemoteException;
101 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
102 throws RemoteException;
103 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn68d881c2009-10-05 13:58:17 -0700104 int resultCode, String data, Bundle extras, boolean ordered, boolean sticky)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 throws RemoteException;
106 void scheduleLowMemory() throws RemoteException;
107 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
Romain Guy7eabe552011-07-21 14:56:34 -0700108 void profilerControl(boolean start, String path, ParcelFileDescriptor fd, int profileType)
Dianne Hackborn9c8dd552009-06-23 19:22:52 -0700109 throws RemoteException;
Andy McFadden824c5102010-07-09 16:26:57 -0700110 void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
111 throws RemoteException;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700112 void setSchedulingGroup(int group) throws RemoteException;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700113 void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700114 static final int PACKAGE_REMOVED = 0;
115 static final int EXTERNAL_STORAGE_UNAVAILABLE = 1;
116 void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700117 void scheduleCrash(String msg) throws RemoteException;
Dianne Hackborn30d71892010-12-11 10:37:55 -0800118 void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -0700119 throws RemoteException;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800120 void setCoreSettings(Bundle coreSettings) throws RemoteException;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400121 void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700122 void scheduleTrimMemory(int level) throws RemoteException;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700123 Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, String[] args) throws RemoteException;
124 void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 String descriptor = "android.app.IApplicationThread";
127
128 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
129 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
130 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
131 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
132 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
133 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
134 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
135 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
136 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
137 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
138 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
139 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
140 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
141 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
142 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
143 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
144 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
145 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
146 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
147 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
148 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
149 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
150 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
151 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
152 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800153 int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800154 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700155 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
Christopher Tate181fafa2009-05-14 11:12:14 -0700156 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
157 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700158 int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31;
Christopher Tate5e1ab332009-09-01 20:32:49 -0700159 int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700160 int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700161 int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
Andy McFadden824c5102010-07-09 16:26:57 -0700162 int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700163 int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700164 int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
Robert Greenwalt434203a2010-10-11 16:00:27 -0700165 int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38;
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400166 int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39;
167 int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40;
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700168 int SCHEDULE_TRIM_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700169 int DUMP_MEM_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42;
170 int DUMP_GFX_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800171}