blob: 55177a90592a3dcbf5d4c537fbf2c1cb7f8ef4ca [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;
26import android.content.res.Configuration;
27import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070028import android.os.Debug;
Dianne Hackborn9c8dd552009-06-23 19:22:52 -070029import android.os.ParcelFileDescriptor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.os.RemoteException;
31import android.os.IBinder;
32import android.os.IInterface;
33
34import java.io.FileDescriptor;
35import java.util.List;
36import java.util.Map;
37
38/**
39 * System private API for communicating with the application. This is given to
40 * the activity manager by an application when it starts up, for the activity
41 * manager to tell the application about things it needs to do.
42 *
43 * {@hide}
44 */
45public interface IApplicationThread extends IInterface {
46 void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,
47 int configChanges) throws RemoteException;
48 void scheduleStopActivity(IBinder token, boolean showWindow,
49 int configChanges) throws RemoteException;
50 void scheduleWindowVisibility(IBinder token, boolean showWindow) throws RemoteException;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -080051 void scheduleSleeping(IBinder token, boolean sleeping) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052 void scheduleResumeActivity(IBinder token, boolean isForward) throws RemoteException;
53 void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException;
Dianne Hackbornb06ea702009-07-13 13:07:51 -070054 void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055 ActivityInfo info, Bundle state, List<ResultInfo> pendingResults,
56 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward)
57 throws RemoteException;
58 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
59 List<Intent> pendingNewIntents, int configChanges,
Dianne Hackborn871ecdc2009-12-11 15:24:33 -080060 boolean notResumed, Configuration config) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException;
62 void scheduleDestroyActivity(IBinder token, boolean finished,
63 int configChanges) throws RemoteException;
64 void scheduleReceiver(Intent intent, ActivityInfo info, int resultCode,
65 String data, Bundle extras, boolean sync) throws RemoteException;
Christopher Tate181fafa2009-05-14 11:12:14 -070066 static final int BACKUP_MODE_INCREMENTAL = 0;
67 static final int BACKUP_MODE_FULL = 1;
68 static final int BACKUP_MODE_RESTORE = 2;
69 void scheduleCreateBackupAgent(ApplicationInfo app, int backupMode) throws RemoteException;
70 void scheduleDestroyBackupAgent(ApplicationInfo app) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080071 void scheduleCreateService(IBinder token, ServiceInfo info) throws RemoteException;
72 void scheduleBindService(IBinder token,
73 Intent intent, boolean rebind) throws RemoteException;
74 void scheduleUnbindService(IBinder token,
75 Intent intent) throws RemoteException;
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -070076 void scheduleServiceArgs(IBinder token, int startId, int flags, Intent args)
77 throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 void scheduleStopService(IBinder token) throws RemoteException;
79 static final int DEBUG_OFF = 0;
80 static final int DEBUG_ON = 1;
81 static final int DEBUG_WAIT = 2;
82 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
83 ComponentName testName, String profileName, Bundle testArguments,
Christopher Tate181fafa2009-05-14 11:12:14 -070084 IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode,
Svetoslav Ganov54d068e2011-03-02 12:58:40 -080085 Configuration config, Map<String, IBinder> services,
86 Bundle coreSettings) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 void scheduleExit() throws RemoteException;
Christopher Tate5e1ab332009-09-01 20:32:49 -070088 void scheduleSuicide() throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089 void requestThumbnail(IBinder token) throws RemoteException;
90 void scheduleConfigurationChanged(Configuration config) throws RemoteException;
91 void updateTimeZone() throws RemoteException;
Robert Greenwalt03595d02010-11-02 14:08:23 -070092 void clearDnsCache() throws RemoteException;
Robert Greenwalt434203a2010-10-11 16:00:27 -070093 void setHttpProxy(String proxy, String port, String exclList) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080094 void processInBackground() throws RemoteException;
95 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
96 throws RemoteException;
97 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn68d881c2009-10-05 13:58:17 -070098 int resultCode, String data, Bundle extras, boolean ordered, boolean sticky)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 throws RemoteException;
100 void scheduleLowMemory() throws RemoteException;
101 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
Dianne Hackborn9c8dd552009-06-23 19:22:52 -0700102 void profilerControl(boolean start, String path, ParcelFileDescriptor fd)
103 throws RemoteException;
Andy McFadden824c5102010-07-09 16:26:57 -0700104 void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd)
105 throws RemoteException;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700106 void setSchedulingGroup(int group) throws RemoteException;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700107 void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700108 static final int PACKAGE_REMOVED = 0;
109 static final int EXTERNAL_STORAGE_UNAVAILABLE = 1;
110 void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700111 void scheduleCrash(String msg) throws RemoteException;
Dianne Hackborn30d71892010-12-11 10:37:55 -0800112 void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -0700113 throws RemoteException;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800114 void setCoreSettings(Bundle coreSettings) throws RemoteException;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 String descriptor = "android.app.IApplicationThread";
117
118 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
119 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
120 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
121 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
122 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
123 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
124 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
125 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
126 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
127 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
128 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
129 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
130 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
131 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
132 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
133 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
134 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
135 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
136 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
137 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
138 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
139 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
140 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
141 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
142 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800143 int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800144 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700145 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
Christopher Tate181fafa2009-05-14 11:12:14 -0700146 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
147 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700148 int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31;
Christopher Tate5e1ab332009-09-01 20:32:49 -0700149 int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32;
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700150 int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33;
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700151 int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34;
Andy McFadden824c5102010-07-09 16:26:57 -0700152 int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35;
Dianne Hackborn625ac272010-09-17 18:29:22 -0700153 int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36;
Robert Greenwalt03595d02010-11-02 14:08:23 -0700154 int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37;
Robert Greenwalt434203a2010-10-11 16:00:27 -0700155 int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38;
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800156 int SET_CORE_SETTINGS = IBinder.FIRST_CALL_TRANSACTION+39;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157}