1 /* 2 * Copyright (C) 2023 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.service.enrollment; 18 19 /** POJO for storing Enrollment(Data/FileDownload/Failed) status */ 20 public class EnrollmentStatus { 21 /** Enum is tied to the AdservicesEnrollmentData atom */ 22 public enum TransactionType { 23 UNKNOWN(0), 24 READ_TRANSACTION_TYPE(1), 25 WRITE_TRANSACTION_TYPE(2); 26 27 private final int mValue; 28 TransactionType(int value)29 TransactionType(int value) { 30 mValue = value; 31 } 32 getValue()33 public int getValue() { 34 return mValue; 35 } 36 } 37 38 /** Enum used by AdservicesEnrollmentFailed atom. */ 39 public enum DataFileGroupStatus { 40 UNKNOWN_DATA_FILE_GROUP_STATUS(0), 41 DOWNLOADED_DATA_FILE_GROUP_STATUS(1), 42 PENDING_DATA_FILE_GROUP_STATUS(2), 43 PENDING_CUSTOM_VALIDATION(3); 44 45 private final int mValue; 46 DataFileGroupStatus(int value)47 DataFileGroupStatus(int value) { 48 mValue = value; 49 } 50 getValue()51 public int getValue() { 52 return mValue; 53 } 54 } 55 56 /** Enum used by AdservicesEnrollmentFailed atom. */ 57 public enum ErrorCause { 58 UNKNOWN_ERROR_CAUSE(0), 59 ENROLLMENT_NOT_FOUND_ERROR_CAUSE(1), 60 ENROLLMENT_BLOCKLISTED_ERROR_CAUSE(2); 61 62 private final int mValue; 63 ErrorCause(int value)64 ErrorCause(int value) { 65 mValue = value; 66 } 67 getValue()68 public int getValue() { 69 return mValue; 70 } 71 } 72 } 73