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