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