IApplicationThread.java revision f9c5e0fe837a3090820da502ecaabc5accc00ace
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 17package android.app; 18 19import android.content.ComponentName; 20import android.content.Intent; 21import android.content.IIntentReceiver; 22import android.content.pm.ActivityInfo; 23import android.content.pm.ApplicationInfo; 24import android.content.pm.ProviderInfo; 25import android.content.pm.ServiceInfo; 26import android.content.res.CompatibilityInfo; 27import android.content.res.Configuration; 28import android.os.Bundle; 29import android.os.Debug; 30import android.os.ParcelFileDescriptor; 31import 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; 52 void scheduleSleeping(IBinder token, boolean sleeping) throws RemoteException; 53 void scheduleResumeActivity(IBinder token, boolean isForward) throws RemoteException; 54 void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException; 55 void scheduleLaunchActivity(Intent intent, IBinder token, int ident, 56 ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo, 57 Bundle state, List<ResultInfo> pendingResults, 58 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward, 59 String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler) 60 throws RemoteException; 61 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults, 62 List<Intent> pendingNewIntents, int configChanges, 63 boolean notResumed, Configuration config) throws RemoteException; 64 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException; 65 void scheduleDestroyActivity(IBinder token, boolean finished, 66 int configChanges) throws RemoteException; 67 void scheduleReceiver(Intent intent, ActivityInfo info, CompatibilityInfo compatInfo, 68 int resultCode, String data, Bundle extras, boolean sync, 69 int sendingUser) throws RemoteException; 70 static final int BACKUP_MODE_INCREMENTAL = 0; 71 static final int BACKUP_MODE_FULL = 1; 72 static final int BACKUP_MODE_RESTORE = 2; 73 static final int BACKUP_MODE_RESTORE_FULL = 3; 74 void scheduleCreateBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo, 75 int backupMode) throws RemoteException; 76 void scheduleDestroyBackupAgent(ApplicationInfo app, CompatibilityInfo compatInfo) 77 throws RemoteException; 78 void scheduleCreateService(IBinder token, ServiceInfo info, 79 CompatibilityInfo compatInfo) throws RemoteException; 80 void scheduleBindService(IBinder token, 81 Intent intent, boolean rebind) throws RemoteException; 82 void scheduleUnbindService(IBinder token, 83 Intent intent) throws RemoteException; 84 void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId, 85 int flags, Intent args) throws RemoteException; 86 void scheduleStopService(IBinder token) throws RemoteException; 87 static final int DEBUG_OFF = 0; 88 static final int DEBUG_ON = 1; 89 static final int DEBUG_WAIT = 2; 90 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers, 91 ComponentName testName, String profileName, ParcelFileDescriptor profileFd, 92 boolean autoStopProfiler, Bundle testArguments, IInstrumentationWatcher testWatcher, 93 int debugMode, boolean openGlTrace, boolean restrictedBackupMode, boolean persistent, 94 Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services, 95 Bundle coreSettings) throws RemoteException; 96 void scheduleExit() throws RemoteException; 97 void scheduleSuicide() throws RemoteException; 98 void requestThumbnail(IBinder token) throws RemoteException; 99 void scheduleConfigurationChanged(Configuration config) throws RemoteException; 100 void updateTimeZone() throws RemoteException; 101 void clearDnsCache() throws RemoteException; 102 void setHttpProxy(String proxy, String port, String exclList) throws RemoteException; 103 void processInBackground() throws RemoteException; 104 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args) 105 throws RemoteException; 106 void dumpProvider(FileDescriptor fd, IBinder servicetoken, String[] args) 107 throws RemoteException; 108 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, 109 int resultCode, String data, Bundle extras, boolean ordered, 110 boolean sticky, int sendingUser) throws RemoteException; 111 void scheduleLowMemory() throws RemoteException; 112 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException; 113 void profilerControl(boolean start, String path, ParcelFileDescriptor fd, int profileType) 114 throws RemoteException; 115 void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd) 116 throws RemoteException; 117 void setSchedulingGroup(int group) throws RemoteException; 118 void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException; 119 static final int PACKAGE_REMOVED = 0; 120 static final int EXTERNAL_STORAGE_UNAVAILABLE = 1; 121 void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException; 122 void scheduleCrash(String msg) throws RemoteException; 123 void dumpActivity(FileDescriptor fd, IBinder servicetoken, String prefix, String[] args) 124 throws RemoteException; 125 void setCoreSettings(Bundle coreSettings) throws RemoteException; 126 void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException; 127 void scheduleTrimMemory(int level) throws RemoteException; 128 Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean all, 129 String[] args) throws RemoteException; 130 void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException; 131 void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException; 132 void unstableProviderDied(IBinder provider) throws RemoteException; 133 void requestActivityExtras(IBinder activityToken, IBinder requestToken, int requestType) 134 throws RemoteException; 135 136 String descriptor = "android.app.IApplicationThread"; 137 138 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; 139 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2; 140 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3; 141 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4; 142 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5; 143 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6; 144 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7; 145 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8; 146 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9; 147 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10; 148 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11; 149 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12; 150 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13; 151 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14; 152 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15; 153 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16; 154 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17; 155 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18; 156 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19; 157 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20; 158 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21; 159 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22; 160 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23; 161 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24; 162 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25; 163 int SCHEDULE_SLEEPING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26; 164 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27; 165 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; 166 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; 167 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; 168 int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; 169 int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; 170 int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; 171 int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; 172 int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35; 173 int DUMP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36; 174 int CLEAR_DNS_CACHE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37; 175 int SET_HTTP_PROXY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38; 176 int SET_CORE_SETTINGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39; 177 int UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40; 178 int SCHEDULE_TRIM_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41; 179 int DUMP_MEM_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42; 180 int DUMP_GFX_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43; 181 int DUMP_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+44; 182 int DUMP_DB_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+45; 183 int UNSTABLE_PROVIDER_DIED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+46; 184 int REQUEST_ACTIVITY_EXTRAS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+47; 185} 186