ApplicationThreadNative.java revision 91097de49b0f683b00e26a75dbc0ac6082344137
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
19import android.content.ComponentName;
20import android.content.Intent;
21import android.content.IIntentReceiver;
22import android.content.pm.ActivityInfo;
23import android.content.pm.ApplicationInfo;
24import android.content.pm.ProviderInfo;
25import android.content.pm.ServiceInfo;
26import android.content.res.CompatibilityInfo;
27import android.content.res.Configuration;
28import android.os.Binder;
29import android.os.Bundle;
30import android.os.Debug;
31import android.os.Parcelable;
32import android.os.RemoteException;
33import android.os.IBinder;
34import android.os.Parcel;
35import android.os.ParcelFileDescriptor;
36import com.android.internal.app.IVoiceInteractor;
37
38import java.io.FileDescriptor;
39import java.io.IOException;
40import java.util.HashMap;
41import java.util.List;
42import java.util.Map;
43
44/** {@hide} */
45public abstract class ApplicationThreadNative extends Binder
46        implements IApplicationThread {
47    /**
48     * Cast a Binder object into an application thread interface, generating
49     * a proxy if needed.
50     */
51    static public IApplicationThread asInterface(IBinder obj) {
52        if (obj == null) {
53            return null;
54        }
55        IApplicationThread in =
56            (IApplicationThread)obj.queryLocalInterface(descriptor);
57        if (in != null) {
58            return in;
59        }
60
61        return new ApplicationThreadProxy(obj);
62    }
63
64    public ApplicationThreadNative() {
65        attachInterface(this, descriptor);
66    }
67
68    @Override
69    public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
70            throws RemoteException {
71        switch (code) {
72        case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION:
73        {
74            data.enforceInterface(IApplicationThread.descriptor);
75            IBinder b = data.readStrongBinder();
76            boolean finished = data.readInt() != 0;
77            boolean userLeaving = data.readInt() != 0;
78            int configChanges = data.readInt();
79            schedulePauseActivity(b, finished, userLeaving, configChanges);
80            return true;
81        }
82
83        case SCHEDULE_STOP_ACTIVITY_TRANSACTION:
84        {
85            data.enforceInterface(IApplicationThread.descriptor);
86            IBinder b = data.readStrongBinder();
87            boolean show = data.readInt() != 0;
88            int configChanges = data.readInt();
89            scheduleStopActivity(b, show, configChanges);
90            return true;
91        }
92
93        case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION:
94        {
95            data.enforceInterface(IApplicationThread.descriptor);
96            IBinder b = data.readStrongBinder();
97            boolean show = data.readInt() != 0;
98            scheduleWindowVisibility(b, show);
99            return true;
100        }
101
102        case SCHEDULE_SLEEPING_TRANSACTION:
103        {
104            data.enforceInterface(IApplicationThread.descriptor);
105            IBinder b = data.readStrongBinder();
106            boolean sleeping = data.readInt() != 0;
107            scheduleSleeping(b, sleeping);
108            return true;
109        }
110
111        case SCHEDULE_RESUME_ACTIVITY_TRANSACTION:
112        {
113            data.enforceInterface(IApplicationThread.descriptor);
114            IBinder b = data.readStrongBinder();
115            int procState = data.readInt();
116            boolean isForward = data.readInt() != 0;
117            Bundle resumeArgs = data.readBundle();
118            scheduleResumeActivity(b, procState, isForward, resumeArgs);
119            return true;
120        }
121
122        case SCHEDULE_SEND_RESULT_TRANSACTION:
123        {
124            data.enforceInterface(IApplicationThread.descriptor);
125            IBinder b = data.readStrongBinder();
126            List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
127            scheduleSendResult(b, ri);
128            return true;
129        }
130
131        case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION:
132        {
133            data.enforceInterface(IApplicationThread.descriptor);
134            Intent intent = Intent.CREATOR.createFromParcel(data);
135            IBinder b = data.readStrongBinder();
136            int ident = data.readInt();
137            ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
138            Configuration curConfig = Configuration.CREATOR.createFromParcel(data);
139            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
140            IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
141                    data.readStrongBinder());
142            int procState = data.readInt();
143            Bundle state = data.readBundle();
144            List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
145            List<Intent> pi = data.createTypedArrayList(Intent.CREATOR);
146            boolean notResumed = data.readInt() != 0;
147            boolean isForward = data.readInt() != 0;
148            String profileName = data.readString();
149            ParcelFileDescriptor profileFd = data.readInt() != 0
150                    ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
151            boolean autoStopProfiler = data.readInt() != 0;
152            Bundle resumeArgs = data.readBundle();
153            scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo,
154                    voiceInteractor, procState, state,
155                    ri, pi, notResumed, isForward, profileName, profileFd, autoStopProfiler,
156                    resumeArgs);
157            return true;
158        }
159
160        case SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION:
161        {
162            data.enforceInterface(IApplicationThread.descriptor);
163            IBinder b = data.readStrongBinder();
164            List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
165            List<Intent> pi = data.createTypedArrayList(Intent.CREATOR);
166            int configChanges = data.readInt();
167            boolean notResumed = data.readInt() != 0;
168            Configuration config = null;
169            if (data.readInt() != 0) {
170                config = Configuration.CREATOR.createFromParcel(data);
171            }
172            scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed, config);
173            return true;
174        }
175
176        case SCHEDULE_NEW_INTENT_TRANSACTION:
177        {
178            data.enforceInterface(IApplicationThread.descriptor);
179            List<Intent> pi = data.createTypedArrayList(Intent.CREATOR);
180            IBinder b = data.readStrongBinder();
181            scheduleNewIntent(pi, b);
182            return true;
183        }
184
185        case SCHEDULE_FINISH_ACTIVITY_TRANSACTION:
186        {
187            data.enforceInterface(IApplicationThread.descriptor);
188            IBinder b = data.readStrongBinder();
189            boolean finishing = data.readInt() != 0;
190            int configChanges = data.readInt();
191            scheduleDestroyActivity(b, finishing, configChanges);
192            return true;
193        }
194
195        case SCHEDULE_RECEIVER_TRANSACTION:
196        {
197            data.enforceInterface(IApplicationThread.descriptor);
198            Intent intent = Intent.CREATOR.createFromParcel(data);
199            ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
200            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
201            int resultCode = data.readInt();
202            String resultData = data.readString();
203            Bundle resultExtras = data.readBundle();
204            boolean sync = data.readInt() != 0;
205            int sendingUser = data.readInt();
206            int processState = data.readInt();
207            scheduleReceiver(intent, info, compatInfo, resultCode, resultData,
208                    resultExtras, sync, sendingUser, processState);
209            return true;
210        }
211
212        case SCHEDULE_CREATE_SERVICE_TRANSACTION: {
213            data.enforceInterface(IApplicationThread.descriptor);
214            IBinder token = data.readStrongBinder();
215            ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data);
216            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
217            int processState = data.readInt();
218            scheduleCreateService(token, info, compatInfo, processState);
219            return true;
220        }
221
222        case SCHEDULE_BIND_SERVICE_TRANSACTION: {
223            data.enforceInterface(IApplicationThread.descriptor);
224            IBinder token = data.readStrongBinder();
225            Intent intent = Intent.CREATOR.createFromParcel(data);
226            boolean rebind = data.readInt() != 0;
227            int processState = data.readInt();
228            scheduleBindService(token, intent, rebind, processState);
229            return true;
230        }
231
232        case SCHEDULE_UNBIND_SERVICE_TRANSACTION: {
233            data.enforceInterface(IApplicationThread.descriptor);
234            IBinder token = data.readStrongBinder();
235            Intent intent = Intent.CREATOR.createFromParcel(data);
236            scheduleUnbindService(token, intent);
237            return true;
238        }
239
240        case SCHEDULE_SERVICE_ARGS_TRANSACTION:
241        {
242            data.enforceInterface(IApplicationThread.descriptor);
243            IBinder token = data.readStrongBinder();
244            boolean taskRemoved = data.readInt() != 0;
245            int startId = data.readInt();
246            int fl = data.readInt();
247            Intent args;
248            if (data.readInt() != 0) {
249                args = Intent.CREATOR.createFromParcel(data);
250            } else {
251                args = null;
252            }
253            scheduleServiceArgs(token, taskRemoved, startId, fl, args);
254            return true;
255        }
256
257        case SCHEDULE_STOP_SERVICE_TRANSACTION:
258        {
259            data.enforceInterface(IApplicationThread.descriptor);
260            IBinder token = data.readStrongBinder();
261            scheduleStopService(token);
262            return true;
263        }
264
265        case BIND_APPLICATION_TRANSACTION:
266        {
267            data.enforceInterface(IApplicationThread.descriptor);
268            String packageName = data.readString();
269            ApplicationInfo info =
270                ApplicationInfo.CREATOR.createFromParcel(data);
271            List<ProviderInfo> providers =
272                data.createTypedArrayList(ProviderInfo.CREATOR);
273            ComponentName testName = (data.readInt() != 0)
274                ? new ComponentName(data) : null;
275            String profileName = data.readString();
276            ParcelFileDescriptor profileFd = data.readInt() != 0
277                    ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
278            boolean autoStopProfiler = data.readInt() != 0;
279            Bundle testArgs = data.readBundle();
280            IBinder binder = data.readStrongBinder();
281            IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder);
282            binder = data.readStrongBinder();
283            IUiAutomationConnection uiAutomationConnection =
284                    IUiAutomationConnection.Stub.asInterface(binder);
285            int testMode = data.readInt();
286            boolean openGlTrace = data.readInt() != 0;
287            boolean restrictedBackupMode = (data.readInt() != 0);
288            boolean persistent = (data.readInt() != 0);
289            Configuration config = Configuration.CREATOR.createFromParcel(data);
290            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
291            HashMap<String, IBinder> services = data.readHashMap(null);
292            Bundle coreSettings = data.readBundle();
293            bindApplication(packageName, info,
294                            providers, testName, profileName, profileFd, autoStopProfiler,
295                            testArgs, testWatcher, uiAutomationConnection, testMode,
296                            openGlTrace, restrictedBackupMode, persistent, config, compatInfo,
297                            services, coreSettings);
298            return true;
299        }
300
301        case SCHEDULE_EXIT_TRANSACTION:
302        {
303            data.enforceInterface(IApplicationThread.descriptor);
304            scheduleExit();
305            return true;
306        }
307
308        case SCHEDULE_SUICIDE_TRANSACTION:
309        {
310            data.enforceInterface(IApplicationThread.descriptor);
311            scheduleSuicide();
312            return true;
313        }
314
315        case REQUEST_THUMBNAIL_TRANSACTION:
316        {
317            data.enforceInterface(IApplicationThread.descriptor);
318            IBinder b = data.readStrongBinder();
319            requestThumbnail(b);
320            return true;
321        }
322
323        case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION:
324        {
325            data.enforceInterface(IApplicationThread.descriptor);
326            Configuration config = Configuration.CREATOR.createFromParcel(data);
327            scheduleConfigurationChanged(config);
328            return true;
329        }
330
331        case UPDATE_TIME_ZONE_TRANSACTION: {
332            data.enforceInterface(IApplicationThread.descriptor);
333            updateTimeZone();
334            return true;
335        }
336
337        case CLEAR_DNS_CACHE_TRANSACTION: {
338            data.enforceInterface(IApplicationThread.descriptor);
339            clearDnsCache();
340            return true;
341        }
342
343        case SET_HTTP_PROXY_TRANSACTION: {
344            data.enforceInterface(IApplicationThread.descriptor);
345            final String proxy = data.readString();
346            final String port = data.readString();
347            final String exclList = data.readString();
348            final String pacFileUrl = data.readString();
349            setHttpProxy(proxy, port, exclList, pacFileUrl);
350            return true;
351        }
352
353        case PROCESS_IN_BACKGROUND_TRANSACTION: {
354            data.enforceInterface(IApplicationThread.descriptor);
355            processInBackground();
356            return true;
357        }
358
359        case DUMP_SERVICE_TRANSACTION: {
360            data.enforceInterface(IApplicationThread.descriptor);
361            ParcelFileDescriptor fd = data.readFileDescriptor();
362            final IBinder service = data.readStrongBinder();
363            final String[] args = data.readStringArray();
364            if (fd != null) {
365                dumpService(fd.getFileDescriptor(), service, args);
366                try {
367                    fd.close();
368                } catch (IOException e) {
369                }
370            }
371            return true;
372        }
373
374        case DUMP_PROVIDER_TRANSACTION: {
375            data.enforceInterface(IApplicationThread.descriptor);
376            ParcelFileDescriptor fd = data.readFileDescriptor();
377            final IBinder service = data.readStrongBinder();
378            final String[] args = data.readStringArray();
379            if (fd != null) {
380                dumpProvider(fd.getFileDescriptor(), service, args);
381                try {
382                    fd.close();
383                } catch (IOException e) {
384                }
385            }
386            return true;
387        }
388
389        case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: {
390            data.enforceInterface(IApplicationThread.descriptor);
391            IIntentReceiver receiver = IIntentReceiver.Stub.asInterface(
392                    data.readStrongBinder());
393            Intent intent = Intent.CREATOR.createFromParcel(data);
394            int resultCode = data.readInt();
395            String dataStr = data.readString();
396            Bundle extras = data.readBundle();
397            boolean ordered = data.readInt() != 0;
398            boolean sticky = data.readInt() != 0;
399            int sendingUser = data.readInt();
400            int processState = data.readInt();
401            scheduleRegisteredReceiver(receiver, intent,
402                    resultCode, dataStr, extras, ordered, sticky, sendingUser, processState);
403            return true;
404        }
405
406        case SCHEDULE_LOW_MEMORY_TRANSACTION:
407        {
408            data.enforceInterface(IApplicationThread.descriptor);
409            scheduleLowMemory();
410            return true;
411        }
412
413        case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION:
414        {
415            data.enforceInterface(IApplicationThread.descriptor);
416            IBinder b = data.readStrongBinder();
417            scheduleActivityConfigurationChanged(b);
418            return true;
419        }
420
421        case PROFILER_CONTROL_TRANSACTION:
422        {
423            data.enforceInterface(IApplicationThread.descriptor);
424            boolean start = data.readInt() != 0;
425            int profileType = data.readInt();
426            String path = data.readString();
427            ParcelFileDescriptor fd = data.readInt() != 0
428                    ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
429            profilerControl(start, path, fd, profileType);
430            return true;
431        }
432
433        case SET_SCHEDULING_GROUP_TRANSACTION:
434        {
435            data.enforceInterface(IApplicationThread.descriptor);
436            int group = data.readInt();
437            setSchedulingGroup(group);
438            return true;
439        }
440
441        case SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION:
442        {
443            data.enforceInterface(IApplicationThread.descriptor);
444            ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
445            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
446            int backupMode = data.readInt();
447            scheduleCreateBackupAgent(appInfo, compatInfo, backupMode);
448            return true;
449        }
450
451        case SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION:
452        {
453            data.enforceInterface(IApplicationThread.descriptor);
454            ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
455            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
456            scheduleDestroyBackupAgent(appInfo, compatInfo);
457            return true;
458        }
459
460        case DISPATCH_PACKAGE_BROADCAST_TRANSACTION:
461        {
462            data.enforceInterface(IApplicationThread.descriptor);
463            int cmd = data.readInt();
464            String[] packages = data.readStringArray();
465            dispatchPackageBroadcast(cmd, packages);
466            return true;
467        }
468
469        case SCHEDULE_CRASH_TRANSACTION:
470        {
471            data.enforceInterface(IApplicationThread.descriptor);
472            String msg = data.readString();
473            scheduleCrash(msg);
474            return true;
475        }
476
477        case DUMP_HEAP_TRANSACTION:
478        {
479            data.enforceInterface(IApplicationThread.descriptor);
480            boolean managed = data.readInt() != 0;
481            String path = data.readString();
482            ParcelFileDescriptor fd = data.readInt() != 0
483                    ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
484            dumpHeap(managed, path, fd);
485            return true;
486        }
487
488        case DUMP_ACTIVITY_TRANSACTION: {
489            data.enforceInterface(IApplicationThread.descriptor);
490            ParcelFileDescriptor fd = data.readFileDescriptor();
491            final IBinder activity = data.readStrongBinder();
492            final String prefix = data.readString();
493            final String[] args = data.readStringArray();
494            if (fd != null) {
495                dumpActivity(fd.getFileDescriptor(), activity, prefix, args);
496                try {
497                    fd.close();
498                } catch (IOException e) {
499                }
500            }
501            return true;
502        }
503
504        case SET_CORE_SETTINGS_TRANSACTION: {
505            data.enforceInterface(IApplicationThread.descriptor);
506            Bundle settings = data.readBundle();
507            setCoreSettings(settings);
508            return true;
509        }
510
511        case UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION: {
512            data.enforceInterface(IApplicationThread.descriptor);
513            String pkg = data.readString();
514            CompatibilityInfo compat = CompatibilityInfo.CREATOR.createFromParcel(data);
515            updatePackageCompatibilityInfo(pkg, compat);
516            return true;
517        }
518
519        case SCHEDULE_TRIM_MEMORY_TRANSACTION: {
520            data.enforceInterface(IApplicationThread.descriptor);
521            int level = data.readInt();
522            scheduleTrimMemory(level);
523            return true;
524        }
525
526        case DUMP_MEM_INFO_TRANSACTION:
527        {
528            data.enforceInterface(IApplicationThread.descriptor);
529            ParcelFileDescriptor fd = data.readFileDescriptor();
530            Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data);
531            boolean checkin = data.readInt() != 0;
532            boolean dumpInfo = data.readInt() != 0;
533            boolean dumpDalvik = data.readInt() != 0;
534            String[] args = data.readStringArray();
535            if (fd != null) {
536                try {
537                    dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args);
538                } finally {
539                    try {
540                        fd.close();
541                    } catch (IOException e) {
542                        // swallowed, not propagated back to the caller
543                    }
544                }
545            }
546            reply.writeNoException();
547            return true;
548        }
549
550        case DUMP_GFX_INFO_TRANSACTION:
551        {
552            data.enforceInterface(IApplicationThread.descriptor);
553            ParcelFileDescriptor fd = data.readFileDescriptor();
554            String[] args = data.readStringArray();
555            if (fd != null) {
556                try {
557                    dumpGfxInfo(fd.getFileDescriptor(), args);
558                } finally {
559                    try {
560                        fd.close();
561                    } catch (IOException e) {
562                        // swallowed, not propagated back to the caller
563                    }
564                }
565            }
566            reply.writeNoException();
567            return true;
568        }
569
570        case DUMP_DB_INFO_TRANSACTION:
571        {
572            data.enforceInterface(IApplicationThread.descriptor);
573            ParcelFileDescriptor fd = data.readFileDescriptor();
574            String[] args = data.readStringArray();
575            if (fd != null) {
576                try {
577                    dumpDbInfo(fd.getFileDescriptor(), args);
578                } finally {
579                    try {
580                        fd.close();
581                    } catch (IOException e) {
582                        // swallowed, not propagated back to the caller
583                    }
584                }
585            }
586            reply.writeNoException();
587            return true;
588        }
589
590        case UNSTABLE_PROVIDER_DIED_TRANSACTION:
591        {
592            data.enforceInterface(IApplicationThread.descriptor);
593            IBinder provider = data.readStrongBinder();
594            unstableProviderDied(provider);
595            reply.writeNoException();
596            return true;
597        }
598
599        case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION:
600        {
601            data.enforceInterface(IApplicationThread.descriptor);
602            IBinder activityToken = data.readStrongBinder();
603            IBinder requestToken = data.readStrongBinder();
604            int requestType = data.readInt();
605            requestAssistContextExtras(activityToken, requestToken, requestType);
606            reply.writeNoException();
607            return true;
608        }
609
610        case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION:
611        {
612            data.enforceInterface(IApplicationThread.descriptor);
613            IBinder token = data.readStrongBinder();
614            boolean timeout = data.readInt() == 1;
615            scheduleTranslucentConversionComplete(token, timeout);
616            reply.writeNoException();
617            return true;
618        }
619
620        case SET_PROCESS_STATE_TRANSACTION:
621        {
622            data.enforceInterface(IApplicationThread.descriptor);
623            int state = data.readInt();
624            setProcessState(state);
625            reply.writeNoException();
626            return true;
627        }
628
629        case SCHEDULE_INSTALL_PROVIDER_TRANSACTION:
630        {
631            data.enforceInterface(IApplicationThread.descriptor);
632            ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data);
633            scheduleInstallProvider(provider);
634            reply.writeNoException();
635            return true;
636        }
637
638        case UPDATE_TIME_PREFS_TRANSACTION:
639        {
640            data.enforceInterface(IApplicationThread.descriptor);
641            byte is24Hour = data.readByte();
642            updateTimePrefs(is24Hour == (byte) 1);
643            reply.writeNoException();
644            return true;
645        }
646        }
647
648        return super.onTransact(code, data, reply, flags);
649    }
650
651    public IBinder asBinder()
652    {
653        return this;
654    }
655}
656
657class ApplicationThreadProxy implements IApplicationThread {
658    private final IBinder mRemote;
659
660    public ApplicationThreadProxy(IBinder remote) {
661        mRemote = remote;
662    }
663
664    public final IBinder asBinder() {
665        return mRemote;
666    }
667
668    public final void schedulePauseActivity(IBinder token, boolean finished,
669            boolean userLeaving, int configChanges) throws RemoteException {
670        Parcel data = Parcel.obtain();
671        data.writeInterfaceToken(IApplicationThread.descriptor);
672        data.writeStrongBinder(token);
673        data.writeInt(finished ? 1 : 0);
674        data.writeInt(userLeaving ? 1 :0);
675        data.writeInt(configChanges);
676        mRemote.transact(SCHEDULE_PAUSE_ACTIVITY_TRANSACTION, data, null,
677                IBinder.FLAG_ONEWAY);
678        data.recycle();
679    }
680
681    public final void scheduleStopActivity(IBinder token, boolean showWindow,
682            int configChanges) throws RemoteException {
683        Parcel data = Parcel.obtain();
684        data.writeInterfaceToken(IApplicationThread.descriptor);
685        data.writeStrongBinder(token);
686        data.writeInt(showWindow ? 1 : 0);
687        data.writeInt(configChanges);
688        mRemote.transact(SCHEDULE_STOP_ACTIVITY_TRANSACTION, data, null,
689                IBinder.FLAG_ONEWAY);
690        data.recycle();
691    }
692
693    public final void scheduleWindowVisibility(IBinder token,
694            boolean showWindow) throws RemoteException {
695        Parcel data = Parcel.obtain();
696        data.writeInterfaceToken(IApplicationThread.descriptor);
697        data.writeStrongBinder(token);
698        data.writeInt(showWindow ? 1 : 0);
699        mRemote.transact(SCHEDULE_WINDOW_VISIBILITY_TRANSACTION, data, null,
700                IBinder.FLAG_ONEWAY);
701        data.recycle();
702    }
703
704    public final void scheduleSleeping(IBinder token,
705            boolean sleeping) throws RemoteException {
706        Parcel data = Parcel.obtain();
707        data.writeInterfaceToken(IApplicationThread.descriptor);
708        data.writeStrongBinder(token);
709        data.writeInt(sleeping ? 1 : 0);
710        mRemote.transact(SCHEDULE_SLEEPING_TRANSACTION, data, null,
711                IBinder.FLAG_ONEWAY);
712        data.recycle();
713    }
714
715    public final void scheduleResumeActivity(IBinder token, int procState, boolean isForward,
716            Bundle resumeArgs)
717            throws RemoteException {
718        Parcel data = Parcel.obtain();
719        data.writeInterfaceToken(IApplicationThread.descriptor);
720        data.writeStrongBinder(token);
721        data.writeInt(procState);
722        data.writeInt(isForward ? 1 : 0);
723        data.writeBundle(resumeArgs);
724        mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null,
725                IBinder.FLAG_ONEWAY);
726        data.recycle();
727    }
728
729    public final void scheduleSendResult(IBinder token, List<ResultInfo> results)
730            throws RemoteException {
731        Parcel data = Parcel.obtain();
732        data.writeInterfaceToken(IApplicationThread.descriptor);
733        data.writeStrongBinder(token);
734        data.writeTypedList(results);
735        mRemote.transact(SCHEDULE_SEND_RESULT_TRANSACTION, data, null,
736                IBinder.FLAG_ONEWAY);
737        data.recycle();
738    }
739
740    public final void scheduleLaunchActivity(Intent intent, IBinder token, int ident,
741            ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo,
742            IVoiceInteractor voiceInteractor,
743            int procState, Bundle state, List<ResultInfo> pendingResults,
744            List<Intent> pendingNewIntents, boolean notResumed, boolean isForward,
745            String profileName, ParcelFileDescriptor profileFd, boolean autoStopProfiler,
746            Bundle resumeArgs)
747            throws RemoteException {
748        Parcel data = Parcel.obtain();
749        data.writeInterfaceToken(IApplicationThread.descriptor);
750        intent.writeToParcel(data, 0);
751        data.writeStrongBinder(token);
752        data.writeInt(ident);
753        info.writeToParcel(data, 0);
754        curConfig.writeToParcel(data, 0);
755        compatInfo.writeToParcel(data, 0);
756        data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
757        data.writeInt(procState);
758        data.writeBundle(state);
759        data.writeTypedList(pendingResults);
760        data.writeTypedList(pendingNewIntents);
761        data.writeInt(notResumed ? 1 : 0);
762        data.writeInt(isForward ? 1 : 0);
763        data.writeString(profileName);
764        if (profileFd != null) {
765            data.writeInt(1);
766            profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
767        } else {
768            data.writeInt(0);
769        }
770        data.writeInt(autoStopProfiler ? 1 : 0);
771        data.writeBundle(resumeArgs);
772        mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null,
773                IBinder.FLAG_ONEWAY);
774        data.recycle();
775    }
776
777    public final void scheduleRelaunchActivity(IBinder token,
778            List<ResultInfo> pendingResults, List<Intent> pendingNewIntents,
779            int configChanges, boolean notResumed, Configuration config)
780            throws RemoteException {
781        Parcel data = Parcel.obtain();
782        data.writeInterfaceToken(IApplicationThread.descriptor);
783        data.writeStrongBinder(token);
784        data.writeTypedList(pendingResults);
785        data.writeTypedList(pendingNewIntents);
786        data.writeInt(configChanges);
787        data.writeInt(notResumed ? 1 : 0);
788        if (config != null) {
789            data.writeInt(1);
790            config.writeToParcel(data, 0);
791        } else {
792            data.writeInt(0);
793        }
794        mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null,
795                IBinder.FLAG_ONEWAY);
796        data.recycle();
797    }
798
799    public void scheduleNewIntent(List<Intent> intents, IBinder token)
800            throws RemoteException {
801        Parcel data = Parcel.obtain();
802        data.writeInterfaceToken(IApplicationThread.descriptor);
803        data.writeTypedList(intents);
804        data.writeStrongBinder(token);
805        mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null,
806                IBinder.FLAG_ONEWAY);
807        data.recycle();
808    }
809
810    public final void scheduleDestroyActivity(IBinder token, boolean finishing,
811            int configChanges) throws RemoteException {
812        Parcel data = Parcel.obtain();
813        data.writeInterfaceToken(IApplicationThread.descriptor);
814        data.writeStrongBinder(token);
815        data.writeInt(finishing ? 1 : 0);
816        data.writeInt(configChanges);
817        mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null,
818                IBinder.FLAG_ONEWAY);
819        data.recycle();
820    }
821
822    public final void scheduleReceiver(Intent intent, ActivityInfo info,
823            CompatibilityInfo compatInfo, int resultCode, String resultData,
824            Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException {
825        Parcel data = Parcel.obtain();
826        data.writeInterfaceToken(IApplicationThread.descriptor);
827        intent.writeToParcel(data, 0);
828        info.writeToParcel(data, 0);
829        compatInfo.writeToParcel(data, 0);
830        data.writeInt(resultCode);
831        data.writeString(resultData);
832        data.writeBundle(map);
833        data.writeInt(sync ? 1 : 0);
834        data.writeInt(sendingUser);
835        data.writeInt(processState);
836        mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null,
837                IBinder.FLAG_ONEWAY);
838        data.recycle();
839    }
840
841    public final void scheduleCreateBackupAgent(ApplicationInfo app,
842            CompatibilityInfo compatInfo, int backupMode) throws RemoteException {
843        Parcel data = Parcel.obtain();
844        data.writeInterfaceToken(IApplicationThread.descriptor);
845        app.writeToParcel(data, 0);
846        compatInfo.writeToParcel(data, 0);
847        data.writeInt(backupMode);
848        mRemote.transact(SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION, data, null,
849                IBinder.FLAG_ONEWAY);
850        data.recycle();
851    }
852
853    public final void scheduleDestroyBackupAgent(ApplicationInfo app,
854            CompatibilityInfo compatInfo) throws RemoteException {
855        Parcel data = Parcel.obtain();
856        data.writeInterfaceToken(IApplicationThread.descriptor);
857        app.writeToParcel(data, 0);
858        compatInfo.writeToParcel(data, 0);
859        mRemote.transact(SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION, data, null,
860                IBinder.FLAG_ONEWAY);
861        data.recycle();
862    }
863
864    public final void scheduleCreateService(IBinder token, ServiceInfo info,
865            CompatibilityInfo compatInfo, int processState) throws RemoteException {
866        Parcel data = Parcel.obtain();
867        data.writeInterfaceToken(IApplicationThread.descriptor);
868        data.writeStrongBinder(token);
869        info.writeToParcel(data, 0);
870        compatInfo.writeToParcel(data, 0);
871        data.writeInt(processState);
872        mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
873                IBinder.FLAG_ONEWAY);
874        data.recycle();
875    }
876
877    public final void scheduleBindService(IBinder token, Intent intent, boolean rebind,
878            int processState) throws RemoteException {
879        Parcel data = Parcel.obtain();
880        data.writeInterfaceToken(IApplicationThread.descriptor);
881        data.writeStrongBinder(token);
882        intent.writeToParcel(data, 0);
883        data.writeInt(rebind ? 1 : 0);
884        data.writeInt(processState);
885        mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null,
886                IBinder.FLAG_ONEWAY);
887        data.recycle();
888    }
889
890    public final void scheduleUnbindService(IBinder token, Intent intent)
891            throws RemoteException {
892        Parcel data = Parcel.obtain();
893        data.writeInterfaceToken(IApplicationThread.descriptor);
894        data.writeStrongBinder(token);
895        intent.writeToParcel(data, 0);
896        mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null,
897                IBinder.FLAG_ONEWAY);
898        data.recycle();
899    }
900
901    public final void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
902            int flags, Intent args) throws RemoteException {
903        Parcel data = Parcel.obtain();
904        data.writeInterfaceToken(IApplicationThread.descriptor);
905        data.writeStrongBinder(token);
906        data.writeInt(taskRemoved ? 1 : 0);
907        data.writeInt(startId);
908        data.writeInt(flags);
909        if (args != null) {
910            data.writeInt(1);
911            args.writeToParcel(data, 0);
912        } else {
913            data.writeInt(0);
914        }
915        mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null,
916                IBinder.FLAG_ONEWAY);
917        data.recycle();
918    }
919
920    public final void scheduleStopService(IBinder token)
921            throws RemoteException {
922        Parcel data = Parcel.obtain();
923        data.writeInterfaceToken(IApplicationThread.descriptor);
924        data.writeStrongBinder(token);
925        mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null,
926                IBinder.FLAG_ONEWAY);
927        data.recycle();
928    }
929
930    public final void bindApplication(String packageName, ApplicationInfo info,
931            List<ProviderInfo> providers, ComponentName testName, String profileName,
932            ParcelFileDescriptor profileFd, boolean autoStopProfiler, Bundle testArgs,
933            IInstrumentationWatcher testWatcher,
934            IUiAutomationConnection uiAutomationConnection, int debugMode,
935            boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
936            Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
937            Bundle coreSettings) throws RemoteException {
938        Parcel data = Parcel.obtain();
939        data.writeInterfaceToken(IApplicationThread.descriptor);
940        data.writeString(packageName);
941        info.writeToParcel(data, 0);
942        data.writeTypedList(providers);
943        if (testName == null) {
944            data.writeInt(0);
945        } else {
946            data.writeInt(1);
947            testName.writeToParcel(data, 0);
948        }
949        data.writeString(profileName);
950        if (profileFd != null) {
951            data.writeInt(1);
952            profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
953        } else {
954            data.writeInt(0);
955        }
956        data.writeInt(autoStopProfiler ? 1 : 0);
957        data.writeBundle(testArgs);
958        data.writeStrongInterface(testWatcher);
959        data.writeStrongInterface(uiAutomationConnection);
960        data.writeInt(debugMode);
961        data.writeInt(openGlTrace ? 1 : 0);
962        data.writeInt(restrictedBackupMode ? 1 : 0);
963        data.writeInt(persistent ? 1 : 0);
964        config.writeToParcel(data, 0);
965        compatInfo.writeToParcel(data, 0);
966        data.writeMap(services);
967        data.writeBundle(coreSettings);
968        mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null,
969                IBinder.FLAG_ONEWAY);
970        data.recycle();
971    }
972
973    public final void scheduleExit() throws RemoteException {
974        Parcel data = Parcel.obtain();
975        data.writeInterfaceToken(IApplicationThread.descriptor);
976        mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null,
977                IBinder.FLAG_ONEWAY);
978        data.recycle();
979    }
980
981    public final void scheduleSuicide() throws RemoteException {
982        Parcel data = Parcel.obtain();
983        data.writeInterfaceToken(IApplicationThread.descriptor);
984        mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null,
985                IBinder.FLAG_ONEWAY);
986        data.recycle();
987    }
988
989    public final void requestThumbnail(IBinder token)
990            throws RemoteException {
991        Parcel data = Parcel.obtain();
992        data.writeInterfaceToken(IApplicationThread.descriptor);
993        data.writeStrongBinder(token);
994        mRemote.transact(REQUEST_THUMBNAIL_TRANSACTION, data, null,
995                IBinder.FLAG_ONEWAY);
996        data.recycle();
997    }
998
999    public final void scheduleConfigurationChanged(Configuration config)
1000            throws RemoteException {
1001        Parcel data = Parcel.obtain();
1002        data.writeInterfaceToken(IApplicationThread.descriptor);
1003        config.writeToParcel(data, 0);
1004        mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1005                IBinder.FLAG_ONEWAY);
1006        data.recycle();
1007    }
1008
1009    public void updateTimeZone() throws RemoteException {
1010        Parcel data = Parcel.obtain();
1011        data.writeInterfaceToken(IApplicationThread.descriptor);
1012        mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null,
1013                IBinder.FLAG_ONEWAY);
1014        data.recycle();
1015    }
1016
1017    public void clearDnsCache() throws RemoteException {
1018        Parcel data = Parcel.obtain();
1019        data.writeInterfaceToken(IApplicationThread.descriptor);
1020        mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null,
1021                IBinder.FLAG_ONEWAY);
1022        data.recycle();
1023    }
1024
1025    public void setHttpProxy(String proxy, String port, String exclList,
1026            String pacFileUrl) throws RemoteException {
1027        Parcel data = Parcel.obtain();
1028        data.writeInterfaceToken(IApplicationThread.descriptor);
1029        data.writeString(proxy);
1030        data.writeString(port);
1031        data.writeString(exclList);
1032        data.writeString(pacFileUrl);
1033        mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1034        data.recycle();
1035    }
1036
1037    public void processInBackground() throws RemoteException {
1038        Parcel data = Parcel.obtain();
1039        data.writeInterfaceToken(IApplicationThread.descriptor);
1040        mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null,
1041                IBinder.FLAG_ONEWAY);
1042        data.recycle();
1043    }
1044
1045    public void dumpService(FileDescriptor fd, IBinder token, String[] args)
1046            throws RemoteException {
1047        Parcel data = Parcel.obtain();
1048        data.writeInterfaceToken(IApplicationThread.descriptor);
1049        data.writeFileDescriptor(fd);
1050        data.writeStrongBinder(token);
1051        data.writeStringArray(args);
1052        mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1053        data.recycle();
1054    }
1055
1056    public void dumpProvider(FileDescriptor fd, IBinder token, String[] args)
1057            throws RemoteException {
1058        Parcel data = Parcel.obtain();
1059        data.writeInterfaceToken(IApplicationThread.descriptor);
1060        data.writeFileDescriptor(fd);
1061        data.writeStrongBinder(token);
1062        data.writeStringArray(args);
1063        mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1064        data.recycle();
1065    }
1066
1067    public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
1068            int resultCode, String dataStr, Bundle extras, boolean ordered,
1069            boolean sticky, int sendingUser, int processState) throws RemoteException {
1070        Parcel data = Parcel.obtain();
1071        data.writeInterfaceToken(IApplicationThread.descriptor);
1072        data.writeStrongBinder(receiver.asBinder());
1073        intent.writeToParcel(data, 0);
1074        data.writeInt(resultCode);
1075        data.writeString(dataStr);
1076        data.writeBundle(extras);
1077        data.writeInt(ordered ? 1 : 0);
1078        data.writeInt(sticky ? 1 : 0);
1079        data.writeInt(sendingUser);
1080        data.writeInt(processState);
1081        mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null,
1082                IBinder.FLAG_ONEWAY);
1083        data.recycle();
1084    }
1085
1086    public final void scheduleLowMemory() throws RemoteException {
1087        Parcel data = Parcel.obtain();
1088        data.writeInterfaceToken(IApplicationThread.descriptor);
1089        mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null,
1090                IBinder.FLAG_ONEWAY);
1091        data.recycle();
1092    }
1093
1094    public final void scheduleActivityConfigurationChanged(
1095            IBinder token) throws RemoteException {
1096        Parcel data = Parcel.obtain();
1097        data.writeInterfaceToken(IApplicationThread.descriptor);
1098        data.writeStrongBinder(token);
1099        mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1100                IBinder.FLAG_ONEWAY);
1101        data.recycle();
1102    }
1103
1104    public void profilerControl(boolean start, String path,
1105            ParcelFileDescriptor fd, int profileType) throws RemoteException {
1106        Parcel data = Parcel.obtain();
1107        data.writeInterfaceToken(IApplicationThread.descriptor);
1108        data.writeInt(start ? 1 : 0);
1109        data.writeInt(profileType);
1110        data.writeString(path);
1111        if (fd != null) {
1112            data.writeInt(1);
1113            fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1114        } else {
1115            data.writeInt(0);
1116        }
1117        mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null,
1118                IBinder.FLAG_ONEWAY);
1119        data.recycle();
1120    }
1121
1122    public void setSchedulingGroup(int group) throws RemoteException {
1123        Parcel data = Parcel.obtain();
1124        data.writeInterfaceToken(IApplicationThread.descriptor);
1125        data.writeInt(group);
1126        mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null,
1127                IBinder.FLAG_ONEWAY);
1128        data.recycle();
1129    }
1130
1131    public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException {
1132        Parcel data = Parcel.obtain();
1133        data.writeInterfaceToken(IApplicationThread.descriptor);
1134        data.writeInt(cmd);
1135        data.writeStringArray(packages);
1136        mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null,
1137                IBinder.FLAG_ONEWAY);
1138        data.recycle();
1139
1140    }
1141
1142    public void scheduleCrash(String msg) throws RemoteException {
1143        Parcel data = Parcel.obtain();
1144        data.writeInterfaceToken(IApplicationThread.descriptor);
1145        data.writeString(msg);
1146        mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null,
1147                IBinder.FLAG_ONEWAY);
1148        data.recycle();
1149
1150    }
1151
1152    public void dumpHeap(boolean managed, String path,
1153            ParcelFileDescriptor fd) throws RemoteException {
1154        Parcel data = Parcel.obtain();
1155        data.writeInterfaceToken(IApplicationThread.descriptor);
1156        data.writeInt(managed ? 1 : 0);
1157        data.writeString(path);
1158        if (fd != null) {
1159            data.writeInt(1);
1160            fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1161        } else {
1162            data.writeInt(0);
1163        }
1164        mRemote.transact(DUMP_HEAP_TRANSACTION, data, null,
1165                IBinder.FLAG_ONEWAY);
1166        data.recycle();
1167    }
1168
1169    public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args)
1170            throws RemoteException {
1171        Parcel data = Parcel.obtain();
1172        data.writeInterfaceToken(IApplicationThread.descriptor);
1173        data.writeFileDescriptor(fd);
1174        data.writeStrongBinder(token);
1175        data.writeString(prefix);
1176        data.writeStringArray(args);
1177        mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1178        data.recycle();
1179    }
1180
1181    public void setCoreSettings(Bundle coreSettings) throws RemoteException {
1182        Parcel data = Parcel.obtain();
1183        data.writeInterfaceToken(IApplicationThread.descriptor);
1184        data.writeBundle(coreSettings);
1185        mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1186    }
1187
1188    public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info)
1189            throws RemoteException {
1190        Parcel data = Parcel.obtain();
1191        data.writeInterfaceToken(IApplicationThread.descriptor);
1192        data.writeString(pkg);
1193        info.writeToParcel(data, 0);
1194        mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null,
1195                IBinder.FLAG_ONEWAY);
1196    }
1197
1198    public void scheduleTrimMemory(int level) throws RemoteException {
1199        Parcel data = Parcel.obtain();
1200        data.writeInterfaceToken(IApplicationThread.descriptor);
1201        data.writeInt(level);
1202        mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null,
1203                IBinder.FLAG_ONEWAY);
1204    }
1205
1206    public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
1207            boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException {
1208        Parcel data = Parcel.obtain();
1209        Parcel reply = Parcel.obtain();
1210        data.writeInterfaceToken(IApplicationThread.descriptor);
1211        data.writeFileDescriptor(fd);
1212        mem.writeToParcel(data, 0);
1213        data.writeInt(checkin ? 1 : 0);
1214        data.writeInt(dumpInfo ? 1 : 0);
1215        data.writeInt(dumpDalvik ? 1 : 0);
1216        data.writeStringArray(args);
1217        mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0);
1218        reply.readException();
1219        data.recycle();
1220        reply.recycle();
1221    }
1222
1223    public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException {
1224        Parcel data = Parcel.obtain();
1225        data.writeInterfaceToken(IApplicationThread.descriptor);
1226        data.writeFileDescriptor(fd);
1227        data.writeStringArray(args);
1228        mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1229        data.recycle();
1230    }
1231
1232    public void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException {
1233        Parcel data = Parcel.obtain();
1234        data.writeInterfaceToken(IApplicationThread.descriptor);
1235        data.writeFileDescriptor(fd);
1236        data.writeStringArray(args);
1237        mRemote.transact(DUMP_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1238        data.recycle();
1239    }
1240
1241    @Override
1242    public void unstableProviderDied(IBinder provider) throws RemoteException {
1243        Parcel data = Parcel.obtain();
1244        data.writeInterfaceToken(IApplicationThread.descriptor);
1245        data.writeStrongBinder(provider);
1246        mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1247        data.recycle();
1248    }
1249
1250    @Override
1251    public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
1252            int requestType) throws RemoteException {
1253        Parcel data = Parcel.obtain();
1254        data.writeInterfaceToken(IApplicationThread.descriptor);
1255        data.writeStrongBinder(activityToken);
1256        data.writeStrongBinder(requestToken);
1257        data.writeInt(requestType);
1258        mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null,
1259                IBinder.FLAG_ONEWAY);
1260        data.recycle();
1261    }
1262
1263    @Override
1264    public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
1265            throws RemoteException {
1266        Parcel data = Parcel.obtain();
1267        data.writeInterfaceToken(IApplicationThread.descriptor);
1268        data.writeStrongBinder(token);
1269        data.writeInt(timeout ? 1 : 0);
1270        mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1271        data.recycle();
1272    }
1273
1274    @Override
1275    public void setProcessState(int state) throws RemoteException {
1276        Parcel data = Parcel.obtain();
1277        data.writeInterfaceToken(IApplicationThread.descriptor);
1278        data.writeInt(state);
1279        mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1280        data.recycle();
1281    }
1282
1283    @Override
1284    public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException {
1285        Parcel data = Parcel.obtain();
1286        data.writeInterfaceToken(IApplicationThread.descriptor);
1287        provider.writeToParcel(data, 0);
1288        mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1289        data.recycle();
1290    }
1291
1292    @Override
1293    public void updateTimePrefs(boolean is24Hour) throws RemoteException {
1294        Parcel data = Parcel.obtain();
1295        data.writeInterfaceToken(IApplicationThread.descriptor);
1296        data.writeByte(is24Hour ? (byte) 1 : (byte) 0);
1297        mRemote.transact(UPDATE_TIME_PREFS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1298        data.recycle();
1299    }
1300}
1301