diff options
| author | Eugene Susla <eugenesusla@google.com> | 2019-10-16 10:12:47 -0700 |
|---|---|---|
| committer | Eugene Susla <eugenesusla@google.com> | 2019-10-16 14:29:58 -0700 |
| commit | 1bfb5e709728959eb77cb756a2db80ecdc7549e1 (patch) | |
| tree | b950e66f914f83fc593e92e514560eb45571d7c6 /core/java/android | |
| parent | 8357dd73aedddbeefaa0fcafe7b55749f0efbc33 (diff) | |
Add @NonNull to some generated methods' args
Test: . frameworks/base/tests/Codegen/runTest.sh
Fixes: 142783758
Change-Id: I7303d420efd59389c324b3e399fcb3532b5d6c37
Diffstat (limited to 'core/java/android')
| -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 |
