1 /*
2  * Copyright (C) 2024 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 package android.app.fgsstarttesthelper;
17 
18 import android.annotation.NonNull;
19 import android.annotation.Nullable;
20 import android.content.Intent;
21 import android.os.Parcel;
22 import android.os.Parcelable;
23 
24 import com.android.internal.util.DataClass;
25 
26 /**
27  * Message class used in this test.
28  */
29 @DataClass(
30         genConstructor = false,
31         genSetters = true,
32         genToString = true,
33         genAidl = false)
34 public class FgsNewLogicMessage implements Parcelable {
FgsNewLogicMessage()35     public FgsNewLogicMessage() {
36     }
37 
38     private boolean mFgsStarted;
39 
40     @Nullable
41     private String mUnexpectedErrorMessage;
42 
setToIntent(Intent i)43     public void setToIntent(Intent i) {
44         i.putExtra(FgsNewLogicMessage.class.getName(), this);
45     }
46 
getFromIntent(Intent i)47     public static FgsNewLogicMessage getFromIntent(Intent i) {
48         return i.getParcelableExtra(FgsNewLogicMessage.class.getName(), FgsNewLogicMessage.class);
49     }
50 
51 
52 
53     // Code below generated by codegen v1.0.23.
54     //
55     // DO NOT MODIFY!
56     // CHECKSTYLE:OFF Generated code
57     //
58     // To regenerate run:
59     // $ codegen $ANDROID_BUILD_TOP/cts/tests/app/FgsTestHelper/src/android/app/fgstesthelper/FgsNewLogicMessage.java
60     //
61     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
62     //   Settings > Editor > Code Style > Formatter Control
63     //@formatter:off
64 
65 
66     @DataClass.Generated.Member
isFgsStarted()67     public boolean isFgsStarted() {
68         return mFgsStarted;
69     }
70 
71     @DataClass.Generated.Member
getUnexpectedErrorMessage()72     public @Nullable String getUnexpectedErrorMessage() {
73         return mUnexpectedErrorMessage;
74     }
75 
76     @DataClass.Generated.Member
setFgsStarted( boolean value)77     public @NonNull FgsNewLogicMessage setFgsStarted( boolean value) {
78         mFgsStarted = value;
79         return this;
80     }
81 
82     @DataClass.Generated.Member
setUnexpectedErrorMessage(@onNull String value)83     public @NonNull FgsNewLogicMessage setUnexpectedErrorMessage(@NonNull String value) {
84         mUnexpectedErrorMessage = value;
85         return this;
86     }
87 
88     @Override
89     @DataClass.Generated.Member
toString()90     public String toString() {
91         // You can override field toString logic by defining methods like:
92         // String fieldNameToString() { ... }
93 
94         return "FgsNewLogicMessage { " +
95                 "fgsStarted = " + mFgsStarted + ", " +
96                 "unexpectedErrorMessage = " + mUnexpectedErrorMessage +
97         " }";
98     }
99 
100     @Override
101     @DataClass.Generated.Member
writeToParcel(@onNull Parcel dest, int flags)102     public void writeToParcel(@NonNull Parcel dest, int flags) {
103         // You can override field parcelling by defining methods like:
104         // void parcelFieldName(Parcel dest, int flags) { ... }
105 
106         byte flg = 0;
107         if (mFgsStarted) flg |= 0x1;
108         if (mUnexpectedErrorMessage != null) flg |= 0x2;
109         dest.writeByte(flg);
110         if (mUnexpectedErrorMessage != null) dest.writeString(mUnexpectedErrorMessage);
111     }
112 
113     @Override
114     @DataClass.Generated.Member
describeContents()115     public int describeContents() { return 0; }
116 
117     /** @hide */
118     @SuppressWarnings({"unchecked", "RedundantCast"})
119     @DataClass.Generated.Member
FgsNewLogicMessage(@onNull Parcel in)120     protected FgsNewLogicMessage(@NonNull Parcel in) {
121         // You can override field unparcelling by defining methods like:
122         // static FieldType unparcelFieldName(Parcel in) { ... }
123 
124         byte flg = in.readByte();
125         boolean fgsStarted = (flg & 0x1) != 0;
126         String unexpectedErrorMessage = (flg & 0x2) == 0 ? null : in.readString();
127 
128         this.mFgsStarted = fgsStarted;
129         this.mUnexpectedErrorMessage = unexpectedErrorMessage;
130 
131         // onConstructed(); // You can define this method to get a callback
132     }
133 
134     @DataClass.Generated.Member
135     public static final @NonNull Parcelable.Creator<FgsNewLogicMessage> CREATOR
136             = new Parcelable.Creator<FgsNewLogicMessage>() {
137         @Override
138         public FgsNewLogicMessage[] newArray(int size) {
139             return new FgsNewLogicMessage[size];
140         }
141 
142         @Override
143         public FgsNewLogicMessage createFromParcel(@NonNull Parcel in) {
144             return new FgsNewLogicMessage(in);
145         }
146     };
147 
148     @DataClass.Generated(
149             time = 1706052038855L,
150             codegenVersion = "1.0.23",
151             sourceFile = "cts/tests/app/FgsTestHelper/src/android/app/fgstesthelper/FgsNewLogicMessage.java",
152             inputSignatures = "private  boolean mFgsStarted\nprivate @android.annotation.Nullable java.lang.String mUnexpectedErrorMessage\npublic  void setToIntent(android.content.Intent)\npublic static  android.app.fgstesthelper.FgsNewLogicMessage getFromIntent(android.content.Intent)\nclass FgsNewLogicMessage extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genConstructor=false, genSetters=true, genToString=true, genAidl=false)")
153     @Deprecated
__metadata()154     private void __metadata() {}
155 
156 
157     //@formatter:on
158     // End of generated code
159 
160 }
161