ApplicationThreadNative.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
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.pm.ActivityInfo; 22import android.content.pm.ApplicationInfo; 23import android.content.pm.ProviderInfo; 24import android.content.pm.ServiceInfo; 25import android.content.res.Configuration; 26import android.os.Binder; 27import android.os.Bundle; 28import android.os.RemoteException; 29import android.os.IBinder; 30import android.os.Parcel; 31import android.os.ParcelFileDescriptor; 32 33import java.io.FileDescriptor; 34import java.io.IOException; 35import java.util.HashMap; 36import java.util.List; 37import java.util.Map; 38 39/** {@hide} */ 40public abstract class ApplicationThreadNative extends Binder 41 implements IApplicationThread { 42 /** 43 * Cast a Binder object into an application thread interface, generating 44 * a proxy if needed. 45 */ 46 static public IApplicationThread asInterface(IBinder obj) { 47 if (obj == null) { 48 return null; 49 } 50 IApplicationThread in = 51 (IApplicationThread)obj.queryLocalInterface(descriptor); 52 if (in != null) { 53 return in; 54 } 55 56 return new ApplicationThreadProxy(obj); 57 } 58 59 public ApplicationThreadNative() { 60 attachInterface(this, descriptor); 61 } 62 63 @Override 64 public boolean onTransact(int code, Parcel data, Parcel reply, int flags) 65 throws RemoteException { 66 switch (code) { 67 case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION: 68 { 69 data.enforceInterface(IApplicationThread.descriptor); 70 IBinder b = data.readStrongBinder(); 71 boolean finished = data.readInt() != 0; 72 boolean userLeaving = data.readInt() != 0; 73 int configChanges = data.readInt(); 74 schedulePauseActivity(b, finished, userLeaving, configChanges); 75 return true; 76 } 77 78 case SCHEDULE_STOP_ACTIVITY_TRANSACTION: 79 { 80 data.enforceInterface(IApplicationThread.descriptor); 81 IBinder b = data.readStrongBinder(); 82 boolean show = data.readInt() != 0; 83 int configChanges = data.readInt(); 84 scheduleStopActivity(b, show, configChanges); 85 return true; 86 } 87 88 case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION: 89 { 90 data.enforceInterface(IApplicationThread.descriptor); 91 IBinder b = data.readStrongBinder(); 92 boolean show = data.readInt() != 0; 93 scheduleWindowVisibility(b, show); 94 return true; 95 } 96 97 case SCHEDULE_RESUME_ACTIVITY_TRANSACTION: 98 { 99 data.enforceInterface(IApplicationThread.descriptor); 100 IBinder b = data.readStrongBinder(); 101 boolean isForward = data.readInt() != 0; 102 scheduleResumeActivity(b, isForward); 103 return true; 104 } 105 106 case SCHEDULE_SEND_RESULT_TRANSACTION: 107 { 108 data.enforceInterface(IApplicationThread.descriptor); 109 IBinder b = data.readStrongBinder(); 110 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); 111 scheduleSendResult(b, ri); 112 return true; 113 } 114 115 case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION: 116 { 117 data.enforceInterface(IApplicationThread.descriptor); 118 Intent intent = Intent.CREATOR.createFromParcel(data); 119 IBinder b = data.readStrongBinder(); 120 ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); 121 Bundle state = data.readBundle(); 122 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); 123 List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); 124 boolean notResumed = data.readInt() != 0; 125 boolean isForward = data.readInt() != 0; 126 scheduleLaunchActivity(intent, b, info, state, ri, pi, notResumed, isForward); 127 return true; 128 } 129 130 case SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION: 131 { 132 data.enforceInterface(IApplicationThread.descriptor); 133 IBinder b = data.readStrongBinder(); 134 List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR); 135 List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); 136 int configChanges = data.readInt(); 137 boolean notResumed = data.readInt() != 0; 138 scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed); 139 return true; 140 } 141 142 case SCHEDULE_NEW_INTENT_TRANSACTION: 143 { 144 data.enforceInterface(IApplicationThread.descriptor); 145 List<Intent> pi = data.createTypedArrayList(Intent.CREATOR); 146 IBinder b = data.readStrongBinder(); 147 scheduleNewIntent(pi, b); 148 return true; 149 } 150 151 case SCHEDULE_FINISH_ACTIVITY_TRANSACTION: 152 { 153 data.enforceInterface(IApplicationThread.descriptor); 154 IBinder b = data.readStrongBinder(); 155 boolean finishing = data.readInt() != 0; 156 int configChanges = data.readInt(); 157 scheduleDestroyActivity(b, finishing, configChanges); 158 return true; 159 } 160 161 case SCHEDULE_RECEIVER_TRANSACTION: 162 { 163 data.enforceInterface(IApplicationThread.descriptor); 164 Intent intent = Intent.CREATOR.createFromParcel(data); 165 ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data); 166 int resultCode = data.readInt(); 167 String resultData = data.readString(); 168 Bundle resultExtras = data.readBundle(); 169 boolean sync = data.readInt() != 0; 170 scheduleReceiver(intent, info, resultCode, resultData, 171 resultExtras, sync); 172 return true; 173 } 174 175 case SCHEDULE_CREATE_SERVICE_TRANSACTION: { 176 data.enforceInterface(IApplicationThread.descriptor); 177 IBinder token = data.readStrongBinder(); 178 ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data); 179 scheduleCreateService(token, info); 180 return true; 181 } 182 183 case SCHEDULE_BIND_SERVICE_TRANSACTION: { 184 data.enforceInterface(IApplicationThread.descriptor); 185 IBinder token = data.readStrongBinder(); 186 Intent intent = Intent.CREATOR.createFromParcel(data); 187 boolean rebind = data.readInt() != 0; 188 scheduleBindService(token, intent, rebind); 189 return true; 190 } 191 192 case SCHEDULE_UNBIND_SERVICE_TRANSACTION: { 193 data.enforceInterface(IApplicationThread.descriptor); 194 IBinder token = data.readStrongBinder(); 195 Intent intent = Intent.CREATOR.createFromParcel(data); 196 scheduleUnbindService(token, intent); 197 return true; 198 } 199 200 case SCHEDULE_SERVICE_ARGS_TRANSACTION: 201 { 202 data.enforceInterface(IApplicationThread.descriptor); 203 IBinder token = data.readStrongBinder(); 204 int startId = data.readInt(); 205 Intent args = Intent.CREATOR.createFromParcel(data); 206 scheduleServiceArgs(token, startId, args); 207 return true; 208 } 209 210 case SCHEDULE_STOP_SERVICE_TRANSACTION: 211 { 212 data.enforceInterface(IApplicationThread.descriptor); 213 IBinder token = data.readStrongBinder(); 214 scheduleStopService(token); 215 return true; 216 } 217 218 case BIND_APPLICATION_TRANSACTION: 219 { 220 data.enforceInterface(IApplicationThread.descriptor); 221 String packageName = data.readString(); 222 ApplicationInfo info = 223 ApplicationInfo.CREATOR.createFromParcel(data); 224 List<ProviderInfo> providers = 225 data.createTypedArrayList(ProviderInfo.CREATOR); 226 ComponentName testName = (data.readInt() != 0) 227 ? new ComponentName(data) : null; 228 String profileName = data.readString(); 229 Bundle testArgs = data.readBundle(); 230 IBinder binder = data.readStrongBinder(); 231 IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder); 232 int testMode = data.readInt(); 233 Configuration config = Configuration.CREATOR.createFromParcel(data); 234 HashMap<String, IBinder> services = data.readHashMap(null); 235 bindApplication(packageName, info, 236 providers, testName, profileName, 237 testArgs, testWatcher, testMode, config, services); 238 return true; 239 } 240 241 case SCHEDULE_EXIT_TRANSACTION: 242 { 243 data.enforceInterface(IApplicationThread.descriptor); 244 scheduleExit(); 245 return true; 246 } 247 248 case REQUEST_THUMBNAIL_TRANSACTION: 249 { 250 data.enforceInterface(IApplicationThread.descriptor); 251 IBinder b = data.readStrongBinder(); 252 requestThumbnail(b); 253 return true; 254 } 255 256 case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION: 257 { 258 data.enforceInterface(IApplicationThread.descriptor); 259 Configuration config = Configuration.CREATOR.createFromParcel(data); 260 scheduleConfigurationChanged(config); 261 return true; 262 } 263 264 case UPDATE_TIME_ZONE_TRANSACTION: { 265 data.enforceInterface(IApplicationThread.descriptor); 266 updateTimeZone(); 267 return true; 268 } 269 270 case PROCESS_IN_BACKGROUND_TRANSACTION: { 271 data.enforceInterface(IApplicationThread.descriptor); 272 processInBackground(); 273 return true; 274 } 275 276 case DUMP_SERVICE_TRANSACTION: { 277 data.enforceInterface(IApplicationThread.descriptor); 278 ParcelFileDescriptor fd = data.readFileDescriptor(); 279 final IBinder service = data.readStrongBinder(); 280 final String[] args = data.readStringArray(); 281 if (fd != null) { 282 dumpService(fd.getFileDescriptor(), service, args); 283 try { 284 fd.close(); 285 } catch (IOException e) { 286 } 287 } 288 return true; 289 } 290 291 case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: { 292 data.enforceInterface(IApplicationThread.descriptor); 293 IIntentReceiver receiver = IIntentReceiver.Stub.asInterface( 294 data.readStrongBinder()); 295 Intent intent = Intent.CREATOR.createFromParcel(data); 296 int resultCode = data.readInt(); 297 String dataStr = data.readString(); 298 Bundle extras = data.readBundle(); 299 boolean ordered = data.readInt() != 0; 300 scheduleRegisteredReceiver(receiver, intent, 301 resultCode, dataStr, extras, ordered); 302 return true; 303 } 304 305 case SCHEDULE_LOW_MEMORY_TRANSACTION: 306 { 307 scheduleLowMemory(); 308 return true; 309 } 310 311 case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION: 312 { 313 data.enforceInterface(IApplicationThread.descriptor); 314 IBinder b = data.readStrongBinder(); 315 scheduleActivityConfigurationChanged(b); 316 return true; 317 } 318 319 case REQUEST_PSS_TRANSACTION: 320 { 321 data.enforceInterface(IApplicationThread.descriptor); 322 requestPss(); 323 return true; 324 } 325 } 326 327 return super.onTransact(code, data, reply, flags); 328 } 329 330 public IBinder asBinder() 331 { 332 return this; 333 } 334} 335 336class ApplicationThreadProxy implements IApplicationThread { 337 private final IBinder mRemote; 338 339 public ApplicationThreadProxy(IBinder remote) { 340 mRemote = remote; 341 } 342 343 public final IBinder asBinder() { 344 return mRemote; 345 } 346 347 public final void schedulePauseActivity(IBinder token, boolean finished, 348 boolean userLeaving, int configChanges) throws RemoteException { 349 Parcel data = Parcel.obtain(); 350 data.writeInterfaceToken(IApplicationThread.descriptor); 351 data.writeStrongBinder(token); 352 data.writeInt(finished ? 1 : 0); 353 data.writeInt(userLeaving ? 1 :0); 354 data.writeInt(configChanges); 355 mRemote.transact(SCHEDULE_PAUSE_ACTIVITY_TRANSACTION, data, null, 356 IBinder.FLAG_ONEWAY); 357 data.recycle(); 358 } 359 360 public final void scheduleStopActivity(IBinder token, boolean showWindow, 361 int configChanges) throws RemoteException { 362 Parcel data = Parcel.obtain(); 363 data.writeInterfaceToken(IApplicationThread.descriptor); 364 data.writeStrongBinder(token); 365 data.writeInt(showWindow ? 1 : 0); 366 data.writeInt(configChanges); 367 mRemote.transact(SCHEDULE_STOP_ACTIVITY_TRANSACTION, data, null, 368 IBinder.FLAG_ONEWAY); 369 data.recycle(); 370 } 371 372 public final void scheduleWindowVisibility(IBinder token, 373 boolean showWindow) throws RemoteException { 374 Parcel data = Parcel.obtain(); 375 data.writeInterfaceToken(IApplicationThread.descriptor); 376 data.writeStrongBinder(token); 377 data.writeInt(showWindow ? 1 : 0); 378 mRemote.transact(SCHEDULE_WINDOW_VISIBILITY_TRANSACTION, data, null, 379 IBinder.FLAG_ONEWAY); 380 data.recycle(); 381 } 382 383 public final void scheduleResumeActivity(IBinder token, boolean isForward) 384 throws RemoteException { 385 Parcel data = Parcel.obtain(); 386 data.writeInterfaceToken(IApplicationThread.descriptor); 387 data.writeStrongBinder(token); 388 data.writeInt(isForward ? 1 : 0); 389 mRemote.transact(SCHEDULE_RESUME_ACTIVITY_TRANSACTION, data, null, 390 IBinder.FLAG_ONEWAY); 391 data.recycle(); 392 } 393 394 public final void scheduleSendResult(IBinder token, List<ResultInfo> results) 395 throws RemoteException { 396 Parcel data = Parcel.obtain(); 397 data.writeInterfaceToken(IApplicationThread.descriptor); 398 data.writeStrongBinder(token); 399 data.writeTypedList(results); 400 mRemote.transact(SCHEDULE_SEND_RESULT_TRANSACTION, data, null, 401 IBinder.FLAG_ONEWAY); 402 data.recycle(); 403 } 404 405 public final void scheduleLaunchActivity(Intent intent, IBinder token, 406 ActivityInfo info, Bundle state, List<ResultInfo> pendingResults, 407 List<Intent> pendingNewIntents, boolean notResumed, boolean isForward) 408 throws RemoteException { 409 Parcel data = Parcel.obtain(); 410 data.writeInterfaceToken(IApplicationThread.descriptor); 411 intent.writeToParcel(data, 0); 412 data.writeStrongBinder(token); 413 info.writeToParcel(data, 0); 414 data.writeBundle(state); 415 data.writeTypedList(pendingResults); 416 data.writeTypedList(pendingNewIntents); 417 data.writeInt(notResumed ? 1 : 0); 418 data.writeInt(isForward ? 1 : 0); 419 mRemote.transact(SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION, data, null, 420 IBinder.FLAG_ONEWAY); 421 data.recycle(); 422 } 423 424 public final void scheduleRelaunchActivity(IBinder token, 425 List<ResultInfo> pendingResults, List<Intent> pendingNewIntents, 426 int configChanges, boolean notResumed) throws RemoteException { 427 Parcel data = Parcel.obtain(); 428 data.writeInterfaceToken(IApplicationThread.descriptor); 429 data.writeStrongBinder(token); 430 data.writeTypedList(pendingResults); 431 data.writeTypedList(pendingNewIntents); 432 data.writeInt(configChanges); 433 data.writeInt(notResumed ? 1 : 0); 434 mRemote.transact(SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION, data, null, 435 IBinder.FLAG_ONEWAY); 436 data.recycle(); 437 } 438 439 public void scheduleNewIntent(List<Intent> intents, IBinder token) 440 throws RemoteException { 441 Parcel data = Parcel.obtain(); 442 data.writeInterfaceToken(IApplicationThread.descriptor); 443 data.writeTypedList(intents); 444 data.writeStrongBinder(token); 445 mRemote.transact(SCHEDULE_NEW_INTENT_TRANSACTION, data, null, 446 IBinder.FLAG_ONEWAY); 447 data.recycle(); 448 } 449 450 public final void scheduleDestroyActivity(IBinder token, boolean finishing, 451 int configChanges) throws RemoteException { 452 Parcel data = Parcel.obtain(); 453 data.writeInterfaceToken(IApplicationThread.descriptor); 454 data.writeStrongBinder(token); 455 data.writeInt(finishing ? 1 : 0); 456 data.writeInt(configChanges); 457 mRemote.transact(SCHEDULE_FINISH_ACTIVITY_TRANSACTION, data, null, 458 IBinder.FLAG_ONEWAY); 459 data.recycle(); 460 } 461 462 public final void scheduleReceiver(Intent intent, ActivityInfo info, 463 int resultCode, String resultData, 464 Bundle map, boolean sync) throws RemoteException { 465 Parcel data = Parcel.obtain(); 466 data.writeInterfaceToken(IApplicationThread.descriptor); 467 intent.writeToParcel(data, 0); 468 info.writeToParcel(data, 0); 469 data.writeInt(resultCode); 470 data.writeString(resultData); 471 data.writeBundle(map); 472 data.writeInt(sync ? 1 : 0); 473 mRemote.transact(SCHEDULE_RECEIVER_TRANSACTION, data, null, 474 IBinder.FLAG_ONEWAY); 475 data.recycle(); 476 } 477 478 public final void scheduleCreateService(IBinder token, ServiceInfo info) 479 throws RemoteException { 480 Parcel data = Parcel.obtain(); 481 data.writeInterfaceToken(IApplicationThread.descriptor); 482 data.writeStrongBinder(token); 483 info.writeToParcel(data, 0); 484 mRemote.transact(SCHEDULE_CREATE_SERVICE_TRANSACTION, data, null, 485 IBinder.FLAG_ONEWAY); 486 data.recycle(); 487 } 488 489 public final void scheduleBindService(IBinder token, Intent intent, boolean rebind) 490 throws RemoteException { 491 Parcel data = Parcel.obtain(); 492 data.writeInterfaceToken(IApplicationThread.descriptor); 493 data.writeStrongBinder(token); 494 intent.writeToParcel(data, 0); 495 data.writeInt(rebind ? 1 : 0); 496 mRemote.transact(SCHEDULE_BIND_SERVICE_TRANSACTION, data, null, 497 IBinder.FLAG_ONEWAY); 498 data.recycle(); 499 } 500 501 public final void scheduleUnbindService(IBinder token, Intent intent) 502 throws RemoteException { 503 Parcel data = Parcel.obtain(); 504 data.writeInterfaceToken(IApplicationThread.descriptor); 505 data.writeStrongBinder(token); 506 intent.writeToParcel(data, 0); 507 mRemote.transact(SCHEDULE_UNBIND_SERVICE_TRANSACTION, data, null, 508 IBinder.FLAG_ONEWAY); 509 data.recycle(); 510 } 511 512 public final void scheduleServiceArgs(IBinder token, int startId, 513 Intent args) throws RemoteException { 514 Parcel data = Parcel.obtain(); 515 data.writeInterfaceToken(IApplicationThread.descriptor); 516 data.writeStrongBinder(token); 517 data.writeInt(startId); 518 args.writeToParcel(data, 0); 519 mRemote.transact(SCHEDULE_SERVICE_ARGS_TRANSACTION, data, null, 520 IBinder.FLAG_ONEWAY); 521 data.recycle(); 522 } 523 524 public final void scheduleStopService(IBinder token) 525 throws RemoteException { 526 Parcel data = Parcel.obtain(); 527 data.writeInterfaceToken(IApplicationThread.descriptor); 528 data.writeStrongBinder(token); 529 mRemote.transact(SCHEDULE_STOP_SERVICE_TRANSACTION, data, null, 530 IBinder.FLAG_ONEWAY); 531 data.recycle(); 532 } 533 534 public final void bindApplication(String packageName, ApplicationInfo info, 535 List<ProviderInfo> providers, ComponentName testName, 536 String profileName, Bundle testArgs, IInstrumentationWatcher testWatcher, int debugMode, 537 Configuration config, Map<String, IBinder> services) throws RemoteException { 538 Parcel data = Parcel.obtain(); 539 data.writeInterfaceToken(IApplicationThread.descriptor); 540 data.writeString(packageName); 541 info.writeToParcel(data, 0); 542 data.writeTypedList(providers); 543 if (testName == null) { 544 data.writeInt(0); 545 } else { 546 data.writeInt(1); 547 testName.writeToParcel(data, 0); 548 } 549 data.writeString(profileName); 550 data.writeBundle(testArgs); 551 data.writeStrongInterface(testWatcher); 552 data.writeInt(debugMode); 553 config.writeToParcel(data, 0); 554 data.writeMap(services); 555 mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null, 556 IBinder.FLAG_ONEWAY); 557 data.recycle(); 558 } 559 560 public final void scheduleExit() throws RemoteException { 561 Parcel data = Parcel.obtain(); 562 data.writeInterfaceToken(IApplicationThread.descriptor); 563 mRemote.transact(SCHEDULE_EXIT_TRANSACTION, data, null, 564 IBinder.FLAG_ONEWAY); 565 data.recycle(); 566 } 567 568 public final void requestThumbnail(IBinder token) 569 throws RemoteException { 570 Parcel data = Parcel.obtain(); 571 data.writeInterfaceToken(IApplicationThread.descriptor); 572 data.writeStrongBinder(token); 573 mRemote.transact(REQUEST_THUMBNAIL_TRANSACTION, data, null, 574 IBinder.FLAG_ONEWAY); 575 data.recycle(); 576 } 577 578 public final void scheduleConfigurationChanged(Configuration config) 579 throws RemoteException { 580 Parcel data = Parcel.obtain(); 581 data.writeInterfaceToken(IApplicationThread.descriptor); 582 config.writeToParcel(data, 0); 583 mRemote.transact(SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION, data, null, 584 IBinder.FLAG_ONEWAY); 585 data.recycle(); 586 } 587 588 public void updateTimeZone() throws RemoteException { 589 Parcel data = Parcel.obtain(); 590 data.writeInterfaceToken(IApplicationThread.descriptor); 591 mRemote.transact(UPDATE_TIME_ZONE_TRANSACTION, data, null, 592 IBinder.FLAG_ONEWAY); 593 data.recycle(); 594 } 595 596 public void processInBackground() throws RemoteException { 597 Parcel data = Parcel.obtain(); 598 data.writeInterfaceToken(IApplicationThread.descriptor); 599 mRemote.transact(PROCESS_IN_BACKGROUND_TRANSACTION, data, null, 600 IBinder.FLAG_ONEWAY); 601 data.recycle(); 602 } 603 604 public void dumpService(FileDescriptor fd, IBinder token, String[] args) 605 throws RemoteException { 606 Parcel data = Parcel.obtain(); 607 data.writeInterfaceToken(IApplicationThread.descriptor); 608 data.writeFileDescriptor(fd); 609 data.writeStrongBinder(token); 610 data.writeStringArray(args); 611 mRemote.transact(DUMP_SERVICE_TRANSACTION, data, null, 0); 612 data.recycle(); 613 } 614 615 public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, 616 int resultCode, String dataStr, Bundle extras, boolean ordered) 617 throws RemoteException { 618 Parcel data = Parcel.obtain(); 619 data.writeInterfaceToken(IApplicationThread.descriptor); 620 data.writeStrongBinder(receiver.asBinder()); 621 intent.writeToParcel(data, 0); 622 data.writeInt(resultCode); 623 data.writeString(dataStr); 624 data.writeBundle(extras); 625 data.writeInt(ordered ? 1 : 0); 626 mRemote.transact(SCHEDULE_REGISTERED_RECEIVER_TRANSACTION, data, null, 627 IBinder.FLAG_ONEWAY); 628 data.recycle(); 629 } 630 631 public final void scheduleLowMemory() throws RemoteException { 632 Parcel data = Parcel.obtain(); 633 data.writeInterfaceToken(IApplicationThread.descriptor); 634 mRemote.transact(SCHEDULE_LOW_MEMORY_TRANSACTION, data, null, 635 IBinder.FLAG_ONEWAY); 636 data.recycle(); 637 } 638 639 public final void scheduleActivityConfigurationChanged( 640 IBinder token) throws RemoteException { 641 Parcel data = Parcel.obtain(); 642 data.writeInterfaceToken(IApplicationThread.descriptor); 643 data.writeStrongBinder(token); 644 mRemote.transact(SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION, data, null, 645 IBinder.FLAG_ONEWAY); 646 data.recycle(); 647 } 648 649 public final void requestPss() throws RemoteException { 650 Parcel data = Parcel.obtain(); 651 data.writeInterfaceToken(IApplicationThread.descriptor); 652 mRemote.transact(REQUEST_PSS_TRANSACTION, data, null, 653 IBinder.FLAG_ONEWAY); 654 data.recycle(); 655 } 656 657} 658 659