diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidMobile.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidMobile.java index c1f4c7d46..4c8643b40 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidMobile.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidMobile.java @@ -46,7 +46,6 @@ public class PrebidMobile { public static boolean isCoppaEnabled = false; - public static boolean useExternalBrowser = false; /** * If true, the SDK sends "af=3,5", indicating support for MRAID diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilder.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilder.java index 84ce89725..1e742dd24 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilder.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilder.java @@ -381,7 +381,7 @@ private void setCommonImpValues(Imp imp, String uuid) { //Send 1 for interstitial/interstitial video and 0 for banners imp.instl = isInterstitial ? 1 : 0; // 0 == embedded, 1 == native - imp.clickBrowser = !PrebidMobile.useExternalBrowser && browserActivityAvailable ? 0 : 1; + imp.clickBrowser = browserActivityAvailable ? 0 : 1; //set secure=1 for https or secure=0 for http if (!adConfiguration.isAdType(AdFormat.VAST)) { imp.secure = 1; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtils.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtils.java index 9c2475df6..6ca852057 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtils.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtils.java @@ -131,7 +131,7 @@ public static void startBrowser(Context context, String url, int broadcastId, intent.addFlags(FLAG_ACTIVITY_NEW_TASK); } - if (!PrebidMobile.useExternalBrowser && isActivityCallable(context, intent)) { + if (isActivityCallable(context, intent)) { startActivity(context, intent); notifyBrowserActionSuccess(BrowserActionResult.INTERNAL_BROWSER, onBrowserActionResultListener); } else { diff --git a/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilderTest.java b/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilderTest.java index 4a3ae0bc7..064d92b19 100644 --- a/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilderTest.java +++ b/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/networking/parameters/BasicParameterBuilderTest.java @@ -129,7 +129,6 @@ public void cleanup() throws Exception { TargetingParams.setOmidPartnerVersion(null); PrebidMobile.sendMraidSupportParams = true; - PrebidMobile.useExternalBrowser = false; PrebidMobile.isCoppaEnabled = false; PrebidMobile.clearStoredBidResponses(); PrebidMobile.setStoredAuctionResponse(null); @@ -635,7 +634,6 @@ public void whenAppendParametersAndUseExternalBrowserFalseAndBrowserActivityAvai adConfiguration.setAdFormat(AdFormat.BANNER); adConfiguration.addSize(new AdSize(320, 50)); - PrebidMobile.useExternalBrowser = false; BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, context.getResources(), @@ -648,33 +646,12 @@ public void whenAppendParametersAndUseExternalBrowserFalseAndBrowserActivityAvai assertEquals(0, actualImp.clickBrowser.intValue()); } - @Test - public void whenAppendParametersAndUseExternalBrowserTrueAndBrowserActivityAvailable_ClickBrowserEqualsOne() { - AdUnitConfiguration adConfiguration = new AdUnitConfiguration(); - adConfiguration.setAdFormat(AdFormat.BANNER); - adConfiguration.addSize(new AdSize(320, 50)); - - PrebidMobile.useExternalBrowser = true; - - BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, - context.getResources(), - browserActivityAvailable - ); - AdRequestInput adRequestInput = new AdRequestInput(); - builder.appendBuilderParameters(adRequestInput); - - Imp actualImp = adRequestInput.getBidRequest().getImp().get(0); - assertEquals(1, actualImp.clickBrowser.intValue()); - } - @Test public void whenAppendParametersAndUseExternalBrowserFalseAndBrowserActivityNotAvailable_ClickBrowserEqualsOne() { AdUnitConfiguration adConfiguration = new AdUnitConfiguration(); adConfiguration.setAdFormat(AdFormat.BANNER); adConfiguration.addSize(new AdSize(320, 50)); - PrebidMobile.useExternalBrowser = false; - BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, context.getResources(), false); AdRequestInput adRequestInput = new AdRequestInput(); builder.appendBuilderParameters(adRequestInput); @@ -1149,7 +1126,7 @@ private Imp getExpectedImp(AdUnitConfiguration adConfiguration, String uuid) { imp.instl = isInterstitial ? 1 : 0; // 0 == embedded, 1 == native - imp.clickBrowser = !PrebidMobile.useExternalBrowser && browserActivityAvailable ? 0 : 1; + imp.clickBrowser = browserActivityAvailable ? 0 : 1; imp.id = uuid; imp.getExt().put("prebid", Prebid.getJsonObjectForImp(adConfiguration)); diff --git a/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtilsTest.java b/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtilsTest.java index 436ad8d93..d584b0860 100644 --- a/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtilsTest.java +++ b/PrebidMobile/PrebidMobile-core/src/test/java/org/prebid/mobile/rendering/utils/helpers/ExternalViewerUtilsTest.java @@ -54,11 +54,6 @@ public void setUp() throws Exception { MockitoAnnotations.initMocks(this); } - @After - public void tearDown() throws Exception { - PrebidMobile.useExternalBrowser = false; - } - @Test public void whenIsActivityCallableAndContextOrIntentNull_ReturnFalse() { assertFalse(ExternalViewerUtils.isActivityCallable(null, null)); @@ -107,7 +102,6 @@ public void whenLaunchApplicationUrl_StartActivity() throws ActionNotResolvedExc @Test public void whenStartBrowserAndUseExternalBrowserFalseAndActivityCallable_NotifyInternalBrowserSuccess() { - PrebidMobile.useExternalBrowser = false; PackageManager mockManager = mock(PackageManager.class); List mockList = Collections.singletonList(mock(ResolveInfo.class)); when(mockManager.queryIntentActivities(any(Intent.class), anyInt())).thenReturn(mockList); @@ -120,7 +114,6 @@ public void whenStartBrowserAndUseExternalBrowserFalseAndActivityCallable_Notify @Test public void whenStartBrowserAndUseExternalBrowserFalseAndActivityNotCallable_NotifyExternalBrowserSuccess() { - PrebidMobile.useExternalBrowser = false; PackageManager mockManager = mock(PackageManager.class); List mockList = Collections.singletonList(mock(ResolveInfo.class)); when(mockManager.queryIntentActivities(any(Intent.class), anyInt())).thenReturn(mockList); @@ -130,13 +123,4 @@ public void whenStartBrowserAndUseExternalBrowserFalseAndActivityNotCallable_Not verify(mockContext).startActivity(any(Intent.class)); verify(mockResultListener).onSuccess(OnBrowserActionResultListener.BrowserActionResult.INTERNAL_BROWSER); } - - @Test - public void whenStartBrowserAndUseExternalBrowserTrue_NotifyExternalBrowserSuccess() { - PrebidMobile.useExternalBrowser = true; - - ExternalViewerUtils.startBrowser(mockContext, "https://url.com", true, mockResultListener); - verify(mockContext).startActivity(any(Intent.class)); - verify(mockResultListener).onSuccess(OnBrowserActionResultListener.BrowserActionResult.EXTERNAL_BROWSER); - } } \ No newline at end of file