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