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