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