The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 | |
| 17 | package android.app; |
| 18 | |
| 19 | import android.content.ComponentName; |
| 20 | import android.content.Intent; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 21 | import android.content.IIntentReceiver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.pm.ActivityInfo; |
| 23 | import android.content.pm.ApplicationInfo; |
| 24 | import android.content.pm.ProviderInfo; |
| 25 | import android.content.pm.ServiceInfo; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 26 | import android.content.res.CompatibilityInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | import android.content.res.Configuration; |
| 28 | import android.os.Bundle; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 29 | import android.os.Debug; |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 30 | import android.os.ParcelFileDescriptor; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import android.os.RemoteException; |
| 32 | import android.os.IBinder; |
| 33 | import android.os.IInterface; |
| 34 | |
| 35 | import java.io.FileDescriptor; |
| 36 | import java.util.List; |
| 37 | import 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 | */ |
| 46 | public 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 Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 52 | void scheduleSleeping(IBinder token, boolean sleeping) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | void scheduleResumeActivity(IBinder token, boolean isForward) throws RemoteException; |
| 54 | void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException; |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 55 | void scheduleLaunchActivity(Intent intent, IBinder token, int ident, |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 56 | ActivityInfo info, CompatibilityInfo compatInfo, Bundle state, |
| 57 | List<ResultInfo> pendingResults, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | 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 Hackborn | 871ecdc | 2009-12-11 15:24:33 -0800 | [diff] [blame] | 62 | boolean notResumed, Configuration config) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 63 | void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException; |
| 64 | void scheduleDestroyActivity(IBinder token, boolean finished, |
| 65 | int configChanges) throws RemoteException; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 66 | void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo, |
| 67 | int resultCode, String data, Bundle extras, boolean sync) throws RemoteException; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 68 | static final int BACKUP_MODE_INCREMENTAL = 0; |
| 69 | static final int BACKUP_MODE_FULL = 1; |
| 70 | static final int BACKUP_MODE_RESTORE = 2; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 71 | void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo, |
| 72 | int backupMode) throws RemoteException; |
| 73 | void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo) |
| 74 | throws RemoteException; |
| 75 | void scheduleCreateService(IBinder token, ServiceInfo info, |
| 76 | CompatibilityInfo compatInfo) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | void scheduleBindService(IBinder token, |
| 78 | Intent intent, boolean rebind) throws RemoteException; |
| 79 | void scheduleUnbindService(IBinder token, |
| 80 | Intent intent) throws RemoteException; |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 81 | void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId, |
| 82 | int flags, Intent args) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | void scheduleStopService(IBinder token) throws RemoteException; |
| 84 | static final int DEBUG_OFF = 0; |
| 85 | static final int DEBUG_ON = 1; |
| 86 | static final int DEBUG_WAIT = 2; |
| 87 | void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers, |
| 88 | ComponentName testName, String profileName, Bundle testArguments, |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 89 | IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode, |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 90 | Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services, |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 91 | Bundle coreSettings) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | void scheduleExit() throws RemoteException; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 93 | void scheduleSuicide() throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 94 | void requestThumbnail(IBinder token) throws RemoteException; |
| 95 | void scheduleConfigurationChanged(Configuration config) throws RemoteException; |
| 96 | void updateTimeZone() throws RemoteException; |
Robert Greenwalt | 03595d0 | 2010-11-02 14:08:23 -0700 | [diff] [blame] | 97 | void clearDnsCache() throws RemoteException; |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 98 | void setHttpProxy(String proxy, String port, String exclList) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | void processInBackground() throws RemoteException; |
| 100 | void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args) |
| 101 | throws RemoteException; |
| 102 | void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, |
Dianne Hackborn | 68d881c | 2009-10-05 13:58:17 -0700 | [diff] [blame] | 103 | int resultCode, String data, Bundle extras, boolean ordered, boolean sticky) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 104 | throws RemoteException; |
| 105 | void scheduleLowMemory() throws RemoteException; |
| 106 | void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException; |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 107 | void profilerControl(boolean start, String path, ParcelFileDescriptor fd) |
| 108 | throws RemoteException; |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 109 | void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd) |
| 110 | throws RemoteException; |
Dianne Hackborn | 06de2ea | 2009-05-21 12:56:43 -0700 | [diff] [blame] | 111 | void setSchedulingGroup(int group) throws RemoteException; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 112 | void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException; |
Dianne Hackborn | 4416c3d | 2010-05-04 17:22:49 -0700 | [diff] [blame] | 113 | static final int PACKAGE_REMOVED = 0; |
| 114 | static final int EXTERNAL_STORAGE_UNAVAILABLE = 1; |
| 115 | void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException; |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 116 | void scheduleCrash(String msg) throws RemoteException; |
Dianne Hackborn | 30d7189 | 2010-12-11 10:37:55 -0800 | [diff] [blame] | 117 | void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args) |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 118 | throws RemoteException; |
Svetoslav Ganov | 54d068e | 2011-03-02 12:58:40 -0800 | [diff] [blame] | 119 | void setCoreSettings(Bundle coreSettings) throws RemoteException; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 120 | void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException; |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 121 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | String descriptor = "android.app.IApplicationThread"; |
| 123 | |
| 124 | int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; |
| 125 | int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2; |
| 126 | int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3; |
| 127 | int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4; |
| 128 | int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5; |
| 129 | int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6; |
| 130 | int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7; |
| 131 | int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8; |
| 132 | int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9; |
| 133 | int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10; |
| 134 | int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11; |
| 135 | int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12; |
| 136 | int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13; |
| 137 | int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14; |
| 138 | int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15; |
| 139 | int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16; |
| 140 | int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17; |
| 141 | int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18; |
| 142 | int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19; |
| 143 | int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20; |
| 144 | int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21; |
| 145 | int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22; |
| 146 | int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23; |
| 147 | int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24; |
| 148 | int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25; |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 149 | int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26; |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 150 | int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27; |
Dianne Hackborn | 06de2ea | 2009-05-21 12:56:43 -0700 | [diff] [blame] | 151 | int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 152 | int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; |
| 153 | int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 154 | int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 155 | int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; |
Dianne Hackborn | 4416c3d | 2010-05-04 17:22:49 -0700 | [diff] [blame] | 156 | int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 157 | int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 158 | int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35; |
Dianne Hackborn | 625ac27 | 2010-09-17 18:29:22 -0700 | [diff] [blame] | 159 | int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36; |
Robert Greenwalt | 03595d0 | 2010-11-02 14:08:23 -0700 | [diff] [blame] | 160 | int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37; |
Robert Greenwalt | 434203a | 2010-10-11 16:00:27 -0700 | [diff] [blame] | 161 | int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 162 | int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39; |
| 163 | int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 164 | } |