1 /* 2 * Copyright (C) 2020 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 android.car.vms; 18 19 import android.annotation.Nullable; 20 import android.os.Parcel; 21 import android.os.Parcelable; 22 23 import com.android.internal.util.DataClass; 24 25 import java.util.Arrays; 26 27 /** 28 * Hidden data object used to communicate Vehicle Map Service publisher information on registration. 29 * 30 * @hide 31 */ 32 @DataClass( 33 genEqualsHashCode = true, 34 genAidl = true) 35 public class VmsProviderInfo implements Parcelable { 36 private @Nullable final byte[] mDescription; 37 38 39 40 // Code below generated by codegen v1.0.14. 41 // 42 // DO NOT MODIFY! 43 // CHECKSTYLE:OFF Generated code 44 // 45 // To regenerate run: 46 // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/vms/VmsProviderInfo.java 47 // 48 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 49 // Settings > Editor > Code Style > Formatter Control 50 //@formatter:off 51 52 53 @DataClass.Generated.Member VmsProviderInfo( @ullable byte[] description)54 public VmsProviderInfo( 55 @Nullable byte[] description) { 56 this.mDescription = description; 57 58 // onConstructed(); // You can define this method to get a callback 59 } 60 61 @DataClass.Generated.Member getDescription()62 public @Nullable byte[] getDescription() { 63 return mDescription; 64 } 65 66 @Override 67 @DataClass.Generated.Member equals(@ullable Object o)68 public boolean equals(@Nullable Object o) { 69 // You can override field equality logic by defining either of the methods like: 70 // boolean fieldNameEquals(VmsProviderInfo other) { ... } 71 // boolean fieldNameEquals(FieldType otherValue) { ... } 72 73 if (this == o) return true; 74 if (o == null || getClass() != o.getClass()) return false; 75 @SuppressWarnings("unchecked") 76 VmsProviderInfo that = (VmsProviderInfo) o; 77 //noinspection PointlessBooleanExpression 78 return true 79 && Arrays.equals(mDescription, that.mDescription); 80 } 81 82 @Override 83 @DataClass.Generated.Member hashCode()84 public int hashCode() { 85 // You can override field hashCode logic by defining methods like: 86 // int fieldNameHashCode() { ... } 87 88 int _hash = 1; 89 _hash = 31 * _hash + Arrays.hashCode(mDescription); 90 return _hash; 91 } 92 93 @Override 94 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull Parcel dest, int flags)95 public void writeToParcel(@android.annotation.NonNull Parcel dest, int flags) { 96 // You can override field parcelling by defining methods like: 97 // void parcelFieldName(Parcel dest, int flags) { ... } 98 99 byte flg = 0; 100 if (mDescription != null) flg |= 0x1; 101 dest.writeByte(flg); 102 if (mDescription != null) dest.writeByteArray(mDescription); 103 } 104 105 @Override 106 @DataClass.Generated.Member describeContents()107 public int describeContents() { return 0; } 108 109 /** @hide */ 110 @SuppressWarnings({"unchecked", "RedundantCast"}) 111 @DataClass.Generated.Member VmsProviderInfo(@ndroid.annotation.NonNull Parcel in)112 protected VmsProviderInfo(@android.annotation.NonNull Parcel in) { 113 // You can override field unparcelling by defining methods like: 114 // static FieldType unparcelFieldName(Parcel in) { ... } 115 116 byte flg = in.readByte(); 117 byte[] description = (flg & 0x1) == 0 ? null : in.createByteArray(); 118 119 this.mDescription = description; 120 121 // onConstructed(); // You can define this method to get a callback 122 } 123 124 @DataClass.Generated.Member 125 public static final @android.annotation.NonNull Parcelable.Creator<VmsProviderInfo> CREATOR 126 = new Parcelable.Creator<VmsProviderInfo>() { 127 @Override 128 public VmsProviderInfo[] newArray(int size) { 129 return new VmsProviderInfo[size]; 130 } 131 132 @Override 133 public VmsProviderInfo createFromParcel(@android.annotation.NonNull Parcel in) { 134 return new VmsProviderInfo(in); 135 } 136 }; 137 138 @DataClass.Generated( 139 time = 1581406319319L, 140 codegenVersion = "1.0.14", 141 sourceFile = "packages/services/Car/car-lib/src/android/car/vms/VmsProviderInfo.java", 142 inputSignatures = "private final @android.annotation.Nullable byte[] mDescription\nclass VmsProviderInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true)") 143 @Deprecated __metadata()144 private void __metadata() {} 145 146 147 //@formatter:on 148 // End of generated code 149 150 } 151