@Test public void buildRegs_ccpaNotPresentInSharedPreference_extensionIsNotSet() { BidMachineImpl.get().getIabSharedPreference().initialize(context); Context.Regs.Builder builder = Context.Regs.newBuilder(); BidMachineImpl.get() .getUserRestrictionParams() .build(builder); assertEquals(0, builder.getExtCount()); }
void build(@NonNull Context.Regs.Builder builder) { builder.setGdpr(subjectToGDPR()); builder.setCoppa(hasCoppa != null && hasCoppa); String iabUsPrivacyString = getUsPrivacy(); if (!TextUtils.isEmpty(iabUsPrivacyString)) { assert iabUsPrivacyString != null; RegsCcpaExtension regsCcpaExtension = RegsCcpaExtension.newBuilder() .setUsPrivacy(iabUsPrivacyString) .build(); builder.addExt(Any.pack(regsCcpaExtension)); } }
UserRestrictionParams extends RequestParams<UserRestrictionParams> implements IUserRestrictionsParams<UserRestrictionParams>, DataRestrictions { void build(@NonNull Context.Regs.Builder builder) { builder.setGdpr(subjectToGDPR()); builder.setCoppa(hasCoppa != null && hasCoppa); String iabUsPrivacyString = getUsPrivacy(); if (!TextUtils.isEmpty(iabUsPrivacyString)) { assert iabUsPrivacyString != null; RegsCcpaExtension regsCcpaExtension = RegsCcpaExtension.newBuilder() .setUsPrivacy(iabUsPrivacyString) .build(); builder.addExt(Any.pack(regsCcpaExtension)); } } }
UserRestrictionParams extends RequestParams<UserRestrictionParams> implements IUserRestrictionsParams<UserRestrictionParams>, DataRestrictions { void build(@NonNull Context.Regs.Builder builder) { builder.setGdpr(subjectToGDPR()); builder.setCoppa(hasCoppa != null && hasCoppa); String iabUsPrivacyString = getUsPrivacy(); if (!TextUtils.isEmpty(iabUsPrivacyString)) { assert iabUsPrivacyString != null; RegsCcpaExtension regsCcpaExtension = RegsCcpaExtension.newBuilder() .setUsPrivacy(iabUsPrivacyString) .build(); builder.addExt(Any.pack(regsCcpaExtension)); } }  }
UserRestrictionParams extends RequestParams<UserRestrictionParams> implements IUserRestrictionsParams<UserRestrictionParams>, DataRestrictions { void build(@NonNull Context.Regs.Builder builder) { builder.setGdpr(subjectToGDPR()); builder.setCoppa(hasCoppa != null && hasCoppa); String iabUsPrivacyString = getUsPrivacy(); if (!TextUtils.isEmpty(iabUsPrivacyString)) { assert iabUsPrivacyString != null; RegsCcpaExtension regsCcpaExtension = RegsCcpaExtension.newBuilder() .setUsPrivacy(iabUsPrivacyString) .build(); builder.addExt(Any.pack(regsCcpaExtension)); } }  @Override void merge(@NonNull UserRestrictionParams instance); @Override UserRestrictionParams setConsentConfig(boolean hasConsent, String consentString); @Override UserRestrictionParams setSubjectToGDPR(Boolean subject); @Override UserRestrictionParams setCoppa(Boolean coppa); @Override boolean canSendGeoPosition(); @Override boolean canSendUserInfo(); @Override boolean canSendDeviceInfo(); @Override boolean canSendIfa(); @Override boolean isUserInGdprScope(); @Override boolean isUserHasConsent(); @Override boolean isUserGdprProtected(); @Override boolean isUserAgeRestricted(); @Nullable @Override String getUsPrivacy(); }
UserRestrictionParams extends RequestParams<UserRestrictionParams> implements IUserRestrictionsParams<UserRestrictionParams>, DataRestrictions { void build(@NonNull Context.Regs.Builder builder) { builder.setGdpr(subjectToGDPR()); builder.setCoppa(hasCoppa != null && hasCoppa); String iabUsPrivacyString = getUsPrivacy(); if (!TextUtils.isEmpty(iabUsPrivacyString)) { assert iabUsPrivacyString != null; RegsCcpaExtension regsCcpaExtension = RegsCcpaExtension.newBuilder() .setUsPrivacy(iabUsPrivacyString) .build(); builder.addExt(Any.pack(regsCcpaExtension)); } }  @Override void merge(@NonNull UserRestrictionParams instance); @Override UserRestrictionParams setConsentConfig(boolean hasConsent, String consentString); @Override UserRestrictionParams setSubjectToGDPR(Boolean subject); @Override UserRestrictionParams setCoppa(Boolean coppa); @Override boolean canSendGeoPosition(); @Override boolean canSendUserInfo(); @Override boolean canSendDeviceInfo(); @Override boolean canSendIfa(); @Override boolean isUserInGdprScope(); @Override boolean isUserHasConsent(); @Override boolean isUserGdprProtected(); @Override boolean isUserAgeRestricted(); @Nullable @Override String getUsPrivacy();  }