• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.consent;
18 
19 import com.google.auto.value.AutoValue;
20 
21 /***
22  * Stores the opt-in/out value of each app during consent migration.
23  */
24 @AutoValue
25 public abstract class AppConsents {
26     /**
27      * @return opt-in/out value for measurement app
28      */
getMsmtConsent()29     public abstract boolean getMsmtConsent();
30 
31     /**
32      * @return opt-in/out value for topics app
33      */
getTopicsConsent()34     public abstract boolean getTopicsConsent();
35 
36     /**
37      * @return opt-in/out value for fledge app
38      */
getFledgeConsent()39     public abstract boolean getFledgeConsent();
40 
41     /**
42      * @return generic builder.
43      */
builder()44     public static AppConsents.Builder builder() {
45         return new AutoValue_AppConsents.Builder();
46     }
47 
48     /** Builder class for {@link AppConsents}. */
49     @AutoValue.Builder
50     public abstract static class Builder {
51         /** Set opt-in/out value for measurement app */
setMsmtConsent(boolean value)52         public abstract AppConsents.Builder setMsmtConsent(boolean value);
53 
54         /** Set opt-in/out value for topics app */
setTopicsConsent(boolean value)55         public abstract AppConsents.Builder setTopicsConsent(boolean value);
56 
57         /** Set opt-in/out value for fledge app */
setFledgeConsent(boolean value)58         public abstract AppConsents.Builder setFledgeConsent(boolean value);
59 
60         /** build for {@link AppConsents}. */
build()61         public abstract AppConsents build();
62     }
63 }
64