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