blob: 744ddf7041617be087e9acac4579912782c2c74f [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;
Jason Monk83520b92014-05-09 15:16:06 -040028import android.net.Uri;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.os.Binder;
30import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070031import android.os.Debug;
Dianne Hackborn9c8dd552009-06-23 19:22:52 -070032import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070033import android.os.PersistableBundle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.os.RemoteException;
35import android.os.IBinder;
36import android.os.Parcel;
37import android.os.ParcelFileDescriptor;
Christopher Tate8a2ce3c2015-06-19 10:28:20 -070038import android.os.TransactionTooLargeException;
39import android.util.Log;
40
Dianne Hackborn91097de2014-04-04 18:02:06 -070041import com.android.internal.app.IVoiceInteractor;
Dianne Hackborn85d558c2014-11-04 10:31:54 -080042import com.android.internal.content.ReferrerIntent;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043
44import java.io.FileDescriptor;
45import java.io.IOException;
46import java.util.HashMap;
47import java.util.List;
48import java.util.Map;
49
50/** {@hide} */
51public abstract class ApplicationThreadNative extends Binder
52 implements IApplicationThread {
53 /**
54 * Cast a Binder object into an application thread interface, generating
55 * a proxy if needed.
56 */
57 static public IApplicationThread asInterface(IBinder obj) {
58 if (obj == null) {
59 return null;
60 }
61 IApplicationThread in =
62 (IApplicationThread)obj.queryLocalInterface(descriptor);
63 if (in != null) {
64 return in;
65 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -070066
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 return new ApplicationThreadProxy(obj);
68 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -070069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 public ApplicationThreadNative() {
71 attachInterface(this, descriptor);
72 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -070073
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 @Override
75 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
76 throws RemoteException {
77 switch (code) {
78 case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION:
79 {
80 data.enforceInterface(IApplicationThread.descriptor);
81 IBinder b = data.readStrongBinder();
82 boolean finished = data.readInt() != 0;
83 boolean userLeaving = data.readInt() != 0;
84 int configChanges = data.readInt();
Dianne Hackborna4e102e2014-09-04 22:52:27 -070085 boolean dontReport = data.readInt() != 0;
86 schedulePauseActivity(b, finished, userLeaving, configChanges, dontReport);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 return true;
88 }
89
90 case SCHEDULE_STOP_ACTIVITY_TRANSACTION:
91 {
92 data.enforceInterface(IApplicationThread.descriptor);
93 IBinder b = data.readStrongBinder();
94 boolean show = data.readInt() != 0;
95 int configChanges = data.readInt();
96 scheduleStopActivity(b, show, configChanges);
97 return true;
98 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -070099
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION:
101 {
102 data.enforceInterface(IApplicationThread.descriptor);
103 IBinder b = data.readStrongBinder();
104 boolean show = data.readInt() != 0;
105 scheduleWindowVisibility(b, show);
106 return true;
107 }
108
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800109 case SCHEDULE_SLEEPING_TRANSACTION:
110 {
111 data.enforceInterface(IApplicationThread.descriptor);
112 IBinder b = data.readStrongBinder();
113 boolean sleeping = data.readInt() != 0;
114 scheduleSleeping(b, sleeping);
115 return true;
116 }
117
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 case SCHEDULE_RESUME_ACTIVITY_TRANSACTION:
119 {
120 data.enforceInterface(IApplicationThread.descriptor);
121 IBinder b = data.readStrongBinder();
Dianne Hackborna413dc02013-07-12 12:02:55 -0700122 int procState = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800123 boolean isForward = data.readInt() != 0;
Adam Powellcfbe9be2013-11-06 14:58:58 -0800124 Bundle resumeArgs = data.readBundle();
125 scheduleResumeActivity(b, procState, isForward, resumeArgs);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126 return true;
127 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700128
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 case SCHEDULE_SEND_RESULT_TRANSACTION:
130 {
131 data.enforceInterface(IApplicationThread.descriptor);
132 IBinder b = data.readStrongBinder();
133 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
134 scheduleSendResult(b, ri);
135 return true;
136 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700137
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800138 case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION:
139 {
140 data.enforceInterface(IApplicationThread.descriptor);
141 Intent intent = Intent.CREATOR.createFromParcel(data);
142 IBinder b = data.readStrongBinder();
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700143 int ident = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700145 Configuration curConfig = Configuration.CREATOR.createFromParcel(data);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800146 Configuration overrideConfig = null;
147 if (data.readInt() != 0) {
148 overrideConfig = Configuration.CREATOR.createFromParcel(data);
149 }
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400150 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800151 String referrer = data.readString();
Dianne Hackborn91097de2014-04-04 18:02:06 -0700152 IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
153 data.readStrongBinder());
Dianne Hackborna413dc02013-07-12 12:02:55 -0700154 int procState = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155 Bundle state = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700156 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800158 List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800159 boolean notResumed = data.readInt() != 0;
160 boolean isForward = data.readInt() != 0;
Jeff Hao1b012d32014-08-20 10:35:34 -0700161 ProfilerInfo profilerInfo = data.readInt() != 0
162 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Wale Ogunwale60454db2015-01-23 16:05:07 -0800163 scheduleLaunchActivity(intent, b, ident, info, curConfig, overrideConfig, compatInfo,
164 referrer, voiceInteractor, procState, state, persistentState, ri, pi,
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800165 notResumed, isForward, profilerInfo);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800166 return true;
167 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700168
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800169 case SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION:
170 {
171 data.enforceInterface(IApplicationThread.descriptor);
172 IBinder b = data.readStrongBinder();
173 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800174 List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800175 int configChanges = data.readInt();
176 boolean notResumed = data.readInt() != 0;
Wale Ogunwale60454db2015-01-23 16:05:07 -0800177 Configuration config = Configuration.CREATOR.createFromParcel(data);
178 Configuration overrideConfig = null;
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800179 if (data.readInt() != 0) {
Wale Ogunwale60454db2015-01-23 16:05:07 -0800180 overrideConfig = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800181 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700182 boolean preserveWindows = data.readInt() == 1;
183 scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed, config, overrideConfig,
184 preserveWindows);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800185 return true;
186 }
Wale Ogunwale60454db2015-01-23 16:05:07 -0800187
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800188 case SCHEDULE_NEW_INTENT_TRANSACTION:
189 {
190 data.enforceInterface(IApplicationThread.descriptor);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800191 List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800192 IBinder b = data.readStrongBinder();
193 scheduleNewIntent(pi, b);
194 return true;
195 }
196
197 case SCHEDULE_FINISH_ACTIVITY_TRANSACTION:
198 {
199 data.enforceInterface(IApplicationThread.descriptor);
200 IBinder b = data.readStrongBinder();
201 boolean finishing = data.readInt() != 0;
202 int configChanges = data.readInt();
203 scheduleDestroyActivity(b, finishing, configChanges);
204 return true;
205 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700206
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800207 case SCHEDULE_RECEIVER_TRANSACTION:
208 {
209 data.enforceInterface(IApplicationThread.descriptor);
210 Intent intent = Intent.CREATOR.createFromParcel(data);
211 ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400212 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800213 int resultCode = data.readInt();
214 String resultData = data.readString();
215 Bundle resultExtras = data.readBundle();
216 boolean sync = data.readInt() != 0;
Dianne Hackborn20e80982012-08-31 19:00:44 -0700217 int sendingUser = data.readInt();
Dianne Hackborna413dc02013-07-12 12:02:55 -0700218 int processState = data.readInt();
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400219 scheduleReceiver(intent, info, compatInfo, resultCode, resultData,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700220 resultExtras, sync, sendingUser, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800221 return true;
222 }
223
224 case SCHEDULE_CREATE_SERVICE_TRANSACTION: {
225 data.enforceInterface(IApplicationThread.descriptor);
226 IBinder token = data.readStrongBinder();
227 ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400228 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700229 int processState = data.readInt();
230 scheduleCreateService(token, info, compatInfo, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800231 return true;
232 }
233
234 case SCHEDULE_BIND_SERVICE_TRANSACTION: {
235 data.enforceInterface(IApplicationThread.descriptor);
236 IBinder token = data.readStrongBinder();
237 Intent intent = Intent.CREATOR.createFromParcel(data);
238 boolean rebind = data.readInt() != 0;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700239 int processState = data.readInt();
240 scheduleBindService(token, intent, rebind, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800241 return true;
242 }
243
244 case SCHEDULE_UNBIND_SERVICE_TRANSACTION: {
245 data.enforceInterface(IApplicationThread.descriptor);
246 IBinder token = data.readStrongBinder();
247 Intent intent = Intent.CREATOR.createFromParcel(data);
248 scheduleUnbindService(token, intent);
249 return true;
250 }
251
252 case SCHEDULE_SERVICE_ARGS_TRANSACTION:
253 {
254 data.enforceInterface(IApplicationThread.descriptor);
255 IBinder token = data.readStrongBinder();
Dianne Hackborn0c5001d2011-04-12 18:16:08 -0700256 boolean taskRemoved = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 int startId = data.readInt();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700258 int fl = data.readInt();
259 Intent args;
260 if (data.readInt() != 0) {
261 args = Intent.CREATOR.createFromParcel(data);
262 } else {
263 args = null;
264 }
Dianne Hackborn0c5001d2011-04-12 18:16:08 -0700265 scheduleServiceArgs(token, taskRemoved, startId, fl, args);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266 return true;
267 }
268
269 case SCHEDULE_STOP_SERVICE_TRANSACTION:
270 {
271 data.enforceInterface(IApplicationThread.descriptor);
272 IBinder token = data.readStrongBinder();
273 scheduleStopService(token);
274 return true;
275 }
276
277 case BIND_APPLICATION_TRANSACTION:
278 {
279 data.enforceInterface(IApplicationThread.descriptor);
280 String packageName = data.readString();
281 ApplicationInfo info =
282 ApplicationInfo.CREATOR.createFromParcel(data);
283 List<ProviderInfo> providers =
284 data.createTypedArrayList(ProviderInfo.CREATOR);
285 ComponentName testName = (data.readInt() != 0)
286 ? new ComponentName(data) : null;
Jeff Hao1b012d32014-08-20 10:35:34 -0700287 ProfilerInfo profilerInfo = data.readInt() != 0
288 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800289 Bundle testArgs = data.readBundle();
290 IBinder binder = data.readStrongBinder();
291 IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder);
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800292 binder = data.readStrongBinder();
293 IUiAutomationConnection uiAutomationConnection =
294 IUiAutomationConnection.Stub.asInterface(binder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800295 int testMode = data.readInt();
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400296 boolean enableBinderTracking = data.readInt() != 0;
Man Caocfa78b22015-06-11 20:14:34 -0700297 boolean trackAllocation = data.readInt() != 0;
Christopher Tate181fafa2009-05-14 11:12:14 -0700298 boolean restrictedBackupMode = (data.readInt() != 0);
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700299 boolean persistent = (data.readInt() != 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800300 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400301 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800302 HashMap<String, IBinder> services = data.readHashMap(null);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800303 Bundle coreSettings = data.readBundle();
Jeff Hao1b012d32014-08-20 10:35:34 -0700304 bindApplication(packageName, info, providers, testName, profilerInfo, testArgs,
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400305 testWatcher, uiAutomationConnection, testMode, enableBinderTracking,
Pablo Ceballosa4d4e822015-10-05 10:27:52 -0700306 trackAllocation, restrictedBackupMode, persistent, config, compatInfo, services,
307 coreSettings);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800308 return true;
309 }
Siva Velusamy92a8b222012-03-09 16:24:04 -0800310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800311 case SCHEDULE_EXIT_TRANSACTION:
312 {
313 data.enforceInterface(IApplicationThread.descriptor);
314 scheduleExit();
315 return true;
316 }
317
Christopher Tate5e1ab332009-09-01 20:32:49 -0700318 case SCHEDULE_SUICIDE_TRANSACTION:
319 {
320 data.enforceInterface(IApplicationThread.descriptor);
321 scheduleSuicide();
322 return true;
323 }
324
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800325 case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION:
326 {
327 data.enforceInterface(IApplicationThread.descriptor);
328 Configuration config = Configuration.CREATOR.createFromParcel(data);
329 scheduleConfigurationChanged(config);
330 return true;
331 }
332
333 case UPDATE_TIME_ZONE_TRANSACTION: {
334 data.enforceInterface(IApplicationThread.descriptor);
335 updateTimeZone();
336 return true;
337 }
338
Robert Greenwalt03595d02010-11-02 14:08:23 -0700339 case CLEAR_DNS_CACHE_TRANSACTION: {
340 data.enforceInterface(IApplicationThread.descriptor);
341 clearDnsCache();
342 return true;
343 }
344
Robert Greenwalt434203a2010-10-11 16:00:27 -0700345 case SET_HTTP_PROXY_TRANSACTION: {
346 data.enforceInterface(IApplicationThread.descriptor);
347 final String proxy = data.readString();
348 final String port = data.readString();
349 final String exclList = data.readString();
Jason Monk83520b92014-05-09 15:16:06 -0400350 final Uri pacFileUrl = Uri.CREATOR.createFromParcel(data);
Jason Monk602b2322013-07-03 17:04:33 -0400351 setHttpProxy(proxy, port, exclList, pacFileUrl);
Robert Greenwalt434203a2010-10-11 16:00:27 -0700352 return true;
353 }
354
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800355 case PROCESS_IN_BACKGROUND_TRANSACTION: {
356 data.enforceInterface(IApplicationThread.descriptor);
357 processInBackground();
358 return true;
359 }
Robert Greenwalt434203a2010-10-11 16:00:27 -0700360
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 case DUMP_SERVICE_TRANSACTION: {
362 data.enforceInterface(IApplicationThread.descriptor);
363 ParcelFileDescriptor fd = data.readFileDescriptor();
364 final IBinder service = data.readStrongBinder();
365 final String[] args = data.readStringArray();
366 if (fd != null) {
367 dumpService(fd.getFileDescriptor(), service, args);
368 try {
369 fd.close();
370 } catch (IOException e) {
371 }
372 }
373 return true;
374 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700375
Marco Nelissen18cb2872011-11-15 11:19:53 -0800376 case DUMP_PROVIDER_TRANSACTION: {
377 data.enforceInterface(IApplicationThread.descriptor);
378 ParcelFileDescriptor fd = data.readFileDescriptor();
379 final IBinder service = data.readStrongBinder();
380 final String[] args = data.readStringArray();
381 if (fd != null) {
382 dumpProvider(fd.getFileDescriptor(), service, args);
383 try {
384 fd.close();
385 } catch (IOException e) {
386 }
387 }
388 return true;
389 }
390
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800391 case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: {
392 data.enforceInterface(IApplicationThread.descriptor);
393 IIntentReceiver receiver = IIntentReceiver.Stub.asInterface(
394 data.readStrongBinder());
395 Intent intent = Intent.CREATOR.createFromParcel(data);
396 int resultCode = data.readInt();
397 String dataStr = data.readString();
398 Bundle extras = data.readBundle();
399 boolean ordered = data.readInt() != 0;
Dianne Hackborn68d881c2009-10-05 13:58:17 -0700400 boolean sticky = data.readInt() != 0;
Dianne Hackborn20e80982012-08-31 19:00:44 -0700401 int sendingUser = data.readInt();
Dianne Hackborna413dc02013-07-12 12:02:55 -0700402 int processState = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800403 scheduleRegisteredReceiver(receiver, intent,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700404 resultCode, dataStr, extras, ordered, sticky, sendingUser, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800405 return true;
406 }
407
408 case SCHEDULE_LOW_MEMORY_TRANSACTION:
409 {
Vairavan Srinivasane94a3e72012-02-01 23:17:14 -0800410 data.enforceInterface(IApplicationThread.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800411 scheduleLowMemory();
412 return true;
413 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700414
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800415 case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION:
416 {
417 data.enforceInterface(IApplicationThread.descriptor);
418 IBinder b = data.readStrongBinder();
Wale Ogunwalec2607b42015-02-07 16:16:59 -0800419 Configuration overrideConfig = null;
420 if (data.readInt() != 0) {
421 overrideConfig = Configuration.CREATOR.createFromParcel(data);
422 }
Filip Gruszczynskica664812015-12-04 12:43:36 -0800423 final boolean reportToActivity = data.readInt() == 1;
424 scheduleActivityConfigurationChanged(b, overrideConfig, reportToActivity);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800425 return true;
426 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700427
Amith Yamasani0af6fa72016-01-17 15:36:19 -0800428 case SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION:
429 {
430 data.enforceInterface(IApplicationThread.descriptor);
431 IBinder token = data.readStrongBinder();
432 IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
433 data.readStrongBinder());
434 scheduleLocalVoiceInteractionStarted(token, voiceInteractor);
435 return true;
436 }
437
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800438 case PROFILER_CONTROL_TRANSACTION:
439 {
440 data.enforceInterface(IApplicationThread.descriptor);
441 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -0700442 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700443 ProfilerInfo profilerInfo = data.readInt() != 0
444 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
445 profilerControl(start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800446 return true;
447 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700448
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700449 case SET_SCHEDULING_GROUP_TRANSACTION:
450 {
451 data.enforceInterface(IApplicationThread.descriptor);
452 int group = data.readInt();
453 setSchedulingGroup(group);
454 return true;
455 }
Christopher Tate181fafa2009-05-14 11:12:14 -0700456
457 case SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION:
458 {
459 data.enforceInterface(IApplicationThread.descriptor);
460 ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400461 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
Christopher Tate181fafa2009-05-14 11:12:14 -0700462 int backupMode = data.readInt();
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400463 scheduleCreateBackupAgent(appInfo, compatInfo, backupMode);
Christopher Tate181fafa2009-05-14 11:12:14 -0700464 return true;
465 }
Christopher Tate1885b372009-06-04 15:00:33 -0700466
467 case SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION:
468 {
469 data.enforceInterface(IApplicationThread.descriptor);
470 ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400471 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
472 scheduleDestroyBackupAgent(appInfo, compatInfo);
Christopher Tate1885b372009-06-04 15:00:33 -0700473 return true;
474 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700475
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700476 case DISPATCH_PACKAGE_BROADCAST_TRANSACTION:
477 {
478 data.enforceInterface(IApplicationThread.descriptor);
479 int cmd = data.readInt();
480 String[] packages = data.readStringArray();
481 dispatchPackageBroadcast(cmd, packages);
482 return true;
483 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700484
485 case SCHEDULE_CRASH_TRANSACTION:
486 {
487 data.enforceInterface(IApplicationThread.descriptor);
488 String msg = data.readString();
489 scheduleCrash(msg);
490 return true;
491 }
Andy McFadden824c5102010-07-09 16:26:57 -0700492
493 case DUMP_HEAP_TRANSACTION:
494 {
495 data.enforceInterface(IApplicationThread.descriptor);
496 boolean managed = data.readInt() != 0;
497 String path = data.readString();
498 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700499 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Andy McFadden824c5102010-07-09 16:26:57 -0700500 dumpHeap(managed, path, fd);
501 return true;
502 }
Dianne Hackborn625ac272010-09-17 18:29:22 -0700503
504 case DUMP_ACTIVITY_TRANSACTION: {
505 data.enforceInterface(IApplicationThread.descriptor);
506 ParcelFileDescriptor fd = data.readFileDescriptor();
507 final IBinder activity = data.readStrongBinder();
Dianne Hackborn30d71892010-12-11 10:37:55 -0800508 final String prefix = data.readString();
Dianne Hackborn625ac272010-09-17 18:29:22 -0700509 final String[] args = data.readStringArray();
510 if (fd != null) {
Dianne Hackborn30d71892010-12-11 10:37:55 -0800511 dumpActivity(fd.getFileDescriptor(), activity, prefix, args);
Dianne Hackborn625ac272010-09-17 18:29:22 -0700512 try {
513 fd.close();
514 } catch (IOException e) {
515 }
516 }
517 return true;
518 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800519
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400520 case SET_CORE_SETTINGS_TRANSACTION: {
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800521 data.enforceInterface(IApplicationThread.descriptor);
522 Bundle settings = data.readBundle();
523 setCoreSettings(settings);
524 return true;
525 }
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400526
527 case UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION: {
528 data.enforceInterface(IApplicationThread.descriptor);
529 String pkg = data.readString();
530 CompatibilityInfo compat = CompatibilityInfo.CREATOR.createFromParcel(data);
531 updatePackageCompatibilityInfo(pkg, compat);
532 return true;
533 }
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700534
535 case SCHEDULE_TRIM_MEMORY_TRANSACTION: {
536 data.enforceInterface(IApplicationThread.descriptor);
537 int level = data.readInt();
538 scheduleTrimMemory(level);
539 return true;
540 }
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700541
542 case DUMP_MEM_INFO_TRANSACTION:
543 {
544 data.enforceInterface(IApplicationThread.descriptor);
545 ParcelFileDescriptor fd = data.readFileDescriptor();
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -0700546 Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data);
Dianne Hackbornb437e092011-08-05 17:50:29 -0700547 boolean checkin = data.readInt() != 0;
Dianne Hackborn64770d12013-05-23 17:51:19 -0700548 boolean dumpInfo = data.readInt() != 0;
549 boolean dumpDalvik = data.readInt() != 0;
Richard Uhlerc14b9cf2015-03-13 12:38:38 -0700550 boolean dumpSummaryOnly = data.readInt() != 0;
Colin Cross84b1e352016-02-02 16:51:15 -0800551 boolean dumpUnreachable = data.readInt() != 0;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700552 String[] args = data.readStringArray();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700553 if (fd != null) {
554 try {
Richard Uhlerc14b9cf2015-03-13 12:38:38 -0700555 dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo,
Colin Cross84b1e352016-02-02 16:51:15 -0800556 dumpDalvik, dumpSummaryOnly, dumpUnreachable, args);
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700557 } finally {
558 try {
559 fd.close();
560 } catch (IOException e) {
561 // swallowed, not propagated back to the caller
562 }
563 }
564 }
565 reply.writeNoException();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700566 return true;
567 }
568
569 case DUMP_GFX_INFO_TRANSACTION:
570 {
571 data.enforceInterface(IApplicationThread.descriptor);
572 ParcelFileDescriptor fd = data.readFileDescriptor();
573 String[] args = data.readStringArray();
574 if (fd != null) {
575 try {
576 dumpGfxInfo(fd.getFileDescriptor(), args);
577 } finally {
578 try {
579 fd.close();
580 } catch (IOException e) {
581 // swallowed, not propagated back to the caller
582 }
583 }
584 }
585 reply.writeNoException();
586 return true;
587 }
Jeff Brown6754ba22011-12-14 20:20:01 -0800588
589 case DUMP_DB_INFO_TRANSACTION:
590 {
591 data.enforceInterface(IApplicationThread.descriptor);
592 ParcelFileDescriptor fd = data.readFileDescriptor();
593 String[] args = data.readStringArray();
594 if (fd != null) {
595 try {
596 dumpDbInfo(fd.getFileDescriptor(), args);
597 } finally {
598 try {
599 fd.close();
600 } catch (IOException e) {
601 // swallowed, not propagated back to the caller
602 }
603 }
604 }
605 reply.writeNoException();
606 return true;
607 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700608
609 case UNSTABLE_PROVIDER_DIED_TRANSACTION:
610 {
611 data.enforceInterface(IApplicationThread.descriptor);
612 IBinder provider = data.readStrongBinder();
613 unstableProviderDied(provider);
614 reply.writeNoException();
615 return true;
616 }
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800617
Adam Skorydfc7fd72013-08-05 19:23:41 -0700618 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION:
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800619 {
620 data.enforceInterface(IApplicationThread.descriptor);
621 IBinder activityToken = data.readStrongBinder();
622 IBinder requestToken = data.readStrongBinder();
623 int requestType = data.readInt();
Adam Skory7140a252013-09-11 12:04:58 +0100624 requestAssistContextExtras(activityToken, requestToken, requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800625 reply.writeNoException();
626 return true;
627 }
Craig Mautner5eda9b32013-07-02 11:58:16 -0700628
629 case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION:
630 {
631 data.enforceInterface(IApplicationThread.descriptor);
632 IBinder token = data.readStrongBinder();
633 boolean timeout = data.readInt() == 1;
634 scheduleTranslucentConversionComplete(token, timeout);
635 reply.writeNoException();
636 return true;
637 }
Dianne Hackborna413dc02013-07-12 12:02:55 -0700638
Craig Mautnereb8abf72014-07-02 15:04:09 -0700639 case SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION:
640 {
641 data.enforceInterface(IApplicationThread.descriptor);
642 IBinder token = data.readStrongBinder();
643 ActivityOptions options = new ActivityOptions(data.readBundle());
644 scheduleOnNewActivityOptions(token, options);
645 reply.writeNoException();
646 return true;
647 }
648
Dianne Hackborna413dc02013-07-12 12:02:55 -0700649 case SET_PROCESS_STATE_TRANSACTION:
650 {
651 data.enforceInterface(IApplicationThread.descriptor);
652 int state = data.readInt();
653 setProcessState(state);
654 reply.writeNoException();
655 return true;
656 }
Jeff Sharkeydd97f422013-10-08 17:01:30 -0700657
658 case SCHEDULE_INSTALL_PROVIDER_TRANSACTION:
659 {
660 data.enforceInterface(IApplicationThread.descriptor);
661 ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data);
662 scheduleInstallProvider(provider);
663 reply.writeNoException();
664 return true;
665 }
Narayan Kamathccb2a0862013-12-19 14:49:36 +0000666
667 case UPDATE_TIME_PREFS_TRANSACTION:
668 {
669 data.enforceInterface(IApplicationThread.descriptor);
670 byte is24Hour = data.readByte();
671 updateTimePrefs(is24Hour == (byte) 1);
672 reply.writeNoException();
673 return true;
674 }
Craig Mautneree2e45a2014-06-27 12:10:03 -0700675
Jose Lima4b6c6692014-08-12 17:41:12 -0700676 case CANCEL_VISIBLE_BEHIND_TRANSACTION:
Craig Mautneree2e45a2014-06-27 12:10:03 -0700677 {
678 data.enforceInterface(IApplicationThread.descriptor);
679 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -0700680 scheduleCancelVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -0700681 reply.writeNoException();
682 return true;
683 }
684
Jose Lima4b6c6692014-08-12 17:41:12 -0700685 case BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION:
Craig Mautneree2e45a2014-06-27 12:10:03 -0700686 {
687 data.enforceInterface(IApplicationThread.descriptor);
688 IBinder token = data.readStrongBinder();
689 boolean enabled = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -0700690 scheduleBackgroundVisibleBehindChanged(token, enabled);
Craig Mautneree2e45a2014-06-27 12:10:03 -0700691 reply.writeNoException();
692 return true;
693 }
Craig Mautner8746a472014-07-24 15:12:54 -0700694
695 case ENTER_ANIMATION_COMPLETE_TRANSACTION:
696 {
697 data.enforceInterface(IApplicationThread.descriptor);
698 IBinder token = data.readStrongBinder();
699 scheduleEnterAnimationComplete(token);
700 reply.writeNoException();
701 return true;
702 }
Jeff Sharkey605eb792014-11-04 13:34:06 -0800703
704 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION:
705 {
706 data.enforceInterface(IApplicationThread.descriptor);
707 final byte[] firstPacket = data.createByteArray();
708 notifyCleartextNetwork(firstPacket);
709 reply.writeNoException();
710 return true;
711 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400712
713 case START_BINDER_TRACKING_TRANSACTION:
714 {
715 data.enforceInterface(IApplicationThread.descriptor);
716 startBinderTracking();
717 return true;
718 }
719
720 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION:
721 {
722 data.enforceInterface(IApplicationThread.descriptor);
723 ParcelFileDescriptor fd = data.readFileDescriptor();
724 if (fd != null) {
725 stopBinderTrackingAndDump(fd.getFileDescriptor());
726 try {
727 fd.close();
728 } catch (IOException e) {
729 }
730 }
731 return true;
732 }
733
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800734 case SCHEDULE_MULTI_WINDOW_CHANGED_TRANSACTION:
Wale Ogunwale5f986092015-12-04 15:35:38 -0800735 {
736 data.enforceInterface(IApplicationThread.descriptor);
737 final IBinder b = data.readStrongBinder();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800738 final boolean inMultiWindow = data.readInt() != 0;
739 scheduleMultiWindowChanged(b, inMultiWindow);
Wale Ogunwale5f986092015-12-04 15:35:38 -0800740 return true;
741 }
742
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800743 case SCHEDULE_PICTURE_IN_PICTURE_CHANGED_TRANSACTION:
Wale Ogunwale5f986092015-12-04 15:35:38 -0800744 {
745 data.enforceInterface(IApplicationThread.descriptor);
746 final IBinder b = data.readStrongBinder();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800747 final boolean inPip = data.readInt() != 0;
748 schedulePictureInPictureChanged(b, inPip);
Wale Ogunwale5f986092015-12-04 15:35:38 -0800749 return true;
750 }
751
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800752 }
753
754 return super.onTransact(code, data, reply, flags);
755 }
756
757 public IBinder asBinder()
758 {
759 return this;
760 }
761}
762
763class ApplicationThreadProxy implements IApplicationThread {
764 private final IBinder mRemote;
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700765
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800766 public ApplicationThreadProxy(IBinder remote) {
767 mRemote = remote;
768 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700769
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800770 public final IBinder asBinder() {
771 return mRemote;
772 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700773
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800774 public final void schedulePauseActivity(IBinder token, boolean finished,
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700775 boolean userLeaving, int configChanges, boolean dontReport) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800776 Parcel data = Parcel.obtain();
777 data.writeInterfaceToken(IApplicationThread.descriptor);
778 data.writeStrongBinder(token);
779 data.writeInt(finished ? 1 : 0);
780 data.writeInt(userLeaving ? 1 :0);
781 data.writeInt(configChanges);
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700782 data.writeInt(dontReport ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800783 mRemote.transact(SCHEDULE_PAUSE_ACTIVITY_TRANSACTION, data, null,
784 IBinder.FLAG_ONEWAY);
785 data.recycle();
786 }
787
788 public final void scheduleStopActivity(IBinder token, boolean showWindow,
789 int configChanges) throws RemoteException {
790 Parcel data = Parcel.obtain();
791 data.writeInterfaceToken(IApplicationThread.descriptor);
792 data.writeStrongBinder(token);
793 data.writeInt(showWindow ? 1 : 0);
794 data.writeInt(configChanges);
795 mRemote.transact(SCHEDULE_STOP_ACTIVITY_TRANSACTION, data, null,
796 IBinder.FLAG_ONEWAY);
797 data.recycle();
798 }
799
800 public final void scheduleWindowVisibility(IBinder token,
801 boolean showWindow) throws RemoteException {
802 Parcel data = Parcel.obtain();
803 data.writeInterfaceToken(IApplicationThread.descriptor);
804 data.writeStrongBinder(token);
805 data.writeInt(showWindow ? 1 : 0);
806 mRemote.transact(SCHEDULE_WINDOW_VISIBILITY_TRANSACTION, data, null,
807 IBinder.FLAG_ONEWAY);
808 data.recycle();
809 }
810
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800811 public final void scheduleSleeping(IBinder token,
812 boolean sleeping) throws RemoteException {
813 Parcel data = Parcel.obtain();
814 data.writeInterfaceToken(IApplicationThread.descriptor);
815 data.writeStrongBinder(token);
816 data.writeInt(sleeping ? 1 : 0);
817 mRemote.transact(SCHEDULE_SLEEPING_TRANSACTION, data, null,
818 IBinder.FLAG_ONEWAY);
819 data.recycle();
820 }
821
Adam Powellcfbe9be2013-11-06 14:58:58 -0800822 public final void scheduleResumeActivity(IBinder token, int procState, boolean isForward,
823 Bundle resumeArgs)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800824 throws RemoteException {
825 Parcel data = Parcel.obtain();
826 data.writeInterfaceToken(IApplicationThread.descriptor);
827 data.writeStrongBinder(token);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700828 data.writeInt(procState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800829 data.writeInt(isForward ? 1 : 0);
Adam Powellcfbe9be2013-11-06 14:58:58 -0800830 data.writeBundle(resumeArgs);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800831 mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null,
832 IBinder.FLAG_ONEWAY);
833 data.recycle();
834 }
835
836 public final void scheduleSendResult(IBinder token, List<ResultInfo> results)
John Spurlock8a985d22014-02-25 09:40:05 -0500837 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800838 Parcel data = Parcel.obtain();
839 data.writeInterfaceToken(IApplicationThread.descriptor);
840 data.writeStrongBinder(token);
841 data.writeTypedList(results);
842 mRemote.transact(SCHEDULE_SEND_RESULT_TRANSACTION, data, null,
843 IBinder.FLAG_ONEWAY);
844 data.recycle();
845 }
846
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700847 public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
Wale Ogunwale60454db2015-01-23 16:05:07 -0800848 ActivityInfo info, Configuration curConfig, Configuration overrideConfig,
849 CompatibilityInfo compatInfo, String referrer, IVoiceInteractor voiceInteractor,
850 int procState, Bundle state, PersistableBundle persistentState,
851 List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
852 boolean notResumed, boolean isForward, ProfilerInfo profilerInfo) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800853 Parcel data = Parcel.obtain();
854 data.writeInterfaceToken(IApplicationThread.descriptor);
855 intent.writeToParcel(data, 0);
856 data.writeStrongBinder(token);
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700857 data.writeInt(ident);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800858 info.writeToParcel(data, 0);
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700859 curConfig.writeToParcel(data, 0);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800860 if (overrideConfig != null) {
861 data.writeInt(1);
862 overrideConfig.writeToParcel(data, 0);
863 } else {
864 data.writeInt(0);
865 }
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400866 compatInfo.writeToParcel(data, 0);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800867 data.writeString(referrer);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700868 data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700869 data.writeInt(procState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800870 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -0700871 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800872 data.writeTypedList(pendingResults);
873 data.writeTypedList(pendingNewIntents);
874 data.writeInt(notResumed ? 1 : 0);
875 data.writeInt(isForward ? 1 : 0);
Jeff Hao1b012d32014-08-20 10:35:34 -0700876 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700877 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -0700878 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700879 } else {
880 data.writeInt(0);
881 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800882 mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null,
883 IBinder.FLAG_ONEWAY);
884 data.recycle();
885 }
886
887 public final void scheduleRelaunchActivity(IBinder token,
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800888 List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
Wale Ogunwale60454db2015-01-23 16:05:07 -0800889 int configChanges, boolean notResumed, Configuration config,
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700890 Configuration overrideConfig, boolean preserveWindow) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800891 Parcel data = Parcel.obtain();
892 data.writeInterfaceToken(IApplicationThread.descriptor);
893 data.writeStrongBinder(token);
894 data.writeTypedList(pendingResults);
895 data.writeTypedList(pendingNewIntents);
896 data.writeInt(configChanges);
897 data.writeInt(notResumed ? 1 : 0);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800898 config.writeToParcel(data, 0);
899 if (overrideConfig != null) {
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800900 data.writeInt(1);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800901 overrideConfig.writeToParcel(data, 0);
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800902 } else {
903 data.writeInt(0);
904 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700905 data.writeInt(preserveWindow ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800906 mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null,
907 IBinder.FLAG_ONEWAY);
908 data.recycle();
909 }
910
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800911 public void scheduleNewIntent(List<ReferrerIntent> intents, IBinder token)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800912 throws RemoteException {
913 Parcel data = Parcel.obtain();
914 data.writeInterfaceToken(IApplicationThread.descriptor);
915 data.writeTypedList(intents);
916 data.writeStrongBinder(token);
917 mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null,
918 IBinder.FLAG_ONEWAY);
919 data.recycle();
920 }
921
922 public final void scheduleDestroyActivity(IBinder token, boolean finishing,
923 int configChanges) throws RemoteException {
924 Parcel data = Parcel.obtain();
925 data.writeInterfaceToken(IApplicationThread.descriptor);
926 data.writeStrongBinder(token);
927 data.writeInt(finishing ? 1 : 0);
928 data.writeInt(configChanges);
929 mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null,
930 IBinder.FLAG_ONEWAY);
931 data.recycle();
932 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700933
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800934 public final void scheduleReceiver(Intent intent, ActivityInfo info,
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400935 CompatibilityInfo compatInfo, int resultCode, String resultData,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700936 Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800937 Parcel data = Parcel.obtain();
938 data.writeInterfaceToken(IApplicationThread.descriptor);
939 intent.writeToParcel(data, 0);
940 info.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400941 compatInfo.writeToParcel(data, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800942 data.writeInt(resultCode);
943 data.writeString(resultData);
944 data.writeBundle(map);
945 data.writeInt(sync ? 1 : 0);
Dianne Hackborn20e80982012-08-31 19:00:44 -0700946 data.writeInt(sendingUser);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700947 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800948 mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null,
949 IBinder.FLAG_ONEWAY);
950 data.recycle();
951 }
952
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400953 public final void scheduleCreateBackupAgent(ApplicationInfo app,
954 CompatibilityInfo compatInfo, int backupMode) throws RemoteException {
Christopher Tate181fafa2009-05-14 11:12:14 -0700955 Parcel data = Parcel.obtain();
956 data.writeInterfaceToken(IApplicationThread.descriptor);
957 app.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400958 compatInfo.writeToParcel(data, 0);
Christopher Tate181fafa2009-05-14 11:12:14 -0700959 data.writeInt(backupMode);
Christopher Tated884f432009-07-23 14:40:13 -0700960 mRemote.transact(SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION, data, null,
961 IBinder.FLAG_ONEWAY);
Christopher Tate181fafa2009-05-14 11:12:14 -0700962 data.recycle();
963 }
964
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400965 public final void scheduleDestroyBackupAgent(ApplicationInfo app,
966 CompatibilityInfo compatInfo) throws RemoteException {
Christopher Tate181fafa2009-05-14 11:12:14 -0700967 Parcel data = Parcel.obtain();
968 data.writeInterfaceToken(IApplicationThread.descriptor);
969 app.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400970 compatInfo.writeToParcel(data, 0);
Christopher Tated884f432009-07-23 14:40:13 -0700971 mRemote.transact(SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION, data, null,
972 IBinder.FLAG_ONEWAY);
Christopher Tate181fafa2009-05-14 11:12:14 -0700973 data.recycle();
974 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700975
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400976 public final void scheduleCreateService(IBinder token, ServiceInfo info,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700977 CompatibilityInfo compatInfo, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800978 Parcel data = Parcel.obtain();
979 data.writeInterfaceToken(IApplicationThread.descriptor);
980 data.writeStrongBinder(token);
981 info.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400982 compatInfo.writeToParcel(data, 0);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700983 data.writeInt(processState);
Christopher Tate8a2ce3c2015-06-19 10:28:20 -0700984 try {
985 mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
986 IBinder.FLAG_ONEWAY);
987 } catch (TransactionTooLargeException e) {
988 Log.e("CREATE_SERVICE", "Binder failure starting service; service=" + info);
989 throw e;
990 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 data.recycle();
992 }
993
Dianne Hackborna413dc02013-07-12 12:02:55 -0700994 public final void scheduleBindService(IBinder token, Intent intent, boolean rebind,
995 int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800996 Parcel data = Parcel.obtain();
997 data.writeInterfaceToken(IApplicationThread.descriptor);
998 data.writeStrongBinder(token);
999 intent.writeToParcel(data, 0);
1000 data.writeInt(rebind ? 1 : 0);
Dianne Hackborna413dc02013-07-12 12:02:55 -07001001 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001002 mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null,
1003 IBinder.FLAG_ONEWAY);
1004 data.recycle();
1005 }
1006
1007 public final void scheduleUnbindService(IBinder token, Intent intent)
1008 throws RemoteException {
1009 Parcel data = Parcel.obtain();
1010 data.writeInterfaceToken(IApplicationThread.descriptor);
1011 data.writeStrongBinder(token);
1012 intent.writeToParcel(data, 0);
1013 mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null,
1014 IBinder.FLAG_ONEWAY);
1015 data.recycle();
1016 }
1017
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001018 public final void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
John Spurlock8a985d22014-02-25 09:40:05 -05001019 int flags, Intent args) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001020 Parcel data = Parcel.obtain();
1021 data.writeInterfaceToken(IApplicationThread.descriptor);
1022 data.writeStrongBinder(token);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001023 data.writeInt(taskRemoved ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001024 data.writeInt(startId);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001025 data.writeInt(flags);
1026 if (args != null) {
1027 data.writeInt(1);
1028 args.writeToParcel(data, 0);
1029 } else {
1030 data.writeInt(0);
1031 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001032 mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null,
1033 IBinder.FLAG_ONEWAY);
1034 data.recycle();
1035 }
1036
1037 public final void scheduleStopService(IBinder token)
1038 throws RemoteException {
1039 Parcel data = Parcel.obtain();
1040 data.writeInterfaceToken(IApplicationThread.descriptor);
1041 data.writeStrongBinder(token);
1042 mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null,
1043 IBinder.FLAG_ONEWAY);
1044 data.recycle();
1045 }
1046
Man Caocfa78b22015-06-11 20:14:34 -07001047 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001048 public final void bindApplication(String packageName, ApplicationInfo info,
Jeff Hao1b012d32014-08-20 10:35:34 -07001049 List<ProviderInfo> providers, ComponentName testName, ProfilerInfo profilerInfo,
1050 Bundle testArgs, IInstrumentationWatcher testWatcher,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001051 IUiAutomationConnection uiAutomationConnection, int debugMode,
Pablo Ceballosa4d4e822015-10-05 10:27:52 -07001052 boolean enableBinderTracking, boolean trackAllocation, boolean restrictedBackupMode,
1053 boolean persistent, Configuration config, CompatibilityInfo compatInfo,
1054 Map<String, IBinder> services, Bundle coreSettings) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001055 Parcel data = Parcel.obtain();
1056 data.writeInterfaceToken(IApplicationThread.descriptor);
1057 data.writeString(packageName);
1058 info.writeToParcel(data, 0);
1059 data.writeTypedList(providers);
1060 if (testName == null) {
1061 data.writeInt(0);
1062 } else {
1063 data.writeInt(1);
1064 testName.writeToParcel(data, 0);
1065 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001066 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001067 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07001068 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001069 } else {
1070 data.writeInt(0);
1071 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001072 data.writeBundle(testArgs);
1073 data.writeStrongInterface(testWatcher);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001074 data.writeStrongInterface(uiAutomationConnection);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001075 data.writeInt(debugMode);
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04001076 data.writeInt(enableBinderTracking ? 1 : 0);
Man Caocfa78b22015-06-11 20:14:34 -07001077 data.writeInt(trackAllocation ? 1 : 0);
Christopher Tate181fafa2009-05-14 11:12:14 -07001078 data.writeInt(restrictedBackupMode ? 1 : 0);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001079 data.writeInt(persistent ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001080 config.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001081 compatInfo.writeToParcel(data, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001082 data.writeMap(services);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001083 data.writeBundle(coreSettings);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001084 mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null,
1085 IBinder.FLAG_ONEWAY);
1086 data.recycle();
1087 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -07001088
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001089 public final void scheduleExit() throws RemoteException {
1090 Parcel data = Parcel.obtain();
1091 data.writeInterfaceToken(IApplicationThread.descriptor);
1092 mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null,
1093 IBinder.FLAG_ONEWAY);
1094 data.recycle();
1095 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001096
1097 public final void scheduleSuicide() throws RemoteException {
1098 Parcel data = Parcel.obtain();
1099 data.writeInterfaceToken(IApplicationThread.descriptor);
1100 mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null,
1101 IBinder.FLAG_ONEWAY);
1102 data.recycle();
1103 }
1104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001105 public final void scheduleConfigurationChanged(Configuration config)
1106 throws RemoteException {
1107 Parcel data = Parcel.obtain();
1108 data.writeInterfaceToken(IApplicationThread.descriptor);
1109 config.writeToParcel(data, 0);
1110 mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1111 IBinder.FLAG_ONEWAY);
1112 data.recycle();
1113 }
1114
Amith Yamasani0af6fa72016-01-17 15:36:19 -08001115 public final void scheduleLocalVoiceInteractionStarted(IBinder token,
1116 IVoiceInteractor voiceInteractor) throws RemoteException {
1117 Parcel data = Parcel.obtain();
1118 data.writeInterfaceToken(IApplicationThread.descriptor);
1119 data.writeStrongBinder(token);
1120 data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
1121 mRemote.transact(SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION, data, null,
1122 IBinder.FLAG_ONEWAY);
1123 data.recycle();
1124 }
1125
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001126 public void updateTimeZone() throws RemoteException {
1127 Parcel data = Parcel.obtain();
1128 data.writeInterfaceToken(IApplicationThread.descriptor);
1129 mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null,
1130 IBinder.FLAG_ONEWAY);
1131 data.recycle();
1132 }
1133
Robert Greenwalt03595d02010-11-02 14:08:23 -07001134 public void clearDnsCache() throws RemoteException {
1135 Parcel data = Parcel.obtain();
1136 data.writeInterfaceToken(IApplicationThread.descriptor);
1137 mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null,
1138 IBinder.FLAG_ONEWAY);
1139 data.recycle();
1140 }
1141
Jason Monk602b2322013-07-03 17:04:33 -04001142 public void setHttpProxy(String proxy, String port, String exclList,
Jason Monk83520b92014-05-09 15:16:06 -04001143 Uri pacFileUrl) throws RemoteException {
Robert Greenwalt434203a2010-10-11 16:00:27 -07001144 Parcel data = Parcel.obtain();
1145 data.writeInterfaceToken(IApplicationThread.descriptor);
1146 data.writeString(proxy);
1147 data.writeString(port);
1148 data.writeString(exclList);
Jason Monk83520b92014-05-09 15:16:06 -04001149 pacFileUrl.writeToParcel(data, 0);
Robert Greenwalt434203a2010-10-11 16:00:27 -07001150 mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1151 data.recycle();
1152 }
1153
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001154 public void processInBackground() throws RemoteException {
1155 Parcel data = Parcel.obtain();
1156 data.writeInterfaceToken(IApplicationThread.descriptor);
1157 mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null,
1158 IBinder.FLAG_ONEWAY);
1159 data.recycle();
1160 }
1161
1162 public void dumpService(FileDescriptor fd, IBinder token, String[] args)
1163 throws RemoteException {
1164 Parcel data = Parcel.obtain();
1165 data.writeInterfaceToken(IApplicationThread.descriptor);
1166 data.writeFileDescriptor(fd);
1167 data.writeStrongBinder(token);
1168 data.writeStringArray(args);
Dianne Hackborne17aeb32011-04-07 15:11:57 -07001169 mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001170 data.recycle();
1171 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -07001172
Marco Nelissen18cb2872011-11-15 11:19:53 -08001173 public void dumpProvider(FileDescriptor fd, IBinder token, String[] args)
1174 throws RemoteException {
1175 Parcel data = Parcel.obtain();
1176 data.writeInterfaceToken(IApplicationThread.descriptor);
1177 data.writeFileDescriptor(fd);
1178 data.writeStrongBinder(token);
1179 data.writeStringArray(args);
1180 mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1181 data.recycle();
1182 }
1183
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001184 public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn20e80982012-08-31 19:00:44 -07001185 int resultCode, String dataStr, Bundle extras, boolean ordered,
Dianne Hackborna413dc02013-07-12 12:02:55 -07001186 boolean sticky, int sendingUser, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001187 Parcel data = Parcel.obtain();
1188 data.writeInterfaceToken(IApplicationThread.descriptor);
1189 data.writeStrongBinder(receiver.asBinder());
1190 intent.writeToParcel(data, 0);
1191 data.writeInt(resultCode);
1192 data.writeString(dataStr);
1193 data.writeBundle(extras);
1194 data.writeInt(ordered ? 1 : 0);
Dianne Hackborn68d881c2009-10-05 13:58:17 -07001195 data.writeInt(sticky ? 1 : 0);
Dianne Hackborn20e80982012-08-31 19:00:44 -07001196 data.writeInt(sendingUser);
Dianne Hackborna413dc02013-07-12 12:02:55 -07001197 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001198 mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null,
1199 IBinder.FLAG_ONEWAY);
1200 data.recycle();
1201 }
1202
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001203 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 public final void scheduleLowMemory() throws RemoteException {
1205 Parcel data = Parcel.obtain();
1206 data.writeInterfaceToken(IApplicationThread.descriptor);
1207 mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null,
1208 IBinder.FLAG_ONEWAY);
1209 data.recycle();
1210 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001211
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001212 @Override
Filip Gruszczynskica664812015-12-04 12:43:36 -08001213 public final void scheduleActivityConfigurationChanged(IBinder token,
1214 Configuration overrideConfig, boolean reportToActivity) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001215 Parcel data = Parcel.obtain();
1216 data.writeInterfaceToken(IApplicationThread.descriptor);
1217 data.writeStrongBinder(token);
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001218 if (overrideConfig != null) {
1219 data.writeInt(1);
1220 overrideConfig.writeToParcel(data, 0);
1221 } else {
1222 data.writeInt(0);
1223 }
Filip Gruszczynskica664812015-12-04 12:43:36 -08001224 data.writeInt(reportToActivity ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001225 mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1226 IBinder.FLAG_ONEWAY);
1227 data.recycle();
1228 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001229
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001230 @Override
Jeff Hao1b012d32014-08-20 10:35:34 -07001231 public void profilerControl(boolean start, ProfilerInfo profilerInfo, int profileType)
1232 throws RemoteException {
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001233 Parcel data = Parcel.obtain();
1234 data.writeInterfaceToken(IApplicationThread.descriptor);
1235 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001236 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07001237 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001238 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07001239 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001240 } else {
1241 data.writeInt(0);
1242 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001243 mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null,
1244 IBinder.FLAG_ONEWAY);
1245 data.recycle();
1246 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001247
Dianne Hackborn06de2ea2009-05-21 12:56:43 -07001248 public void setSchedulingGroup(int group) throws RemoteException {
1249 Parcel data = Parcel.obtain();
1250 data.writeInterfaceToken(IApplicationThread.descriptor);
1251 data.writeInt(group);
1252 mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null,
1253 IBinder.FLAG_ONEWAY);
1254 data.recycle();
1255 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001256
Dianne Hackborn4416c3d2010-05-04 17:22:49 -07001257 public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException {
1258 Parcel data = Parcel.obtain();
1259 data.writeInterfaceToken(IApplicationThread.descriptor);
1260 data.writeInt(cmd);
1261 data.writeStringArray(packages);
1262 mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null,
1263 IBinder.FLAG_ONEWAY);
1264 data.recycle();
Dianne Hackborn4416c3d2010-05-04 17:22:49 -07001265 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001266
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001267 public void scheduleCrash(String msg) throws RemoteException {
1268 Parcel data = Parcel.obtain();
1269 data.writeInterfaceToken(IApplicationThread.descriptor);
1270 data.writeString(msg);
1271 mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null,
1272 IBinder.FLAG_ONEWAY);
1273 data.recycle();
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001274 }
Andy McFadden824c5102010-07-09 16:26:57 -07001275
1276 public void dumpHeap(boolean managed, String path,
1277 ParcelFileDescriptor fd) throws RemoteException {
1278 Parcel data = Parcel.obtain();
1279 data.writeInterfaceToken(IApplicationThread.descriptor);
1280 data.writeInt(managed ? 1 : 0);
1281 data.writeString(path);
1282 if (fd != null) {
1283 data.writeInt(1);
1284 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1285 } else {
1286 data.writeInt(0);
1287 }
1288 mRemote.transact(DUMP_HEAP_TRANSACTION, data, null,
1289 IBinder.FLAG_ONEWAY);
1290 data.recycle();
1291 }
Dianne Hackborn625ac272010-09-17 18:29:22 -07001292
Dianne Hackborn30d71892010-12-11 10:37:55 -08001293 public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -07001294 throws RemoteException {
1295 Parcel data = Parcel.obtain();
1296 data.writeInterfaceToken(IApplicationThread.descriptor);
1297 data.writeFileDescriptor(fd);
1298 data.writeStrongBinder(token);
Dianne Hackborn30d71892010-12-11 10:37:55 -08001299 data.writeString(prefix);
Dianne Hackborn625ac272010-09-17 18:29:22 -07001300 data.writeStringArray(args);
Dianne Hackborne17aeb32011-04-07 15:11:57 -07001301 mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
Dianne Hackborn625ac272010-09-17 18:29:22 -07001302 data.recycle();
1303 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001304
1305 public void setCoreSettings(Bundle coreSettings) throws RemoteException {
1306 Parcel data = Parcel.obtain();
1307 data.writeInterfaceToken(IApplicationThread.descriptor);
1308 data.writeBundle(coreSettings);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001309 mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1310 }
1311
1312 public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info)
1313 throws RemoteException {
1314 Parcel data = Parcel.obtain();
1315 data.writeInterfaceToken(IApplicationThread.descriptor);
1316 data.writeString(pkg);
1317 info.writeToParcel(data, 0);
1318 mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null,
1319 IBinder.FLAG_ONEWAY);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001320 }
Dianne Hackbornce86ba82011-07-13 19:33:41 -07001321
1322 public void scheduleTrimMemory(int level) throws RemoteException {
1323 Parcel data = Parcel.obtain();
1324 data.writeInterfaceToken(IApplicationThread.descriptor);
1325 data.writeInt(level);
1326 mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null,
1327 IBinder.FLAG_ONEWAY);
Maunik Shahdb1a9a32014-06-19 14:18:39 +05301328 data.recycle();
Dianne Hackbornce86ba82011-07-13 19:33:41 -07001329 }
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001330
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -07001331 public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
Colin Cross84b1e352016-02-02 16:51:15 -08001332 boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly,
1333 boolean dumpUnreachable, String[] args) throws RemoteException {
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001334 Parcel data = Parcel.obtain();
1335 Parcel reply = Parcel.obtain();
1336 data.writeInterfaceToken(IApplicationThread.descriptor);
1337 data.writeFileDescriptor(fd);
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -07001338 mem.writeToParcel(data, 0);
Dianne Hackbornb437e092011-08-05 17:50:29 -07001339 data.writeInt(checkin ? 1 : 0);
Dianne Hackborn64770d12013-05-23 17:51:19 -07001340 data.writeInt(dumpInfo ? 1 : 0);
1341 data.writeInt(dumpDalvik ? 1 : 0);
Richard Uhlerc14b9cf2015-03-13 12:38:38 -07001342 data.writeInt(dumpSummaryOnly ? 1 : 0);
Colin Cross84b1e352016-02-02 16:51:15 -08001343 data.writeInt(dumpUnreachable ? 1 : 0);
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001344 data.writeStringArray(args);
1345 mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0);
1346 reply.readException();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001347 data.recycle();
1348 reply.recycle();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001349 }
1350
1351 public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException {
1352 Parcel data = Parcel.obtain();
1353 data.writeInterfaceToken(IApplicationThread.descriptor);
1354 data.writeFileDescriptor(fd);
1355 data.writeStringArray(args);
1356 mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1357 data.recycle();
1358 }
Jeff Brown6754ba22011-12-14 20:20:01 -08001359
1360 public void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException {
1361 Parcel data = Parcel.obtain();
1362 data.writeInterfaceToken(IApplicationThread.descriptor);
1363 data.writeFileDescriptor(fd);
1364 data.writeStringArray(args);
1365 mRemote.transact(DUMP_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1366 data.recycle();
1367 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001368
Craig Mautner5eda9b32013-07-02 11:58:16 -07001369 @Override
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001370 public void unstableProviderDied(IBinder provider) throws RemoteException {
1371 Parcel data = Parcel.obtain();
1372 data.writeInterfaceToken(IApplicationThread.descriptor);
1373 data.writeStrongBinder(provider);
1374 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1375 data.recycle();
1376 }
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001377
Craig Mautner5eda9b32013-07-02 11:58:16 -07001378 @Override
Adam Skorydfc7fd72013-08-05 19:23:41 -07001379 public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
Adam Skory7140a252013-09-11 12:04:58 +01001380 int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001381 Parcel data = Parcel.obtain();
1382 data.writeInterfaceToken(IApplicationThread.descriptor);
1383 data.writeStrongBinder(activityToken);
1384 data.writeStrongBinder(requestToken);
1385 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07001386 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null,
1387 IBinder.FLAG_ONEWAY);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001388 data.recycle();
1389 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07001390
1391 @Override
1392 public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
1393 throws RemoteException {
1394 Parcel data = Parcel.obtain();
1395 data.writeInterfaceToken(IApplicationThread.descriptor);
1396 data.writeStrongBinder(token);
1397 data.writeInt(timeout ? 1 : 0);
Craig Mautnereb8abf72014-07-02 15:04:09 -07001398 mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null,
1399 IBinder.FLAG_ONEWAY);
1400 data.recycle();
1401 }
1402
1403 @Override
1404 public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options)
1405 throws RemoteException {
1406 Parcel data = Parcel.obtain();
1407 data.writeInterfaceToken(IApplicationThread.descriptor);
1408 data.writeStrongBinder(token);
1409 data.writeBundle(options == null ? null : options.toBundle());
1410 mRemote.transact(SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION, data, null,
1411 IBinder.FLAG_ONEWAY);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001412 data.recycle();
1413 }
Dianne Hackborna413dc02013-07-12 12:02:55 -07001414
1415 @Override
1416 public void setProcessState(int state) throws RemoteException {
1417 Parcel data = Parcel.obtain();
1418 data.writeInterfaceToken(IApplicationThread.descriptor);
1419 data.writeInt(state);
1420 mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1421 data.recycle();
1422 }
Jeff Sharkeydd97f422013-10-08 17:01:30 -07001423
1424 @Override
1425 public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException {
1426 Parcel data = Parcel.obtain();
1427 data.writeInterfaceToken(IApplicationThread.descriptor);
1428 provider.writeToParcel(data, 0);
1429 mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1430 data.recycle();
1431 }
Narayan Kamathccb2a0862013-12-19 14:49:36 +00001432
1433 @Override
1434 public void updateTimePrefs(boolean is24Hour) throws RemoteException {
1435 Parcel data = Parcel.obtain();
1436 data.writeInterfaceToken(IApplicationThread.descriptor);
1437 data.writeByte(is24Hour ? (byte) 1 : (byte) 0);
1438 mRemote.transact(UPDATE_TIME_PREFS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1439 data.recycle();
1440 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07001441
1442 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07001443 public void scheduleCancelVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07001444 Parcel data = Parcel.obtain();
1445 data.writeInterfaceToken(IApplicationThread.descriptor);
1446 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07001447 mRemote.transact(CANCEL_VISIBLE_BEHIND_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07001448 data.recycle();
1449 }
1450
1451 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07001452 public void scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled)
1453 throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07001454 Parcel data = Parcel.obtain();
1455 data.writeInterfaceToken(IApplicationThread.descriptor);
1456 data.writeStrongBinder(token);
1457 data.writeInt(enabled ? 1 : 0);
Jose Lima4b6c6692014-08-12 17:41:12 -07001458 mRemote.transact(BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION, data, null,
1459 IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07001460 data.recycle();
1461 }
Craig Mautner8746a472014-07-24 15:12:54 -07001462
1463 @Override
1464 public void scheduleEnterAnimationComplete(IBinder token) throws RemoteException {
1465 Parcel data = Parcel.obtain();
1466 data.writeInterfaceToken(IApplicationThread.descriptor);
1467 data.writeStrongBinder(token);
1468 mRemote.transact(ENTER_ANIMATION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1469 data.recycle();
1470 }
Jeff Sharkey605eb792014-11-04 13:34:06 -08001471
1472 @Override
1473 public void notifyCleartextNetwork(byte[] firstPacket) throws RemoteException {
1474 Parcel data = Parcel.obtain();
1475 data.writeInterfaceToken(IApplicationThread.descriptor);
1476 data.writeByteArray(firstPacket);
1477 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1478 data.recycle();
1479 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04001480
1481 @Override
1482 public void startBinderTracking() throws RemoteException {
1483 Parcel data = Parcel.obtain();
1484 data.writeInterfaceToken(IApplicationThread.descriptor);
1485 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, null,
1486 IBinder.FLAG_ONEWAY);
1487 data.recycle();
1488 }
1489
1490 @Override
1491 public void stopBinderTrackingAndDump(FileDescriptor fd) throws RemoteException {
1492 Parcel data = Parcel.obtain();
1493 data.writeInterfaceToken(IApplicationThread.descriptor);
1494 data.writeFileDescriptor(fd);
1495 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, null,
1496 IBinder.FLAG_ONEWAY);
1497 data.recycle();
1498 }
Wale Ogunwale5f986092015-12-04 15:35:38 -08001499
1500 @Override
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001501 public final void scheduleMultiWindowChanged(
1502 IBinder token, boolean inMultiWindow) throws RemoteException {
Wale Ogunwale5f986092015-12-04 15:35:38 -08001503 Parcel data = Parcel.obtain();
1504 data.writeInterfaceToken(IApplicationThread.descriptor);
1505 data.writeStrongBinder(token);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001506 data.writeInt(inMultiWindow ? 1 : 0);
1507 mRemote.transact(SCHEDULE_MULTI_WINDOW_CHANGED_TRANSACTION, data, null,
Wale Ogunwale5f986092015-12-04 15:35:38 -08001508 IBinder.FLAG_ONEWAY);
1509 data.recycle();
1510 }
1511
1512 @Override
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001513 public final void schedulePictureInPictureChanged(IBinder token, boolean inPip)
Wale Ogunwale5f986092015-12-04 15:35:38 -08001514 throws RemoteException {
1515 Parcel data = Parcel.obtain();
1516 data.writeInterfaceToken(IApplicationThread.descriptor);
1517 data.writeStrongBinder(token);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001518 data.writeInt(inPip ? 1 : 0);
1519 mRemote.transact(SCHEDULE_PICTURE_IN_PICTURE_CHANGED_TRANSACTION, data, null,
Wale Ogunwale5f986092015-12-04 15:35:38 -08001520 IBinder.FLAG_ONEWAY);
1521 data.recycle();
1522 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001523}