diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-10-17 00:15:05 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-10-17 00:15:05 +0000 |
| commit | 44466345721d3ef3a1e2ff42fe69e8aa45f32976 (patch) | |
| tree | d7d6fbc08312a268bc595576c121a034dc707316 /core/java | |
| parent | 82f9350c92b012f19a279820cbd6a151a9643b58 (diff) | |
| parent | 1bfb5e709728959eb77cb756a2db80ecdc7549e1 (diff) | |
Merge "Add @NonNull to some generated methods' args"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/AsyncNotedAppOp.java | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/core/java/android/app/AsyncNotedAppOp.java b/core/java/android/app/AsyncNotedAppOp.java index df6533a340f2..241895c9ff64 100644 --- a/core/java/android/app/AsyncNotedAppOp.java +++ b/core/java/android/app/AsyncNotedAppOp.java @@ -66,14 +66,18 @@ public final class AsyncNotedAppOp implements Parcelable { - // Code below generated by codegen v1.0.0. + // Code below generated by codegen v1.0.9. // // DO NOT MODIFY! + // CHECKSTYLE:OFF Generated code // // To regenerate run: // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/app/AsyncNotedAppOp.java // - // CHECKSTYLE:OFF Generated code + // To exclude the generated code from IntelliJ auto-formatting enable (one-time): + // Settings > Editor > Code Style > Formatter Control + //@formatter:off + /** * Creates a new AsyncNotedAppOp. @@ -83,7 +87,8 @@ public final class AsyncNotedAppOp implements Parcelable { * @param notingUid * Uid that noted the op * @param notingPackageName - * Package that noted the op + * Package that noted the op. {@code null} if the package name that noted the op could be not + * be determined (e.g. when the op is noted from native code). * @param message * Message associated with the noteOp. This message is set by the app noting the op * @param time @@ -127,7 +132,8 @@ public final class AsyncNotedAppOp implements Parcelable { } /** - * Package that noted the op + * Package that noted the op. {@code null} if the package name that noted the op could be not + * be determined (e.g. when the op is noted from native code). */ @DataClass.Generated.Member public @Nullable String getNotingPackageName() { @@ -152,7 +158,7 @@ public final class AsyncNotedAppOp implements Parcelable { @Override @DataClass.Generated.Member - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { // You can override field equality logic by defining either of the methods like: // boolean fieldNameEquals(AsyncNotedAppOp other) { ... } // boolean fieldNameEquals(FieldType otherValue) { ... } @@ -187,7 +193,7 @@ public final class AsyncNotedAppOp implements Parcelable { @Override @DataClass.Generated.Member - public void writeToParcel(android.os.Parcel dest, int flags) { + public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { // You can override field parcelling by defining methods like: // void parcelFieldName(Parcel dest, int flags) { ... } @@ -205,6 +211,41 @@ public final class AsyncNotedAppOp implements Parcelable { @DataClass.Generated.Member public int describeContents() { return 0; } + /** @hide */ + @SuppressWarnings({"unchecked", "RedundantCast"}) + @DataClass.Generated.Member + /* package-private */ AsyncNotedAppOp(@NonNull android.os.Parcel in) { + // You can override field unparcelling by defining methods like: + // static FieldType unparcelFieldName(Parcel in) { ... } + + byte flg = in.readByte(); + int opCode = in.readInt(); + int notingUid = in.readInt(); + String notingPackageName = (flg & 0x4) == 0 ? null : in.readString(); + String message = in.readString(); + long time = in.readLong(); + + this.mOpCode = opCode; + com.android.internal.util.AnnotationValidations.validate( + IntRange.class, null, mOpCode, + "from", 0, + "to", AppOpsManager._NUM_OP - 1); + this.mNotingUid = notingUid; + com.android.internal.util.AnnotationValidations.validate( + IntRange.class, null, mNotingUid, + "from", 0); + this.mNotingPackageName = notingPackageName; + this.mMessage = message; + com.android.internal.util.AnnotationValidations.validate( + NonNull.class, null, mMessage); + this.mTime = time; + com.android.internal.util.AnnotationValidations.validate( + IntRange.class, null, mTime, + "from", 0); + + // onConstructed(); // You can define this method to get a callback + } + @DataClass.Generated.Member public static final @NonNull Parcelable.Creator<AsyncNotedAppOp> CREATOR = new Parcelable.Creator<AsyncNotedAppOp>() { @@ -214,29 +255,14 @@ public final class AsyncNotedAppOp implements Parcelable { } @Override - @SuppressWarnings({"unchecked", "RedundantCast"}) - public AsyncNotedAppOp createFromParcel(android.os.Parcel in) { - // You can override field unparcelling by defining methods like: - // static FieldType unparcelFieldName(Parcel in) { ... } - - byte flg = in.readByte(); - int opCode = in.readInt(); - int notingUid = in.readInt(); - String notingPackageName = (flg & 0x4) == 0 ? null : in.readString(); - String message = in.readString(); - long time = in.readLong(); - return new AsyncNotedAppOp( - opCode, - notingUid, - notingPackageName, - message, - time); + public AsyncNotedAppOp createFromParcel(@NonNull android.os.Parcel in) { + return new AsyncNotedAppOp(in); } }; @DataClass.Generated( - time = 1566503083973L, - codegenVersion = "1.0.0", + time = 1571246617363L, + codegenVersion = "1.0.9", sourceFile = "frameworks/base/core/java/android/app/AsyncNotedAppOp.java", inputSignatures = "private final @android.annotation.IntRange(from=0L, to=91L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mNotingPackageName\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)") @Deprecated |
