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.ui.enrollment.collection; 18 19 import android.os.Build; 20 21 import androidx.annotation.RequiresApi; 22 23 import com.android.adservices.service.ui.enrollment.base.PrivacySandboxEnrollmentChannel; 24 import com.android.adservices.service.ui.enrollment.impl.AlreadyEnrolledChannel; 25 import com.android.adservices.service.ui.enrollment.impl.ConsentNotificationDebugChannel; 26 import com.android.adservices.service.ui.enrollment.impl.ConsentNotificationResetChannel; 27 import com.android.adservices.service.ui.enrollment.impl.FirstConsentNotificationChannel; 28 import com.android.adservices.service.ui.enrollment.impl.GaGraduationChannel; 29 import com.android.adservices.service.ui.enrollment.impl.PasFirstConsentNotificationChannel; 30 import com.android.adservices.service.ui.enrollment.impl.PasReconsentNotificationChannel; 31 import com.android.adservices.service.ui.enrollment.impl.ReconsentNotificationChannel; 32 import com.android.adservices.service.ui.enrollment.impl.RvcPostOTAChannel; 33 34 /* Collection of GA UX enrollment channels. */ 35 @RequiresApi(Build.VERSION_CODES.S) 36 public enum GaUxEnrollmentChannelCollection implements PrivacySandboxEnrollmentChannelCollection { 37 CONSENT_NOTIFICATION_DEBUG_CHANNEL(/* priority= */ 0, new ConsentNotificationDebugChannel()), 38 39 CONSENT_NOTIFICATION_RESET_CHANNEL(/* priority= */ 1, new ConsentNotificationResetChannel()), 40 41 ALREADY_ENROLLED_CHANNEL(/* priority= */ 2, new AlreadyEnrolledChannel()), 42 43 PAS_FIRST_CONSENT_NOTIFICATION_CHANNEL( 44 /* priority= */ 3, new PasFirstConsentNotificationChannel()), 45 46 PAS_RECONSENT_NOTIFICATION_CHANNEL(/* priority= */ 4, new PasReconsentNotificationChannel()), 47 48 FIRST_CONSENT_NOTIFICATION_CHANNEL(/* priority= */ 5, new FirstConsentNotificationChannel()), 49 50 RECONSENT_NOTIFICATION_CHANNEL(/* priority= */ 6, new ReconsentNotificationChannel()), 51 52 GA_GRADUATION_CHANNEL(/* priority= */ 7, new GaGraduationChannel()), 53 54 RVC_POST_OTA_CHANNEL(/* priority= */ 8, new RvcPostOTAChannel()); 55 56 private final int mPriority; 57 58 private final PrivacySandboxEnrollmentChannel mEnrollmentChannel; 59 GaUxEnrollmentChannelCollection( int priority, PrivacySandboxEnrollmentChannel enrollmentChannel)60 GaUxEnrollmentChannelCollection( 61 int priority, PrivacySandboxEnrollmentChannel enrollmentChannel) { 62 mPriority = priority; 63 mEnrollmentChannel = enrollmentChannel; 64 } 65 getPriority()66 public int getPriority() { 67 return mPriority; 68 } 69 getEnrollmentChannel()70 public PrivacySandboxEnrollmentChannel getEnrollmentChannel() { 71 return mEnrollmentChannel; 72 } 73 } 74