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