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.22. 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 // Added AddedInOrBefore or ApiRequirement Annotation manually 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 getForegroundModeBytes()88 public long getForegroundModeBytes() { 89 return mForegroundModeBytes; 90 } 91 92 /** 93 * Number of bytes attributed to the application background mode. 94 */ 95 @DataClass.Generated.Member getBackgroundModeBytes()96 public long getBackgroundModeBytes() { 97 return mBackgroundModeBytes; 98 } 99 100 /** 101 * Number of bytes attributed to the system garage mode. 102 */ 103 @DataClass.Generated.Member getGarageModeBytes()104 public long getGarageModeBytes() { 105 return mGarageModeBytes; 106 } 107 108 @Override 109 @DataClass.Generated.Member toString()110 public String toString() { 111 // You can override field toString logic by defining methods like: 112 // String fieldNameToString() { ... } 113 114 return "PerStateBytes { " + 115 "foregroundModeBytes = " + mForegroundModeBytes + ", " + 116 "backgroundModeBytes = " + mBackgroundModeBytes + ", " + 117 "garageModeBytes = " + mGarageModeBytes + 118 " }"; 119 } 120 121 @Override 122 @DataClass.Generated.Member writeToParcel(@ndroid.annotation.NonNull android.os.Parcel dest, int flags)123 public void writeToParcel(@android.annotation.NonNull android.os.Parcel dest, int flags) { 124 // You can override field parcelling by defining methods like: 125 // void parcelFieldName(Parcel dest, int flags) { ... } 126 127 dest.writeLong(mForegroundModeBytes); 128 dest.writeLong(mBackgroundModeBytes); 129 dest.writeLong(mGarageModeBytes); 130 } 131 132 @Override 133 @DataClass.Generated.Member 134 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) describeContents()135 public int describeContents() { return 0; } 136 137 /** @hide */ 138 @SuppressWarnings({"unchecked", "RedundantCast"}) 139 @DataClass.Generated.Member PerStateBytes(@ndroid.annotation.NonNull android.os.Parcel in)140 /* package-private */ PerStateBytes(@android.annotation.NonNull android.os.Parcel in) { 141 // You can override field unparcelling by defining methods like: 142 // static FieldType unparcelFieldName(Parcel in) { ... } 143 144 long foregroundModeBytes = in.readLong(); 145 long backgroundModeBytes = in.readLong(); 146 long garageModeBytes = in.readLong(); 147 148 this.mForegroundModeBytes = foregroundModeBytes; 149 this.mBackgroundModeBytes = backgroundModeBytes; 150 this.mGarageModeBytes = garageModeBytes; 151 152 // onConstructed(); // You can define this method to get a callback 153 } 154 155 @DataClass.Generated.Member 156 public static final @android.annotation.NonNull Parcelable.Creator<PerStateBytes> CREATOR 157 = new Parcelable.Creator<PerStateBytes>() { 158 @Override 159 public PerStateBytes[] newArray(int size) { 160 return new PerStateBytes[size]; 161 } 162 163 @Override 164 public PerStateBytes createFromParcel(@android.annotation.NonNull android.os.Parcel in) { 165 return new PerStateBytes(in); 166 } 167 }; 168 169 @DataClass.Generated( 170 time = 1614388529869L, 171 codegenVersion = "1.0.22", 172 sourceFile = "packages/services/Car/car-lib/src/android/car/watchdog/PerStateBytes.java", 173 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)") 174 @Deprecated 175 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) __metadata()176 private void __metadata() {} 177 178 179 //@formatter:on 180 // End of generated code 181 182 } 183