blob: 029c650f8c338e706726b054f7a4cb7f03e4ca5a [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;
28import android.os.RemoteException;
29import android.os.IBinder;
30import android.os.IInterface;
31
32import java.io.FileDescriptor;
33import java.util.List;
34import java.util.Map;
35
36/**
37 * System private API for communicating with the application. This is given to
38 * the activity manager by an application when it starts up, for the activity
39 * manager to tell the application about things it needs to do.
40 *
41 * {@hide}
42 */
43public interface IApplicationThread extends IInterface {
44 void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,
45 int configChanges) throws RemoteException;
46 void scheduleStopActivity(IBinder token, boolean showWindow,
47 int configChanges) throws RemoteException;
48 void scheduleWindowVisibility(IBinder token, boolean showWindow) throws RemoteException;
49 void scheduleResumeActivity(IBinder token, boolean isForward) throws RemoteException;
50 void scheduleSendResult(IBinder token, List<ResultInfo> results) throws RemoteException;
51 void scheduleLaunchActivity(Intent intent, IBinder token,
52 ActivityInfo info, Bundle state, List<ResultInfo> pendingResults,
53 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward)
54 throws RemoteException;
55 void scheduleRelaunchActivity(IBinder token, List<ResultInfo> pendingResults,
56 List<Intent> pendingNewIntents, int configChanges,
57 boolean notResumed) throws RemoteException;
58 void scheduleNewIntent(List<Intent> intent, IBinder token) throws RemoteException;
59 void scheduleDestroyActivity(IBinder token, boolean finished,
60 int configChanges) throws RemoteException;
61 void scheduleReceiver(Intent intent, ActivityInfo info, int resultCode,
62 String data, Bundle extras, boolean sync) throws RemoteException;
Christopher Tate181fafa2009-05-14 11:12:14 -070063 static final int BACKUP_MODE_INCREMENTAL = 0;
64 static final int BACKUP_MODE_FULL = 1;
65 static final int BACKUP_MODE_RESTORE = 2;
66 void scheduleCreateBackupAgent(ApplicationInfo app, int backupMode) throws RemoteException;
67 void scheduleDestroyBackupAgent(ApplicationInfo app) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 void scheduleCreateService(IBinder token, ServiceInfo info) throws RemoteException;
69 void scheduleBindService(IBinder token,
70 Intent intent, boolean rebind) throws RemoteException;
71 void scheduleUnbindService(IBinder token,
72 Intent intent) throws RemoteException;
73 void scheduleServiceArgs(IBinder token, int startId, Intent args) throws RemoteException;
74 void scheduleStopService(IBinder token) throws RemoteException;
75 static final int DEBUG_OFF = 0;
76 static final int DEBUG_ON = 1;
77 static final int DEBUG_WAIT = 2;
78 void bindApplication(String packageName, ApplicationInfo info, List<ProviderInfo> providers,
79 ComponentName testName, String profileName, Bundle testArguments,
Christopher Tate181fafa2009-05-14 11:12:14 -070080 IInstrumentationWatcher testWatcher, int debugMode, boolean restrictedBackupMode,
81 Configuration config, Map<String, IBinder> services) throws RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 void scheduleExit() throws RemoteException;
83 void requestThumbnail(IBinder token) throws RemoteException;
84 void scheduleConfigurationChanged(Configuration config) throws RemoteException;
85 void updateTimeZone() throws RemoteException;
86 void processInBackground() throws RemoteException;
87 void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
88 throws RemoteException;
89 void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
90 int resultCode, String data, Bundle extras, boolean ordered)
91 throws RemoteException;
92 void scheduleLowMemory() throws RemoteException;
93 void scheduleActivityConfigurationChanged(IBinder token) throws RemoteException;
94 void requestPss() throws RemoteException;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -080095 void profilerControl(boolean start, String path) throws RemoteException;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -070096 void setSchedulingGroup(int group) throws RemoteException;
97
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 String descriptor = "android.app.IApplicationThread";
99
100 int SCHEDULE_PAUSE_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION;
101 int SCHEDULE_STOP_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2;
102 int SCHEDULE_WINDOW_VISIBILITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3;
103 int SCHEDULE_RESUME_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4;
104 int SCHEDULE_SEND_RESULT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+5;
105 int SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+6;
106 int SCHEDULE_NEW_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+7;
107 int SCHEDULE_FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+8;
108 int SCHEDULE_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+9;
109 int SCHEDULE_CREATE_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10;
110 int SCHEDULE_STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11;
111 int BIND_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12;
112 int SCHEDULE_EXIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
113 int REQUEST_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14;
114 int SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15;
115 int SCHEDULE_SERVICE_ARGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16;
116 int UPDATE_TIME_ZONE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17;
117 int PROCESS_IN_BACKGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18;
118 int SCHEDULE_BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19;
119 int SCHEDULE_UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20;
120 int DUMP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21;
121 int SCHEDULE_REGISTERED_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22;
122 int SCHEDULE_LOW_MEMORY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23;
123 int SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24;
124 int SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25;
125 int REQUEST_PSS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26;
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800126 int PROFILER_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27;
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700127 int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28;
Christopher Tate181fafa2009-05-14 11:12:14 -0700128 int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29;
129 int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800130}