1 /* 2 * Copyright (C) 2024 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 com.android.adservices.shared.spe.logging; 18 19 import com.google.auto.value.AutoValue; 20 21 /** 22 * Class for BackgroundJobSchedulingReported atom. 23 * 24 * <p><b>Note: This is a data transfer object (DTO) used for logging. Though it isn't "final", it 25 * should NOT be extended any more.</b> 26 */ 27 @AutoValue 28 public abstract class SchedulingReportedStats { 29 30 /** Returns the unique id of a background job. */ getJobId()31 public abstract int getJobId(); 32 33 /** Returns the Scheduling result code. */ getResultCode()34 public abstract int getResultCode(); 35 36 /** Returns the scheduler type that schedules the job. */ getSchedulerType()37 public abstract int getSchedulerType(); 38 39 /** Returns module name from which the job execution is being reported. */ getModuleName()40 public abstract int getModuleName(); 41 42 /** Create an instance for {@link SchedulingReportedStats.Builder}. */ builder()43 public static SchedulingReportedStats.Builder builder() { 44 return new AutoValue_SchedulingReportedStats.Builder(); 45 } 46 47 /** Builder class for {@link SchedulingReportedStats}. */ 48 @AutoValue.Builder 49 public abstract static class Builder { 50 /** Sets the unique id of a background job. */ setJobId(int value)51 public abstract Builder setJobId(int value); 52 53 /** Sets the Scheduling result code. */ setResultCode(int value)54 public abstract Builder setResultCode(int value); 55 56 /** Sets the scheduler type that schedules the job. */ setSchedulerType(int value)57 public abstract Builder setSchedulerType(int value); 58 59 /** Sets module name from which the job execution is being reported. */ setModuleName(int value)60 public abstract Builder setModuleName(int value); 61 62 /** Build an instance of {@link SchedulingReportedStats}. */ build()63 public abstract SchedulingReportedStats build(); 64 } 65 } 66