Search in sources :

Example 1 with DeviceInfoParameterBuilder

use of org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder in project prebid-mobile-android by prebid.

the class Requester method getParameterBuilders.

protected List<ParameterBuilder> getParameterBuilders() {
    Context context = mContextReference.get();
    Resources resources = null;
    if (context != null) {
        resources = context.getResources();
    }
    boolean browserActivityAvailable = ExternalViewerUtils.isBrowserActivityCallable(context);
    ArrayList<ParameterBuilder> parameterBuilderArray = new ArrayList<>();
    parameterBuilderArray.add(new BasicParameterBuilder(mAdConfiguration, resources, browserActivityAvailable));
    parameterBuilderArray.add(new GeoLocationParameterBuilder());
    parameterBuilderArray.add(new AppInfoParameterBuilder(mAdConfiguration));
    parameterBuilderArray.add(new DeviceInfoParameterBuilder(mAdConfiguration));
    parameterBuilderArray.add(new NetworkParameterBuilder());
    parameterBuilderArray.add(new UserConsentParameterBuilder(mUserConsentManager));
    return parameterBuilderArray;
}
Also used : Context(android.content.Context) AppInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder) DeviceInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder) GeoLocationParameterBuilder(org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder) ArrayList(java.util.ArrayList) NetworkParameterBuilder(org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder) UserConsentParameterBuilder(org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder) Resources(android.content.res.Resources) GeoLocationParameterBuilder(org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder) BasicParameterBuilder(org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder) NetworkParameterBuilder(org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder) UserConsentParameterBuilder(org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder) ParameterBuilder(org.prebid.mobile.rendering.networking.parameters.ParameterBuilder) AppInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder) DeviceInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder) BasicParameterBuilder(org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)

Example 2 with DeviceInfoParameterBuilder

use of org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder in project prebid-mobile-android by prebid.

the class AutoDetectedOpenRtbTest method overwrittenDeviceInfoParameterBuilder.

@Test
public void overwrittenDeviceInfoParameterBuilder() {
    mOriginalOpenRtbParams.getDevice().dpidmd5 = "foo";
    mOriginalOpenRtbParams.getDevice().dpidsha1 = "foo";
    mOriginalOpenRtbParams.getDevice().w = 0;
    mOriginalOpenRtbParams.getDevice().h = 0;
    mParamBuilderArray.add(new DeviceInfoParameterBuilder(new AdConfiguration()));
    AdRequestInput newAdRequestInput = URLBuilder.buildParameters(mParamBuilderArray, mOriginalAdRequestInput);
    BidRequest newOpenRtbParams = newAdRequestInput.getBidRequest();
    assertNotEquals(mOriginalOpenRtbParams.getDevice().dpidmd5, newOpenRtbParams.getDevice().dpidmd5);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().dpidsha1, newOpenRtbParams.getDevice().dpidsha1);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().w, newOpenRtbParams.getDevice().w);
    assertNotEquals(mOriginalOpenRtbParams.getDevice().h, newOpenRtbParams.getDevice().h);
}
Also used : AdRequestInput(org.prebid.mobile.rendering.networking.parameters.AdRequestInput) DeviceInfoParameterBuilder(org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder) AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) BidRequest(org.prebid.mobile.rendering.models.openrtb.BidRequest) Test(org.junit.Test)

Aggregations

DeviceInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.DeviceInfoParameterBuilder)2 Context (android.content.Context)1 Resources (android.content.res.Resources)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)1 BidRequest (org.prebid.mobile.rendering.models.openrtb.BidRequest)1 AdRequestInput (org.prebid.mobile.rendering.networking.parameters.AdRequestInput)1 AppInfoParameterBuilder (org.prebid.mobile.rendering.networking.parameters.AppInfoParameterBuilder)1 BasicParameterBuilder (org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)1 GeoLocationParameterBuilder (org.prebid.mobile.rendering.networking.parameters.GeoLocationParameterBuilder)1 NetworkParameterBuilder (org.prebid.mobile.rendering.networking.parameters.NetworkParameterBuilder)1 ParameterBuilder (org.prebid.mobile.rendering.networking.parameters.ParameterBuilder)1 UserConsentParameterBuilder (org.prebid.mobile.rendering.networking.parameters.UserConsentParameterBuilder)1