ApplicationThreadNative.java revision a002604af0c9b1204556610537b85685d7055996
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.PersistableBundle;
33import android.os.RemoteException;
34import android.os.IBinder;
35import android.os.Parcel;
36import android.os.ParcelFileDescriptor;
37import com.android.internal.app.IVoiceInteractor;
38
39import java.io.FileDescriptor;
40import java.io.IOException;
41import java.util.HashMap;
42import java.util.List;
43import java.util.Map;
44
45/** {@hide} */
46public abstract class ApplicationThreadNative extends Binder
47        implements IApplicationThread {
48    /**
49     * Cast a Binder object into an application thread interface, generating
50     * a proxy if needed.
51     */
52    static public IApplicationThread asInterface(IBinder obj) {
53        if (obj == null) {
54            return null;
55        }
56        IApplicationThread in =
57            (IApplicationThread)obj.queryLocalInterface(descriptor);
58        if (in != null) {
59            return in;
60        }
61
62        return new ApplicationThreadProxy(obj);
63    }
64
65    public ApplicationThreadNative() {
66        attachInterface(this, descriptor);
67    }
68
69    @Override
70    public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
71            throws RemoteException {
72        switch (code) {
73        case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION:
74        {
75            data.enforceInterface(IApplicationThread.descriptor);
76            IBinder b = data.readStrongBinder();
77            boolean finished = data.readInt() != 0;
78            boolean userLeaving = data.readInt() != 0;
79            int configChanges = data.readInt();
80            schedulePauseActivity(b, finished, userLeaving, configChanges);
81            return true;
82        }
83
84        case SCHEDULE_STOP_ACTIVITY_TRANSACTION:
85        {
86            data.enforceInterface(IApplicationThread.descriptor);
87            IBinder b = data.readStrongBinder();
88            boolean show = data.readInt() != 0;
89            int configChanges = data.readInt();
90            scheduleStopActivity(b, show, configChanges);
91            return true;
92        }
93
94        case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION:
95        {
96            data.enforceInterface(IApplicationThread.descriptor);
97            IBinder b = data.readStrongBinder();
98            boolean show = data.readInt() != 0;
99            scheduleWindowVisibility(b, show);
100            return true;
101        }
102
103        case SCHEDULE_SLEEPING_TRANSACTION:
104        {
105            data.enforceInterface(IApplicationThread.descriptor);
106            IBinder b = data.readStrongBinder();
107            boolean sleeping = data.readInt() != 0;
108            scheduleSleeping(b, sleeping);
109            return true;
110        }
111
112        case SCHEDULE_RESUME_ACTIVITY_TRANSACTION:
113        {
114            data.enforceInterface(IApplicationThread.descriptor);
115            IBinder b = data.readStrongBinder();
116            int procState = data.readInt();
117            boolean isForward = data.readInt() != 0;
118            Bundle resumeArgs = data.readBundle();
119            scheduleResumeActivity(b, procState, isForward, resumeArgs);
120            return true;
121        }
122
123        case SCHEDULE_SEND_RESULT_TRANSACTION:
124        {
125            data.enforceInterface(IApplicationThread.descriptor);
126            IBinder b = data.readStrongBinder();
127            List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
128            scheduleSendResult(b, ri);
129            return true;
130        }
131
132        case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION:
133        {
134            data.enforceInterface(IApplicationThread.descriptor);
135            Intent intent = Intent.CREATOR.createFromParcel(data);
136            IBinder b = data.readStrongBinder();
137            int ident = data.readInt();
138            ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
139            Configuration curConfig = Configuration.CREATOR.createFromParcel(data);
140            CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
141            IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
142                    data.readStrongBinder());
143            int procState = data.readInt();
144            Bundle state = data.readBundle();
145            PersistableBundle persistentState = data.readPersistableBundle();
146            List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
147            List<Intent> pi = data.createTypedArrayList(Intent.CREATOR);
148            boolean notResumed = data.readInt() != 0;
149            boolean isForward = data.readInt() != 0;
150            String profileName = data.readString();
151            ParcelFileDescriptor profileFd = data.readInt() != 0
152                    ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
153            boolean autoStopProfiler = data.readInt() != 0;
154            Bundle resumeArgs = data.readBundle();
155            scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo,
156                    voiceInteractor, procState, state, persistentState,
157                    ri, pi, notResumed, isForward, profileName, profileFd,
158                    autoStopProfiler, resumeArgs);
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 String pacFileUrl = data.readString();
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            Bundle resumeArgs)
741            throws RemoteException {
742        Parcel data = Parcel.obtain();
743        data.writeInterfaceToken(IApplicationThread.descriptor);
744        intent.writeToParcel(data, 0);
745        data.writeStrongBinder(token);
746        data.writeInt(ident);
747        info.writeToParcel(data, 0);
748        curConfig.writeToParcel(data, 0);
749        compatInfo.writeToParcel(data, 0);
750        data.writeStrongBinder(voiceInteractor != null ? voiceInteractor.asBinder() : null);
751        data.writeInt(procState);
752        data.writeBundle(state);
753        data.writePersistableBundle(persistentState);
754        data.writeTypedList(pendingResults);
755        data.writeTypedList(pendingNewIntents);
756        data.writeInt(notResumed ? 1 : 0);
757        data.writeInt(isForward ? 1 : 0);
758        data.writeString(profileName);
759        if (profileFd != null) {
760            data.writeInt(1);
761            profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
762        } else {
763            data.writeInt(0);
764        }
765        data.writeInt(autoStopProfiler ? 1 : 0);
766        data.writeBundle(resumeArgs);
767        mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null,
768                IBinder.FLAG_ONEWAY);
769        data.recycle();
770    }
771
772    public final void scheduleRelaunchActivity(IBinder token,
773            List<ResultInfo> pendingResults, List<Intent> pendingNewIntents,
774            int configChanges, boolean notResumed, Configuration config)
775            throws RemoteException {
776        Parcel data = Parcel.obtain();
777        data.writeInterfaceToken(IApplicationThread.descriptor);
778        data.writeStrongBinder(token);
779        data.writeTypedList(pendingResults);
780        data.writeTypedList(pendingNewIntents);
781        data.writeInt(configChanges);
782        data.writeInt(notResumed ? 1 : 0);
783        if (config != null) {
784            data.writeInt(1);
785            config.writeToParcel(data, 0);
786        } else {
787            data.writeInt(0);
788        }
789        mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null,
790                IBinder.FLAG_ONEWAY);
791        data.recycle();
792    }
793
794    public void scheduleNewIntent(List<Intent> intents, IBinder token)
795            throws RemoteException {
796        Parcel data = Parcel.obtain();
797        data.writeInterfaceToken(IApplicationThread.descriptor);
798        data.writeTypedList(intents);
799        data.writeStrongBinder(token);
800        mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null,
801                IBinder.FLAG_ONEWAY);
802        data.recycle();
803    }
804
805    public final void scheduleDestroyActivity(IBinder token, boolean finishing,
806            int configChanges) throws RemoteException {
807        Parcel data = Parcel.obtain();
808        data.writeInterfaceToken(IApplicationThread.descriptor);
809        data.writeStrongBinder(token);
810        data.writeInt(finishing ? 1 : 0);
811        data.writeInt(configChanges);
812        mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null,
813                IBinder.FLAG_ONEWAY);
814        data.recycle();
815    }
816
817    public final void scheduleReceiver(Intent intent, ActivityInfo info,
818            CompatibilityInfo compatInfo, int resultCode, String resultData,
819            Bundle map, boolean sync, int sendingUser, int processState) throws RemoteException {
820        Parcel data = Parcel.obtain();
821        data.writeInterfaceToken(IApplicationThread.descriptor);
822        intent.writeToParcel(data, 0);
823        info.writeToParcel(data, 0);
824        compatInfo.writeToParcel(data, 0);
825        data.writeInt(resultCode);
826        data.writeString(resultData);
827        data.writeBundle(map);
828        data.writeInt(sync ? 1 : 0);
829        data.writeInt(sendingUser);
830        data.writeInt(processState);
831        mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null,
832                IBinder.FLAG_ONEWAY);
833        data.recycle();
834    }
835
836    public final void scheduleCreateBackupAgent(ApplicationInfo app,
837            CompatibilityInfo compatInfo, int backupMode) throws RemoteException {
838        Parcel data = Parcel.obtain();
839        data.writeInterfaceToken(IApplicationThread.descriptor);
840        app.writeToParcel(data, 0);
841        compatInfo.writeToParcel(data, 0);
842        data.writeInt(backupMode);
843        mRemote.transact(SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION, data, null,
844                IBinder.FLAG_ONEWAY);
845        data.recycle();
846    }
847
848    public final void scheduleDestroyBackupAgent(ApplicationInfo app,
849            CompatibilityInfo compatInfo) throws RemoteException {
850        Parcel data = Parcel.obtain();
851        data.writeInterfaceToken(IApplicationThread.descriptor);
852        app.writeToParcel(data, 0);
853        compatInfo.writeToParcel(data, 0);
854        mRemote.transact(SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION, data, null,
855                IBinder.FLAG_ONEWAY);
856        data.recycle();
857    }
858
859    public final void scheduleCreateService(IBinder token, ServiceInfo info,
860            CompatibilityInfo compatInfo, int processState) throws RemoteException {
861        Parcel data = Parcel.obtain();
862        data.writeInterfaceToken(IApplicationThread.descriptor);
863        data.writeStrongBinder(token);
864        info.writeToParcel(data, 0);
865        compatInfo.writeToParcel(data, 0);
866        data.writeInt(processState);
867        mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null,
868                IBinder.FLAG_ONEWAY);
869        data.recycle();
870    }
871
872    public final void scheduleBindService(IBinder token, Intent intent, boolean rebind,
873            int processState) throws RemoteException {
874        Parcel data = Parcel.obtain();
875        data.writeInterfaceToken(IApplicationThread.descriptor);
876        data.writeStrongBinder(token);
877        intent.writeToParcel(data, 0);
878        data.writeInt(rebind ? 1 : 0);
879        data.writeInt(processState);
880        mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null,
881                IBinder.FLAG_ONEWAY);
882        data.recycle();
883    }
884
885    public final void scheduleUnbindService(IBinder token, Intent intent)
886            throws RemoteException {
887        Parcel data = Parcel.obtain();
888        data.writeInterfaceToken(IApplicationThread.descriptor);
889        data.writeStrongBinder(token);
890        intent.writeToParcel(data, 0);
891        mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null,
892                IBinder.FLAG_ONEWAY);
893        data.recycle();
894    }
895
896    public final void scheduleServiceArgs(IBinder token, boolean taskRemoved, int startId,
897            int flags, Intent args) throws RemoteException {
898        Parcel data = Parcel.obtain();
899        data.writeInterfaceToken(IApplicationThread.descriptor);
900        data.writeStrongBinder(token);
901        data.writeInt(taskRemoved ? 1 : 0);
902        data.writeInt(startId);
903        data.writeInt(flags);
904        if (args != null) {
905            data.writeInt(1);
906            args.writeToParcel(data, 0);
907        } else {
908            data.writeInt(0);
909        }
910        mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null,
911                IBinder.FLAG_ONEWAY);
912        data.recycle();
913    }
914
915    public final void scheduleStopService(IBinder token)
916            throws RemoteException {
917        Parcel data = Parcel.obtain();
918        data.writeInterfaceToken(IApplicationThread.descriptor);
919        data.writeStrongBinder(token);
920        mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null,
921                IBinder.FLAG_ONEWAY);
922        data.recycle();
923    }
924
925    public final void bindApplication(String packageName, ApplicationInfo info,
926            List<ProviderInfo> providers, ComponentName testName, String profileName,
927            ParcelFileDescriptor profileFd, boolean autoStopProfiler, Bundle testArgs,
928            IInstrumentationWatcher testWatcher,
929            IUiAutomationConnection uiAutomationConnection, int debugMode,
930            boolean openGlTrace, boolean restrictedBackupMode, boolean persistent,
931            Configuration config, CompatibilityInfo compatInfo, Map<String, IBinder> services,
932            Bundle coreSettings) throws RemoteException {
933        Parcel data = Parcel.obtain();
934        data.writeInterfaceToken(IApplicationThread.descriptor);
935        data.writeString(packageName);
936        info.writeToParcel(data, 0);
937        data.writeTypedList(providers);
938        if (testName == null) {
939            data.writeInt(0);
940        } else {
941            data.writeInt(1);
942            testName.writeToParcel(data, 0);
943        }
944        data.writeString(profileName);
945        if (profileFd != null) {
946            data.writeInt(1);
947            profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
948        } else {
949            data.writeInt(0);
950        }
951        data.writeInt(autoStopProfiler ? 1 : 0);
952        data.writeBundle(testArgs);
953        data.writeStrongInterface(testWatcher);
954        data.writeStrongInterface(uiAutomationConnection);
955        data.writeInt(debugMode);
956        data.writeInt(openGlTrace ? 1 : 0);
957        data.writeInt(restrictedBackupMode ? 1 : 0);
958        data.writeInt(persistent ? 1 : 0);
959        config.writeToParcel(data, 0);
960        compatInfo.writeToParcel(data, 0);
961        data.writeMap(services);
962        data.writeBundle(coreSettings);
963        mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null,
964                IBinder.FLAG_ONEWAY);
965        data.recycle();
966    }
967
968    public final void scheduleExit() throws RemoteException {
969        Parcel data = Parcel.obtain();
970        data.writeInterfaceToken(IApplicationThread.descriptor);
971        mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null,
972                IBinder.FLAG_ONEWAY);
973        data.recycle();
974    }
975
976    public final void scheduleSuicide() throws RemoteException {
977        Parcel data = Parcel.obtain();
978        data.writeInterfaceToken(IApplicationThread.descriptor);
979        mRemote.transact(SCHEDULE_SUICIDE_TRANSACTION, data, null,
980                IBinder.FLAG_ONEWAY);
981        data.recycle();
982    }
983
984    public final void scheduleConfigurationChanged(Configuration config)
985            throws RemoteException {
986        Parcel data = Parcel.obtain();
987        data.writeInterfaceToken(IApplicationThread.descriptor);
988        config.writeToParcel(data, 0);
989        mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null,
990                IBinder.FLAG_ONEWAY);
991        data.recycle();
992    }
993
994    public void updateTimeZone() throws RemoteException {
995        Parcel data = Parcel.obtain();
996        data.writeInterfaceToken(IApplicationThread.descriptor);
997        mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null,
998                IBinder.FLAG_ONEWAY);
999        data.recycle();
1000    }
1001
1002    public void clearDnsCache() throws RemoteException {
1003        Parcel data = Parcel.obtain();
1004        data.writeInterfaceToken(IApplicationThread.descriptor);
1005        mRemote.transact(CLEAR_DNS_CACHE_TRANSACTION, data, null,
1006                IBinder.FLAG_ONEWAY);
1007        data.recycle();
1008    }
1009
1010    public void setHttpProxy(String proxy, String port, String exclList,
1011            String pacFileUrl) throws RemoteException {
1012        Parcel data = Parcel.obtain();
1013        data.writeInterfaceToken(IApplicationThread.descriptor);
1014        data.writeString(proxy);
1015        data.writeString(port);
1016        data.writeString(exclList);
1017        data.writeString(pacFileUrl);
1018        mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1019        data.recycle();
1020    }
1021
1022    public void processInBackground() throws RemoteException {
1023        Parcel data = Parcel.obtain();
1024        data.writeInterfaceToken(IApplicationThread.descriptor);
1025        mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null,
1026                IBinder.FLAG_ONEWAY);
1027        data.recycle();
1028    }
1029
1030    public void dumpService(FileDescriptor fd, IBinder token, String[] args)
1031            throws RemoteException {
1032        Parcel data = Parcel.obtain();
1033        data.writeInterfaceToken(IApplicationThread.descriptor);
1034        data.writeFileDescriptor(fd);
1035        data.writeStrongBinder(token);
1036        data.writeStringArray(args);
1037        mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1038        data.recycle();
1039    }
1040
1041    public void dumpProvider(FileDescriptor fd, IBinder token, String[] args)
1042            throws RemoteException {
1043        Parcel data = Parcel.obtain();
1044        data.writeInterfaceToken(IApplicationThread.descriptor);
1045        data.writeFileDescriptor(fd);
1046        data.writeStrongBinder(token);
1047        data.writeStringArray(args);
1048        mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1049        data.recycle();
1050    }
1051
1052    public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent,
1053            int resultCode, String dataStr, Bundle extras, boolean ordered,
1054            boolean sticky, int sendingUser, int processState) throws RemoteException {
1055        Parcel data = Parcel.obtain();
1056        data.writeInterfaceToken(IApplicationThread.descriptor);
1057        data.writeStrongBinder(receiver.asBinder());
1058        intent.writeToParcel(data, 0);
1059        data.writeInt(resultCode);
1060        data.writeString(dataStr);
1061        data.writeBundle(extras);
1062        data.writeInt(ordered ? 1 : 0);
1063        data.writeInt(sticky ? 1 : 0);
1064        data.writeInt(sendingUser);
1065        data.writeInt(processState);
1066        mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null,
1067                IBinder.FLAG_ONEWAY);
1068        data.recycle();
1069    }
1070
1071    public final void scheduleLowMemory() throws RemoteException {
1072        Parcel data = Parcel.obtain();
1073        data.writeInterfaceToken(IApplicationThread.descriptor);
1074        mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null,
1075                IBinder.FLAG_ONEWAY);
1076        data.recycle();
1077    }
1078
1079    public final void scheduleActivityConfigurationChanged(
1080            IBinder token) throws RemoteException {
1081        Parcel data = Parcel.obtain();
1082        data.writeInterfaceToken(IApplicationThread.descriptor);
1083        data.writeStrongBinder(token);
1084        mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null,
1085                IBinder.FLAG_ONEWAY);
1086        data.recycle();
1087    }
1088
1089    public void profilerControl(boolean start, String path,
1090            ParcelFileDescriptor fd, int profileType) throws RemoteException {
1091        Parcel data = Parcel.obtain();
1092        data.writeInterfaceToken(IApplicationThread.descriptor);
1093        data.writeInt(start ? 1 : 0);
1094        data.writeInt(profileType);
1095        data.writeString(path);
1096        if (fd != null) {
1097            data.writeInt(1);
1098            fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1099        } else {
1100            data.writeInt(0);
1101        }
1102        mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null,
1103                IBinder.FLAG_ONEWAY);
1104        data.recycle();
1105    }
1106
1107    public void setSchedulingGroup(int group) throws RemoteException {
1108        Parcel data = Parcel.obtain();
1109        data.writeInterfaceToken(IApplicationThread.descriptor);
1110        data.writeInt(group);
1111        mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null,
1112                IBinder.FLAG_ONEWAY);
1113        data.recycle();
1114    }
1115
1116    public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException {
1117        Parcel data = Parcel.obtain();
1118        data.writeInterfaceToken(IApplicationThread.descriptor);
1119        data.writeInt(cmd);
1120        data.writeStringArray(packages);
1121        mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null,
1122                IBinder.FLAG_ONEWAY);
1123        data.recycle();
1124
1125    }
1126
1127    public void scheduleCrash(String msg) throws RemoteException {
1128        Parcel data = Parcel.obtain();
1129        data.writeInterfaceToken(IApplicationThread.descriptor);
1130        data.writeString(msg);
1131        mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null,
1132                IBinder.FLAG_ONEWAY);
1133        data.recycle();
1134
1135    }
1136
1137    public void dumpHeap(boolean managed, String path,
1138            ParcelFileDescriptor fd) throws RemoteException {
1139        Parcel data = Parcel.obtain();
1140        data.writeInterfaceToken(IApplicationThread.descriptor);
1141        data.writeInt(managed ? 1 : 0);
1142        data.writeString(path);
1143        if (fd != null) {
1144            data.writeInt(1);
1145            fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1146        } else {
1147            data.writeInt(0);
1148        }
1149        mRemote.transact(DUMP_HEAP_TRANSACTION, data, null,
1150                IBinder.FLAG_ONEWAY);
1151        data.recycle();
1152    }
1153
1154    public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args)
1155            throws RemoteException {
1156        Parcel data = Parcel.obtain();
1157        data.writeInterfaceToken(IApplicationThread.descriptor);
1158        data.writeFileDescriptor(fd);
1159        data.writeStrongBinder(token);
1160        data.writeString(prefix);
1161        data.writeStringArray(args);
1162        mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1163        data.recycle();
1164    }
1165
1166    public void setCoreSettings(Bundle coreSettings) throws RemoteException {
1167        Parcel data = Parcel.obtain();
1168        data.writeInterfaceToken(IApplicationThread.descriptor);
1169        data.writeBundle(coreSettings);
1170        mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1171    }
1172
1173    public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info)
1174            throws RemoteException {
1175        Parcel data = Parcel.obtain();
1176        data.writeInterfaceToken(IApplicationThread.descriptor);
1177        data.writeString(pkg);
1178        info.writeToParcel(data, 0);
1179        mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null,
1180                IBinder.FLAG_ONEWAY);
1181    }
1182
1183    public void scheduleTrimMemory(int level) throws RemoteException {
1184        Parcel data = Parcel.obtain();
1185        data.writeInterfaceToken(IApplicationThread.descriptor);
1186        data.writeInt(level);
1187        mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null,
1188                IBinder.FLAG_ONEWAY);
1189    }
1190
1191    public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin,
1192            boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException {
1193        Parcel data = Parcel.obtain();
1194        Parcel reply = Parcel.obtain();
1195        data.writeInterfaceToken(IApplicationThread.descriptor);
1196        data.writeFileDescriptor(fd);
1197        mem.writeToParcel(data, 0);
1198        data.writeInt(checkin ? 1 : 0);
1199        data.writeInt(dumpInfo ? 1 : 0);
1200        data.writeInt(dumpDalvik ? 1 : 0);
1201        data.writeStringArray(args);
1202        mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0);
1203        reply.readException();
1204        data.recycle();
1205        reply.recycle();
1206    }
1207
1208    public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException {
1209        Parcel data = Parcel.obtain();
1210        data.writeInterfaceToken(IApplicationThread.descriptor);
1211        data.writeFileDescriptor(fd);
1212        data.writeStringArray(args);
1213        mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1214        data.recycle();
1215    }
1216
1217    public void dumpDbInfo(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_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1223        data.recycle();
1224    }
1225
1226    @Override
1227    public void unstableProviderDied(IBinder provider) throws RemoteException {
1228        Parcel data = Parcel.obtain();
1229        data.writeInterfaceToken(IApplicationThread.descriptor);
1230        data.writeStrongBinder(provider);
1231        mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1232        data.recycle();
1233    }
1234
1235    @Override
1236    public void requestAssistContextExtras(IBinder activityToken, IBinder requestToken,
1237            int requestType) throws RemoteException {
1238        Parcel data = Parcel.obtain();
1239        data.writeInterfaceToken(IApplicationThread.descriptor);
1240        data.writeStrongBinder(activityToken);
1241        data.writeStrongBinder(requestToken);
1242        data.writeInt(requestType);
1243        mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, null,
1244                IBinder.FLAG_ONEWAY);
1245        data.recycle();
1246    }
1247
1248    @Override
1249    public void scheduleTranslucentConversionComplete(IBinder token, boolean timeout)
1250            throws RemoteException {
1251        Parcel data = Parcel.obtain();
1252        data.writeInterfaceToken(IApplicationThread.descriptor);
1253        data.writeStrongBinder(token);
1254        data.writeInt(timeout ? 1 : 0);
1255        mRemote.transact(SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1256        data.recycle();
1257    }
1258
1259    @Override
1260    public void setProcessState(int state) throws RemoteException {
1261        Parcel data = Parcel.obtain();
1262        data.writeInterfaceToken(IApplicationThread.descriptor);
1263        data.writeInt(state);
1264        mRemote.transact(SET_PROCESS_STATE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1265        data.recycle();
1266    }
1267
1268    @Override
1269    public void scheduleInstallProvider(ProviderInfo provider) throws RemoteException {
1270        Parcel data = Parcel.obtain();
1271        data.writeInterfaceToken(IApplicationThread.descriptor);
1272        provider.writeToParcel(data, 0);
1273        mRemote.transact(SCHEDULE_INSTALL_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1274        data.recycle();
1275    }
1276
1277    @Override
1278    public void updateTimePrefs(boolean is24Hour) throws RemoteException {
1279        Parcel data = Parcel.obtain();
1280        data.writeInterfaceToken(IApplicationThread.descriptor);
1281        data.writeByte(is24Hour ? (byte) 1 : (byte) 0);
1282        mRemote.transact(UPDATE_TIME_PREFS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
1283        data.recycle();
1284    }
1285}
1286