• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.car.internal.property;
18 
19 import static android.car.hardware.property.VehicleHalStatusCode.VEHICLE_HAL_STATUS_CODES;
20 
21 import android.annotation.FlaggedApi;
22 import android.annotation.IntDef;
23 import android.annotation.NonNull;
24 import android.annotation.SuppressLint;
25 import android.car.feature.Flags;
26 import android.car.hardware.property.CarInternalErrorException;
27 import android.car.hardware.property.CarPropertyManager;
28 import android.car.hardware.property.CarPropertyManager.CarPropertyAsyncErrorCode;
29 import android.car.hardware.property.DetailedErrorCode;
30 import android.car.hardware.property.DetailedErrorCode.DetailedErrorCodeInt;
31 import android.car.hardware.property.PropertyAccessDeniedSecurityException;
32 import android.car.hardware.property.PropertyNotAvailableAndRetryException;
33 import android.car.hardware.property.PropertyNotAvailableErrorCode;
34 import android.car.hardware.property.PropertyNotAvailableErrorCode.PropertyNotAvailableErrorCodeInt;
35 import android.car.hardware.property.PropertyNotAvailableException;
36 import android.car.hardware.property.VehicleHalStatusCode;
37 import android.car.hardware.property.VehicleHalStatusCode.VehicleHalStatusCodeInt;
38 import android.os.Parcel;
39 import android.os.Parcelable;
40 import android.util.Slog;
41 import android.util.SparseIntArray;
42 
43 import com.android.car.internal.util.AnnotationValidations;
44 import com.android.car.internal.util.DataClass;
45 
46 import java.util.StringJoiner;
47 
48 /**
49  * Stores the various error codes for vehicle properties as they get passed up
50  * the stack.
51  */
52 @DataClass(genConstructor = false, genSetters = false, genGetters = false)
53 public final class CarPropertyErrorCodes implements Parcelable {
54 
55     private static final String TAG = "CarPropertyErrorCodes";
56 
57     private static final SparseIntArray DETAILED_ERROR_CODE_BY_STATUS =
58             new SparseIntArray();
59     static {
DETAILED_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_DISABLED, DetailedErrorCode.NOT_AVAILABLE_DISABLED)60         DETAILED_ERROR_CODE_BY_STATUS.put(
61                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_DISABLED,
62                 DetailedErrorCode.NOT_AVAILABLE_DISABLED);
DETAILED_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_LOW, DetailedErrorCode.NOT_AVAILABLE_SPEED_LOW)63         DETAILED_ERROR_CODE_BY_STATUS.put(
64                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_LOW,
65                 DetailedErrorCode.NOT_AVAILABLE_SPEED_LOW);
DETAILED_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_HIGH, DetailedErrorCode.NOT_AVAILABLE_SPEED_HIGH)66         DETAILED_ERROR_CODE_BY_STATUS.put(
67                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_HIGH,
68                 DetailedErrorCode.NOT_AVAILABLE_SPEED_HIGH);
DETAILED_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_POOR_VISIBILITY, DetailedErrorCode.NOT_AVAILABLE_POOR_VISIBILITY)69         DETAILED_ERROR_CODE_BY_STATUS.put(
70                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_POOR_VISIBILITY,
71                 DetailedErrorCode.NOT_AVAILABLE_POOR_VISIBILITY);
DETAILED_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SAFETY, DetailedErrorCode.NOT_AVAILABLE_SAFETY)72         DETAILED_ERROR_CODE_BY_STATUS.put(
73                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SAFETY,
74                 DetailedErrorCode.NOT_AVAILABLE_SAFETY);
75         // TODO(b/381298607): Add STATUS_NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED once
76         // NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED is added to DetailedErrorCode.
77     }
78 
79     private static final SparseIntArray PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS =
80             new SparseIntArray();
81     static {
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE, PropertyNotAvailableErrorCode.NOT_AVAILABLE)82         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
83                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE,
84                 PropertyNotAvailableErrorCode.NOT_AVAILABLE);
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_DISABLED, PropertyNotAvailableErrorCode.NOT_AVAILABLE_DISABLED)85         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
86                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_DISABLED,
87                 PropertyNotAvailableErrorCode.NOT_AVAILABLE_DISABLED);
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_LOW, PropertyNotAvailableErrorCode.NOT_AVAILABLE_SPEED_LOW)88         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
89                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_LOW,
90                 PropertyNotAvailableErrorCode.NOT_AVAILABLE_SPEED_LOW);
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_HIGH, PropertyNotAvailableErrorCode.NOT_AVAILABLE_SPEED_HIGH)91         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
92                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SPEED_HIGH,
93                 PropertyNotAvailableErrorCode.NOT_AVAILABLE_SPEED_HIGH);
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_POOR_VISIBILITY, PropertyNotAvailableErrorCode.NOT_AVAILABLE_POOR_VISIBILITY)94         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
95                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_POOR_VISIBILITY,
96                 PropertyNotAvailableErrorCode.NOT_AVAILABLE_POOR_VISIBILITY);
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SAFETY, PropertyNotAvailableErrorCode.NOT_AVAILABLE_SAFETY)97         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
98                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SAFETY,
99                 PropertyNotAvailableErrorCode.NOT_AVAILABLE_SAFETY);
100         // TODO(b/381298607): Change the mapping once
101         // NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED is added to PropertyNotAvailableErrorCode.
PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put( VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED, PropertyNotAvailableErrorCode.NOT_AVAILABLE)102         PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.put(
103                 VehicleHalStatusCode.STATUS_NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED,
104                 PropertyNotAvailableErrorCode.NOT_AVAILABLE);
105     }
106 
107     /**
108      * Status indicating no error.
109      *
110      * <p>This is not exposed to the client as this will be used only for deciding
111      * {@link GetPropertyCallback#onSuccess} or {@link GetPropertyCallback#onFailure} is called.
112      */
113     public static final int STATUS_OK = 0;
114     public static final int STATUS_TRY_AGAIN = -1;
115 
116     private static final int SYSTEM_ERROR_CODE_MASK = 0xffff;
117     private static final int VENDOR_ERROR_CODE_SHIFT = 16;
118 
119     /**
120      * CarPropertyErrorCodes with no errors.
121      */
122     public static CarPropertyErrorCodes STATUS_OK_NO_ERROR =
123             new CarPropertyErrorCodes(STATUS_OK, /* vendorErrorCode= */ 0, /* systemErrorCode */ 0);
124 
125     /**
126      * CarPropertyErrorCodes generated internally from car service with general not_available error.
127      */
128     public static CarPropertyErrorCodes ERROR_CODES_NOT_AVAILABLE =
129             new CarPropertyErrorCodes(CarPropertyManager.STATUS_ERROR_NOT_AVAILABLE,
130                     /* vendorErrorCode= */ 0, /* systemErrorCode */ 0);
131 
132     /**
133      * CarPropertyErrorCodes generated internally from car service with try_again error.
134      */
135     public static CarPropertyErrorCodes ERROR_CODES_TRY_AGAIN =
136             new CarPropertyErrorCodes(STATUS_TRY_AGAIN, /* vendorErrorCode= */ 0,
137                     /* systemErrorCode */ 0);
138 
139     /**
140      * CarPropertyErrorCodes generated internally from car service with general internal error.
141      */
142     public static CarPropertyErrorCodes ERROR_CODES_INTERNAL =
143             new CarPropertyErrorCodes(CarPropertyManager.STATUS_ERROR_INTERNAL_ERROR,
144                     /* vendorErrorCode= */ 0, /* systemErrorCode */ 0);
145 
146     /**
147      * CarPropertyErrorCodes generated internally from car service with timeout error.
148      */
149     public static CarPropertyErrorCodes ERROR_CODES_TIMEOUT =
150             new CarPropertyErrorCodes(CarPropertyManager.STATUS_ERROR_TIMEOUT,
151                     /* vendorErrorCode= */ 0, /* systemErrorCode */ 0);
152 
153 
154     /**
155      * Creates a {@link CarPropertyErrorCodes} structure from a VHAL status code.
156      */
createFromVhalStatusCode(int vhalStatusCode)157     public static CarPropertyErrorCodes createFromVhalStatusCode(int vhalStatusCode) {
158         @VehicleHalStatusCodeInt int systemErrorCode = getVhalSystemErrorCode(vhalStatusCode);
159         @CarPropMgrErrorCode int carPropertyManagerErrorCode = STATUS_OK;
160 
161         if (isNotAvailableVehicleHalStatusCode(systemErrorCode)) {
162             carPropertyManagerErrorCode = CarPropertyManager.STATUS_ERROR_NOT_AVAILABLE;
163         } else {
164             switch (systemErrorCode) {
165                 case VehicleHalStatusCode.STATUS_OK:
166                     break;
167                 case VehicleHalStatusCode.STATUS_TRY_AGAIN:
168                     carPropertyManagerErrorCode = STATUS_TRY_AGAIN;
169                     break;
170                 default:
171                     carPropertyManagerErrorCode = CarPropertyManager.STATUS_ERROR_INTERNAL_ERROR;
172                     break;
173             }
174         }
175 
176         CarPropertyErrorCodes errorCodes = new CarPropertyErrorCodes(
177                 carPropertyManagerErrorCode, getVhalVendorErrorCode(vhalStatusCode),
178                 systemErrorCode);
179 
180         return errorCodes;
181     }
182 
183     /**
184      * This is same as {@link CarPropertyAsyncErrorCode} except that it contains
185      * {@code STATUS_TRY_AGAIN}.
186      */
187     @IntDef(prefix = {"STATUS_"}, value = {
188             STATUS_OK,
189             CarPropertyManager.STATUS_ERROR_INTERNAL_ERROR,
190             CarPropertyManager.STATUS_ERROR_NOT_AVAILABLE,
191             CarPropertyManager.STATUS_ERROR_TIMEOUT,
192             STATUS_TRY_AGAIN
193     })
194     public @interface CarPropMgrErrorCode {}
195 
196     // This is the internal tracking error code. This should be checked first before checking
197     // vendor or system error code.
198     private @CarPropMgrErrorCode int mCarPropertyManagerErrorCode;
199     // If the error code comes from VHAL, this contains the optional vendor-specific error code.
200     private int mVendorErrorCode;
201     // If the error code comes from VHAL, this contains the VHAL system-defined error code. This is
202     // set to 0 if the error is generated internally from car service.
203     private int mSystemErrorCode;
204 
205     /**
206      * Create an instance of CarPropertyErrorCodes given a car property manager error code, a vendor
207      * error code, and a system error code.
208      */
CarPropertyErrorCodes(@arPropMgrErrorCode int carPropertyManagerErrorCode, int vendorErrorCode, int systemErrorCode)209     private CarPropertyErrorCodes(@CarPropMgrErrorCode int carPropertyManagerErrorCode,
210             int vendorErrorCode, int systemErrorCode) {
211         mCarPropertyManagerErrorCode = carPropertyManagerErrorCode;
212         mVendorErrorCode = vendorErrorCode;
213         mSystemErrorCode = systemErrorCode;
214     }
215 
216     /**
217      * Whether status is okay (there is no error).
218      */
isOkay()219     public boolean isOkay() {
220         return mCarPropertyManagerErrorCode == STATUS_OK;
221     }
222 
223     /**
224      * Whether the error is try again.
225      */
isTryAgain()226     public boolean isTryAgain() {
227         return mCarPropertyManagerErrorCode == STATUS_TRY_AGAIN;
228     }
229 
230     /**
231      * Get the vendor specified error code to allow for more detailed error codes returned from
232      * VHAL.
233      *
234      * This will be 0 if the error is generated internally from car service.
235      *
236      * A vendor error code will have a range from 0x0000 to 0xffff.
237      *
238      * @return the vendor error code if it is set, otherwise 0.
239      */
getVendorErrorCode()240     public int getVendorErrorCode() {
241         return mVendorErrorCode;
242     }
243 
244     /**
245      * Get the system error code returned from VHAL.
246      *
247      * This will be 0 if the error is generated internally from car service.
248      *
249      * A system error code will have a range from 0x0000 to 0xffff.
250      */
getSystemErrorCode()251     public @VehicleHalStatusCodeInt int getSystemErrorCode() {
252         return mSystemErrorCode;
253     }
254 
255     /**
256      * Converts this to one of {@link CarPropertyAsyncErrorCode}.
257      *
258      * @return the async error code
259      * @throws IllegalArgumentException if an invalid error code is passed in.
260      */
toCarPropertyAsyncErrorCode()261     public @CarPropertyAsyncErrorCode int toCarPropertyAsyncErrorCode() {
262         switch (mCarPropertyManagerErrorCode) {
263             case STATUS_OK: // Fallthrough
264             case CarPropertyManager.STATUS_ERROR_INTERNAL_ERROR: // Fallthrough
265             case CarPropertyManager.STATUS_ERROR_NOT_AVAILABLE: // Fallthrough
266             case CarPropertyManager.STATUS_ERROR_TIMEOUT: // Fallthrough
267                 return mCarPropertyManagerErrorCode;
268             case STATUS_TRY_AGAIN: // Fallthrough
269             default:
270                 throw new IllegalArgumentException(
271                         "Invalid error code: " + mCarPropertyManagerErrorCode);
272         }
273     }
274 
275     /**
276      * Converts this to one of {@link DetailedErrorCodeInt}.
277      *
278      * @return the detailed error code if available, otherwise set to 0.
279      * @throws IllegalArgumentException if an invalid error code is passed in.
280      */
281     @FlaggedApi(Flags.FLAG_CAR_PROPERTY_DETAILED_ERROR_CODES)
toDetailedErrorCode()282     public @DetailedErrorCodeInt int toDetailedErrorCode() {
283         if (!VEHICLE_HAL_STATUS_CODES.contains(mSystemErrorCode)) {
284             throw new IllegalArgumentException(
285                         "Invalid VHAL system error code: " + mSystemErrorCode);
286         }
287         return DETAILED_ERROR_CODE_BY_STATUS.get(mSystemErrorCode,
288                 /* valueIfKeyNotFound= */ DetailedErrorCode.NO_DETAILED_ERROR_CODE);
289     }
290 
291     /**
292      * Checks the error code and throws corresponding exception.
293      *
294      * @throws PropertyNotAvailableException If the error code is one of NOT_AVAILABLE error.
295      * @throws CarInternalErrorException If the error code is INTERNAL_ERROR.
296      */
checkAndMaybeThrowException(int propertyId, int areaId)297     public void checkAndMaybeThrowException(int propertyId, int areaId) {
298         if (isOkay()) {
299             return;
300         }
301 
302         if (mCarPropertyManagerErrorCode == CarPropertyManager.STATUS_ERROR_NOT_AVAILABLE) {
303             throw new PropertyNotAvailableException(propertyId, areaId,
304                     getPropertyNotAvailableErrorCodeFromStatusCode(mSystemErrorCode),
305                     mVendorErrorCode);
306         }
307 
308         switch (mSystemErrorCode) {
309             case VehicleHalStatusCode.STATUS_TRY_AGAIN:
310                 // Vendor error code is ignored for STATUS_TRY_AGAIN error
311                 throw new PropertyNotAvailableAndRetryException(propertyId, areaId);
312             case VehicleHalStatusCode.STATUS_ACCESS_DENIED:
313                 // Vendor error code is ignored for STATUS_ACCESS_DENIED error
314                 throw new PropertyAccessDeniedSecurityException(propertyId, areaId);
315             case VehicleHalStatusCode.STATUS_INTERNAL_ERROR:
316                 throw new CarInternalErrorException(propertyId, areaId, mVendorErrorCode);
317             default:
318                 Slog.e(TAG, "Invalid VAHL error code: " + mSystemErrorCode
319                         + ", convert to CarInternalErrorException");
320                 throw new CarInternalErrorException(propertyId, areaId);
321         }
322     }
323 
324     /**
325      * Returns {@code true} if {@code vehicleHalStatusCode} is one of the not available
326      * {@link VehicleHalStatusCode} values}. Otherwise returns {@code false}.
327      */
isNotAvailableVehicleHalStatusCode( @ehicleHalStatusCodeInt int vehicleHalStatusCode)328     public static boolean isNotAvailableVehicleHalStatusCode(
329             @VehicleHalStatusCodeInt int vehicleHalStatusCode) {
330         return PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS
331                 .indexOfKey(vehicleHalStatusCode) >= 0;
332     }
333 
334     /**
335      * Convert {@link VehicleHalStatusCode} into public {@link PropertyNotAvailableErrorCode}
336      * equivalents.
337      *
338      * @throws IllegalArgumentException if an invalid status code is passed in.
339      * @hide
340      */
341     private static @PropertyNotAvailableErrorCodeInt int
getPropertyNotAvailableErrorCodeFromStatusCode(int statusCode)342             getPropertyNotAvailableErrorCodeFromStatusCode(int statusCode) {
343         Integer propertyNotAvailableErrorCode =
344                 PROP_NOT_AVAILABLE_ERROR_CODE_BY_STATUS.get(statusCode);
345         if (propertyNotAvailableErrorCode == null) {
346             throw new IllegalArgumentException(
347                     "Not an not_available error status code: " + statusCode);
348         }
349         return propertyNotAvailableErrorCode;
350     }
351 
352     /**
353      * Returns the system error code contained in the error code returned from VHAL.
354      */
355     @SuppressLint("WrongConstant")
getVhalSystemErrorCode(int vhalErrorCode)356     public static @VehicleHalStatusCodeInt int getVhalSystemErrorCode(int vhalErrorCode) {
357         return vhalErrorCode & SYSTEM_ERROR_CODE_MASK;
358     }
359 
360     /**
361      * Returns the vendor error code contained in the error code returned from VHAL.
362      */
getVhalVendorErrorCode(int vhalErrorCode)363     public static int getVhalVendorErrorCode(int vhalErrorCode) {
364         return vhalErrorCode >>> VENDOR_ERROR_CODE_SHIFT;
365     }
366 
367     @Override
toString()368     public String toString() {
369         return carPropertyErrorCodestoString(this);
370     }
371 
372     /**
373      * Returns a string representation of a {@code CarPropertyErrorCodes}.
374      */
375     @NonNull
carPropertyErrorCodestoString( CarPropertyErrorCodes carPropertyErrorCodes)376     public static String carPropertyErrorCodestoString(
377             CarPropertyErrorCodes carPropertyErrorCodes) {
378         var sj = new StringJoiner(", ", "CarPropertyErrorCodes{", "}");
379         sj.add("cpmErrorCode: " + carPropertyErrorCodes.mCarPropertyManagerErrorCode);
380         sj.add("vendorErrorCode: " + carPropertyErrorCodes.getVendorErrorCode());
381         sj.add("systemErrorCode: " + carPropertyErrorCodes.getSystemErrorCode());
382         return sj.toString();
383     }
384 
385 
386 
387     // Code below generated by codegen v1.0.23.
388     //
389     // DO NOT MODIFY!
390     // CHECKSTYLE:OFF Generated code
391     //
392     // To regenerate run:
393     // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/com/android/car/internal/property/CarPropertyErrorCodes.java
394     //
395     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
396     //   Settings > Editor > Code Style > Formatter Control
397     //@formatter:off
398 
399 
400     @IntDef(prefix = "STATUS_", value = {
401         STATUS_OK,
402         STATUS_TRY_AGAIN
403     })
404     @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)
405     @DataClass.Generated.Member
406     public @interface Status {}
407 
408     @DataClass.Generated.Member
statusToString(@tatus int value)409     public static String statusToString(@Status int value) {
410         switch (value) {
411             case STATUS_OK:
412                     return "STATUS_OK";
413             case STATUS_TRY_AGAIN:
414                     return "STATUS_TRY_AGAIN";
415             default: return Integer.toHexString(value);
416         }
417     }
418 
419     @Override
420     @DataClass.Generated.Member
writeToParcel(@onNull Parcel dest, int flags)421     public void writeToParcel(@NonNull Parcel dest, int flags) {
422         // You can override field parcelling by defining methods like:
423         // void parcelFieldName(Parcel dest, int flags) { ... }
424 
425         dest.writeInt(mCarPropertyManagerErrorCode);
426         dest.writeInt(mVendorErrorCode);
427         dest.writeInt(mSystemErrorCode);
428     }
429 
430     @Override
431     @DataClass.Generated.Member
describeContents()432     public int describeContents() { return 0; }
433 
434     /** @hide */
435     @SuppressWarnings({"unchecked", "RedundantCast"})
436     @DataClass.Generated.Member
CarPropertyErrorCodes(@onNull Parcel in)437     /* package-private */ CarPropertyErrorCodes(@NonNull Parcel in) {
438         // You can override field unparcelling by defining methods like:
439         // static FieldType unparcelFieldName(Parcel in) { ... }
440 
441         int carPropertyManagerErrorCode = in.readInt();
442         int vendorErrorCode = in.readInt();
443         int systemErrorCode = in.readInt();
444 
445         this.mCarPropertyManagerErrorCode = carPropertyManagerErrorCode;
446         AnnotationValidations.validate(
447                 CarPropMgrErrorCode.class, null, mCarPropertyManagerErrorCode);
448         this.mVendorErrorCode = vendorErrorCode;
449         this.mSystemErrorCode = systemErrorCode;
450 
451         // onConstructed(); // You can define this method to get a callback
452     }
453 
454     @DataClass.Generated.Member
455     public static final @NonNull Parcelable.Creator<CarPropertyErrorCodes> CREATOR
456             = new Parcelable.Creator<CarPropertyErrorCodes>() {
457         @Override
458         public CarPropertyErrorCodes[] newArray(int size) {
459             return new CarPropertyErrorCodes[size];
460         }
461 
462         @Override
463         public CarPropertyErrorCodes createFromParcel(@NonNull Parcel in) {
464             return new CarPropertyErrorCodes(in);
465         }
466     };
467 
468     @DataClass.Generated(
469             time = 1732673628876L,
470             codegenVersion = "1.0.23",
471             sourceFile = "packages/services/Car/car-lib/src/com/android/car/internal/property/CarPropertyErrorCodes.java",
472             inputSignatures = "public static final  int STATUS_OK\npublic static final  int STATUS_TRY_AGAIN\nprivate static final  int SYSTEM_ERROR_CODE_MASK\nprivate static final  int VENDOR_ERROR_CODE_SHIFT\npublic static  com.android.car.internal.property.CarPropertyErrorCodes STATUS_OK_NO_ERROR\npublic static  com.android.car.internal.property.CarPropertyErrorCodes ERROR_CODES_NOT_AVAILABLE\npublic static  com.android.car.internal.property.CarPropertyErrorCodes ERROR_CODES_TRY_AGAIN\npublic static  com.android.car.internal.property.CarPropertyErrorCodes ERROR_CODES_INTERNAL\npublic static  com.android.car.internal.property.CarPropertyErrorCodes ERROR_CODES_TIMEOUT\nprivate @com.android.car.internal.property.CarPropertyErrorCodes.CarPropMgrErrorCode int mCarPropertyManagerErrorCode\nprivate  int mVendorErrorCode\nprivate  int mSystemErrorCode\npublic static  com.android.car.internal.property.CarPropertyErrorCodes createFromVhalStatusCode(int)\npublic  boolean isOkay()\npublic  boolean isTryAgain()\npublic  int getVendorErrorCode()\npublic  int getSystemErrorCode()\npublic @android.car.hardware.property.CarPropertyManager.CarPropertyAsyncErrorCode int toCarPropertyAsyncErrorCode()\npublic static @android.annotation.SuppressLint @android.car.hardware.property.VehicleHalStatusCode.VehicleHalStatusCodeInt int getVhalSystemErrorCode(int)\npublic static  int getVhalVendorErrorCode(int)\npublic static  boolean isNotAvailableVehicleHalStatusCode(int)\npublic @java.lang.Override java.lang.String toString()\npublic static @android.annotation.NonNull java.lang.String toString(com.android.car.internal.property.CarPropertyErrorCodes)\nclass CarPropertyErrorCodes extends java.lang.Object implements [android.os.Parcelable]\n@com.android.car.internal.util.DataClass(genConstructor=false, genSetters=false, genGetters=false)")
473     @Deprecated
__metadata()474     private void __metadata() {}
475 
476 
477     //@formatter:on
478     // End of generated code
479 
480 }
481