blob: 12e527ea48414875b857e12ddd204089cb3f0790 [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();
Wale Ogunwale826c7062016-09-13 08:25:54 -0700193 final boolean andPause = data.readInt() == 1;
194 scheduleNewIntent(pi, b, andPause);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800195 return true;
196 }
197
198 case SCHEDULE_FINISH_ACTIVITY_TRANSACTION:
199 {
200 data.enforceInterface(IApplicationThread.descriptor);
201 IBinder b = data.readStrongBinder();
202 boolean finishing = data.readInt() != 0;
203 int configChanges = data.readInt();
204 scheduleDestroyActivity(b, finishing, configChanges);
205 return true;
206 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700207
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800208 case SCHEDULE_RECEIVER_TRANSACTION:
209 {
210 data.enforceInterface(IApplicationThread.descriptor);
211 Intent intent = Intent.CREATOR.createFromParcel(data);
212 ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400213 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800214 int resultCode = data.readInt();
215 String resultData = data.readString();
216 Bundle resultExtras = data.readBundle();
217 boolean sync = data.readInt() != 0;
Dianne Hackborn20e80982012-08-31 19:00:44 -0700218 int sendingUser = data.readInt();
Dianne Hackborna413dc02013-07-12 12:02:55 -0700219 int processState = data.readInt();
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400220 scheduleReceiver(intent, info, compatInfo, resultCode, resultData,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700221 resultExtras, sync, sendingUser, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800222 return true;
223 }
224
225 case SCHEDULE_CREATE_SERVICE_TRANSACTION: {
226 data.enforceInterface(IApplicationThread.descriptor);
227 IBinder token = data.readStrongBinder();
228 ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400229 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700230 int processState = data.readInt();
231 scheduleCreateService(token, info, compatInfo, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800232 return true;
233 }
234
235 case SCHEDULE_BIND_SERVICE_TRANSACTION: {
236 data.enforceInterface(IApplicationThread.descriptor);
237 IBinder token = data.readStrongBinder();
238 Intent intent = Intent.CREATOR.createFromParcel(data);
239 boolean rebind = data.readInt() != 0;
Dianne Hackborna413dc02013-07-12 12:02:55 -0700240 int processState = data.readInt();
241 scheduleBindService(token, intent, rebind, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800242 return true;
243 }
244
245 case SCHEDULE_UNBIND_SERVICE_TRANSACTION: {
246 data.enforceInterface(IApplicationThread.descriptor);
247 IBinder token = data.readStrongBinder();
248 Intent intent = Intent.CREATOR.createFromParcel(data);
249 scheduleUnbindService(token, intent);
250 return true;
251 }
252
253 case SCHEDULE_SERVICE_ARGS_TRANSACTION:
254 {
255 data.enforceInterface(IApplicationThread.descriptor);
256 IBinder token = data.readStrongBinder();
Dianne Hackborn0c5001d2011-04-12 18:16:08 -0700257 boolean taskRemoved = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800258 int startId = data.readInt();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700259 int fl = data.readInt();
260 Intent args;
261 if (data.readInt() != 0) {
262 args = Intent.CREATOR.createFromParcel(data);
263 } else {
264 args = null;
265 }
Dianne Hackborn0c5001d2011-04-12 18:16:08 -0700266 scheduleServiceArgs(token, taskRemoved, startId, fl, args);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800267 return true;
268 }
269
270 case SCHEDULE_STOP_SERVICE_TRANSACTION:
271 {
272 data.enforceInterface(IApplicationThread.descriptor);
273 IBinder token = data.readStrongBinder();
274 scheduleStopService(token);
275 return true;
276 }
277
278 case BIND_APPLICATION_TRANSACTION:
279 {
280 data.enforceInterface(IApplicationThread.descriptor);
281 String packageName = data.readString();
282 ApplicationInfo info =
283 ApplicationInfo.CREATOR.createFromParcel(data);
284 List<ProviderInfo> providers =
285 data.createTypedArrayList(ProviderInfo.CREATOR);
286 ComponentName testName = (data.readInt() != 0)
287 ? new ComponentName(data) : null;
Jeff Hao1b012d32014-08-20 10:35:34 -0700288 ProfilerInfo profilerInfo = data.readInt() != 0
289 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800290 Bundle testArgs = data.readBundle();
291 IBinder binder = data.readStrongBinder();
292 IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder);
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800293 binder = data.readStrongBinder();
294 IUiAutomationConnection uiAutomationConnection =
295 IUiAutomationConnection.Stub.asInterface(binder);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800296 int testMode = data.readInt();
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400297 boolean enableBinderTracking = data.readInt() != 0;
Man Caocfa78b22015-06-11 20:14:34 -0700298 boolean trackAllocation = data.readInt() != 0;
Christopher Tate181fafa2009-05-14 11:12:14 -0700299 boolean restrictedBackupMode = (data.readInt() != 0);
Dianne Hackborn5d927c22011-09-02 12:22:18 -0700300 boolean persistent = (data.readInt() != 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800301 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400302 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303 HashMap<String, IBinder> services = data.readHashMap(null);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800304 Bundle coreSettings = data.readBundle();
Svet Ganov37e43272016-09-09 16:01:32 -0700305 String buildSerial = data.readString();
Jeff Hao1b012d32014-08-20 10:35:34 -0700306 bindApplication(packageName, info, providers, testName, profilerInfo, testArgs,
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400307 testWatcher, uiAutomationConnection, testMode, enableBinderTracking,
Pablo Ceballosa4d4e822015-10-05 10:27:52 -0700308 trackAllocation, restrictedBackupMode, persistent, config, compatInfo, services,
Svet Ganov37e43272016-09-09 16:01:32 -0700309 coreSettings, buildSerial);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800310 return true;
311 }
Siva Velusamy92a8b222012-03-09 16:24:04 -0800312
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800313 case SCHEDULE_EXIT_TRANSACTION:
314 {
315 data.enforceInterface(IApplicationThread.descriptor);
316 scheduleExit();
317 return true;
318 }
319
Christopher Tate5e1ab332009-09-01 20:32:49 -0700320 case SCHEDULE_SUICIDE_TRANSACTION:
321 {
322 data.enforceInterface(IApplicationThread.descriptor);
323 scheduleSuicide();
324 return true;
325 }
326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800327 case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION:
328 {
329 data.enforceInterface(IApplicationThread.descriptor);
330 Configuration config = Configuration.CREATOR.createFromParcel(data);
331 scheduleConfigurationChanged(config);
332 return true;
333 }
334
335 case UPDATE_TIME_ZONE_TRANSACTION: {
336 data.enforceInterface(IApplicationThread.descriptor);
337 updateTimeZone();
338 return true;
339 }
340
Robert Greenwalt03595d02010-11-02 14:08:23 -0700341 case CLEAR_DNS_CACHE_TRANSACTION: {
342 data.enforceInterface(IApplicationThread.descriptor);
343 clearDnsCache();
344 return true;
345 }
346
Robert Greenwalt434203a2010-10-11 16:00:27 -0700347 case SET_HTTP_PROXY_TRANSACTION: {
348 data.enforceInterface(IApplicationThread.descriptor);
349 final String proxy = data.readString();
350 final String port = data.readString();
351 final String exclList = data.readString();
Jason Monk83520b92014-05-09 15:16:06 -0400352 final Uri pacFileUrl = Uri.CREATOR.createFromParcel(data);
Jason Monk602b2322013-07-03 17:04:33 -0400353 setHttpProxy(proxy, port, exclList, pacFileUrl);
Robert Greenwalt434203a2010-10-11 16:00:27 -0700354 return true;
355 }
356
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800357 case PROCESS_IN_BACKGROUND_TRANSACTION: {
358 data.enforceInterface(IApplicationThread.descriptor);
359 processInBackground();
360 return true;
361 }
Robert Greenwalt434203a2010-10-11 16:00:27 -0700362
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800363 case DUMP_SERVICE_TRANSACTION: {
364 data.enforceInterface(IApplicationThread.descriptor);
365 ParcelFileDescriptor fd = data.readFileDescriptor();
366 final IBinder service = data.readStrongBinder();
367 final String[] args = data.readStringArray();
368 if (fd != null) {
369 dumpService(fd.getFileDescriptor(), service, args);
370 try {
371 fd.close();
372 } catch (IOException e) {
373 }
374 }
375 return true;
376 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700377
Marco Nelissen18cb2872011-11-15 11:19:53 -0800378 case DUMP_PROVIDER_TRANSACTION: {
379 data.enforceInterface(IApplicationThread.descriptor);
380 ParcelFileDescriptor fd = data.readFileDescriptor();
381 final IBinder service = data.readStrongBinder();
382 final String[] args = data.readStringArray();
383 if (fd != null) {
384 dumpProvider(fd.getFileDescriptor(), service, args);
385 try {
386 fd.close();
387 } catch (IOException e) {
388 }
389 }
390 return true;
391 }
392
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800393 case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: {
394 data.enforceInterface(IApplicationThread.descriptor);
395 IIntentReceiver receiver = IIntentReceiver.Stub.asInterface(
396 data.readStrongBinder());
397 Intent intent = Intent.CREATOR.createFromParcel(data);
398 int resultCode = data.readInt();
399 String dataStr = data.readString();
400 Bundle extras = data.readBundle();
401 boolean ordered = data.readInt() != 0;
Dianne Hackborn68d881c2009-10-05 13:58:17 -0700402 boolean sticky = data.readInt() != 0;
Dianne Hackborn20e80982012-08-31 19:00:44 -0700403 int sendingUser = data.readInt();
Dianne Hackborna413dc02013-07-12 12:02:55 -0700404 int processState = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800405 scheduleRegisteredReceiver(receiver, intent,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700406 resultCode, dataStr, extras, ordered, sticky, sendingUser, processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800407 return true;
408 }
409
410 case SCHEDULE_LOW_MEMORY_TRANSACTION:
411 {
Vairavan Srinivasane94a3e72012-02-01 23:17:14 -0800412 data.enforceInterface(IApplicationThread.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 scheduleLowMemory();
414 return true;
415 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700416
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800417 case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION:
418 {
419 data.enforceInterface(IApplicationThread.descriptor);
420 IBinder b = data.readStrongBinder();
Wale Ogunwalec2607b42015-02-07 16:16:59 -0800421 Configuration overrideConfig = null;
422 if (data.readInt() != 0) {
423 overrideConfig = Configuration.CREATOR.createFromParcel(data);
424 }
Filip Gruszczynskica664812015-12-04 12:43:36 -0800425 final boolean reportToActivity = data.readInt() == 1;
426 scheduleActivityConfigurationChanged(b, overrideConfig, reportToActivity);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 return true;
428 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700429
Amith Yamasani0af6fa72016-01-17 15:36:19 -0800430 case SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION:
431 {
432 data.enforceInterface(IApplicationThread.descriptor);
433 IBinder token = data.readStrongBinder();
434 IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
435 data.readStrongBinder());
436 scheduleLocalVoiceInteractionStarted(token, voiceInteractor);
437 return true;
438 }
439
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800440 case PROFILER_CONTROL_TRANSACTION:
441 {
442 data.enforceInterface(IApplicationThread.descriptor);
443 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -0700444 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700445 ProfilerInfo profilerInfo = data.readInt() != 0
446 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
447 profilerControl(start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -0800448 return true;
449 }
Jeff Hao1b012d32014-08-20 10:35:34 -0700450
Dianne Hackborn06de2ea2009-05-21 12:56:43 -0700451 case SET_SCHEDULING_GROUP_TRANSACTION:
452 {
453 data.enforceInterface(IApplicationThread.descriptor);
454 int group = data.readInt();
455 setSchedulingGroup(group);
456 return true;
457 }
Christopher Tate181fafa2009-05-14 11:12:14 -0700458
459 case SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION:
460 {
461 data.enforceInterface(IApplicationThread.descriptor);
462 ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400463 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
Christopher Tate181fafa2009-05-14 11:12:14 -0700464 int backupMode = data.readInt();
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400465 scheduleCreateBackupAgent(appInfo, compatInfo, backupMode);
Christopher Tate181fafa2009-05-14 11:12:14 -0700466 return true;
467 }
Christopher Tate1885b372009-06-04 15:00:33 -0700468
469 case SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION:
470 {
471 data.enforceInterface(IApplicationThread.descriptor);
472 ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400473 CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
474 scheduleDestroyBackupAgent(appInfo, compatInfo);
Christopher Tate1885b372009-06-04 15:00:33 -0700475 return true;
476 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -0700477
Dianne Hackborn4416c3d2010-05-04 17:22:49 -0700478 case DISPATCH_PACKAGE_BROADCAST_TRANSACTION:
479 {
480 data.enforceInterface(IApplicationThread.descriptor);
481 int cmd = data.readInt();
482 String[] packages = data.readStringArray();
483 dispatchPackageBroadcast(cmd, packages);
484 return true;
485 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700486
487 case SCHEDULE_CRASH_TRANSACTION:
488 {
489 data.enforceInterface(IApplicationThread.descriptor);
490 String msg = data.readString();
491 scheduleCrash(msg);
492 return true;
493 }
Andy McFadden824c5102010-07-09 16:26:57 -0700494
495 case DUMP_HEAP_TRANSACTION:
496 {
497 data.enforceInterface(IApplicationThread.descriptor);
498 boolean managed = data.readInt() != 0;
499 String path = data.readString();
500 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700501 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Andy McFadden824c5102010-07-09 16:26:57 -0700502 dumpHeap(managed, path, fd);
503 return true;
504 }
Dianne Hackborn625ac272010-09-17 18:29:22 -0700505
506 case DUMP_ACTIVITY_TRANSACTION: {
507 data.enforceInterface(IApplicationThread.descriptor);
508 ParcelFileDescriptor fd = data.readFileDescriptor();
509 final IBinder activity = data.readStrongBinder();
Dianne Hackborn30d71892010-12-11 10:37:55 -0800510 final String prefix = data.readString();
Dianne Hackborn625ac272010-09-17 18:29:22 -0700511 final String[] args = data.readStringArray();
512 if (fd != null) {
Dianne Hackborn30d71892010-12-11 10:37:55 -0800513 dumpActivity(fd.getFileDescriptor(), activity, prefix, args);
Dianne Hackborn625ac272010-09-17 18:29:22 -0700514 try {
515 fd.close();
516 } catch (IOException e) {
517 }
518 }
519 return true;
520 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800521
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400522 case SET_CORE_SETTINGS_TRANSACTION: {
Svetoslav Ganov54d068e2011-03-02 12:58:40 -0800523 data.enforceInterface(IApplicationThread.descriptor);
524 Bundle settings = data.readBundle();
525 setCoreSettings(settings);
526 return true;
527 }
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400528
529 case UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION: {
530 data.enforceInterface(IApplicationThread.descriptor);
531 String pkg = data.readString();
532 CompatibilityInfo compat = CompatibilityInfo.CREATOR.createFromParcel(data);
533 updatePackageCompatibilityInfo(pkg, compat);
534 return true;
535 }
Dianne Hackbornce86ba82011-07-13 19:33:41 -0700536
537 case SCHEDULE_TRIM_MEMORY_TRANSACTION: {
538 data.enforceInterface(IApplicationThread.descriptor);
539 int level = data.readInt();
540 scheduleTrimMemory(level);
541 return true;
542 }
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700543
544 case DUMP_MEM_INFO_TRANSACTION:
545 {
546 data.enforceInterface(IApplicationThread.descriptor);
547 ParcelFileDescriptor fd = data.readFileDescriptor();
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -0700548 Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data);
Dianne Hackbornb437e092011-08-05 17:50:29 -0700549 boolean checkin = data.readInt() != 0;
Dianne Hackborn64770d12013-05-23 17:51:19 -0700550 boolean dumpInfo = data.readInt() != 0;
551 boolean dumpDalvik = data.readInt() != 0;
Richard Uhlerc14b9cf2015-03-13 12:38:38 -0700552 boolean dumpSummaryOnly = data.readInt() != 0;
Colin Crossc4fb5f92016-02-02 16:51:15 -0800553 boolean dumpUnreachable = data.readInt() != 0;
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700554 String[] args = data.readStringArray();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700555 if (fd != null) {
556 try {
Richard Uhlerc14b9cf2015-03-13 12:38:38 -0700557 dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo,
Colin Crossc4fb5f92016-02-02 16:51:15 -0800558 dumpDalvik, dumpSummaryOnly, dumpUnreachable, args);
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700559 } finally {
560 try {
561 fd.close();
562 } catch (IOException e) {
563 // swallowed, not propagated back to the caller
564 }
565 }
566 }
567 reply.writeNoException();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -0700568 return true;
569 }
570
571 case DUMP_GFX_INFO_TRANSACTION:
572 {
573 data.enforceInterface(IApplicationThread.descriptor);
574 ParcelFileDescriptor fd = data.readFileDescriptor();
575 String[] args = data.readStringArray();
576 if (fd != null) {
577 try {
578 dumpGfxInfo(fd.getFileDescriptor(), args);
579 } finally {
580 try {
581 fd.close();
582 } catch (IOException e) {
583 // swallowed, not propagated back to the caller
584 }
585 }
586 }
587 reply.writeNoException();
588 return true;
589 }
Jeff Brown6754ba22011-12-14 20:20:01 -0800590
591 case DUMP_DB_INFO_TRANSACTION:
592 {
593 data.enforceInterface(IApplicationThread.descriptor);
594 ParcelFileDescriptor fd = data.readFileDescriptor();
595 String[] args = data.readStringArray();
596 if (fd != null) {
597 try {
598 dumpDbInfo(fd.getFileDescriptor(), args);
599 } finally {
600 try {
601 fd.close();
602 } catch (IOException e) {
603 // swallowed, not propagated back to the caller
604 }
605 }
606 }
607 reply.writeNoException();
608 return true;
609 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700610
611 case UNSTABLE_PROVIDER_DIED_TRANSACTION:
612 {
613 data.enforceInterface(IApplicationThread.descriptor);
614 IBinder provider = data.readStrongBinder();
615 unstableProviderDied(provider);
616 reply.writeNoException();
617 return true;
618 }
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800619
Adam Skorydfc7fd72013-08-05 19:23:41 -0700620 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION:
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800621 {
622 data.enforceInterface(IApplicationThread.descriptor);
623 IBinder activityToken = data.readStrongBinder();
624 IBinder requestToken = data.readStrongBinder();
625 int requestType = data.readInt();
Amith Yamasani4f128e42016-05-10 11:44:12 -0700626 int sessionId = data.readInt();
627 requestAssistContextExtras(activityToken, requestToken, requestType, sessionId);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -0800628 reply.writeNoException();
629 return true;
630 }
Craig Mautner5eda9b32013-07-02 11:58:16 -0700631
632 case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION:
633 {
634 data.enforceInterface(IApplicationThread.descriptor);
635 IBinder token = data.readStrongBinder();
636 boolean timeout = data.readInt() == 1;
637 scheduleTranslucentConversionComplete(token, timeout);
638 reply.writeNoException();
639 return true;
640 }
Dianne Hackborna413dc02013-07-12 12:02:55 -0700641
Craig Mautnereb8abf72014-07-02 15:04:09 -0700642 case SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION:
643 {
644 data.enforceInterface(IApplicationThread.descriptor);
645 IBinder token = data.readStrongBinder();
646 ActivityOptions options = new ActivityOptions(data.readBundle());
647 scheduleOnNewActivityOptions(token, options);
648 reply.writeNoException();
649 return true;
650 }
651
Dianne Hackborna413dc02013-07-12 12:02:55 -0700652 case SET_PROCESS_STATE_TRANSACTION:
653 {
654 data.enforceInterface(IApplicationThread.descriptor);
655 int state = data.readInt();
656 setProcessState(state);
657 reply.writeNoException();
658 return true;
659 }
Jeff Sharkeydd97f422013-10-08 17:01:30 -0700660
661 case SCHEDULE_INSTALL_PROVIDER_TRANSACTION:
662 {
663 data.enforceInterface(IApplicationThread.descriptor);
664 ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data);
665 scheduleInstallProvider(provider);
666 reply.writeNoException();
667 return true;
668 }
Narayan Kamathccb2a0862013-12-19 14:49:36 +0000669
670 case UPDATE_TIME_PREFS_TRANSACTION:
671 {
672 data.enforceInterface(IApplicationThread.descriptor);
673 byte is24Hour = data.readByte();
674 updateTimePrefs(is24Hour == (byte) 1);
675 reply.writeNoException();
676 return true;
677 }
Craig Mautneree2e45a2014-06-27 12:10:03 -0700678
Jose Lima4b6c6692014-08-12 17:41:12 -0700679 case CANCEL_VISIBLE_BEHIND_TRANSACTION:
Craig Mautneree2e45a2014-06-27 12:10:03 -0700680 {
681 data.enforceInterface(IApplicationThread.descriptor);
682 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -0700683 scheduleCancelVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -0700684 reply.writeNoException();
685 return true;
686 }
687
Jose Lima4b6c6692014-08-12 17:41:12 -0700688 case BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION:
Craig Mautneree2e45a2014-06-27 12:10:03 -0700689 {
690 data.enforceInterface(IApplicationThread.descriptor);
691 IBinder token = data.readStrongBinder();
692 boolean enabled = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -0700693 scheduleBackgroundVisibleBehindChanged(token, enabled);
Craig Mautneree2e45a2014-06-27 12:10:03 -0700694 reply.writeNoException();
695 return true;
696 }
Craig Mautner8746a472014-07-24 15:12:54 -0700697
698 case ENTER_ANIMATION_COMPLETE_TRANSACTION:
699 {
700 data.enforceInterface(IApplicationThread.descriptor);
701 IBinder token = data.readStrongBinder();
702 scheduleEnterAnimationComplete(token);
703 reply.writeNoException();
704 return true;
705 }
Jeff Sharkey605eb792014-11-04 13:34:06 -0800706
707 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION:
708 {
709 data.enforceInterface(IApplicationThread.descriptor);
710 final byte[] firstPacket = data.createByteArray();
711 notifyCleartextNetwork(firstPacket);
712 reply.writeNoException();
713 return true;
714 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -0400715
716 case START_BINDER_TRACKING_TRANSACTION:
717 {
718 data.enforceInterface(IApplicationThread.descriptor);
719 startBinderTracking();
720 return true;
721 }
722
723 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION:
724 {
725 data.enforceInterface(IApplicationThread.descriptor);
726 ParcelFileDescriptor fd = data.readFileDescriptor();
727 if (fd != null) {
728 stopBinderTrackingAndDump(fd.getFileDescriptor());
729 try {
730 fd.close();
731 } catch (IOException e) {
732 }
733 }
734 return true;
735 }
736
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800737 case SCHEDULE_MULTI_WINDOW_CHANGED_TRANSACTION:
Wale Ogunwale5f986092015-12-04 15:35:38 -0800738 {
739 data.enforceInterface(IApplicationThread.descriptor);
740 final IBinder b = data.readStrongBinder();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800741 final boolean inMultiWindow = data.readInt() != 0;
Andrii Kulian933076d2016-03-29 17:04:42 -0700742 scheduleMultiWindowModeChanged(b, inMultiWindow);
Wale Ogunwale5f986092015-12-04 15:35:38 -0800743 return true;
744 }
745
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800746 case SCHEDULE_PICTURE_IN_PICTURE_CHANGED_TRANSACTION:
Wale Ogunwale5f986092015-12-04 15:35:38 -0800747 {
748 data.enforceInterface(IApplicationThread.descriptor);
749 final IBinder b = data.readStrongBinder();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -0800750 final boolean inPip = data.readInt() != 0;
Andrii Kulian933076d2016-03-29 17:04:42 -0700751 schedulePictureInPictureModeChanged(b, inPip);
Wale Ogunwale5f986092015-12-04 15:35:38 -0800752 return true;
753 }
Chad Brubakerc72875b2016-04-27 16:35:11 -0700754 case HANDLE_TRUST_STORAGE_UPDATE_TRANSACTION:
755 {
756 data.enforceInterface(IApplicationThread.descriptor);
757 handleTrustStorageUpdate();
758 return true;
759 }
Wale Ogunwale5f986092015-12-04 15:35:38 -0800760
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800761 }
762
763 return super.onTransact(code, data, reply, flags);
764 }
765
766 public IBinder asBinder()
767 {
768 return this;
769 }
770}
771
772class ApplicationThreadProxy implements IApplicationThread {
773 private final IBinder mRemote;
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700774
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800775 public ApplicationThreadProxy(IBinder remote) {
776 mRemote = remote;
777 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700778
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800779 public final IBinder asBinder() {
780 return mRemote;
781 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700782
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800783 public final void schedulePauseActivity(IBinder token, boolean finished,
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700784 boolean userLeaving, int configChanges, boolean dontReport) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800785 Parcel data = Parcel.obtain();
786 data.writeInterfaceToken(IApplicationThread.descriptor);
787 data.writeStrongBinder(token);
788 data.writeInt(finished ? 1 : 0);
789 data.writeInt(userLeaving ? 1 :0);
790 data.writeInt(configChanges);
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700791 data.writeInt(dontReport ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800792 mRemote.transact(SCHEDULE_PAUSE_ACTIVITY_TRANSACTION, data, null,
793 IBinder.FLAG_ONEWAY);
794 data.recycle();
795 }
796
797 public final void scheduleStopActivity(IBinder token, boolean showWindow,
798 int configChanges) throws RemoteException {
799 Parcel data = Parcel.obtain();
800 data.writeInterfaceToken(IApplicationThread.descriptor);
801 data.writeStrongBinder(token);
802 data.writeInt(showWindow ? 1 : 0);
803 data.writeInt(configChanges);
804 mRemote.transact(SCHEDULE_STOP_ACTIVITY_TRANSACTION, data, null,
805 IBinder.FLAG_ONEWAY);
806 data.recycle();
807 }
808
809 public final void scheduleWindowVisibility(IBinder token,
810 boolean showWindow) throws RemoteException {
811 Parcel data = Parcel.obtain();
812 data.writeInterfaceToken(IApplicationThread.descriptor);
813 data.writeStrongBinder(token);
814 data.writeInt(showWindow ? 1 : 0);
815 mRemote.transact(SCHEDULE_WINDOW_VISIBILITY_TRANSACTION, data, null,
816 IBinder.FLAG_ONEWAY);
817 data.recycle();
818 }
819
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800820 public final void scheduleSleeping(IBinder token,
821 boolean sleeping) throws RemoteException {
822 Parcel data = Parcel.obtain();
823 data.writeInterfaceToken(IApplicationThread.descriptor);
824 data.writeStrongBinder(token);
825 data.writeInt(sleeping ? 1 : 0);
826 mRemote.transact(SCHEDULE_SLEEPING_TRANSACTION, data, null,
827 IBinder.FLAG_ONEWAY);
828 data.recycle();
829 }
830
Adam Powellcfbe9be2013-11-06 14:58:58 -0800831 public final void scheduleResumeActivity(IBinder token, int procState, boolean isForward,
832 Bundle resumeArgs)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800833 throws RemoteException {
834 Parcel data = Parcel.obtain();
835 data.writeInterfaceToken(IApplicationThread.descriptor);
836 data.writeStrongBinder(token);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700837 data.writeInt(procState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800838 data.writeInt(isForward ? 1 : 0);
Adam Powellcfbe9be2013-11-06 14:58:58 -0800839 data.writeBundle(resumeArgs);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800840 mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null,
841 IBinder.FLAG_ONEWAY);
842 data.recycle();
843 }
844
845 public final void scheduleSendResult(IBinder token, List<ResultInfo> results)
John Spurlock8a985d22014-02-25 09:40:05 -0500846 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800847 Parcel data = Parcel.obtain();
848 data.writeInterfaceToken(IApplicationThread.descriptor);
849 data.writeStrongBinder(token);
850 data.writeTypedList(results);
851 mRemote.transact(SCHEDULE_SEND_RESULT_TRANSACTION, data, null,
852 IBinder.FLAG_ONEWAY);
853 data.recycle();
854 }
855
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700856 public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
Wale Ogunwale60454db2015-01-23 16:05:07 -0800857 ActivityInfo info, Configuration curConfig, Configuration overrideConfig,
858 CompatibilityInfo compatInfo, String referrer, IVoiceInteractor voiceInteractor,
859 int procState, Bundle state, PersistableBundle persistentState,
860 List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
861 boolean notResumed, boolean isForward, ProfilerInfo profilerInfo) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800862 Parcel data = Parcel.obtain();
863 data.writeInterfaceToken(IApplicationThread.descriptor);
864 intent.writeToParcel(data, 0);
865 data.writeStrongBinder(token);
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700866 data.writeInt(ident);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800867 info.writeToParcel(data, 0);
Dianne Hackborn58f42a52011-10-10 13:46:34 -0700868 curConfig.writeToParcel(data, 0);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800869 if (overrideConfig != null) {
870 data.writeInt(1);
871 overrideConfig.writeToParcel(data, 0);
872 } else {
873 data.writeInt(0);
874 }
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400875 compatInfo.writeToParcel(data, 0);
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800876 data.writeString(referrer);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700877 data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700878 data.writeInt(procState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800879 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -0700880 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800881 data.writeTypedList(pendingResults);
882 data.writeTypedList(pendingNewIntents);
883 data.writeInt(notResumed ? 1 : 0);
884 data.writeInt(isForward ? 1 : 0);
Jeff Hao1b012d32014-08-20 10:35:34 -0700885 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700886 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -0700887 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700888 } else {
889 data.writeInt(0);
890 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800891 mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null,
892 IBinder.FLAG_ONEWAY);
893 data.recycle();
894 }
895
896 public final void scheduleRelaunchActivity(IBinder token,
Dianne Hackborn85d558c2014-11-04 10:31:54 -0800897 List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
Wale Ogunwale60454db2015-01-23 16:05:07 -0800898 int configChanges, boolean notResumed, Configuration config,
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700899 Configuration overrideConfig, boolean preserveWindow) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800900 Parcel data = Parcel.obtain();
901 data.writeInterfaceToken(IApplicationThread.descriptor);
902 data.writeStrongBinder(token);
903 data.writeTypedList(pendingResults);
904 data.writeTypedList(pendingNewIntents);
905 data.writeInt(configChanges);
906 data.writeInt(notResumed ? 1 : 0);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800907 config.writeToParcel(data, 0);
908 if (overrideConfig != null) {
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800909 data.writeInt(1);
Wale Ogunwale60454db2015-01-23 16:05:07 -0800910 overrideConfig.writeToParcel(data, 0);
Dianne Hackborn871ecdc2009-12-11 15:24:33 -0800911 } else {
912 data.writeInt(0);
913 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700914 data.writeInt(preserveWindow ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800915 mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null,
916 IBinder.FLAG_ONEWAY);
917 data.recycle();
918 }
919
Wale Ogunwale826c7062016-09-13 08:25:54 -0700920 public void scheduleNewIntent(List<ReferrerIntent> intents, IBinder token, boolean andPause)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800921 throws RemoteException {
922 Parcel data = Parcel.obtain();
923 data.writeInterfaceToken(IApplicationThread.descriptor);
924 data.writeTypedList(intents);
925 data.writeStrongBinder(token);
Wale Ogunwale826c7062016-09-13 08:25:54 -0700926 data.writeInt(andPause ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800927 mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null,
928 IBinder.FLAG_ONEWAY);
929 data.recycle();
930 }
931
932 public final void scheduleDestroyActivity(IBinder token, boolean finishing,
933 int configChanges) throws RemoteException {
934 Parcel data = Parcel.obtain();
935 data.writeInterfaceToken(IApplicationThread.descriptor);
936 data.writeStrongBinder(token);
937 data.writeInt(finishing ? 1 : 0);
938 data.writeInt(configChanges);
939 mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null,
940 IBinder.FLAG_ONEWAY);
941 data.recycle();
942 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700943
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800944 public final void scheduleReceiver(Intent intent, ActivityInfo info,
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400945 CompatibilityInfo compatInfo, int resultCode, String resultData,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700946 Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800947 Parcel data = Parcel.obtain();
948 data.writeInterfaceToken(IApplicationThread.descriptor);
949 intent.writeToParcel(data, 0);
950 info.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400951 compatInfo.writeToParcel(data, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800952 data.writeInt(resultCode);
953 data.writeString(resultData);
954 data.writeBundle(map);
955 data.writeInt(sync ? 1 : 0);
Dianne Hackborn20e80982012-08-31 19:00:44 -0700956 data.writeInt(sendingUser);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700957 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800958 mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null,
959 IBinder.FLAG_ONEWAY);
960 data.recycle();
961 }
962
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400963 public final void scheduleCreateBackupAgent(ApplicationInfo app,
964 CompatibilityInfo compatInfo, int backupMode) throws RemoteException {
Christopher Tate181fafa2009-05-14 11:12:14 -0700965 Parcel data = Parcel.obtain();
966 data.writeInterfaceToken(IApplicationThread.descriptor);
967 app.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400968 compatInfo.writeToParcel(data, 0);
Christopher Tate181fafa2009-05-14 11:12:14 -0700969 data.writeInt(backupMode);
Christopher Tated884f432009-07-23 14:40:13 -0700970 mRemote.transact(SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION, data, null,
971 IBinder.FLAG_ONEWAY);
Christopher Tate181fafa2009-05-14 11:12:14 -0700972 data.recycle();
973 }
974
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400975 public final void scheduleDestroyBackupAgent(ApplicationInfo app,
976 CompatibilityInfo compatInfo) throws RemoteException {
Christopher Tate181fafa2009-05-14 11:12:14 -0700977 Parcel data = Parcel.obtain();
978 data.writeInterfaceToken(IApplicationThread.descriptor);
979 app.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400980 compatInfo.writeToParcel(data, 0);
Christopher Tated884f432009-07-23 14:40:13 -0700981 mRemote.transact(SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION, data, null,
982 IBinder.FLAG_ONEWAY);
Christopher Tate181fafa2009-05-14 11:12:14 -0700983 data.recycle();
984 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -0700985
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400986 public final void scheduleCreateService(IBinder token, ServiceInfo info,
Dianne Hackborna413dc02013-07-12 12:02:55 -0700987 CompatibilityInfo compatInfo, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800988 Parcel data = Parcel.obtain();
989 data.writeInterfaceToken(IApplicationThread.descriptor);
990 data.writeStrongBinder(token);
991 info.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -0400992 compatInfo.writeToParcel(data, 0);
Dianne Hackborna413dc02013-07-12 12:02:55 -0700993 data.writeInt(processState);
Christopher Tate8a2ce3c2015-06-19 10:28:20 -0700994 try {
995 mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
996 IBinder.FLAG_ONEWAY);
997 } catch (TransactionTooLargeException e) {
998 Log.e("CREATE_SERVICE", "Binder failure starting service; service=" + info);
999 throw e;
1000 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001001 data.recycle();
1002 }
1003
Dianne Hackborna413dc02013-07-12 12:02:55 -07001004 public final void scheduleBindService(IBinder token, Intent intent, boolean rebind,
1005 int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001006 Parcel data = Parcel.obtain();
1007 data.writeInterfaceToken(IApplicationThread.descriptor);
1008 data.writeStrongBinder(token);
1009 intent.writeToParcel(data, 0);
1010 data.writeInt(rebind ? 1 : 0);
Dianne Hackborna413dc02013-07-12 12:02:55 -07001011 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001012 mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null,
1013 IBinder.FLAG_ONEWAY);
1014 data.recycle();
1015 }
1016
1017 public final void scheduleUnbindService(IBinder token, Intent intent)
1018 throws RemoteException {
1019 Parcel data = Parcel.obtain();
1020 data.writeInterfaceToken(IApplicationThread.descriptor);
1021 data.writeStrongBinder(token);
1022 intent.writeToParcel(data, 0);
1023 mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null,
1024 IBinder.FLAG_ONEWAY);
1025 data.recycle();
1026 }
1027
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001028 public final void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
John Spurlock8a985d22014-02-25 09:40:05 -05001029 int flags, Intent args) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001030 Parcel data = Parcel.obtain();
1031 data.writeInterfaceToken(IApplicationThread.descriptor);
1032 data.writeStrongBinder(token);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001033 data.writeInt(taskRemoved ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001034 data.writeInt(startId);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001035 data.writeInt(flags);
1036 if (args != null) {
1037 data.writeInt(1);
1038 args.writeToParcel(data, 0);
1039 } else {
1040 data.writeInt(0);
1041 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001042 mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null,
1043 IBinder.FLAG_ONEWAY);
1044 data.recycle();
1045 }
1046
1047 public final void scheduleStopService(IBinder token)
1048 throws RemoteException {
1049 Parcel data = Parcel.obtain();
1050 data.writeInterfaceToken(IApplicationThread.descriptor);
1051 data.writeStrongBinder(token);
1052 mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null,
1053 IBinder.FLAG_ONEWAY);
1054 data.recycle();
1055 }
1056
Man Caocfa78b22015-06-11 20:14:34 -07001057 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001058 public final void bindApplication(String packageName, ApplicationInfo info,
Jeff Hao1b012d32014-08-20 10:35:34 -07001059 List<ProviderInfo> providers, ComponentName testName, ProfilerInfo profilerInfo,
1060 Bundle testArgs, IInstrumentationWatcher testWatcher,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001061 IUiAutomationConnection uiAutomationConnection, int debugMode,
Pablo Ceballosa4d4e822015-10-05 10:27:52 -07001062 boolean enableBinderTracking, boolean trackAllocation, boolean restrictedBackupMode,
1063 boolean persistent, Configuration config, CompatibilityInfo compatInfo,
Svet Ganov37e43272016-09-09 16:01:32 -07001064 Map<String, IBinder> services, Bundle coreSettings, String buildSerial)
1065 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001066 Parcel data = Parcel.obtain();
1067 data.writeInterfaceToken(IApplicationThread.descriptor);
1068 data.writeString(packageName);
1069 info.writeToParcel(data, 0);
1070 data.writeTypedList(providers);
1071 if (testName == null) {
1072 data.writeInt(0);
1073 } else {
1074 data.writeInt(1);
1075 testName.writeToParcel(data, 0);
1076 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001077 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001078 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07001079 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001080 } else {
1081 data.writeInt(0);
1082 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001083 data.writeBundle(testArgs);
1084 data.writeStrongInterface(testWatcher);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001085 data.writeStrongInterface(uiAutomationConnection);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001086 data.writeInt(debugMode);
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04001087 data.writeInt(enableBinderTracking ? 1 : 0);
Man Caocfa78b22015-06-11 20:14:34 -07001088 data.writeInt(trackAllocation ? 1 : 0);
Christopher Tate181fafa2009-05-14 11:12:14 -07001089 data.writeInt(restrictedBackupMode ? 1 : 0);
Dianne Hackborn5d927c22011-09-02 12:22:18 -07001090 data.writeInt(persistent ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001091 config.writeToParcel(data, 0);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001092 compatInfo.writeToParcel(data, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001093 data.writeMap(services);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001094 data.writeBundle(coreSettings);
Svet Ganov37e43272016-09-09 16:01:32 -07001095 data.writeString(buildSerial);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001096 mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null,
1097 IBinder.FLAG_ONEWAY);
1098 data.recycle();
1099 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -07001100
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001101 public final void scheduleExit() throws RemoteException {
1102 Parcel data = Parcel.obtain();
1103 data.writeInterfaceToken(IApplicationThread.descriptor);
1104 mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null,
1105 IBinder.FLAG_ONEWAY);
1106 data.recycle();
1107 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001108
1109 public final void scheduleSuicide() throws RemoteException {
1110 Parcel data = Parcel.obtain();
1111 data.writeInterfaceToken(IApplicationThread.descriptor);
1112 mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null,
1113 IBinder.FLAG_ONEWAY);
1114 data.recycle();
1115 }
1116
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001117 public final void scheduleConfigurationChanged(Configuration config)
1118 throws RemoteException {
1119 Parcel data = Parcel.obtain();
1120 data.writeInterfaceToken(IApplicationThread.descriptor);
1121 config.writeToParcel(data, 0);
1122 mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1123 IBinder.FLAG_ONEWAY);
1124 data.recycle();
1125 }
1126
Amith Yamasani0af6fa72016-01-17 15:36:19 -08001127 public final void scheduleLocalVoiceInteractionStarted(IBinder token,
1128 IVoiceInteractor voiceInteractor) throws RemoteException {
1129 Parcel data = Parcel.obtain();
1130 data.writeInterfaceToken(IApplicationThread.descriptor);
1131 data.writeStrongBinder(token);
1132 data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
1133 mRemote.transact(SCHEDULE_LOCAL_VOICE_INTERACTION_STARTED_TRANSACTION, data, null,
1134 IBinder.FLAG_ONEWAY);
1135 data.recycle();
1136 }
1137
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001138 public void updateTimeZone() throws RemoteException {
1139 Parcel data = Parcel.obtain();
1140 data.writeInterfaceToken(IApplicationThread.descriptor);
1141 mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null,
1142 IBinder.FLAG_ONEWAY);
1143 data.recycle();
1144 }
1145
Robert Greenwalt03595d02010-11-02 14:08:23 -07001146 public void clearDnsCache() throws RemoteException {
1147 Parcel data = Parcel.obtain();
1148 data.writeInterfaceToken(IApplicationThread.descriptor);
1149 mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null,
1150 IBinder.FLAG_ONEWAY);
1151 data.recycle();
1152 }
1153
Jason Monk602b2322013-07-03 17:04:33 -04001154 public void setHttpProxy(String proxy, String port, String exclList,
Jason Monk83520b92014-05-09 15:16:06 -04001155 Uri pacFileUrl) throws RemoteException {
Robert Greenwalt434203a2010-10-11 16:00:27 -07001156 Parcel data = Parcel.obtain();
1157 data.writeInterfaceToken(IApplicationThread.descriptor);
1158 data.writeString(proxy);
1159 data.writeString(port);
1160 data.writeString(exclList);
Jason Monk83520b92014-05-09 15:16:06 -04001161 pacFileUrl.writeToParcel(data, 0);
Robert Greenwalt434203a2010-10-11 16:00:27 -07001162 mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1163 data.recycle();
1164 }
1165
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001166 public void processInBackground() throws RemoteException {
1167 Parcel data = Parcel.obtain();
1168 data.writeInterfaceToken(IApplicationThread.descriptor);
1169 mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null,
1170 IBinder.FLAG_ONEWAY);
1171 data.recycle();
1172 }
1173
1174 public void dumpService(FileDescriptor fd, IBinder token, String[] args)
1175 throws RemoteException {
1176 Parcel data = Parcel.obtain();
1177 data.writeInterfaceToken(IApplicationThread.descriptor);
1178 data.writeFileDescriptor(fd);
1179 data.writeStrongBinder(token);
1180 data.writeStringArray(args);
Dianne Hackborne17aeb32011-04-07 15:11:57 -07001181 mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 data.recycle();
1183 }
Filip Gruszczynskia59ac9c2015-09-10 18:28:48 -07001184
Marco Nelissen18cb2872011-11-15 11:19:53 -08001185 public void dumpProvider(FileDescriptor fd, IBinder token, String[] args)
1186 throws RemoteException {
1187 Parcel data = Parcel.obtain();
1188 data.writeInterfaceToken(IApplicationThread.descriptor);
1189 data.writeFileDescriptor(fd);
1190 data.writeStrongBinder(token);
1191 data.writeStringArray(args);
1192 mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1193 data.recycle();
1194 }
1195
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
Dianne Hackborn20e80982012-08-31 19:00:44 -07001197 int resultCode, String dataStr, Bundle extras, boolean ordered,
Dianne Hackborna413dc02013-07-12 12:02:55 -07001198 boolean sticky, int sendingUser, int processState) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001199 Parcel data = Parcel.obtain();
1200 data.writeInterfaceToken(IApplicationThread.descriptor);
1201 data.writeStrongBinder(receiver.asBinder());
1202 intent.writeToParcel(data, 0);
1203 data.writeInt(resultCode);
1204 data.writeString(dataStr);
1205 data.writeBundle(extras);
1206 data.writeInt(ordered ? 1 : 0);
Dianne Hackborn68d881c2009-10-05 13:58:17 -07001207 data.writeInt(sticky ? 1 : 0);
Dianne Hackborn20e80982012-08-31 19:00:44 -07001208 data.writeInt(sendingUser);
Dianne Hackborna413dc02013-07-12 12:02:55 -07001209 data.writeInt(processState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001210 mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null,
1211 IBinder.FLAG_ONEWAY);
1212 data.recycle();
1213 }
1214
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001215 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001216 public final void scheduleLowMemory() throws RemoteException {
1217 Parcel data = Parcel.obtain();
1218 data.writeInterfaceToken(IApplicationThread.descriptor);
1219 mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null,
1220 IBinder.FLAG_ONEWAY);
1221 data.recycle();
1222 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001223
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001224 @Override
Filip Gruszczynskica664812015-12-04 12:43:36 -08001225 public final void scheduleActivityConfigurationChanged(IBinder token,
1226 Configuration overrideConfig, boolean reportToActivity) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001227 Parcel data = Parcel.obtain();
1228 data.writeInterfaceToken(IApplicationThread.descriptor);
1229 data.writeStrongBinder(token);
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001230 if (overrideConfig != null) {
1231 data.writeInt(1);
1232 overrideConfig.writeToParcel(data, 0);
1233 } else {
1234 data.writeInt(0);
1235 }
Filip Gruszczynskica664812015-12-04 12:43:36 -08001236 data.writeInt(reportToActivity ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001237 mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1238 IBinder.FLAG_ONEWAY);
1239 data.recycle();
1240 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001241
Wale Ogunwalec2607b42015-02-07 16:16:59 -08001242 @Override
Jeff Hao1b012d32014-08-20 10:35:34 -07001243 public void profilerControl(boolean start, ProfilerInfo profilerInfo, int profileType)
1244 throws RemoteException {
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001245 Parcel data = Parcel.obtain();
1246 data.writeInterfaceToken(IApplicationThread.descriptor);
1247 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001248 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07001249 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001250 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07001251 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001252 } else {
1253 data.writeInt(0);
1254 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001255 mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null,
1256 IBinder.FLAG_ONEWAY);
1257 data.recycle();
1258 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001259
Dianne Hackborn06de2ea2009-05-21 12:56:43 -07001260 public void setSchedulingGroup(int group) throws RemoteException {
1261 Parcel data = Parcel.obtain();
1262 data.writeInterfaceToken(IApplicationThread.descriptor);
1263 data.writeInt(group);
1264 mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null,
1265 IBinder.FLAG_ONEWAY);
1266 data.recycle();
1267 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001268
Dianne Hackborn4416c3d2010-05-04 17:22:49 -07001269 public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException {
1270 Parcel data = Parcel.obtain();
1271 data.writeInterfaceToken(IApplicationThread.descriptor);
1272 data.writeInt(cmd);
1273 data.writeStringArray(packages);
1274 mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null,
1275 IBinder.FLAG_ONEWAY);
1276 data.recycle();
Dianne Hackborn4416c3d2010-05-04 17:22:49 -07001277 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001278
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001279 public void scheduleCrash(String msg) throws RemoteException {
1280 Parcel data = Parcel.obtain();
1281 data.writeInterfaceToken(IApplicationThread.descriptor);
1282 data.writeString(msg);
1283 mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null,
1284 IBinder.FLAG_ONEWAY);
1285 data.recycle();
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001286 }
Andy McFadden824c5102010-07-09 16:26:57 -07001287
1288 public void dumpHeap(boolean managed, String path,
1289 ParcelFileDescriptor fd) throws RemoteException {
1290 Parcel data = Parcel.obtain();
1291 data.writeInterfaceToken(IApplicationThread.descriptor);
1292 data.writeInt(managed ? 1 : 0);
1293 data.writeString(path);
1294 if (fd != null) {
1295 data.writeInt(1);
1296 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1297 } else {
1298 data.writeInt(0);
1299 }
1300 mRemote.transact(DUMP_HEAP_TRANSACTION, data, null,
1301 IBinder.FLAG_ONEWAY);
1302 data.recycle();
1303 }
Dianne Hackborn625ac272010-09-17 18:29:22 -07001304
Dianne Hackborn30d71892010-12-11 10:37:55 -08001305 public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args)
Dianne Hackborn625ac272010-09-17 18:29:22 -07001306 throws RemoteException {
1307 Parcel data = Parcel.obtain();
1308 data.writeInterfaceToken(IApplicationThread.descriptor);
1309 data.writeFileDescriptor(fd);
1310 data.writeStrongBinder(token);
Dianne Hackborn30d71892010-12-11 10:37:55 -08001311 data.writeString(prefix);
Dianne Hackborn625ac272010-09-17 18:29:22 -07001312 data.writeStringArray(args);
Dianne Hackborne17aeb32011-04-07 15:11:57 -07001313 mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
Dianne Hackborn625ac272010-09-17 18:29:22 -07001314 data.recycle();
1315 }
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001316
1317 public void setCoreSettings(Bundle coreSettings) throws RemoteException {
1318 Parcel data = Parcel.obtain();
1319 data.writeInterfaceToken(IApplicationThread.descriptor);
1320 data.writeBundle(coreSettings);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001321 mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1322 }
1323
1324 public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info)
1325 throws RemoteException {
1326 Parcel data = Parcel.obtain();
1327 data.writeInterfaceToken(IApplicationThread.descriptor);
1328 data.writeString(pkg);
1329 info.writeToParcel(data, 0);
1330 mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null,
1331 IBinder.FLAG_ONEWAY);
Svetoslav Ganov54d068e2011-03-02 12:58:40 -08001332 }
Dianne Hackbornce86ba82011-07-13 19:33:41 -07001333
1334 public void scheduleTrimMemory(int level) throws RemoteException {
1335 Parcel data = Parcel.obtain();
1336 data.writeInterfaceToken(IApplicationThread.descriptor);
1337 data.writeInt(level);
1338 mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null,
1339 IBinder.FLAG_ONEWAY);
Maunik Shahdb1a9a32014-06-19 14:18:39 +05301340 data.recycle();
Dianne Hackbornce86ba82011-07-13 19:33:41 -07001341 }
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001342
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -07001343 public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
Colin Crossc4fb5f92016-02-02 16:51:15 -08001344 boolean dumpInfo, boolean dumpDalvik, boolean dumpSummaryOnly,
1345 boolean dumpUnreachable, String[] args) throws RemoteException {
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001346 Parcel data = Parcel.obtain();
1347 Parcel reply = Parcel.obtain();
1348 data.writeInterfaceToken(IApplicationThread.descriptor);
1349 data.writeFileDescriptor(fd);
Dianne Hackborn3bc8f78d2013-09-19 13:34:35 -07001350 mem.writeToParcel(data, 0);
Dianne Hackbornb437e092011-08-05 17:50:29 -07001351 data.writeInt(checkin ? 1 : 0);
Dianne Hackborn64770d12013-05-23 17:51:19 -07001352 data.writeInt(dumpInfo ? 1 : 0);
1353 data.writeInt(dumpDalvik ? 1 : 0);
Richard Uhlerc14b9cf2015-03-13 12:38:38 -07001354 data.writeInt(dumpSummaryOnly ? 1 : 0);
Colin Crossc4fb5f92016-02-02 16:51:15 -08001355 data.writeInt(dumpUnreachable ? 1 : 0);
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001356 data.writeStringArray(args);
1357 mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0);
1358 reply.readException();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001359 data.recycle();
1360 reply.recycle();
Dianne Hackborn0e3328f2011-07-17 13:31:17 -07001361 }
1362
1363 public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException {
1364 Parcel data = Parcel.obtain();
1365 data.writeInterfaceToken(IApplicationThread.descriptor);
1366 data.writeFileDescriptor(fd);
1367 data.writeStringArray(args);
1368 mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1369 data.recycle();
1370 }
Jeff Brown6754ba22011-12-14 20:20:01 -08001371
1372 public void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException {
1373 Parcel data = Parcel.obtain();
1374 data.writeInterfaceToken(IApplicationThread.descriptor);
1375 data.writeFileDescriptor(fd);
1376 data.writeStringArray(args);
1377 mRemote.transact(DUMP_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1378 data.recycle();
1379 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001380
Craig Mautner5eda9b32013-07-02 11:58:16 -07001381 @Override
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001382 public void unstableProviderDied(IBinder provider) throws RemoteException {
1383 Parcel data = Parcel.obtain();
1384 data.writeInterfaceToken(IApplicationThread.descriptor);
1385 data.writeStrongBinder(provider);
1386 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1387 data.recycle();
1388 }
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001389
Craig Mautner5eda9b32013-07-02 11:58:16 -07001390 @Override
Adam Skorydfc7fd72013-08-05 19:23:41 -07001391 public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
Amith Yamasani4f128e42016-05-10 11:44:12 -07001392 int requestType, int sessionId) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001393 Parcel data = Parcel.obtain();
1394 data.writeInterfaceToken(IApplicationThread.descriptor);
1395 data.writeStrongBinder(activityToken);
1396 data.writeStrongBinder(requestToken);
1397 data.writeInt(requestType);
Amith Yamasani4f128e42016-05-10 11:44:12 -07001398 data.writeInt(sessionId);
Adam Skorydfc7fd72013-08-05 19:23:41 -07001399 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null,
1400 IBinder.FLAG_ONEWAY);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001401 data.recycle();
1402 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07001403
1404 @Override
1405 public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
1406 throws RemoteException {
1407 Parcel data = Parcel.obtain();
1408 data.writeInterfaceToken(IApplicationThread.descriptor);
1409 data.writeStrongBinder(token);
1410 data.writeInt(timeout ? 1 : 0);
Craig Mautnereb8abf72014-07-02 15:04:09 -07001411 mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null,
1412 IBinder.FLAG_ONEWAY);
1413 data.recycle();
1414 }
1415
1416 @Override
1417 public void scheduleOnNewActivityOptions(IBinder token, ActivityOptions options)
1418 throws RemoteException {
1419 Parcel data = Parcel.obtain();
1420 data.writeInterfaceToken(IApplicationThread.descriptor);
1421 data.writeStrongBinder(token);
1422 data.writeBundle(options == null ? null : options.toBundle());
1423 mRemote.transact(SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION, data, null,
1424 IBinder.FLAG_ONEWAY);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001425 data.recycle();
1426 }
Dianne Hackborna413dc02013-07-12 12:02:55 -07001427
1428 @Override
1429 public void setProcessState(int state) throws RemoteException {
1430 Parcel data = Parcel.obtain();
1431 data.writeInterfaceToken(IApplicationThread.descriptor);
1432 data.writeInt(state);
1433 mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1434 data.recycle();
1435 }
Jeff Sharkeydd97f422013-10-08 17:01:30 -07001436
1437 @Override
1438 public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException {
1439 Parcel data = Parcel.obtain();
1440 data.writeInterfaceToken(IApplicationThread.descriptor);
1441 provider.writeToParcel(data, 0);
1442 mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1443 data.recycle();
1444 }
Narayan Kamathccb2a0862013-12-19 14:49:36 +00001445
1446 @Override
1447 public void updateTimePrefs(boolean is24Hour) throws RemoteException {
1448 Parcel data = Parcel.obtain();
1449 data.writeInterfaceToken(IApplicationThread.descriptor);
1450 data.writeByte(is24Hour ? (byte) 1 : (byte) 0);
1451 mRemote.transact(UPDATE_TIME_PREFS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1452 data.recycle();
1453 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07001454
1455 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07001456 public void scheduleCancelVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07001457 Parcel data = Parcel.obtain();
1458 data.writeInterfaceToken(IApplicationThread.descriptor);
1459 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07001460 mRemote.transact(CANCEL_VISIBLE_BEHIND_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07001461 data.recycle();
1462 }
1463
1464 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07001465 public void scheduleBackgroundVisibleBehindChanged(IBinder token, boolean enabled)
1466 throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07001467 Parcel data = Parcel.obtain();
1468 data.writeInterfaceToken(IApplicationThread.descriptor);
1469 data.writeStrongBinder(token);
1470 data.writeInt(enabled ? 1 : 0);
Jose Lima4b6c6692014-08-12 17:41:12 -07001471 mRemote.transact(BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION, data, null,
1472 IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07001473 data.recycle();
1474 }
Craig Mautner8746a472014-07-24 15:12:54 -07001475
1476 @Override
1477 public void scheduleEnterAnimationComplete(IBinder token) throws RemoteException {
1478 Parcel data = Parcel.obtain();
1479 data.writeInterfaceToken(IApplicationThread.descriptor);
1480 data.writeStrongBinder(token);
1481 mRemote.transact(ENTER_ANIMATION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1482 data.recycle();
1483 }
Jeff Sharkey605eb792014-11-04 13:34:06 -08001484
1485 @Override
1486 public void notifyCleartextNetwork(byte[] firstPacket) throws RemoteException {
1487 Parcel data = Parcel.obtain();
1488 data.writeInterfaceToken(IApplicationThread.descriptor);
1489 data.writeByteArray(firstPacket);
1490 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1491 data.recycle();
1492 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04001493
1494 @Override
1495 public void startBinderTracking() throws RemoteException {
1496 Parcel data = Parcel.obtain();
1497 data.writeInterfaceToken(IApplicationThread.descriptor);
1498 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, null,
1499 IBinder.FLAG_ONEWAY);
1500 data.recycle();
1501 }
1502
1503 @Override
1504 public void stopBinderTrackingAndDump(FileDescriptor fd) throws RemoteException {
1505 Parcel data = Parcel.obtain();
1506 data.writeInterfaceToken(IApplicationThread.descriptor);
1507 data.writeFileDescriptor(fd);
1508 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, null,
1509 IBinder.FLAG_ONEWAY);
1510 data.recycle();
1511 }
Wale Ogunwale5f986092015-12-04 15:35:38 -08001512
1513 @Override
Andrii Kulian933076d2016-03-29 17:04:42 -07001514 public final void scheduleMultiWindowModeChanged(
1515 IBinder token, boolean isInMultiWindowMode) throws RemoteException {
Wale Ogunwale5f986092015-12-04 15:35:38 -08001516 Parcel data = Parcel.obtain();
1517 data.writeInterfaceToken(IApplicationThread.descriptor);
1518 data.writeStrongBinder(token);
Andrii Kulian933076d2016-03-29 17:04:42 -07001519 data.writeInt(isInMultiWindowMode ? 1 : 0);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001520 mRemote.transact(SCHEDULE_MULTI_WINDOW_CHANGED_TRANSACTION, data, null,
Wale Ogunwale5f986092015-12-04 15:35:38 -08001521 IBinder.FLAG_ONEWAY);
1522 data.recycle();
1523 }
1524
1525 @Override
Andrii Kulian933076d2016-03-29 17:04:42 -07001526 public final void schedulePictureInPictureModeChanged(IBinder token, boolean isInPipMode)
Wale Ogunwale5f986092015-12-04 15:35:38 -08001527 throws RemoteException {
1528 Parcel data = Parcel.obtain();
1529 data.writeInterfaceToken(IApplicationThread.descriptor);
1530 data.writeStrongBinder(token);
Andrii Kulian933076d2016-03-29 17:04:42 -07001531 data.writeInt(isInPipMode ? 1 : 0);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08001532 mRemote.transact(SCHEDULE_PICTURE_IN_PICTURE_CHANGED_TRANSACTION, data, null,
Wale Ogunwale5f986092015-12-04 15:35:38 -08001533 IBinder.FLAG_ONEWAY);
1534 data.recycle();
1535 }
Chad Brubakerc72875b2016-04-27 16:35:11 -07001536
1537 @Override
1538 public void handleTrustStorageUpdate() throws RemoteException {
1539 Parcel data = Parcel.obtain();
1540 data.writeInterfaceToken(IApplicationThread.descriptor);
1541 mRemote.transact(HANDLE_TRUST_STORAGE_UPDATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1542 data.recycle();
1543 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001544}