• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2   * Copyright (C) 2022 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.app.adservices;
18 
19 import android.app.adservices.consent.ConsentParcel;
20 import android.app.adservices.topics.TopicParcel;
21 
22 /**
23   * AdServices Manager Service
24   *
25   * {@hide}
26   */
27 interface IAdServicesManager {
28     /**
29      * Get Consent
30      */
getConsent(in int consentApiType)31     ConsentParcel getConsent(in int consentApiType);
32 
33     /**
34      * Set Consent
35      */
setConsent(in ConsentParcel consentParcel)36     void setConsent(in ConsentParcel consentParcel);
37 
38     /**
39      * Saves information to the storage that a deletion of measurement data occurred.
40      */
recordAdServicesDeletionOccurred(in int deletionType)41      void recordAdServicesDeletionOccurred(in int deletionType);
42 
43      /**
44       * Checks whether the module needs to handle data reconciliation after a rollback.
45       */
needsToHandleRollbackReconciliation(in int deletionType)46      boolean needsToHandleRollbackReconciliation(in int deletionType);
47 
48     /**
49      * Saves information to the storage that notification was displayed for the first time to the
50      * user.
51      */
recordNotificationDisplayed()52     void recordNotificationDisplayed();
53 
54     /**
55      * Returns information whether Consent Notification was displayed or not.
56      *
57      * @return true if Consent Notification was displayed, otherwise false.
58      */
wasNotificationDisplayed()59     boolean wasNotificationDisplayed();
60 
61     /**
62      * Saves information to the storage that GA UX notification was displayed for the
63      * first time to the user.
64      */
recordGaUxNotificationDisplayed()65     void recordGaUxNotificationDisplayed();
66 
67     /**
68      * Returns information whether GA UX Consent Notification was displayed or not.
69      *
70      * @return true if GA UX Consent Notification was displayed, otherwise false.
71      */
wasGaUxNotificationDisplayed()72     boolean wasGaUxNotificationDisplayed();
73 
74     /**
75      * Saves information to the storage that user explicitly interacted with consent.
76      *
77      * Current state:
78      * <ul>
79      *    <li> -1 means no manual interaction recorded </li>
80      *    <li> 0 means no data about interaction </li>
81      *    <li> 1 means manual interaction recorded </li>
82      * </ul>
83      */
recordUserManualInteractionWithConsent(in int interactionId)84     void recordUserManualInteractionWithConsent(in int interactionId);
85 
86     /**
87      * Returns information about the user's manual interaction with consent.
88      * Current state:
89      * <ul>
90      *    <li> -1 means no manual interaction recorded </li>
91      *    <li> 0 means no data about interaction </li>
92      *    <li> 1 means manual interaction recorded </li>
93      * </ul>
94      */
getUserManualInteractionWithConsent()95     int getUserManualInteractionWithConsent();
96 
97     /**
98      * Record a blocked topic.
99      */
recordBlockedTopic(in List<TopicParcel> blockedTopicParcels)100     void recordBlockedTopic(in List<TopicParcel> blockedTopicParcels);
101 
102     /**
103      * Remove a blocked topic.
104      */
removeBlockedTopic(in TopicParcel blockedTopicParcel)105     void removeBlockedTopic(in TopicParcel blockedTopicParcel);
106 
107     /**
108      * Get all blocked topics.
109      */
retrieveAllBlockedTopics()110     List<TopicParcel> retrieveAllBlockedTopics();
111 
112     /**
113      * Clear all blocked topics.
114      */
clearAllBlockedTopics()115     void clearAllBlockedTopics();
116 
117     /**
118       * Saves the PP API default consent of a user.
119       */
recordDefaultConsent(in boolean defaultConsent)120     void recordDefaultConsent(in boolean defaultConsent);
121 
122     /**
123       * Saves the topics default consent of a user.
124       */
recordTopicsDefaultConsent(in boolean defaultConsent)125     void recordTopicsDefaultConsent(in boolean defaultConsent);
126 
127     /**
128       * Saves the FLEDGE default consent of a user.
129       */
recordFledgeDefaultConsent(in boolean defaultConsent)130     void recordFledgeDefaultConsent(in boolean defaultConsent);
131 
132     /**
133       * Saves the measurement default consent of a user.
134       */
recordMeasurementDefaultConsent(in boolean defaultConsent)135     void recordMeasurementDefaultConsent(in boolean defaultConsent);
136 
137     /**
138       * Saves the default AdId state of a user.
139       */
recordDefaultAdIdState(in boolean defaultAdIdState)140     void recordDefaultAdIdState(in boolean defaultAdIdState);
141 
142     /**
143       * Returns the PP API default consent of a user.
144       *
145       * @return true if the PP API default consent is given, false otherwise.
146       */
getDefaultConsent()147     boolean getDefaultConsent();
148 
149     /**
150       * Returns the topics default consent of a user.
151       *
152       * @return true if the topics default consent is given, false otherwise.
153       */
getTopicsDefaultConsent()154     boolean getTopicsDefaultConsent();
155 
156     /**
157       * Returns the FLEDGE default consent of a user.
158       *
159       * @return true if the FLEDGE default consent is given, false otherwise.
160       */
getFledgeDefaultConsent()161     boolean getFledgeDefaultConsent();
162 
163      /**
164        * Returns the measurement default consent of a user.
165        *
166        * @return true if the measurement default consent is given, false otherwise.
167        */
getMeasurementDefaultConsent()168      boolean getMeasurementDefaultConsent();
169 
170      /**
171        * Returns the default AdId state of a user.
172        *
173        * @return true if the default AdId state is enabled, false otherwise.
174        */
getDefaultAdIdState()175      boolean getDefaultAdIdState();
176 
getCurrentPrivacySandboxFeature()177     String getCurrentPrivacySandboxFeature();
178 
setCurrentPrivacySandboxFeature(in String featureType)179     void setCurrentPrivacySandboxFeature(in String featureType);
180 
getKnownAppsWithConsent(in List<String> installedPackages)181     List<String> getKnownAppsWithConsent(in List<String> installedPackages);
182 
getAppsWithRevokedConsent(in List<String> installedPackages)183     List<String> getAppsWithRevokedConsent(in List<String> installedPackages);
184 
setConsentForApp(in String packageName,in int packageUid,in boolean isConsentRevoked)185     void setConsentForApp(in String packageName,in int packageUid,in boolean isConsentRevoked);
186 
clearKnownAppsWithConsent()187     void clearKnownAppsWithConsent();
188 
clearAllAppConsentData()189     void clearAllAppConsentData();
190 
isConsentRevokedForApp(in String packageName,in int packageUid)191     boolean isConsentRevokedForApp(in String packageName,in int packageUid);
192 
setConsentForAppIfNew(in String packageName,in int packageUid,in boolean isConsentRevoked)193     boolean setConsentForAppIfNew(in String packageName,in int packageUid,in boolean isConsentRevoked);
194 
clearConsentForUninstalledApp(in String packageName,in int packageUid)195     void clearConsentForUninstalledApp(in String packageName,in int packageUid);
196 
197     /** Returns whether the isAdIdEnabled bit is true. */
isAdIdEnabled()198     boolean isAdIdEnabled();
199 
200     /** Saves the isAdIdEnabled bit. */
setAdIdEnabled(boolean isAdIdEnabled)201     void setAdIdEnabled(boolean isAdIdEnabled);
202 
203     /** Returns whether the isU18Account bit is true. */
isU18Account()204     boolean isU18Account();
205 
206     /** Saves the isU18Account bit. */
setU18Account(boolean isU18Account)207     void setU18Account(boolean isU18Account);
208 
209     /** Returns whether the isEntryPointEnabled bit is true. */
isEntryPointEnabled()210     boolean isEntryPointEnabled();
211 
212     /** Saves the isEntryPointEnabled bit. */
setEntryPointEnabled(boolean isEntryPointEnabled)213     void setEntryPointEnabled(boolean isEntryPointEnabled);
214 
215     /** Returns whether the isAdultAccount bit is true. */
isAdultAccount()216     boolean isAdultAccount();
217 
setAdultAccount(boolean isAdultAccount)218     void setAdultAccount(boolean isAdultAccount);
219 
220     /** Returns whether the wasU18NotificationDisplayed bit is true. */
wasU18NotificationDisplayed()221     boolean wasU18NotificationDisplayed();
222 
223     /** Saves the wasU18NotificationDisplayed bit. */
setU18NotificationDisplayed(boolean wasU18NotificationDisplayed)224     void setU18NotificationDisplayed(boolean wasU18NotificationDisplayed);
225 
226 }