SUDOPPrivacyConfig
SUDOPPrivacyConfig is an optional advertising privacy configuration passed during OP SDK initialization. It only carries states already confirmed by the host through a CMP or its own compliance flow.
Builder
public static Builder builder();
// Builder
public Builder setGdprConsentStatus(GdprConsentStatus value);
public Builder setDoNotSellStatus(DoNotSellStatus value);
public Builder setLgpdConsentStatus(LgpdConsentStatus value);
public Builder setAgeRestrictedTreatment(AgeRestrictedTreatment value);
public SUDOPPrivacyConfig build();Parameters
Create a builder with builder(), set confirmed states as needed, then call build() to create an immutable configuration. Unset fields default to null; later changes to the builder do not affect configurations already built.
| Parameter | Values | Description |
|---|---|---|
gdprConsentStatus | NOT_APPLICABLE / GRANTED / DENIED | GDPR consent for advertising-related data processing. |
doNotSellStatus | NOT_APPLICABLE / OPTED_OUT / NOT_OPTED_OUT | Whether the user opted out of the sale or sharing of personal information. |
lgpdConsentStatus | NOT_APPLICABLE / GRANTED / DENIED | Brazil LGPD consent state. |
ageRestrictedTreatment | UNSPECIFIED / CHILD / TEEN | Child or teen advertising treatment. |
The whole configuration or any parameter may be null. null means the OP SDK does not actively set that ad-SDK state; it does not mean granted, denied, or not applicable.
NOT_APPLICABLE in the first three fields does not set the corresponding state. Age treatment UNSPECIFIED sets age treatment to unspecified and differs from null. To withdraw a choice, pass an explicit state such as DENIED or OPTED_OUT, not an empty configuration.
Example
// Read the user's confirmed choices from the host's CMP/consent flow first.
// Values below illustrate syntax, not defaults or a recommendation to grant consent.
// Each argument may be null: do not actively set that state. Null is not withdrawal.
SUDOPPrivacyConfig privacyConfig = SUDOPPrivacyConfig.builder()
// GDPR consent: GRANTED = granted; DENIED = denied or withdrawn.
// NOT_APPLICABLE = not applicable; this field is not set.
.setGdprConsentStatus(SUDOPPrivacyConfig.GdprConsentStatus.GRANTED)
// Sale/sharing opt-out: OPTED_OUT = user opted out; NOT_OPTED_OUT = did not opt out.
// NOT_APPLICABLE = not applicable. Opted out is not the same as granting consent.
.setDoNotSellStatus(SUDOPPrivacyConfig.DoNotSellStatus.OPTED_OUT)
// Brazil LGPD consent: GRANTED = granted; DENIED = denied or withdrawn.
// NOT_APPLICABLE = not applicable. Set independently of the GDPR field.
.setLgpdConsentStatus(SUDOPPrivacyConfig.LgpdConsentStatus.NOT_APPLICABLE)
// Age treatment: CHILD = child; TEEN = teen treatment, not child treatment.
// UNSPECIFIED explicitly requests unspecified age treatment; null does not set it.
.setAgeRestrictedTreatment(SUDOPPrivacyConfig.AgeRestrictedTreatment.TEEN)
.build();Notes
- The integrator determines legal applicability and obtains the user's choice. This object does not display consent dialogs or replace a CMP.
- Standard strings such as IAB TCF and GPP remain managed by the selected CMP according to each ad platform's requirements.
- Pass the configuration through initSDK during initialization.
