1 /* 2 * Copyright (C) 2020 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 17 package android.window; 18 19 import static android.view.WindowManager.transitTypeToString; 20 21 import android.annotation.Nullable; 22 import android.app.ActivityManager; 23 import android.app.WindowConfiguration; 24 import android.graphics.Rect; 25 import android.os.Parcelable; 26 import android.view.WindowManager; 27 28 import com.android.internal.util.DataClass; 29 30 /** 31 * Used to communicate information about what is changing during a transition to a TransitionPlayer. 32 * @hide 33 */ 34 @DataClass(genToString = true, genSetters = true, genAidl = true) 35 public final class TransitionRequestInfo implements Parcelable { 36 37 /** The type of the transition being requested. */ 38 private final @WindowManager.TransitionType int mType; 39 40 /** 41 * If non-null, the task containing the activity whose lifecycle change (start or 42 * finish) has caused this transition to occur. 43 */ 44 private @Nullable ActivityManager.RunningTaskInfo mTriggerTask; 45 46 /** 47 * If non-null, this request might lead to a PiP transition; {@code PipChange} caches both 48 * {@code TaskFragment} token and the {@code TaskInfo} of the task with PiP candidate activity. 49 */ 50 private @Nullable TransitionRequestInfo.PipChange mPipChange; 51 52 /** If non-null, a remote-transition associated with the source of this transition. */ 53 private @Nullable RemoteTransition mRemoteTransition; 54 55 /** 56 * If non-null, this request was triggered by this display change. This will not be complete: 57 * The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds 58 * (if size is changing). 59 */ 60 private @Nullable TransitionRequestInfo.DisplayChange mDisplayChange; 61 62 /** The transition flags known at the time of the request. These may not be complete. */ 63 private final int mFlags; 64 65 /** This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! */ 66 private final int mDebugId; 67 68 /** constructor override */ TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition)69 public TransitionRequestInfo( 70 @WindowManager.TransitionType int type, 71 @Nullable ActivityManager.RunningTaskInfo triggerTask, 72 @Nullable RemoteTransition remoteTransition) { 73 this(type, triggerTask, null /* pipChange */, 74 remoteTransition, null /* displayChange */, 0 /* flags */, -1 /* debugId */); 75 } 76 77 /** constructor override */ TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition, int flags)78 public TransitionRequestInfo( 79 @WindowManager.TransitionType int type, 80 @Nullable ActivityManager.RunningTaskInfo triggerTask, 81 @Nullable RemoteTransition remoteTransition, 82 int flags) { 83 this(type, triggerTask, null /* pipChange */, 84 remoteTransition, null /* displayChange */, flags, -1 /* debugId */); 85 } 86 87 /** constructor override */ TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags)88 public TransitionRequestInfo( 89 @WindowManager.TransitionType int type, 90 @Nullable ActivityManager.RunningTaskInfo triggerTask, 91 @Nullable RemoteTransition remoteTransition, 92 @Nullable TransitionRequestInfo.DisplayChange displayChange, 93 int flags) { 94 this(type, triggerTask, null /* pipChange */, remoteTransition, displayChange, flags, 95 -1 /* debugId */); 96 } 97 98 /** constructor override */ TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable ActivityManager.RunningTaskInfo pipTask, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags)99 public TransitionRequestInfo( 100 @WindowManager.TransitionType int type, 101 @Nullable ActivityManager.RunningTaskInfo triggerTask, 102 @Nullable ActivityManager.RunningTaskInfo pipTask, 103 @Nullable RemoteTransition remoteTransition, 104 @Nullable TransitionRequestInfo.DisplayChange displayChange, 105 int flags) { 106 this(type, triggerTask, 107 pipTask != null ? new TransitionRequestInfo.PipChange(pipTask) : null, 108 remoteTransition, displayChange, flags, -1 /* debugId */); 109 } 110 111 /** @hide */ typeToString()112 String typeToString() { 113 return transitTypeToString(mType); 114 } 115 116 /** Requested change to a display. */ 117 @DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false) 118 public static final class DisplayChange implements Parcelable { 119 private final int mDisplayId; 120 121 // If non-null, these bounds changes should ignore any potential rotation changes. 122 @Nullable private Rect mStartAbsBounds = null; 123 @Nullable private Rect mEndAbsBounds = null; 124 125 private int mStartRotation = WindowConfiguration.ROTATION_UNDEFINED; 126 private int mEndRotation = WindowConfiguration.ROTATION_UNDEFINED; 127 private boolean mPhysicalDisplayChanged = false; 128 129 /** Create empty display-change. */ DisplayChange(int displayId)130 public DisplayChange(int displayId) { 131 mDisplayId = displayId; 132 } 133 134 /** Create a display-change representing a rotation. */ DisplayChange(int displayId, int startRotation, int endRotation)135 public DisplayChange(int displayId, int startRotation, int endRotation) { 136 mDisplayId = displayId; 137 mStartRotation = startRotation; 138 mEndRotation = endRotation; 139 } 140 141 142 143 // Code below generated by codegen v1.0.23. 144 // 145 // DO NOT MODIFY! 146 // CHECKSTYLE:OFF Generated code 147 // 148 // To regenerate run: 149 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/window/TransitionRequestInfo.java 150 // 151 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 152 // Settings > Editor > Code Style > Formatter Control 153 //@formatter:off 154 155 156 @DataClass.Generated.Member getDisplayId()157 public int getDisplayId() { 158 return mDisplayId; 159 } 160 161 @DataClass.Generated.Member getStartAbsBounds()162 public @Nullable Rect getStartAbsBounds() { 163 return mStartAbsBounds; 164 } 165 166 @DataClass.Generated.Member getEndAbsBounds()167 public @Nullable Rect getEndAbsBounds() { 168 return mEndAbsBounds; 169 } 170 171 @DataClass.Generated.Member getStartRotation()172 public int getStartRotation() { 173 return mStartRotation; 174 } 175 176 @DataClass.Generated.Member getEndRotation()177 public int getEndRotation() { 178 return mEndRotation; 179 } 180 181 @DataClass.Generated.Member isPhysicalDisplayChanged()182 public boolean isPhysicalDisplayChanged() { 183 return mPhysicalDisplayChanged; 184 } 185 186 @DataClass.Generated.Member setStartAbsBounds(@ndroid.annotation.NonNull Rect value)187 public @android.annotation.NonNull DisplayChange setStartAbsBounds(@android.annotation.NonNull Rect value) { 188 mStartAbsBounds = value; 189 return this; 190 } 191 192 @DataClass.Generated.Member setEndAbsBounds(@ndroid.annotation.NonNull Rect value)193 public @android.annotation.NonNull DisplayChange setEndAbsBounds(@android.annotation.NonNull Rect value) { 194 mEndAbsBounds = value; 195 return this; 196 } 197 198 @DataClass.Generated.Member setStartRotation( int value)199 public @android.annotation.NonNull DisplayChange setStartRotation( int value) { 200 mStartRotation = value; 201 return this; 202 } 203 204 @DataClass.Generated.Member setEndRotation( int value)205 public @android.annotation.NonNull DisplayChange setEndRotation( int value) { 206 mEndRotation = value; 207 return this; 208 } 209 210 @DataClass.Generated.Member setPhysicalDisplayChanged( boolean value)211 public @android.annotation.NonNull DisplayChange setPhysicalDisplayChanged( boolean value) { 212 mPhysicalDisplayChanged = value; 213 return this; 214 } 215 216 @Override 217 @DataClass.Generated.Member toString()218 public String toString() { 219 // You can override field toString logic by defining methods like: 220 // String fieldNameToString() { ... } 221 222 return "DisplayChange { " + 223 "displayId = " + mDisplayId + ", " + 224 "startAbsBounds = " + mStartAbsBounds + ", " + 225 "endAbsBounds = " + mEndAbsBounds + ", " + 226 "startRotation = " + mStartRotation + ", " + 227 "endRotation = " + mEndRotation + ", " + 228 "physicalDisplayChanged = " + mPhysicalDisplayChanged + 229 " }"; 230 } 231 232 @Override 233 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)234 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 235 // You can override field parcelling by defining methods like: 236 // void parcelFieldName(Parcel dest, int flags) { ... } 237 238 byte flg = 0; 239 if (mPhysicalDisplayChanged) flg |= 0x20; 240 if (mStartAbsBounds != null) flg |= 0x2; 241 if (mEndAbsBounds != null) flg |= 0x4; 242 dest.writeByte(flg); 243 dest.writeInt(mDisplayId); 244 if (mStartAbsBounds != null) dest.writeTypedObject(mStartAbsBounds, flags); 245 if (mEndAbsBounds != null) dest.writeTypedObject(mEndAbsBounds, flags); 246 dest.writeInt(mStartRotation); 247 dest.writeInt(mEndRotation); 248 } 249 250 @Override 251 @DataClass.Generated.Member describeContents()252 public int describeContents() { return 0; } 253 254 /** @hide */ 255 @SuppressWarnings({"unchecked", "RedundantCast"}) 256 @DataClass.Generated.Member DisplayChange(@ndroid.annotation.NonNull android.os.Parcel in)257 /* package-private */ DisplayChange(@android.annotation.NonNull android.os.Parcel in) { 258 // You can override field unparcelling by defining methods like: 259 // static FieldType unparcelFieldName(Parcel in) { ... } 260 261 byte flg = in.readByte(); 262 boolean physicalDisplayChanged = (flg & 0x20) != 0; 263 int displayId = in.readInt(); 264 Rect startAbsBounds = (flg & 0x2) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR); 265 Rect endAbsBounds = (flg & 0x4) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR); 266 int startRotation = in.readInt(); 267 int endRotation = in.readInt(); 268 269 this.mDisplayId = displayId; 270 this.mStartAbsBounds = startAbsBounds; 271 this.mEndAbsBounds = endAbsBounds; 272 this.mStartRotation = startRotation; 273 this.mEndRotation = endRotation; 274 this.mPhysicalDisplayChanged = physicalDisplayChanged; 275 276 // onConstructed(); // You can define this method to get a callback 277 } 278 279 @DataClass.Generated.Member 280 public static final @android.annotation.NonNull Parcelable.Creator<DisplayChange> CREATOR 281 = new Parcelable.Creator<DisplayChange>() { 282 @Override 283 public DisplayChange[] newArray(int size) { 284 return new DisplayChange[size]; 285 } 286 287 @Override 288 public DisplayChange createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 289 return new DisplayChange(in); 290 } 291 }; 292 293 @DataClass.Generated( 294 time = 1733334462577L, 295 codegenVersion = "1.0.23", 296 sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", 297 inputSignatures = "private final int mDisplayId\nprivate @android.annotation.Nullable android.graphics.Rect mStartAbsBounds\nprivate @android.annotation.Nullable android.graphics.Rect mEndAbsBounds\nprivate int mStartRotation\nprivate int mEndRotation\nprivate boolean mPhysicalDisplayChanged\nclass DisplayChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)") 298 @Deprecated __metadata()299 private void __metadata() {} 300 301 302 //@formatter:on 303 // End of generated code 304 305 } 306 307 @DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false) 308 public static final class PipChange implements Parcelable { 309 // In AE case, we might care about the TF token instead of the task token. 310 @android.annotation.NonNull 311 private WindowContainerToken mTaskFragmentToken; 312 313 @android.annotation.NonNull 314 private ActivityManager.RunningTaskInfo mTaskInfo; 315 316 /** Create empty display-change. */ PipChange(ActivityManager.RunningTaskInfo taskInfo)317 public PipChange(ActivityManager.RunningTaskInfo taskInfo) { 318 mTaskFragmentToken = taskInfo.token; 319 mTaskInfo = taskInfo; 320 } 321 322 /** Create a display-change representing a rotation. */ PipChange(WindowContainerToken taskFragmentToken, ActivityManager.RunningTaskInfo taskInfo)323 public PipChange(WindowContainerToken taskFragmentToken, 324 ActivityManager.RunningTaskInfo taskInfo) { 325 mTaskFragmentToken = taskFragmentToken; 326 mTaskInfo = taskInfo; 327 } 328 329 330 331 // Code below generated by codegen v1.0.23. 332 // 333 // DO NOT MODIFY! 334 // CHECKSTYLE:OFF Generated code 335 // 336 // To regenerate run: 337 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/window/TransitionRequestInfo.java 338 // 339 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 340 // Settings > Editor > Code Style > Formatter Control 341 //@formatter:off 342 343 344 @DataClass.Generated.Member getTaskFragmentToken()345 public @android.annotation.NonNull WindowContainerToken getTaskFragmentToken() { 346 return mTaskFragmentToken; 347 } 348 349 @DataClass.Generated.Member getTaskInfo()350 public @android.annotation.NonNull ActivityManager.RunningTaskInfo getTaskInfo() { 351 return mTaskInfo; 352 } 353 354 @DataClass.Generated.Member setTaskFragmentToken(@ndroid.annotation.NonNull WindowContainerToken value)355 public @android.annotation.NonNull PipChange setTaskFragmentToken(@android.annotation.NonNull WindowContainerToken value) { 356 mTaskFragmentToken = value; 357 com.android.internal.util.AnnotationValidations.validate( 358 android.annotation.NonNull.class, null, mTaskFragmentToken); 359 return this; 360 } 361 362 @DataClass.Generated.Member setTaskInfo(@ndroid.annotation.NonNull ActivityManager.RunningTaskInfo value)363 public @android.annotation.NonNull PipChange setTaskInfo(@android.annotation.NonNull ActivityManager.RunningTaskInfo value) { 364 mTaskInfo = value; 365 com.android.internal.util.AnnotationValidations.validate( 366 android.annotation.NonNull.class, null, mTaskInfo); 367 return this; 368 } 369 370 @Override 371 @DataClass.Generated.Member toString()372 public String toString() { 373 // You can override field toString logic by defining methods like: 374 // String fieldNameToString() { ... } 375 376 return "PipChange { " + 377 "taskFragmentToken = " + mTaskFragmentToken + ", " + 378 "taskInfo = " + mTaskInfo + 379 " }"; 380 } 381 382 @Override 383 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)384 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 385 // You can override field parcelling by defining methods like: 386 // void parcelFieldName(Parcel dest, int flags) { ... } 387 388 dest.writeTypedObject(mTaskFragmentToken, flags); 389 dest.writeTypedObject(mTaskInfo, flags); 390 } 391 392 @Override 393 @DataClass.Generated.Member describeContents()394 public int describeContents() { return 0; } 395 396 /** @hide */ 397 @SuppressWarnings({"unchecked", "RedundantCast"}) 398 @DataClass.Generated.Member PipChange(@ndroid.annotation.NonNull android.os.Parcel in)399 /* package-private */ PipChange(@android.annotation.NonNull android.os.Parcel in) { 400 // You can override field unparcelling by defining methods like: 401 // static FieldType unparcelFieldName(Parcel in) { ... } 402 403 WindowContainerToken taskFragmentToken = (WindowContainerToken) in.readTypedObject(WindowContainerToken.CREATOR); 404 ActivityManager.RunningTaskInfo taskInfo = (ActivityManager.RunningTaskInfo) in.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR); 405 406 this.mTaskFragmentToken = taskFragmentToken; 407 com.android.internal.util.AnnotationValidations.validate( 408 android.annotation.NonNull.class, null, mTaskFragmentToken); 409 this.mTaskInfo = taskInfo; 410 com.android.internal.util.AnnotationValidations.validate( 411 android.annotation.NonNull.class, null, mTaskInfo); 412 413 // onConstructed(); // You can define this method to get a callback 414 } 415 416 @DataClass.Generated.Member 417 public static final @android.annotation.NonNull Parcelable.Creator<PipChange> CREATOR 418 = new Parcelable.Creator<PipChange>() { 419 @Override 420 public PipChange[] newArray(int size) { 421 return new PipChange[size]; 422 } 423 424 @Override 425 public PipChange createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 426 return new PipChange(in); 427 } 428 }; 429 430 @DataClass.Generated( 431 time = 1733334462588L, 432 codegenVersion = "1.0.23", 433 sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", 434 inputSignatures = "private @android.annotation.NonNull android.window.WindowContainerToken mTaskFragmentToken\nprivate @android.annotation.NonNull android.app.ActivityManager.RunningTaskInfo mTaskInfo\nclass PipChange extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genBuilder=false, genConstructor=false)") 435 @Deprecated __metadata()436 private void __metadata() {} 437 438 439 //@formatter:on 440 // End of generated code 441 442 } 443 444 445 446 447 // Code below generated by codegen v1.0.23. 448 // 449 // DO NOT MODIFY! 450 // CHECKSTYLE:OFF Generated code 451 // 452 // To regenerate run: 453 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/window/TransitionRequestInfo.java 454 // 455 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 456 // Settings > Editor > Code Style > Formatter Control 457 //@formatter:off 458 459 460 /** 461 * Creates a new TransitionRequestInfo. 462 * 463 * @param type 464 * The type of the transition being requested. 465 * @param triggerTask 466 * If non-null, the task containing the activity whose lifecycle change (start or 467 * finish) has caused this transition to occur. 468 * @param pipChange 469 * If non-null, this request might lead to a PiP transition; {@code PipChange} caches both 470 * {@code TaskFragment} token and the {@code TaskInfo} of the task with PiP candidate activity. 471 * @param remoteTransition 472 * If non-null, a remote-transition associated with the source of this transition. 473 * @param displayChange 474 * If non-null, this request was triggered by this display change. This will not be complete: 475 * The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds 476 * (if size is changing). 477 * @param flags 478 * The transition flags known at the time of the request. These may not be complete. 479 * @param debugId 480 * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! 481 */ 482 @DataClass.Generated.Member TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable TransitionRequestInfo.PipChange pipChange, @Nullable RemoteTransition remoteTransition, @Nullable TransitionRequestInfo.DisplayChange displayChange, int flags, int debugId)483 public TransitionRequestInfo( 484 @WindowManager.TransitionType int type, 485 @Nullable ActivityManager.RunningTaskInfo triggerTask, 486 @Nullable TransitionRequestInfo.PipChange pipChange, 487 @Nullable RemoteTransition remoteTransition, 488 @Nullable TransitionRequestInfo.DisplayChange displayChange, 489 int flags, 490 int debugId) { 491 this.mType = type; 492 com.android.internal.util.AnnotationValidations.validate( 493 WindowManager.TransitionType.class, null, mType); 494 this.mTriggerTask = triggerTask; 495 this.mPipChange = pipChange; 496 this.mRemoteTransition = remoteTransition; 497 this.mDisplayChange = displayChange; 498 this.mFlags = flags; 499 this.mDebugId = debugId; 500 501 // onConstructed(); // You can define this method to get a callback 502 } 503 504 /** 505 * The type of the transition being requested. 506 */ 507 @DataClass.Generated.Member getType()508 public @WindowManager.TransitionType int getType() { 509 return mType; 510 } 511 512 /** 513 * If non-null, the task containing the activity whose lifecycle change (start or 514 * finish) has caused this transition to occur. 515 */ 516 @DataClass.Generated.Member getTriggerTask()517 public @Nullable ActivityManager.RunningTaskInfo getTriggerTask() { 518 return mTriggerTask; 519 } 520 521 /** 522 * If non-null, this request might lead to a PiP transition; {@code PipChange} caches both 523 * {@code TaskFragment} token and the {@code TaskInfo} of the task with PiP candidate activity. 524 */ 525 @DataClass.Generated.Member getPipChange()526 public @Nullable TransitionRequestInfo.PipChange getPipChange() { 527 return mPipChange; 528 } 529 530 /** 531 * If non-null, a remote-transition associated with the source of this transition. 532 */ 533 @DataClass.Generated.Member getRemoteTransition()534 public @Nullable RemoteTransition getRemoteTransition() { 535 return mRemoteTransition; 536 } 537 538 /** 539 * If non-null, this request was triggered by this display change. This will not be complete: 540 * The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds 541 * (if size is changing). 542 */ 543 @DataClass.Generated.Member getDisplayChange()544 public @Nullable TransitionRequestInfo.DisplayChange getDisplayChange() { 545 return mDisplayChange; 546 } 547 548 /** 549 * The transition flags known at the time of the request. These may not be complete. 550 */ 551 @DataClass.Generated.Member getFlags()552 public int getFlags() { 553 return mFlags; 554 } 555 556 /** 557 * This is only a BEST-EFFORT id used for log correlation. DO NOT USE for any real work! 558 */ 559 @DataClass.Generated.Member getDebugId()560 public int getDebugId() { 561 return mDebugId; 562 } 563 564 /** 565 * If non-null, the task containing the activity whose lifecycle change (start or 566 * finish) has caused this transition to occur. 567 */ 568 @DataClass.Generated.Member setTriggerTask(@ndroid.annotation.NonNull ActivityManager.RunningTaskInfo value)569 public @android.annotation.NonNull TransitionRequestInfo setTriggerTask(@android.annotation.NonNull ActivityManager.RunningTaskInfo value) { 570 mTriggerTask = value; 571 return this; 572 } 573 574 /** 575 * If non-null, this request might lead to a PiP transition; {@code PipChange} caches both 576 * {@code TaskFragment} token and the {@code TaskInfo} of the task with PiP candidate activity. 577 */ 578 @DataClass.Generated.Member setPipChange(@ndroid.annotation.NonNull TransitionRequestInfo.PipChange value)579 public @android.annotation.NonNull TransitionRequestInfo setPipChange(@android.annotation.NonNull TransitionRequestInfo.PipChange value) { 580 mPipChange = value; 581 return this; 582 } 583 584 /** 585 * If non-null, a remote-transition associated with the source of this transition. 586 */ 587 @DataClass.Generated.Member setRemoteTransition(@ndroid.annotation.NonNull RemoteTransition value)588 public @android.annotation.NonNull TransitionRequestInfo setRemoteTransition(@android.annotation.NonNull RemoteTransition value) { 589 mRemoteTransition = value; 590 return this; 591 } 592 593 /** 594 * If non-null, this request was triggered by this display change. This will not be complete: 595 * The reliable parts should be flags, rotation start/end (if rotating), and start/end bounds 596 * (if size is changing). 597 */ 598 @DataClass.Generated.Member setDisplayChange(@ndroid.annotation.NonNull TransitionRequestInfo.DisplayChange value)599 public @android.annotation.NonNull TransitionRequestInfo setDisplayChange(@android.annotation.NonNull TransitionRequestInfo.DisplayChange value) { 600 mDisplayChange = value; 601 return this; 602 } 603 604 @Override 605 @DataClass.Generated.Member toString()606 public String toString() { 607 // You can override field toString logic by defining methods like: 608 // String fieldNameToString() { ... } 609 610 return "TransitionRequestInfo { " + 611 "type = " + typeToString() + ", " + 612 "triggerTask = " + mTriggerTask + ", " + 613 "pipChange = " + mPipChange + ", " + 614 "remoteTransition = " + mRemoteTransition + ", " + 615 "displayChange = " + mDisplayChange + ", " + 616 "flags = " + mFlags + ", " + 617 "debugId = " + mDebugId + 618 " }"; 619 } 620 621 @Override 622 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)623 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 624 // You can override field parcelling by defining methods like: 625 // void parcelFieldName(Parcel dest, int flags) { ... } 626 627 byte flg = 0; 628 if (mTriggerTask != null) flg |= 0x2; 629 if (mPipChange != null) flg |= 0x4; 630 if (mRemoteTransition != null) flg |= 0x8; 631 if (mDisplayChange != null) flg |= 0x10; 632 dest.writeByte(flg); 633 dest.writeInt(mType); 634 if (mTriggerTask != null) dest.writeTypedObject(mTriggerTask, flags); 635 if (mPipChange != null) dest.writeTypedObject(mPipChange, flags); 636 if (mRemoteTransition != null) dest.writeTypedObject(mRemoteTransition, flags); 637 if (mDisplayChange != null) dest.writeTypedObject(mDisplayChange, flags); 638 dest.writeInt(mFlags); 639 dest.writeInt(mDebugId); 640 } 641 642 @Override 643 @DataClass.Generated.Member describeContents()644 public int describeContents() { return 0; } 645 646 /** @hide */ 647 @SuppressWarnings({"unchecked", "RedundantCast"}) 648 @DataClass.Generated.Member TransitionRequestInfo(@ndroid.annotation.NonNull android.os.Parcel in)649 /* package-private */ TransitionRequestInfo(@android.annotation.NonNull android.os.Parcel in) { 650 // You can override field unparcelling by defining methods like: 651 // static FieldType unparcelFieldName(Parcel in) { ... } 652 653 byte flg = in.readByte(); 654 int type = in.readInt(); 655 ActivityManager.RunningTaskInfo triggerTask = (flg & 0x2) == 0 ? null : (ActivityManager.RunningTaskInfo) in.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR); 656 TransitionRequestInfo.PipChange pipChange = (flg & 0x4) == 0 ? null : (TransitionRequestInfo.PipChange) in.readTypedObject(TransitionRequestInfo.PipChange.CREATOR); 657 RemoteTransition remoteTransition = (flg & 0x8) == 0 ? null : (RemoteTransition) in.readTypedObject(RemoteTransition.CREATOR); 658 TransitionRequestInfo.DisplayChange displayChange = (flg & 0x10) == 0 ? null : (TransitionRequestInfo.DisplayChange) in.readTypedObject(TransitionRequestInfo.DisplayChange.CREATOR); 659 int flags = in.readInt(); 660 int debugId = in.readInt(); 661 662 this.mType = type; 663 com.android.internal.util.AnnotationValidations.validate( 664 WindowManager.TransitionType.class, null, mType); 665 this.mTriggerTask = triggerTask; 666 this.mPipChange = pipChange; 667 this.mRemoteTransition = remoteTransition; 668 this.mDisplayChange = displayChange; 669 this.mFlags = flags; 670 this.mDebugId = debugId; 671 672 // onConstructed(); // You can define this method to get a callback 673 } 674 675 @DataClass.Generated.Member 676 public static final @android.annotation.NonNull Parcelable.Creator<TransitionRequestInfo> CREATOR 677 = new Parcelable.Creator<TransitionRequestInfo>() { 678 @Override 679 public TransitionRequestInfo[] newArray(int size) { 680 return new TransitionRequestInfo[size]; 681 } 682 683 @Override 684 public TransitionRequestInfo createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 685 return new TransitionRequestInfo(in); 686 } 687 }; 688 689 @DataClass.Generated( 690 time = 1733334462604L, 691 codegenVersion = "1.0.23", 692 sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", 693 inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.PipChange mPipChange\nprivate @android.annotation.Nullable android.window.RemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.window.TransitionRequestInfo.DisplayChange mDisplayChange\nprivate final int mFlags\nprivate final int mDebugId\n java.lang.String typeToString()\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") 694 @Deprecated __metadata()695 private void __metadata() {} 696 697 698 //@formatter:on 699 // End of generated code 700 701 } 702