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.IntDef; 22 import android.annotation.NonNull; 23 import android.annotation.Nullable; 24 import android.annotation.StringDef; 25 import android.annotation.SystemApi; 26 import android.car.annotation.AddedInOrBefore; 27 import android.os.Parcelable; 28 29 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport; 30 import com.android.car.internal.util.AnnotationValidations; 31 import com.android.car.internal.util.DataClass; 32 33 import java.lang.annotation.Retention; 34 import java.lang.annotation.RetentionPolicy; 35 import java.util.List; 36 import java.util.Map; 37 38 /** 39 * Resource overuse configuration for a component. 40 * 41 * @hide 42 */ 43 @SystemApi 44 @DataClass(genToString = true, genBuilder = true, genHiddenConstDefs = true) 45 public final class ResourceOveruseConfiguration implements Parcelable { 46 /** 47 * System component. 48 */ 49 @ComponentType 50 @AddedInOrBefore(majorVersion = 33) 51 public static final int COMPONENT_TYPE_SYSTEM = 1; 52 53 /** 54 * Vendor component. 55 */ 56 @ComponentType 57 @AddedInOrBefore(majorVersion = 33) 58 public static final int COMPONENT_TYPE_VENDOR = 2; 59 60 /** 61 * Third party component. 62 */ 63 @ComponentType 64 @AddedInOrBefore(majorVersion = 33) 65 public static final int COMPONENT_TYPE_THIRD_PARTY = 3; 66 67 /** 68 * Map applications. 69 */ 70 @ApplicationCategoryType 71 @AddedInOrBefore(majorVersion = 33) 72 public static final String APPLICATION_CATEGORY_TYPE_MAPS = 73 "android.car.watchdog.app.category.MAPS"; 74 75 /** 76 * Media applications. 77 */ 78 @ApplicationCategoryType 79 @AddedInOrBefore(majorVersion = 33) 80 public static final String APPLICATION_CATEGORY_TYPE_MEDIA = 81 "android.car.watchdog.app.category.MEDIA"; 82 83 /** 84 * Component type of the I/O overuse configuration. 85 */ 86 private @ComponentType int mComponentType; 87 88 /** 89 * List of system or vendor packages that are safe to be killed on resource overuse. 90 * 91 * <p>When specifying shared package names, the package names should contain the prefix 92 * 'shared:'. 93 * <p>System components must provide only safe-to-kill system packages in this list. 94 * <p>Vendor components must provide only safe-to-kill vendor packages in this list. 95 */ 96 private @NonNull List<String> mSafeToKillPackages; 97 98 /** 99 * List of vendor package prefixes. 100 * 101 * <p>Any pre-installed package name starting with one of the prefixes or any package from the 102 * vendor partition is identified as a vendor package and vendor provided thresholds are applied 103 * to these packages. This list must be provided only by the vendor component. 104 * 105 * <p>When specifying shared package name prefixes, the prefix should contain 'shared:' at 106 * the beginning. 107 */ 108 private @NonNull List<String> mVendorPackagePrefixes; 109 110 111 /** 112 * Mappings from package name to application category types. 113 * 114 * <p>This mapping must contain only packages that can be mapped to one of the 115 * {@link ApplicationCategoryType} types. This mapping must be defined only by the system and 116 * vendor components. 117 * 118 * <p>For packages under a shared UID, the application category type must be specified 119 * for the shared package name and not for individual packages under the shared UID. When 120 * specifying shared package names, the package names should contain the prefix 'shared:'. 121 */ 122 private @NonNull Map<String, String> mPackagesToAppCategoryTypes; 123 124 /** 125 * I/O overuse configuration for the component specified by 126 * {@link ResourceOveruseConfiguration#getComponentType}. 127 */ 128 private @Nullable IoOveruseConfiguration mIoOveruseConfiguration = null; 129 130 131 132 // Code below generated by codegen v1.0.23. 133 // 134 // DO NOT MODIFY! 135 // CHECKSTYLE:OFF Generated code 136 // 137 // To regenerate run: 138 // $ codegen $ANDROID_BUILD_TOP/packages/services/Car/car-lib/src/android/car/watchdog/ResourceOveruseConfiguration.java 139 // Added AddedInOrBefore or ApiRequirement Annotation manually 140 // 141 // To exclude the generated code from IntelliJ auto-formatting enable (one-time): 142 // Settings > Editor > Code Style > Formatter Control 143 //@formatter:off 144 145 146 /** @hide */ 147 @IntDef(prefix = "COMPONENT_TYPE_", value = { 148 COMPONENT_TYPE_SYSTEM, 149 COMPONENT_TYPE_VENDOR, 150 COMPONENT_TYPE_THIRD_PARTY 151 }) 152 @Retention(RetentionPolicy.SOURCE) 153 @DataClass.Generated.Member 154 public @interface ComponentType {} 155 156 /** @hide */ 157 @DataClass.Generated.Member 158 @AddedInOrBefore(majorVersion = 33) componentTypeToString(@omponentType int value)159 public static String componentTypeToString(@ComponentType int value) { 160 switch (value) { 161 case COMPONENT_TYPE_SYSTEM: 162 return "COMPONENT_TYPE_SYSTEM"; 163 case COMPONENT_TYPE_VENDOR: 164 return "COMPONENT_TYPE_VENDOR"; 165 case COMPONENT_TYPE_THIRD_PARTY: 166 return "COMPONENT_TYPE_THIRD_PARTY"; 167 default: return Integer.toHexString(value); 168 } 169 } 170 171 /** @hide */ 172 @StringDef(prefix = "APPLICATION_CATEGORY_TYPE_", value = { 173 APPLICATION_CATEGORY_TYPE_MAPS, 174 APPLICATION_CATEGORY_TYPE_MEDIA 175 }) 176 @Retention(RetentionPolicy.SOURCE) 177 @DataClass.Generated.Member 178 public @interface ApplicationCategoryType {} 179 180 @DataClass.Generated.Member ResourceOveruseConfiguration( @omponentType int componentType, @NonNull List<String> safeToKillPackages, @NonNull List<String> vendorPackagePrefixes, @NonNull Map<String,String> packagesToAppCategoryTypes, @Nullable IoOveruseConfiguration ioOveruseConfiguration)181 /* package-private */ ResourceOveruseConfiguration( 182 @ComponentType int componentType, 183 @NonNull List<String> safeToKillPackages, 184 @NonNull List<String> vendorPackagePrefixes, 185 @NonNull Map<String,String> packagesToAppCategoryTypes, 186 @Nullable IoOveruseConfiguration ioOveruseConfiguration) { 187 this.mComponentType = componentType; 188 189 if (!(mComponentType == COMPONENT_TYPE_SYSTEM) 190 && !(mComponentType == COMPONENT_TYPE_VENDOR) 191 && !(mComponentType == COMPONENT_TYPE_THIRD_PARTY)) { 192 throw new java.lang.IllegalArgumentException( 193 "componentType was " + mComponentType + " but must be one of: " 194 + "COMPONENT_TYPE_SYSTEM(" + COMPONENT_TYPE_SYSTEM + "), " 195 + "COMPONENT_TYPE_VENDOR(" + COMPONENT_TYPE_VENDOR + "), " 196 + "COMPONENT_TYPE_THIRD_PARTY(" + COMPONENT_TYPE_THIRD_PARTY + ")"); 197 } 198 199 this.mSafeToKillPackages = safeToKillPackages; 200 AnnotationValidations.validate( 201 NonNull.class, null, mSafeToKillPackages); 202 this.mVendorPackagePrefixes = vendorPackagePrefixes; 203 AnnotationValidations.validate( 204 NonNull.class, null, mVendorPackagePrefixes); 205 this.mPackagesToAppCategoryTypes = packagesToAppCategoryTypes; 206 AnnotationValidations.validate( 207 NonNull.class, null, mPackagesToAppCategoryTypes); 208 this.mIoOveruseConfiguration = ioOveruseConfiguration; 209 210 // onConstructed(); // You can define this method to get a callback 211 } 212 213 /** 214 * Component type of the I/O overuse configuration. 215 */ 216 @DataClass.Generated.Member 217 @AddedInOrBefore(majorVersion = 33) getComponentType()218 public @ComponentType int getComponentType() { 219 return mComponentType; 220 } 221 222 /** 223 * List of system or vendor packages that are safe to be killed on resource overuse. 224 * 225 * <p>When specifying shared package names, the package names should contain the prefix 226 * 'shared:'. 227 * <p>System components must provide only safe-to-kill system packages in this list. 228 * <p>Vendor components must provide only safe-to-kill vendor packages in this list. 229 */ 230 @DataClass.Generated.Member 231 @AddedInOrBefore(majorVersion = 33) getSafeToKillPackages()232 public @NonNull List<String> getSafeToKillPackages() { 233 return mSafeToKillPackages; 234 } 235 236 /** 237 * List of vendor package prefixes. 238 * 239 * <p>Any pre-installed package name starting with one of the prefixes or any package from the 240 * vendor partition is identified as a vendor package and vendor provided thresholds are applied 241 * to these packages. This list must be provided only by the vendor component. 242 * 243 * <p>When specifying shared package name prefixes, the prefix should contain 'shared:' at 244 * the beginning. 245 */ 246 @DataClass.Generated.Member 247 @AddedInOrBefore(majorVersion = 33) getVendorPackagePrefixes()248 public @NonNull List<String> getVendorPackagePrefixes() { 249 return mVendorPackagePrefixes; 250 } 251 252 /** 253 * Mappings from package name to application category types. 254 * 255 * <p>This mapping must contain only packages that can be mapped to one of the 256 * {@link ApplicationCategoryType} types. This mapping must be defined only by the system and 257 * vendor components. 258 * 259 * <p>For packages under a shared UID, the application category type must be specified 260 * for the shared package name and not for individual packages under the shared UID. When 261 * specifying shared package names, the package names should contain the prefix 'shared:'. 262 */ 263 @DataClass.Generated.Member 264 @AddedInOrBefore(majorVersion = 33) getPackagesToAppCategoryTypes()265 public @NonNull Map<String,String> getPackagesToAppCategoryTypes() { 266 return mPackagesToAppCategoryTypes; 267 } 268 269 /** 270 * I/O overuse configuration for the component specified by 271 * {@link ResourceOveruseConfiguration#getComponentType}. 272 */ 273 @DataClass.Generated.Member 274 @AddedInOrBefore(majorVersion = 33) getIoOveruseConfiguration()275 public @Nullable IoOveruseConfiguration getIoOveruseConfiguration() { 276 return mIoOveruseConfiguration; 277 } 278 279 @Override 280 @DataClass.Generated.Member toString()281 public String toString() { 282 // You can override field toString logic by defining methods like: 283 // String fieldNameToString() { ... } 284 285 return "ResourceOveruseConfiguration { " + 286 "componentType = " + componentTypeToString(mComponentType) + ", " + 287 "safeToKillPackages = " + mSafeToKillPackages + ", " + 288 "vendorPackagePrefixes = " + mVendorPackagePrefixes + ", " + 289 "packagesToAppCategoryTypes = " + mPackagesToAppCategoryTypes + ", " + 290 "ioOveruseConfiguration = " + mIoOveruseConfiguration + 291 " }"; 292 } 293 294 @Override 295 @DataClass.Generated.Member 296 @AddedInOrBefore(majorVersion = 33) writeToParcel(@onNull android.os.Parcel dest, int flags)297 public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { 298 // You can override field parcelling by defining methods like: 299 // void parcelFieldName(Parcel dest, int flags) { ... } 300 301 byte flg = 0; 302 if (mIoOveruseConfiguration != null) flg |= 0x10; 303 dest.writeByte(flg); 304 dest.writeInt(mComponentType); 305 dest.writeStringList(mSafeToKillPackages); 306 dest.writeStringList(mVendorPackagePrefixes); 307 dest.writeMap(mPackagesToAppCategoryTypes); 308 if (mIoOveruseConfiguration != null) dest.writeTypedObject(mIoOveruseConfiguration, flags); 309 } 310 311 @Override 312 @DataClass.Generated.Member 313 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) 314 @AddedInOrBefore(majorVersion = 33) describeContents()315 public int describeContents() { return 0; } 316 317 /** @hide */ 318 @SuppressWarnings({"unchecked", "RedundantCast"}) 319 @DataClass.Generated.Member ResourceOveruseConfiguration(@onNull android.os.Parcel in)320 /* package-private */ ResourceOveruseConfiguration(@NonNull android.os.Parcel in) { 321 // You can override field unparcelling by defining methods like: 322 // static FieldType unparcelFieldName(Parcel in) { ... } 323 324 byte flg = in.readByte(); 325 int componentType = in.readInt(); 326 List<String> safeToKillPackages = new java.util.ArrayList<>(); 327 in.readStringList(safeToKillPackages); 328 List<String> vendorPackagePrefixes = new java.util.ArrayList<>(); 329 in.readStringList(vendorPackagePrefixes); 330 Map<String,String> packagesToAppCategoryTypes = new java.util.LinkedHashMap<>(); 331 in.readMap(packagesToAppCategoryTypes, String.class.getClassLoader()); 332 IoOveruseConfiguration ioOveruseConfiguration = (flg & 0x10) == 0 ? null : (IoOveruseConfiguration) in.readTypedObject(IoOveruseConfiguration.CREATOR); 333 334 this.mComponentType = componentType; 335 336 if (!(mComponentType == COMPONENT_TYPE_SYSTEM) 337 && !(mComponentType == COMPONENT_TYPE_VENDOR) 338 && !(mComponentType == COMPONENT_TYPE_THIRD_PARTY)) { 339 throw new java.lang.IllegalArgumentException( 340 "componentType was " + mComponentType + " but must be one of: " 341 + "COMPONENT_TYPE_SYSTEM(" + COMPONENT_TYPE_SYSTEM + "), " 342 + "COMPONENT_TYPE_VENDOR(" + COMPONENT_TYPE_VENDOR + "), " 343 + "COMPONENT_TYPE_THIRD_PARTY(" + COMPONENT_TYPE_THIRD_PARTY + ")"); 344 } 345 346 this.mSafeToKillPackages = safeToKillPackages; 347 AnnotationValidations.validate( 348 NonNull.class, null, mSafeToKillPackages); 349 this.mVendorPackagePrefixes = vendorPackagePrefixes; 350 AnnotationValidations.validate( 351 NonNull.class, null, mVendorPackagePrefixes); 352 this.mPackagesToAppCategoryTypes = packagesToAppCategoryTypes; 353 AnnotationValidations.validate( 354 NonNull.class, null, mPackagesToAppCategoryTypes); 355 this.mIoOveruseConfiguration = ioOveruseConfiguration; 356 357 // onConstructed(); // You can define this method to get a callback 358 } 359 360 @DataClass.Generated.Member 361 @AddedInOrBefore(majorVersion = 33) 362 public static final @NonNull Parcelable.Creator<ResourceOveruseConfiguration> CREATOR 363 = new Parcelable.Creator<ResourceOveruseConfiguration>() { 364 @Override 365 public ResourceOveruseConfiguration[] newArray(int size) { 366 return new ResourceOveruseConfiguration[size]; 367 } 368 369 @Override 370 public ResourceOveruseConfiguration createFromParcel(@NonNull android.os.Parcel in) { 371 return new ResourceOveruseConfiguration(in); 372 } 373 }; 374 375 /** 376 * A builder for {@link ResourceOveruseConfiguration} 377 */ 378 @SuppressWarnings("WeakerAccess") 379 @DataClass.Generated.Member 380 public static final class Builder { 381 382 private @ComponentType int mComponentType; 383 private @NonNull List<String> mSafeToKillPackages; 384 private @NonNull List<String> mVendorPackagePrefixes; 385 private @NonNull Map<String,String> mPackagesToAppCategoryTypes; 386 private @Nullable IoOveruseConfiguration mIoOveruseConfiguration; 387 388 private long mBuilderFieldsSet = 0L; 389 390 /** 391 * Creates a new Builder. 392 * 393 * @param componentType 394 * Component type of the I/O overuse configuration. 395 * @param safeToKillPackages 396 * List of system or vendor packages that are safe to be killed on resource overuse. 397 * 398 * <p>When specifying shared package names, the package names should contain the prefix 399 * 'shared:'. 400 * <p>System components must provide only safe-to-kill system packages in this list. 401 * <p>Vendor components must provide only safe-to-kill vendor packages in this list. 402 * @param vendorPackagePrefixes 403 * List of vendor package prefixes. 404 * 405 * <p>Any pre-installed package name starting with one of the prefixes or any package from the 406 * vendor partition is identified as a vendor package and vendor provided thresholds are applied 407 * to these packages. This list must be provided only by the vendor component. 408 * 409 * <p>When specifying shared package name prefixes, the prefix should contain 'shared:' at 410 * the beginning. 411 * @param packagesToAppCategoryTypes 412 * Mappings from package name to application category types. 413 * 414 * <p>This mapping must contain only packages that can be mapped to one of the 415 * {@link ApplicationCategoryType} types. This mapping must be defined only by the system and 416 * vendor components. 417 * 418 * <p>For packages under a shared UID, the application category type must be specified 419 * for the shared package name and not for individual packages under the shared UID. When 420 * specifying shared package names, the package names should contain the prefix 'shared:'. 421 */ Builder( @omponentType int componentType, @NonNull List<String> safeToKillPackages, @NonNull List<String> vendorPackagePrefixes, @NonNull Map<String,String> packagesToAppCategoryTypes)422 public Builder( 423 @ComponentType int componentType, 424 @NonNull List<String> safeToKillPackages, 425 @NonNull List<String> vendorPackagePrefixes, 426 @NonNull Map<String,String> packagesToAppCategoryTypes) { 427 mComponentType = componentType; 428 429 if (!(mComponentType == COMPONENT_TYPE_SYSTEM) 430 && !(mComponentType == COMPONENT_TYPE_VENDOR) 431 && !(mComponentType == COMPONENT_TYPE_THIRD_PARTY)) { 432 throw new java.lang.IllegalArgumentException( 433 "componentType was " + mComponentType + " but must be one of: " 434 + "COMPONENT_TYPE_SYSTEM(" + COMPONENT_TYPE_SYSTEM + "), " 435 + "COMPONENT_TYPE_VENDOR(" + COMPONENT_TYPE_VENDOR + "), " 436 + "COMPONENT_TYPE_THIRD_PARTY(" + COMPONENT_TYPE_THIRD_PARTY + ")"); 437 } 438 439 mSafeToKillPackages = safeToKillPackages; 440 AnnotationValidations.validate( 441 NonNull.class, null, mSafeToKillPackages); 442 mVendorPackagePrefixes = vendorPackagePrefixes; 443 AnnotationValidations.validate( 444 NonNull.class, null, mVendorPackagePrefixes); 445 mPackagesToAppCategoryTypes = packagesToAppCategoryTypes; 446 AnnotationValidations.validate( 447 NonNull.class, null, mPackagesToAppCategoryTypes); 448 } 449 450 /** 451 * Component type of the I/O overuse configuration. 452 */ 453 @DataClass.Generated.Member 454 @AddedInOrBefore(majorVersion = 33) setComponentType(@omponentType int value)455 public @NonNull Builder setComponentType(@ComponentType int value) { 456 checkNotUsed(); 457 mBuilderFieldsSet |= 0x1; 458 mComponentType = value; 459 return this; 460 } 461 462 /** 463 * List of system or vendor packages that are safe to be killed on resource overuse. 464 * 465 * <p>When specifying shared package names, the package names should contain the prefix 466 * 'shared:'. 467 * <p>System components must provide only safe-to-kill system packages in this list. 468 * <p>Vendor components must provide only safe-to-kill vendor packages in this list. 469 */ 470 @DataClass.Generated.Member 471 @AddedInOrBefore(majorVersion = 33) setSafeToKillPackages(@onNull List<String> value)472 public @NonNull Builder setSafeToKillPackages(@NonNull List<String> value) { 473 checkNotUsed(); 474 mBuilderFieldsSet |= 0x2; 475 mSafeToKillPackages = value; 476 return this; 477 } 478 479 /** @see #setSafeToKillPackages */ 480 @DataClass.Generated.Member 481 @AddedInOrBefore(majorVersion = 33) addSafeToKillPackages(@onNull String value)482 public @NonNull Builder addSafeToKillPackages(@NonNull String value) { 483 // You can refine this method's name by providing item's singular name, e.g.: 484 // @DataClass.PluralOf("item")) mItems = ... 485 486 if (mSafeToKillPackages == null) setSafeToKillPackages(new java.util.ArrayList<>()); 487 mSafeToKillPackages.add(value); 488 return this; 489 } 490 491 /** 492 * List of vendor package prefixes. 493 * 494 * <p>Any pre-installed package name starting with one of the prefixes or any package from the 495 * vendor partition is identified as a vendor package and vendor provided thresholds are applied 496 * to these packages. This list must be provided only by the vendor component. 497 * 498 * <p>When specifying shared package name prefixes, the prefix should contain 'shared:' at 499 * the beginning. 500 */ 501 @DataClass.Generated.Member 502 @AddedInOrBefore(majorVersion = 33) setVendorPackagePrefixes(@onNull List<String> value)503 public @NonNull Builder setVendorPackagePrefixes(@NonNull List<String> value) { 504 checkNotUsed(); 505 mBuilderFieldsSet |= 0x4; 506 mVendorPackagePrefixes = value; 507 return this; 508 } 509 510 /** @see #setVendorPackagePrefixes */ 511 @DataClass.Generated.Member 512 @AddedInOrBefore(majorVersion = 33) addVendorPackagePrefixes(@onNull String value)513 public @NonNull Builder addVendorPackagePrefixes(@NonNull String value) { 514 // You can refine this method's name by providing item's singular name, e.g.: 515 // @DataClass.PluralOf("item")) mItems = ... 516 517 if (mVendorPackagePrefixes == null) setVendorPackagePrefixes(new java.util.ArrayList<>()); 518 mVendorPackagePrefixes.add(value); 519 return this; 520 } 521 522 /** 523 * Mappings from package name to application category types. 524 * 525 * <p>This mapping must contain only packages that can be mapped to one of the 526 * {@link ApplicationCategoryType} types. This mapping must be defined only by the system and 527 * vendor components. 528 * 529 * <p>For packages under a shared UID, the application category type must be specified 530 * for the shared package name and not for individual packages under the shared UID. When 531 * specifying shared package names, the package names should contain the prefix 'shared:'. 532 */ 533 @DataClass.Generated.Member 534 @AddedInOrBefore(majorVersion = 33) setPackagesToAppCategoryTypes(@onNull Map<String,String> value)535 public @NonNull Builder setPackagesToAppCategoryTypes(@NonNull Map<String,String> value) { 536 checkNotUsed(); 537 mBuilderFieldsSet |= 0x8; 538 mPackagesToAppCategoryTypes = value; 539 return this; 540 } 541 542 /** @see #setPackagesToAppCategoryTypes */ 543 @DataClass.Generated.Member 544 @AddedInOrBefore(majorVersion = 33) addPackagesToAppCategoryTypes(@onNull String key, @NonNull String value)545 public @NonNull Builder addPackagesToAppCategoryTypes(@NonNull String key, @NonNull String value) { 546 // You can refine this method's name by providing item's singular name, e.g.: 547 // @DataClass.PluralOf("item")) mItems = ... 548 549 if (mPackagesToAppCategoryTypes == null) setPackagesToAppCategoryTypes(new java.util.LinkedHashMap()); 550 mPackagesToAppCategoryTypes.put(key, value); 551 return this; 552 } 553 554 /** 555 * I/O overuse configuration for the component specified by 556 * {@link ResourceOveruseConfiguration#getComponentType}. 557 */ 558 @DataClass.Generated.Member 559 @AddedInOrBefore(majorVersion = 33) setIoOveruseConfiguration(@onNull IoOveruseConfiguration value)560 public @NonNull Builder setIoOveruseConfiguration(@NonNull IoOveruseConfiguration value) { 561 checkNotUsed(); 562 mBuilderFieldsSet |= 0x10; 563 mIoOveruseConfiguration = value; 564 return this; 565 } 566 567 /** Builds the instance. This builder should not be touched after calling this! */ 568 @AddedInOrBefore(majorVersion = 33) build()569 public @NonNull ResourceOveruseConfiguration build() { 570 checkNotUsed(); 571 mBuilderFieldsSet |= 0x20; // Mark builder used 572 573 if ((mBuilderFieldsSet & 0x10) == 0) { 574 mIoOveruseConfiguration = null; 575 } 576 ResourceOveruseConfiguration o = new ResourceOveruseConfiguration( 577 mComponentType, 578 mSafeToKillPackages, 579 mVendorPackagePrefixes, 580 mPackagesToAppCategoryTypes, 581 mIoOveruseConfiguration); 582 return o; 583 } 584 checkNotUsed()585 private void checkNotUsed() { 586 if ((mBuilderFieldsSet & 0x20) != 0) { 587 throw new IllegalStateException( 588 "This Builder should not be reused. Use a new Builder instance instead"); 589 } 590 } 591 } 592 593 @DataClass.Generated( 594 time = 1673057073656L, 595 codegenVersion = "1.0.23", 596 sourceFile = "packages/services/Car/car-lib/src/android/car/watchdog/ResourceOveruseConfiguration.java", 597 inputSignatures = "public static final @android.car.watchdog.ResourceOveruseConfiguration.ComponentType @android.car.annotation.AddedInOrBefore int COMPONENT_TYPE_SYSTEM\npublic static final @android.car.watchdog.ResourceOveruseConfiguration.ComponentType @android.car.annotation.AddedInOrBefore int COMPONENT_TYPE_VENDOR\npublic static final @android.car.watchdog.ResourceOveruseConfiguration.ComponentType @android.car.annotation.AddedInOrBefore int COMPONENT_TYPE_THIRD_PARTY\npublic static final @android.car.watchdog.ResourceOveruseConfiguration.ApplicationCategoryType @android.car.annotation.AddedInOrBefore java.lang.String APPLICATION_CATEGORY_TYPE_MAPS\npublic static final @android.car.watchdog.ResourceOveruseConfiguration.ApplicationCategoryType @android.car.annotation.AddedInOrBefore java.lang.String APPLICATION_CATEGORY_TYPE_MEDIA\nprivate @android.car.watchdog.ResourceOveruseConfiguration.ComponentType int mComponentType\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mSafeToKillPackages\nprivate @android.annotation.NonNull java.util.List<java.lang.String> mVendorPackagePrefixes\nprivate @android.annotation.NonNull java.util.Map<java.lang.String,java.lang.String> mPackagesToAppCategoryTypes\nprivate @android.annotation.Nullable android.car.watchdog.IoOveruseConfiguration mIoOveruseConfiguration\nclass ResourceOveruseConfiguration extends java.lang.Object implements [android.os.Parcelable]\n@com.android.car.internal.util.DataClass(genToString=true, genBuilder=true, genHiddenConstDefs=true)") 598 @Deprecated 599 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) __metadata()600 private void __metadata() {} 601 602 603 //@formatter:on 604 // End of generated code 605 606 } 607