ApplicationThreadNative.java revision 602b232a06ede86999aa362a12eb28cbc782dc1d
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_ACTIVITY_EXTRAS_TRANSACTION: 604 { 605 data.enforceInterface(IApplicationThread.descriptor); 606 IBinder activityToken = data.readStrongBinder(); 607 IBinder requestToken = data.readStrongBinder(); 608 int requestType = data.readInt(); 609 requestActivityExtras(activityToken, requestToken, requestType); 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, 1006 String pacFileUrl) throws RemoteException { 1007 Parcel data = Parcel.obtain(); 1008 data.writeInterfaceToken(IApplicationThread.descriptor); 1009 data.writeString(proxy); 1010 data.writeString(port); 1011 data.writeString(exclList); 1012 data.writeString(pacFileUrl); 1013 mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1014 data.recycle(); 1015 } 1016 1017 public void processInBackground() throws RemoteException { 1018 Parcel data = Parcel.obtain(); 1019 data.writeInterfaceToken(IApplicationThread.descriptor); 1020 mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null, 1021 IBinder.FLAG_ONEWAY); 1022 data.recycle(); 1023 } 1024 1025 public void dumpService(FileDescriptor fd, IBinder token, String[] args) 1026 throws RemoteException { 1027 Parcel data = Parcel.obtain(); 1028 data.writeInterfaceToken(IApplicationThread.descriptor); 1029 data.writeFileDescriptor(fd); 1030 data.writeStrongBinder(token); 1031 data.writeStringArray(args); 1032 mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1033 data.recycle(); 1034 } 1035 1036 public void dumpProvider(FileDescriptor fd, IBinder token, String[] args) 1037 throws RemoteException { 1038 Parcel data = Parcel.obtain(); 1039 data.writeInterfaceToken(IApplicationThread.descriptor); 1040 data.writeFileDescriptor(fd); 1041 data.writeStrongBinder(token); 1042 data.writeStringArray(args); 1043 mRemote.transact(DUMP_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1044 data.recycle(); 1045 } 1046 1047 public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, 1048 int resultCode, String dataStr, Bundle extras, boolean ordered, 1049 boolean sticky, int sendingUser, int processState) throws RemoteException { 1050 Parcel data = Parcel.obtain(); 1051 data.writeInterfaceToken(IApplicationThread.descriptor); 1052 data.writeStrongBinder(receiver.asBinder()); 1053 intent.writeToParcel(data, 0); 1054 data.writeInt(resultCode); 1055 data.writeString(dataStr); 1056 data.writeBundle(extras); 1057 data.writeInt(ordered ? 1 : 0); 1058 data.writeInt(sticky ? 1 : 0); 1059 data.writeInt(sendingUser); 1060 data.writeInt(processState); 1061 mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null, 1062 IBinder.FLAG_ONEWAY); 1063 data.recycle(); 1064 } 1065 1066 public final void scheduleLowMemory() throws RemoteException { 1067 Parcel data = Parcel.obtain(); 1068 data.writeInterfaceToken(IApplicationThread.descriptor); 1069 mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null, 1070 IBinder.FLAG_ONEWAY); 1071 data.recycle(); 1072 } 1073 1074 public final void scheduleActivityConfigurationChanged( 1075 IBinder token) throws RemoteException { 1076 Parcel data = Parcel.obtain(); 1077 data.writeInterfaceToken(IApplicationThread.descriptor); 1078 data.writeStrongBinder(token); 1079 mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null, 1080 IBinder.FLAG_ONEWAY); 1081 data.recycle(); 1082 } 1083 1084 public void profilerControl(boolean start, String path, 1085 ParcelFileDescriptor fd, int profileType) throws RemoteException { 1086 Parcel data = Parcel.obtain(); 1087 data.writeInterfaceToken(IApplicationThread.descriptor); 1088 data.writeInt(start ? 1 : 0); 1089 data.writeInt(profileType); 1090 data.writeString(path); 1091 if (fd != null) { 1092 data.writeInt(1); 1093 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); 1094 } else { 1095 data.writeInt(0); 1096 } 1097 mRemote.transact(PROFILER_CONTROL_TRANSACTION, data, null, 1098 IBinder.FLAG_ONEWAY); 1099 data.recycle(); 1100 } 1101 1102 public void setSchedulingGroup(int group) throws RemoteException { 1103 Parcel data = Parcel.obtain(); 1104 data.writeInterfaceToken(IApplicationThread.descriptor); 1105 data.writeInt(group); 1106 mRemote.transact(SET_SCHEDULING_GROUP_TRANSACTION, data, null, 1107 IBinder.FLAG_ONEWAY); 1108 data.recycle(); 1109 } 1110 1111 public void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException { 1112 Parcel data = Parcel.obtain(); 1113 Parcel reply = Parcel.obtain(); 1114 data.writeInterfaceToken(IApplicationThread.descriptor); 1115 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); 1116 reply.readException(); 1117 outInfo.readFromParcel(reply); 1118 data.recycle(); 1119 reply.recycle(); 1120 } 1121 1122 public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException { 1123 Parcel data = Parcel.obtain(); 1124 data.writeInterfaceToken(IApplicationThread.descriptor); 1125 data.writeInt(cmd); 1126 data.writeStringArray(packages); 1127 mRemote.transact(DISPATCH_PACKAGE_BROADCAST_TRANSACTION, data, null, 1128 IBinder.FLAG_ONEWAY); 1129 data.recycle(); 1130 1131 } 1132 1133 public void scheduleCrash(String msg) throws RemoteException { 1134 Parcel data = Parcel.obtain(); 1135 data.writeInterfaceToken(IApplicationThread.descriptor); 1136 data.writeString(msg); 1137 mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null, 1138 IBinder.FLAG_ONEWAY); 1139 data.recycle(); 1140 1141 } 1142 1143 public void dumpHeap(boolean managed, String path, 1144 ParcelFileDescriptor fd) throws RemoteException { 1145 Parcel data = Parcel.obtain(); 1146 data.writeInterfaceToken(IApplicationThread.descriptor); 1147 data.writeInt(managed ? 1 : 0); 1148 data.writeString(path); 1149 if (fd != null) { 1150 data.writeInt(1); 1151 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); 1152 } else { 1153 data.writeInt(0); 1154 } 1155 mRemote.transact(DUMP_HEAP_TRANSACTION, data, null, 1156 IBinder.FLAG_ONEWAY); 1157 data.recycle(); 1158 } 1159 1160 public void dumpActivity(FileDescriptor fd, IBinder token, String prefix, String[] args) 1161 throws RemoteException { 1162 Parcel data = Parcel.obtain(); 1163 data.writeInterfaceToken(IApplicationThread.descriptor); 1164 data.writeFileDescriptor(fd); 1165 data.writeStrongBinder(token); 1166 data.writeString(prefix); 1167 data.writeStringArray(args); 1168 mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1169 data.recycle(); 1170 } 1171 1172 public void setCoreSettings(Bundle coreSettings) throws RemoteException { 1173 Parcel data = Parcel.obtain(); 1174 data.writeInterfaceToken(IApplicationThread.descriptor); 1175 data.writeBundle(coreSettings); 1176 mRemote.transact(SET_CORE_SETTINGS_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1177 } 1178 1179 public void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) 1180 throws RemoteException { 1181 Parcel data = Parcel.obtain(); 1182 data.writeInterfaceToken(IApplicationThread.descriptor); 1183 data.writeString(pkg); 1184 info.writeToParcel(data, 0); 1185 mRemote.transact(UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION, data, null, 1186 IBinder.FLAG_ONEWAY); 1187 } 1188 1189 public void scheduleTrimMemory(int level) throws RemoteException { 1190 Parcel data = Parcel.obtain(); 1191 data.writeInterfaceToken(IApplicationThread.descriptor); 1192 data.writeInt(level); 1193 mRemote.transact(SCHEDULE_TRIM_MEMORY_TRANSACTION, data, null, 1194 IBinder.FLAG_ONEWAY); 1195 } 1196 1197 public Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean dumpInfo, 1198 boolean dumpDalvik, String[] args) throws RemoteException { 1199 Parcel data = Parcel.obtain(); 1200 Parcel reply = Parcel.obtain(); 1201 data.writeInterfaceToken(IApplicationThread.descriptor); 1202 data.writeFileDescriptor(fd); 1203 data.writeInt(checkin ? 1 : 0); 1204 data.writeInt(dumpInfo ? 1 : 0); 1205 data.writeInt(dumpDalvik ? 1 : 0); 1206 data.writeStringArray(args); 1207 mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0); 1208 reply.readException(); 1209 Debug.MemoryInfo info = new Debug.MemoryInfo(); 1210 info.readFromParcel(reply); 1211 data.recycle(); 1212 reply.recycle(); 1213 return info; 1214 } 1215 1216 public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException { 1217 Parcel data = Parcel.obtain(); 1218 data.writeInterfaceToken(IApplicationThread.descriptor); 1219 data.writeFileDescriptor(fd); 1220 data.writeStringArray(args); 1221 mRemote.transact(DUMP_GFX_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1222 data.recycle(); 1223 } 1224 1225 public void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException { 1226 Parcel data = Parcel.obtain(); 1227 data.writeInterfaceToken(IApplicationThread.descriptor); 1228 data.writeFileDescriptor(fd); 1229 data.writeStringArray(args); 1230 mRemote.transact(DUMP_DB_INFO_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1231 data.recycle(); 1232 } 1233 1234 @Override 1235 public void unstableProviderDied(IBinder provider) throws RemoteException { 1236 Parcel data = Parcel.obtain(); 1237 data.writeInterfaceToken(IApplicationThread.descriptor); 1238 data.writeStrongBinder(provider); 1239 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); 1240 data.recycle(); 1241 } 1242 1243 @Override 1244 public void requestActivityExtras(IBinder activityToken, IBinder requestToken, int requestType) 1245 throws RemoteException { 1246 Parcel data = Parcel.obtain(); 1247 data.writeInterfaceToken(IApplicationThread.descriptor); 1248 data.writeStrongBinder(activityToken); 1249 data.writeStrongBinder(requestToken); 1250 data.writeInt(requestType); 1251 mRemote.transact(REQUEST_ACTIVITY_EXTRAS_TRANSACTION, data, null, 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