| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.graphics.Rect; |
| 22 |
import android.os.Parcelable; |
| 23 |
import android.os.RemoteException; |
| 24 |
|
| 25 |
import com.android.internal.util.DataClass; |
| 26 |
|
| 27 |
import java.util.ArrayList; |
| 28 |
|
| 29 |
|
| 30 |
@DataClass(genToString = true, genGetters = true) |
| 31 |
public class ScrollCaptureResponse implements Parcelable { |
| 32 |
|
| 33 |
|
| 34 |
@NonNull |
| 35 |
private String mDescription = ""; |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
@Nullable |
| 41 |
@DataClass.MaySetToNull |
| 42 |
private IScrollCaptureConnection mConnection = null; |
| 43 |
|
| 44 |
|
| 45 |
@Nullable |
| 46 |
private Rect mWindowBounds = null; |
| 47 |
|
| 48 |
|
| 49 |
@Nullable |
| 50 |
private Rect mBoundsInWindow = null; |
| 51 |
|
| 52 |
|
| 53 |
@Nullable |
| 54 |
private String mWindowTitle = null; |
| 55 |
|
| 56 |
|
| 57 |
@Nullable |
| 58 |
private String mPackageName = null; |
| 59 |
|
| 60 |
|
| 61 |
@NonNull |
| 62 |
@DataClass.PluralOf("message") |
| 63 |
private ArrayList<String> mMessages = new ArrayList<>(); |
| 64 |
|
| 65 |
|
| 66 |
public boolean isConnected() { |
| 67 |
return mConnection != null && mConnection.asBinder().isBinderAlive(); |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
public void close() { |
| 72 |
if (mConnection != null) { |
| 73 |
try { |
| 74 |
mConnection.close(); |
| 75 |
} catch (RemoteException e) { |
| 76 |
|
| 77 |
} |
| 78 |
mConnection = null; |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
@DataClass.Generated.Member |
| 98 |
ScrollCaptureResponse( |
| 99 |
@NonNull String description, |
| 100 |
@Nullable IScrollCaptureConnection connection, |
| 101 |
@Nullable Rect windowBounds, |
| 102 |
@Nullable Rect boundsInWindow, |
| 103 |
@Nullable String windowTitle, |
| 104 |
@Nullable String packageName, |
| 105 |
@NonNull ArrayList<String> messages) { |
| 106 |
this.mDescription = description; |
| 107 |
com.android.internal.util.AnnotationValidations.validate( |
| 108 |
NonNull.class, null, mDescription); |
| 109 |
this.mConnection = connection; |
| 110 |
this.mWindowBounds = windowBounds; |
| 111 |
this.mBoundsInWindow = boundsInWindow; |
| 112 |
this.mWindowTitle = windowTitle; |
| 113 |
this.mPackageName = packageName; |
| 114 |
this.mMessages = messages; |
| 115 |
com.android.internal.util.AnnotationValidations.validate( |
| 116 |
NonNull.class, null, mMessages); |
| 117 |
|
| 118 |
|
| 119 |
} |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
@DataClass.Generated.Member |
| 125 |
public @NonNull String getDescription() { |
| 126 |
return mDescription; |
| 127 |
} |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
@DataClass.Generated.Member |
| 133 |
public @Nullable IScrollCaptureConnection getConnection() { |
| 134 |
return mConnection; |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
@DataClass.Generated.Member |
| 141 |
public @Nullable Rect getWindowBounds() { |
| 142 |
return mWindowBounds; |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
@DataClass.Generated.Member |
| 149 |
public @Nullable Rect getBoundsInWindow() { |
| 150 |
return mBoundsInWindow; |
| 151 |
} |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
@DataClass.Generated.Member |
| 157 |
public @Nullable String getWindowTitle() { |
| 158 |
return mWindowTitle; |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
@DataClass.Generated.Member |
| 165 |
public @Nullable String getPackageName() { |
| 166 |
return mPackageName; |
| 167 |
} |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
@DataClass.Generated.Member |
| 173 |
public @NonNull ArrayList<String> getMessages() { |
| 174 |
return mMessages; |
| 175 |
} |
| 176 |
|
| 177 |
@Override |
| 178 |
@DataClass.Generated.Member |
| 179 |
public String toString() { |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
return "ScrollCaptureResponse { " + |
| 184 |
"description = " + mDescription + ", " + |
| 185 |
"connection = " + mConnection + ", " + |
| 186 |
"windowBounds = " + mWindowBounds + ", " + |
| 187 |
"boundsInWindow = " + mBoundsInWindow + ", " + |
| 188 |
"windowTitle = " + mWindowTitle + ", " + |
| 189 |
"packageName = " + mPackageName + ", " + |
| 190 |
"messages = " + mMessages + |
| 191 |
" }"; |
| 192 |
} |
| 193 |
|
| 194 |
@Override |
| 195 |
@DataClass.Generated.Member |
| 196 |
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
byte flg = 0; |
| 201 |
if (mConnection != null) flg |= 0x2; |
| 202 |
if (mWindowBounds != null) flg |= 0x4; |
| 203 |
if (mBoundsInWindow != null) flg |= 0x8; |
| 204 |
if (mWindowTitle != null) flg |= 0x10; |
| 205 |
if (mPackageName != null) flg |= 0x20; |
| 206 |
dest.writeByte(flg); |
| 207 |
dest.writeString(mDescription); |
| 208 |
if (mConnection != null) dest.writeStrongInterface(mConnection); |
| 209 |
if (mWindowBounds != null) dest.writeTypedObject(mWindowBounds, flags); |
| 210 |
if (mBoundsInWindow != null) dest.writeTypedObject(mBoundsInWindow, flags); |
| 211 |
if (mWindowTitle != null) dest.writeString(mWindowTitle); |
| 212 |
if (mPackageName != null) dest.writeString(mPackageName); |
| 213 |
dest.writeStringList(mMessages); |
| 214 |
} |
| 215 |
|
| 216 |
@Override |
| 217 |
@DataClass.Generated.Member |
| 218 |
public int describeContents() { return 0; } |
| 219 |
|
| 220 |
|
| 221 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 222 |
@DataClass.Generated.Member |
| 223 |
protected ScrollCaptureResponse(@NonNull android.os.Parcel in) { |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
byte flg = in.readByte(); |
| 228 |
String description = in.readString(); |
| 229 |
IScrollCaptureConnection connection = (flg & 0x2) == 0 ? null : IScrollCaptureConnection.Stub.asInterface(in.readStrongBinder()); |
| 230 |
Rect windowBounds = (flg & 0x4) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR); |
| 231 |
Rect boundsInWindow = (flg & 0x8) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR); |
| 232 |
String windowTitle = (flg & 0x10) == 0 ? null : in.readString(); |
| 233 |
String packageName = (flg & 0x20) == 0 ? null : in.readString(); |
| 234 |
ArrayList<String> messages = new ArrayList<>(); |
| 235 |
in.readStringList(messages); |
| 236 |
|
| 237 |
this.mDescription = description; |
| 238 |
com.android.internal.util.AnnotationValidations.validate( |
| 239 |
NonNull.class, null, mDescription); |
| 240 |
this.mConnection = connection; |
| 241 |
this.mWindowBounds = windowBounds; |
| 242 |
this.mBoundsInWindow = boundsInWindow; |
| 243 |
this.mWindowTitle = windowTitle; |
| 244 |
this.mPackageName = packageName; |
| 245 |
this.mMessages = messages; |
| 246 |
com.android.internal.util.AnnotationValidations.validate( |
| 247 |
NonNull.class, null, mMessages); |
| 248 |
|
| 249 |
|
| 250 |
} |
| 251 |
|
| 252 |
@DataClass.Generated.Member |
| 253 |
public static final @NonNull Parcelable.Creator<ScrollCaptureResponse> CREATOR |
| 254 |
= new Parcelable.Creator<ScrollCaptureResponse>() { |
| 255 |
@Override |
| 256 |
public ScrollCaptureResponse[] newArray(int size) { |
| 257 |
return new ScrollCaptureResponse[size]; |
| 258 |
} |
| 259 |
|
| 260 |
@Override |
| 261 |
public ScrollCaptureResponse createFromParcel(@NonNull android.os.Parcel in) { |
| 262 |
return new ScrollCaptureResponse(in); |
| 263 |
} |
| 264 |
}; |
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
@SuppressWarnings("WeakerAccess") |
| 270 |
@DataClass.Generated.Member |
| 271 |
public static class Builder { |
| 272 |
|
| 273 |
private @NonNull String mDescription; |
| 274 |
private @Nullable IScrollCaptureConnection mConnection; |
| 275 |
private @Nullable Rect mWindowBounds; |
| 276 |
private @Nullable Rect mBoundsInWindow; |
| 277 |
private @Nullable String mWindowTitle; |
| 278 |
private @Nullable String mPackageName; |
| 279 |
private @NonNull ArrayList<String> mMessages; |
| 280 |
|
| 281 |
private long mBuilderFieldsSet = 0L; |
| 282 |
|
| 283 |
public Builder() { |
| 284 |
} |
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
@DataClass.Generated.Member |
| 290 |
public @NonNull Builder setDescription(@NonNull String value) { |
| 291 |
checkNotUsed(); |
| 292 |
mBuilderFieldsSet |= 0x1; |
| 293 |
mDescription = value; |
| 294 |
return this; |
| 295 |
} |
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
@DataClass.Generated.Member |
| 301 |
public @NonNull Builder setConnection(@Nullable IScrollCaptureConnection value) { |
| 302 |
checkNotUsed(); |
| 303 |
mBuilderFieldsSet |= 0x2; |
| 304 |
mConnection = value; |
| 305 |
return this; |
| 306 |
} |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
@DataClass.Generated.Member |
| 312 |
public @NonNull Builder setWindowBounds(@NonNull Rect value) { |
| 313 |
checkNotUsed(); |
| 314 |
mBuilderFieldsSet |= 0x4; |
| 315 |
mWindowBounds = value; |
| 316 |
return this; |
| 317 |
} |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
@DataClass.Generated.Member |
| 323 |
public @NonNull Builder setBoundsInWindow(@NonNull Rect value) { |
| 324 |
checkNotUsed(); |
| 325 |
mBuilderFieldsSet |= 0x8; |
| 326 |
mBoundsInWindow = value; |
| 327 |
return this; |
| 328 |
} |
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
@DataClass.Generated.Member |
| 334 |
public @NonNull Builder setWindowTitle(@NonNull String value) { |
| 335 |
checkNotUsed(); |
| 336 |
mBuilderFieldsSet |= 0x10; |
| 337 |
mWindowTitle = value; |
| 338 |
return this; |
| 339 |
} |
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
@DataClass.Generated.Member |
| 345 |
public @NonNull Builder setPackageName(@NonNull String value) { |
| 346 |
checkNotUsed(); |
| 347 |
mBuilderFieldsSet |= 0x20; |
| 348 |
mPackageName = value; |
| 349 |
return this; |
| 350 |
} |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
@DataClass.Generated.Member |
| 356 |
public @NonNull Builder setMessages(@NonNull ArrayList<String> value) { |
| 357 |
checkNotUsed(); |
| 358 |
mBuilderFieldsSet |= 0x40; |
| 359 |
mMessages = value; |
| 360 |
return this; |
| 361 |
} |
| 362 |
|
| 363 |
|
| 364 |
@DataClass.Generated.Member |
| 365 |
public @NonNull Builder addMessage(@NonNull String value) { |
| 366 |
if (mMessages == null) setMessages(new ArrayList<>()); |
| 367 |
mMessages.add(value); |
| 368 |
return this; |
| 369 |
} |
| 370 |
|
| 371 |
|
| 372 |
public @NonNull ScrollCaptureResponse build() { |
| 373 |
checkNotUsed(); |
| 374 |
mBuilderFieldsSet |= 0x80; |
| 375 |
|
| 376 |
if ((mBuilderFieldsSet & 0x1) == 0) { |
| 377 |
mDescription = ""; |
| 378 |
} |
| 379 |
if ((mBuilderFieldsSet & 0x2) == 0) { |
| 380 |
mConnection = null; |
| 381 |
} |
| 382 |
if ((mBuilderFieldsSet & 0x4) == 0) { |
| 383 |
mWindowBounds = null; |
| 384 |
} |
| 385 |
if ((mBuilderFieldsSet & 0x8) == 0) { |
| 386 |
mBoundsInWindow = null; |
| 387 |
} |
| 388 |
if ((mBuilderFieldsSet & 0x10) == 0) { |
| 389 |
mWindowTitle = null; |
| 390 |
} |
| 391 |
if ((mBuilderFieldsSet & 0x20) == 0) { |
| 392 |
mPackageName = null; |
| 393 |
} |
| 394 |
if ((mBuilderFieldsSet & 0x40) == 0) { |
| 395 |
mMessages = new ArrayList<>(); |
| 396 |
} |
| 397 |
ScrollCaptureResponse o = new ScrollCaptureResponse( |
| 398 |
mDescription, |
| 399 |
mConnection, |
| 400 |
mWindowBounds, |
| 401 |
mBoundsInWindow, |
| 402 |
mWindowTitle, |
| 403 |
mPackageName, |
| 404 |
mMessages); |
| 405 |
return o; |
| 406 |
} |
| 407 |
|
| 408 |
private void checkNotUsed() { |
| 409 |
if ((mBuilderFieldsSet & 0x80) != 0) { |
| 410 |
throw new IllegalStateException( |
| 411 |
"This Builder should not be reused. Use a new Builder instance instead"); |
| 412 |
} |
| 413 |
} |
| 414 |
} |
| 415 |
|
| 416 |
@DataClass.Generated( |
| 417 |
time = 1628630366187L, |
| 418 |
codegenVersion = "1.0.23", |
| 419 |
sourceFile = "frameworks/base/core/java/android/view/ScrollCaptureResponse.java", |
| 420 |
inputSignatures = "private @android.annotation.NonNull java.lang.String mDescription\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.MaySetToNull android.view.IScrollCaptureConnection mConnection\nprivate @android.annotation.Nullable android.graphics.Rect mWindowBounds\nprivate @android.annotation.Nullable android.graphics.Rect mBoundsInWindow\nprivate @android.annotation.Nullable java.lang.String mWindowTitle\nprivate @android.annotation.Nullable java.lang.String mPackageName\nprivate @android.annotation.NonNull @com.android.internal.util.DataClass.PluralOf(\"message\") java.util.ArrayList<java.lang.String> mMessages\npublic boolean isConnected()\npublic void close()\nclass ScrollCaptureResponse extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genGetters=true)") |
| 421 |
@Deprecated |
| 422 |
private void __metadata() {} |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
} |