1 /* 2 * Copyright (C) 2021 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.watchdog; 18 19 import static com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport.BOILERPLATE_CODE; 20 21 import android.car.annotation.AddedInOrBefore; 22 import android.os.Parcelable; 23 24 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport; 25 import com.android.car.internal.util.DataClass; 26 27 /** 28 * Number of bytes attributed to each application or system state. 29 */ 30 @DataClass(genToString = true) 31 public final class PerStateBytes implements Parcelable { 32 /** 33 * Number of bytes attributed to the application foreground mode. 34 */ 35 private long mForegroundModeBytes; 36 37 /** 38 * Number of bytes attributed to the application background mode. 39 */ 40 private long mBackgroundModeBytes; 41 42 /** 43 * Number of bytes attributed to the system garage mode. 44 */ 45 private long mGarageModeBytes; 46 47 48 49 // Code below generated by codegen v1.0.22. 50 // 51 // DO NOT MODIFY! 52 // CHECKSTYLE:OFF Generated code 53 // 54 // To regenerate run: 55 // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/watchdog/PerStateBytes.java 56 // 57 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 58 // Settings > Editor > Code Style > Formatter Control 59 //@formatter:off 60 61 62 /** 63 * Creates a new PerStateBytes. 64 * 65 * @param foregroundModeBytes 66 * Number of bytes attributed to the application foreground mode. 67 * @param backgroundModeBytes 68 * Number of bytes attributed to the application background mode. 69 * @param garageModeBytes 70 * Number of bytes attributed to the system garage mode. 71 */ 72 @DataClass.Generated.Member PerStateBytes( long foregroundModeBytes, long backgroundModeBytes, long garageModeBytes)73 public PerStateBytes( 74 long foregroundModeBytes, 75 long backgroundModeBytes, 76 long garageModeBytes) { 77 this.mForegroundModeBytes = foregroundModeBytes; 78 this.mBackgroundModeBytes = backgroundModeBytes; 79 this.mGarageModeBytes = garageModeBytes; 80 81 // onConstructed(); // You can define this method to get a callback 82 } 83 84 /** 85 * Number of bytes attributed to the application foreground mode. 86 */ 87 @DataClass.Generated.Member 88 @AddedInOrBefore(majorVersion = 33) getForegroundModeBytes()89 public long getForegroundModeBytes() { 90 return mForegroundModeBytes; 91 } 92 93 /** 94 * Number of bytes attributed to the application background mode. 95 */ 96 @DataClass.Generated.Member 97 @AddedInOrBefore(majorVersion = 33) getBackgroundModeBytes()98 public long getBackgroundModeBytes() { 99 return mBackgroundModeBytes; 100 } 101 102 /** 103 * Number of bytes attributed to the system garage mode. 104 */ 105 @DataClass.Generated.Member 106 @AddedInOrBefore(majorVersion = 33) getGarageModeBytes()107 public long getGarageModeBytes() { 108 return mGarageModeBytes; 109 } 110 111 @Override 112 @DataClass.Generated.Member 113 @AddedInOrBefore(majorVersion = 33) toString()114 public String toString() { 115 // You can override field toString logic by defining methods like: 116 // String fieldNameToString() { ... } 117 118 return "PerStateBytes { " + 119 "foregroundModeBytes = " + mForegroundModeBytes + ", " + 120 "backgroundModeBytes = " + mBackgroundModeBytes + ", " + 121 "garageModeBytes = " + mGarageModeBytes + 122 " }"; 123 } 124 125 @Override 126 @DataClass.Generated.Member 127 @AddedInOrBefore(majorVersion = 33) writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)128 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 129 // You can override field parcelling by defining methods like: 130 // void parcelFieldName(Parcel dest, int flags) { ... } 131 132 dest.writeLong(mForegroundModeBytes); 133 dest.writeLong(mBackgroundModeBytes); 134 dest.writeLong(mGarageModeBytes); 135 } 136 137 @Override 138 @DataClass.Generated.Member 139 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) 140 @AddedInOrBefore(majorVersion = 33) describeContents()141 public int describeContents() { return 0; } 142 143 /** @hide */ 144 @SuppressWarnings({"unchecked", "RedundantCast"}) 145 @DataClass.Generated.Member PerStateBytes(@ndroid.annotation.NonNull android.os.Parcel in)146 /* package-private */ PerStateBytes(@android.annotation.NonNull android.os.Parcel in) { 147 // You can override field unparcelling by defining methods like: 148 // static FieldType unparcelFieldName(Parcel in) { ... } 149 150 long foregroundModeBytes = in.readLong(); 151 long backgroundModeBytes = in.readLong(); 152 long garageModeBytes = in.readLong(); 153 154 this.mForegroundModeBytes = foregroundModeBytes; 155 this.mBackgroundModeBytes = backgroundModeBytes; 156 this.mGarageModeBytes = garageModeBytes; 157 158 // onConstructed(); // You can define this method to get a callback 159 } 160 161 @DataClass.Generated.Member 162 @AddedInOrBefore(majorVersion = 33) 163 public static final @android.annotation.NonNull Parcelable.Creator<PerStateBytes> CREATOR 164 = new Parcelable.Creator<PerStateBytes>() { 165 @Override 166 public PerStateBytes[] newArray(int size) { 167 return new PerStateBytes[size]; 168 } 169 170 @Override 171 public PerStateBytes createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 172 return new PerStateBytes(in); 173 } 174 }; 175 176 @DataClass.Generated( 177 time = 1614388529869L, 178 codegenVersion = "1.0.22", 179 sourceFile = "packages/services/Car/car-lib/src/android/car/watchdog/PerStateBytes.java", 180 inputSignatures = "private long mForegroundModeBytes\nprivate long mBackgroundModeBytes\nprivate long mGarageModeBytes\nclass PerStateBytes extends java.lang.Object implements [android.os.Parcelable]\n@com.android.car.internal.util.DataClass(genToString=true)") 181 @Deprecated 182 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) __metadata()183 private void __metadata() {} 184 185 186 //@formatter:on 187 // End of generated code 188 189 } 190