Skip to content

Commit

Permalink
feat(unification): remove default auto refresh time #370
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinPostindustria committed Mar 24, 2022
1 parent a70ff1b commit 75af686
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class AdFragment : BaseFragment() {
protected var adUnitId: String = ""
protected var width = 0
protected var height = 0
protected var refreshDelay = PrebidMobile.AUTO_REFRESH_DELAY_DEFAULT / 1000
protected var refreshDelay = PrebidMobile.AUTO_REFRESH_DELAY_MIN / 1000

private var adView: Any? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AdConfiguratorDialogFragment : DialogFragment() {
heightField?.setText(argHeight.toString())
if (mode == AdConfiguratorMode.BANNER) {
refreshDelayField = dialogView.findViewById(R.id.etRefreshDelay)
refreshDelayField?.setText((PrebidMobile.AUTO_REFRESH_DELAY_DEFAULT / 1000).toString())
refreshDelayField?.setText((PrebidMobile.AUTO_REFRESH_DELAY_MIN / 1000).toString())
}

dialogView.findViewById<Button>(R.id.btnLoad).setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ public class PrebidMobile {
*/
public static final int AUTO_REFRESH_DELAY_MAX = 120_000;

/**
* Default refresh interval. 0 seconds
* Used when the refresh interval is not in the AUTO_REFRESH_DELAY_MIN & AUTO_REFRESH_DELAY_MAX range.
*/
public static final int AUTO_REFRESH_DELAY_DEFAULT = 0;

/**
* Minimum refresh interval allowed. 30 seconds
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void onError(AdException exception) {
protected MediationBaseAdUnit(Context context, String configId, AdSize adSize, PrebidMediationDelegate mediationDelegate) {
mContextWeakReference = new WeakReference<>(context);
mMediationDelegate = mediationDelegate;
mAdUnitConfig.setAutoRefreshDelay(PrebidMobile.AUTO_REFRESH_DELAY_MIN / 1000);
initSdk(context);
initAdConfig(configId, adSize);
initBidLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import java.util.*;

import static org.prebid.mobile.PrebidMobile.AUTO_REFRESH_DELAY_DEFAULT;

public class AdUnitConfiguration {

Expand All @@ -22,7 +21,7 @@ public class AdUnitConfiguration {
private boolean isBuiltInVideo = false;

private int videoSkipOffset = SKIP_OFFSET_NOT_ASSIGNED;
private int autoRefreshDelayInMillis = AUTO_REFRESH_DELAY_DEFAULT;
private int autoRefreshDelayInMillis = 0;
private final int broadcastId = Utils.generateRandomInt();
private float videoInitialVolume = ExoPlayerView.DEFAULT_INITIAL_VIDEO_VOLUME;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import org.junit.Test;
import org.junit.runner.RunWith;
import org.prebid.mobile.PrebidMobile;
import org.prebid.mobile.rendering.errors.AdException;
import org.prebid.mobile.units.configuration.AdUnitConfiguration;
import org.robolectric.RobolectricTestRunner;
Expand All @@ -39,6 +38,6 @@ public void testAdConfiguration() {
adConfig = new AdUnitConfiguration();
assertNotNull(adConfig);
assertNull(err);
assertEquals(PrebidMobile.AUTO_REFRESH_DELAY_DEFAULT, adConfig.getAutoRefreshDelay());
assertEquals(0, adConfig.getAutoRefreshDelay());
}
}

0 comments on commit 75af686

Please sign in to comment.