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.annotation.NonNull; 22 import android.annotation.SuppressLint; 23 import android.annotation.SystemApi; 24 import android.os.Parcelable; 25 26 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport; 27 import com.android.internal.util.DataClass; 28 29 /** 30 * System-wide disk I/O overuse alert threshold. 31 * 32 * @hide 33 */ 34 @SystemApi 35 @DataClass(genToString = true, genHiddenConstructor = true) 36 public final class IoOveruseAlertThreshold implements Parcelable { 37 /** 38 * Duration over which the given written bytes per second should be checked against. 39 * 40 * <p>Non-zero duration must provided in seconds. 41 */ 42 @SuppressLint({"MethodNameUnits"}) 43 private long mDurationInSeconds; 44 45 /** 46 * Alert I/O overuse on reaching the written bytes/second over {@link #mDurationInSeconds}. 47 * 48 * <p>Must provide non-zero bytes. 49 */ 50 private long mWrittenBytesPerSecond; 51 52 53 54 // Code below generated by codegen v1.0.22. 55 // 56 // DO NOT MODIFY! 57 // CHECKSTYLE:OFF Generated code 58 // 59 // To regenerate run: 60 // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/watchdog/IoOveruseAlertThreshold.java 61 // 62 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 63 // Settings > Editor > Code Style > Formatter Control 64 //@formatter:off 65 66 67 /** 68 * Creates a new IoOveruseAlertThreshold. 69 * 70 * @param durationInSeconds 71 * Duration over which the given written bytes per second should be checked against. 72 * 73 * <p>Non-zero duration must provided in seconds. 74 * @param writtenBytesPerSecond 75 * Alert I/O overuse on reaching the written bytes/second over {@link #mDurationInSeconds}. 76 * 77 * <p>Must provide non-zero bytes. 78 * @hide 79 */ 80 @DataClass.Generated.Member IoOveruseAlertThreshold( @uppressLint{ "MethodNameUnits" }) long durationInSeconds, long writtenBytesPerSecond)81 public IoOveruseAlertThreshold( 82 @SuppressLint({ "MethodNameUnits" }) long durationInSeconds, 83 long writtenBytesPerSecond) { 84 this.mDurationInSeconds = durationInSeconds; 85 this.mWrittenBytesPerSecond = writtenBytesPerSecond; 86 87 // onConstructed(); // You can define this method to get a callback 88 } 89 90 /** 91 * Duration over which the given written bytes per second should be checked against. 92 * 93 * <p>Non-zero duration must provided in seconds. 94 */ 95 @DataClass.Generated.Member getDurationInSeconds()96 public @SuppressLint({ "MethodNameUnits" }) long getDurationInSeconds() { 97 return mDurationInSeconds; 98 } 99 100 /** 101 * Alert I/O overuse on reaching the written bytes/second over {@link #mDurationInSeconds}. 102 * 103 * <p>Must provide non-zero bytes. 104 */ 105 @DataClass.Generated.Member getWrittenBytesPerSecond()106 public long getWrittenBytesPerSecond() { 107 return mWrittenBytesPerSecond; 108 } 109 110 @Override 111 @DataClass.Generated.Member toString()112 public String toString() { 113 // You can override field toString logic by defining methods like: 114 // String fieldNameToString() { ... } 115 116 return "IoOveruseAlertThreshold { " + 117 "durationInSeconds = " + mDurationInSeconds + ", " + 118 "writtenBytesPerSecond = " + mWrittenBytesPerSecond + 119 " }"; 120 } 121 122 @Override 123 @DataClass.Generated.Member writeToParcel(@onNull android.os.Parcel dest, int flags)124 public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { 125 // You can override field parcelling by defining methods like: 126 // void parcelFieldName(Parcel dest, int flags) { ... } 127 128 dest.writeLong(mDurationInSeconds); 129 dest.writeLong(mWrittenBytesPerSecond); 130 } 131 132 @Override 133 @DataClass.Generated.Member describeContents()134 public int describeContents() { return 0; } 135 136 /** @hide */ 137 @SuppressWarnings({"unchecked", "RedundantCast"}) 138 @DataClass.Generated.Member IoOveruseAlertThreshold(@onNull android.os.Parcel in)139 /* package-private */ IoOveruseAlertThreshold(@NonNull android.os.Parcel in) { 140 // You can override field unparcelling by defining methods like: 141 // static FieldType unparcelFieldName(Parcel in) { ... } 142 143 long durationInSeconds = in.readLong(); 144 long writtenBytesPerSecond = in.readLong(); 145 146 this.mDurationInSeconds = durationInSeconds; 147 this.mWrittenBytesPerSecond = writtenBytesPerSecond; 148 149 // onConstructed(); // You can define this method to get a callback 150 } 151 152 @DataClass.Generated.Member 153 public static final @NonNull Parcelable.Creator<IoOveruseAlertThreshold> CREATOR 154 = new Parcelable.Creator<IoOveruseAlertThreshold>() { 155 @Override 156 public IoOveruseAlertThreshold[] newArray(int size) { 157 return new IoOveruseAlertThreshold[size]; 158 } 159 160 @Override 161 public IoOveruseAlertThreshold createFromParcel(@NonNull android.os.Parcel in) { 162 return new IoOveruseAlertThreshold(in); 163 } 164 }; 165 166 @DataClass.Generated( 167 time = 1615312119067L, 168 codegenVersion = "1.0.22", 169 sourceFile = "packages/services/Car/car-lib/src/android/car/watchdog/IoOveruseAlertThreshold.java", 170 inputSignatures = "private @android.annotation.SuppressLint long mDurationInSeconds\nprivate long mWrittenBytesPerSecond\nclass IoOveruseAlertThreshold extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstructor=true)") 171 @Deprecated 172 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) __metadata()173 private void __metadata() {} 174 175 176 //@formatter:on 177 // End of generated code 178 179 } 180