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 android.annotation.Nullable; 20 import android.app.ActivityManager; 21 import android.os.Parcelable; 22 import android.view.WindowManager; 23 24 import com.android.internal.util.DataClass; 25 26 /** 27 * Used to communicate information about what is changing during a transition to a TransitionPlayer. 28 * @hide 29 */ 30 @DataClass(genToString = true, genSetters = true, genAidl = true) 31 public final class TransitionRequestInfo implements Parcelable { 32 33 /** The type of the transition being requested. */ 34 private final @WindowManager.TransitionType int mType; 35 36 /** 37 * If non-null, If non-null, the task containing the activity whose lifecycle change (start or 38 * finish) has caused this transition to occur. 39 */ 40 private @Nullable ActivityManager.RunningTaskInfo mTriggerTask; 41 42 /** If non-null, a remote-transition associated with the source of this transition. */ 43 private @Nullable IRemoteTransition mRemoteTransition; 44 45 46 47 // Code below generated by codegen v1.0.22. 48 // 49 // DO NOT MODIFY! 50 // CHECKSTYLE:OFF Generated code 51 // 52 // To regenerate run: 53 // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/window/TransitionRequestInfo.java 54 // 55 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 56 // Settings > Editor > Code Style > Formatter Control 57 //@formatter:off 58 59 60 /** 61 * Creates a new TransitionRequestInfo. 62 * 63 * @param type 64 * The type of the transition being requested. 65 * @param triggerTask 66 * If non-null, If non-null, the task containing the activity whose lifecycle change (start or 67 * finish) has caused this transition to occur. 68 * @param remoteTransition 69 * If non-null, a remote-transition associated with the source of this transition. 70 */ 71 @DataClass.Generated.Member TransitionRequestInfo( @indowManager.TransitionType int type, @Nullable ActivityManager.RunningTaskInfo triggerTask, @Nullable IRemoteTransition remoteTransition)72 public TransitionRequestInfo( 73 @WindowManager.TransitionType int type, 74 @Nullable ActivityManager.RunningTaskInfo triggerTask, 75 @Nullable IRemoteTransition remoteTransition) { 76 this.mType = type; 77 com.android.internal.util.AnnotationValidations.validate( 78 WindowManager.TransitionType.class, null, mType); 79 this.mTriggerTask = triggerTask; 80 this.mRemoteTransition = remoteTransition; 81 82 // onConstructed(); // You can define this method to get a callback 83 } 84 85 /** 86 * The type of the transition being requested. 87 */ 88 @DataClass.Generated.Member getType()89 public @WindowManager.TransitionType int getType() { 90 return mType; 91 } 92 93 /** 94 * If non-null, If non-null, the task containing the activity whose lifecycle change (start or 95 * finish) has caused this transition to occur. 96 */ 97 @DataClass.Generated.Member getTriggerTask()98 public @Nullable ActivityManager.RunningTaskInfo getTriggerTask() { 99 return mTriggerTask; 100 } 101 102 /** 103 * If non-null, a remote-transition associated with the source of this transition. 104 */ 105 @DataClass.Generated.Member getRemoteTransition()106 public @Nullable IRemoteTransition getRemoteTransition() { 107 return mRemoteTransition; 108 } 109 110 /** 111 * If non-null, If non-null, the task containing the activity whose lifecycle change (start or 112 * finish) has caused this transition to occur. 113 */ 114 @DataClass.Generated.Member setTriggerTask(@ndroid.annotation.NonNull ActivityManager.RunningTaskInfo value)115 public @android.annotation.NonNull TransitionRequestInfo setTriggerTask(@android.annotation.NonNull ActivityManager.RunningTaskInfo value) { 116 mTriggerTask = value; 117 return this; 118 } 119 120 /** 121 * If non-null, a remote-transition associated with the source of this transition. 122 */ 123 @DataClass.Generated.Member setRemoteTransition(@ndroid.annotation.NonNull IRemoteTransition value)124 public @android.annotation.NonNull TransitionRequestInfo setRemoteTransition(@android.annotation.NonNull IRemoteTransition value) { 125 mRemoteTransition = value; 126 return this; 127 } 128 129 @Override 130 @DataClass.Generated.Member toString()131 public String toString() { 132 // You can override field toString logic by defining methods like: 133 // String fieldNameToString() { ... } 134 135 return "TransitionRequestInfo { " + 136 "type = " + mType + ", " + 137 "triggerTask = " + mTriggerTask + ", " + 138 "remoteTransition = " + mRemoteTransition + 139 " }"; 140 } 141 142 @Override 143 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)144 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 145 // You can override field parcelling by defining methods like: 146 // void parcelFieldName(Parcel dest, int flags) { ... } 147 148 byte flg = 0; 149 if (mTriggerTask != null) flg |= 0x2; 150 if (mRemoteTransition != null) flg |= 0x4; 151 dest.writeByte(flg); 152 dest.writeInt(mType); 153 if (mTriggerTask != null) dest.writeTypedObject(mTriggerTask, flags); 154 if (mRemoteTransition != null) dest.writeStrongInterface(mRemoteTransition); 155 } 156 157 @Override 158 @DataClass.Generated.Member describeContents()159 public int describeContents() { return 0; } 160 161 /** @hide */ 162 @SuppressWarnings({"unchecked", "RedundantCast"}) 163 @DataClass.Generated.Member TransitionRequestInfo(@ndroid.annotation.NonNull android.os.Parcel in)164 /* package-private */ TransitionRequestInfo(@android.annotation.NonNull android.os.Parcel in) { 165 // You can override field unparcelling by defining methods like: 166 // static FieldType unparcelFieldName(Parcel in) { ... } 167 168 byte flg = in.readByte(); 169 int type = in.readInt(); 170 ActivityManager.RunningTaskInfo triggerTask = (flg & 0x2) == 0 ? null : (ActivityManager.RunningTaskInfo) in.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR); 171 IRemoteTransition remoteTransition = (flg & 0x4) == 0 ? null : IRemoteTransition.Stub.asInterface(in.readStrongBinder()); 172 173 this.mType = type; 174 com.android.internal.util.AnnotationValidations.validate( 175 WindowManager.TransitionType.class, null, mType); 176 this.mTriggerTask = triggerTask; 177 this.mRemoteTransition = remoteTransition; 178 179 // onConstructed(); // You can define this method to get a callback 180 } 181 182 @DataClass.Generated.Member 183 public static final @android.annotation.NonNull Parcelable.Creator<TransitionRequestInfo> CREATOR 184 = new Parcelable.Creator<TransitionRequestInfo>() { 185 @Override 186 public TransitionRequestInfo[] newArray(int size) { 187 return new TransitionRequestInfo[size]; 188 } 189 190 @Override 191 public TransitionRequestInfo createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 192 return new TransitionRequestInfo(in); 193 } 194 }; 195 196 @DataClass.Generated( 197 time = 1610060387917L, 198 codegenVersion = "1.0.22", 199 sourceFile = "frameworks/base/core/java/android/window/TransitionRequestInfo.java", 200 inputSignatures = "private final @android.view.WindowManager.TransitionType int mType\nprivate @android.annotation.Nullable android.app.ActivityManager.RunningTaskInfo mTriggerTask\nprivate @android.annotation.Nullable android.window.IRemoteTransition mRemoteTransition\nclass TransitionRequestInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)") 201 @Deprecated __metadata()202 private void __metadata() {} 203 204 205 //@formatter:on 206 // End of generated code 207 208 } 209