From 6437fb760a9db48dee4207c2a8b65da6d9052a2e Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 10:14:43 +0200 Subject: [PATCH 01/22] feat: generate combined Javadoc documentation --- PrebidMobile/build.gradle | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/PrebidMobile/build.gradle b/PrebidMobile/build.gradle index e48b39fc4..9d5460f9c 100644 --- a/PrebidMobile/build.gradle +++ b/PrebidMobile/build.gradle @@ -3,4 +3,30 @@ apply from: 'publisher.gradle' dependencies { api project(':PrebidMobile-core') +} + +task combinedJavadoc(type: Javadoc, dependsOn: assemble) { + var sourcePaths = project(":PrebidMobile-core").files("src/main/java") + .plus(project(":PrebidMobile-admobAdapters").files("src/main/java")) + .plus(project(":PrebidMobile-gamEventHandlers").files("src/main/java")) + .plus(project(":PrebidMobile-maxAdapters").files("src/main/java")) + source = sourcePaths + + destinationDir = file("$projectDir/build/combinedJavadoc") + failOnError false + options.addBooleanOption('-ignore-source-errors', true) + + exclude("**/com/applovin/mediation/adapters/prebid/**") + exclude("**/org/prebid/mobile/addendum**") + exclude("**/org/prebid/mobile/configuration**") + exclude("**/org/prebid/mobile/http**") + exclude("**/org/prebid/mobile/tasksmanager**") + exclude("**/org/prebid/mobile/rendering**") + exclude("**/org/prebid/mobile/eventhandlers/utils**") + exclude("**/org/prebid/mobile/eventhandlers/global**") + + // Boot class path fix + afterEvaluate { + tasks.combinedJavadoc.classpath += files(android.getBootClasspath()) + } } \ No newline at end of file From 594f87ba4711f49925c88b45f5bf7e976978e4cf Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 10:29:43 +0200 Subject: [PATCH 02/22] feat: add Circle CI step with documentation --- .circleci/config.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 181e091bf..6a25c7536 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,28 @@ jobs: name: Test Frameworks command: scripts/testPrebidMobile.sh + # Below is the definition of your job to build and test your app, you can rename and customize it as you want. + generate-documentation: + # These next lines define the Android machine image executor. + # See: https://circleci.com/docs/2.0/executor-types/ + executor: + name: android/android-machine + tag: default + # Add steps to the job + # See: https://circleci.com/docs/2.0/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - android/change-java-version: + java-version: 17 + # And finally run the release build + - run: + name: Test Frameworks + command: ./gradlew :PrebidMobile:combinedJavadoc + + - store_artifacts: + path: ./PrebidMobile/build/combinedJavadoc + # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: From 231a56b7057210218679d10a8281b5ab54207adf Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 10:52:44 +0200 Subject: [PATCH 03/22] feat: config corrections 1 --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a25c7536..3c5f094d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,8 @@ jobs: # And finally run the release build - run: name: Test Frameworks - command: ./gradlew :PrebidMobile:combinedJavadoc + command: + ./gradlew :PrebidMobile:combinedJavadoc - store_artifacts: path: ./PrebidMobile/build/combinedJavadoc @@ -103,3 +104,6 @@ workflows: name: Run Unit Tests - Prebid Mobile - android-test: name: Run Smoke UI Tests - Demo App Kotlin - Android 11 + # TODO: Move to release branch only + - generate-documentation: + name: Generating documentation From 25f3f93991dd599550c97005a465092e7c8ba0e8 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 11:28:15 +0200 Subject: [PATCH 04/22] feat: publishing to docs branch --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c5f094d2..34808dbb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,11 @@ jobs: name: Test Frameworks command: ./gradlew :PrebidMobile:combinedJavadoc - + git checkout docs + cp -r PrebidMobile/build/combinedJavadoc docs + rm -r docs + git add ./docs + git push - store_artifacts: path: ./PrebidMobile/build/combinedJavadoc From 4da6a9dcfd38e43cd7fdafc03d5077718ef1c617 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 11:32:12 +0200 Subject: [PATCH 05/22] feat: config corrections 2 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34808dbb5..1ccfe6b17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: # And finally run the release build - run: name: Test Frameworks - command: + command: | ./gradlew :PrebidMobile:combinedJavadoc git checkout docs cp -r PrebidMobile/build/combinedJavadoc docs From adbd3b3c85358acf511fe02d1a1a863c5da81315 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 11:37:24 +0200 Subject: [PATCH 06/22] feat: config corrections 3 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ccfe6b17..914865ffc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: ./gradlew :PrebidMobile:combinedJavadoc git checkout docs cp -r PrebidMobile/build/combinedJavadoc docs - rm -r docs + rm -rf docs git add ./docs git push - store_artifacts: From 7849c843c82034e1c1d1c202da9c79c2fae51a0d Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 11:45:09 +0200 Subject: [PATCH 07/22] feat: config corrections 4 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 914865ffc..7a1546d42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,8 +82,8 @@ jobs: command: | ./gradlew :PrebidMobile:combinedJavadoc git checkout docs - cp -r PrebidMobile/build/combinedJavadoc docs rm -rf docs + cp -r PrebidMobile/build/combinedJavadoc docs git add ./docs git push - store_artifacts: From 13783de7743f07ec128ccf98e5d6c778b57403a9 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 12:32:34 +0200 Subject: [PATCH 08/22] feat: config corrections 5 --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a1546d42..1f127940c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,10 +81,13 @@ jobs: name: Test Frameworks command: | ./gradlew :PrebidMobile:combinedJavadoc + git config --local user.name "CircleCI" && git config --local user.email "valentin.petrovich@postindustria.com" git checkout docs + git pull --rebase rm -rf docs cp -r PrebidMobile/build/combinedJavadoc docs git add ./docs + git commit -m "Javadoc publication" git push - store_artifacts: path: ./PrebidMobile/build/combinedJavadoc From 5521a499e3d45081ebe5b505996024bcbc79ce54 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 14:20:44 +0200 Subject: [PATCH 09/22] feat: add custom title --- PrebidMobile/build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PrebidMobile/build.gradle b/PrebidMobile/build.gradle index 9d5460f9c..833c7fb2d 100644 --- a/PrebidMobile/build.gradle +++ b/PrebidMobile/build.gradle @@ -6,15 +6,19 @@ dependencies { } task combinedJavadoc(type: Javadoc, dependsOn: assemble) { + title = """ +

Prebid Mobile Android SDK

+

Documentation to the public API.

+ """ + var sourcePaths = project(":PrebidMobile-core").files("src/main/java") .plus(project(":PrebidMobile-admobAdapters").files("src/main/java")) .plus(project(":PrebidMobile-gamEventHandlers").files("src/main/java")) .plus(project(":PrebidMobile-maxAdapters").files("src/main/java")) source = sourcePaths - destinationDir = file("$projectDir/build/combinedJavadoc") - failOnError false options.addBooleanOption('-ignore-source-errors', true) + failOnError false exclude("**/com/applovin/mediation/adapters/prebid/**") exclude("**/org/prebid/mobile/addendum**") From 66916d0501913d0579e723e44ddfd19b67cd46ca Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 6 Aug 2024 14:21:07 +0200 Subject: [PATCH 10/22] feat: add package info for all public packages --- .../src/main/java/org/prebid/mobile/admob/package-info.java | 4 ++++ .../main/java/org/prebid/mobile/api/data/package-info.java | 4 ++++ .../java/org/prebid/mobile/api/exceptions/package-info.java | 4 ++++ .../prebid/mobile/api/mediation/listeners/package-info.java | 4 ++++ .../java/org/prebid/mobile/api/mediation/package-info.java | 4 ++++ .../java/org/prebid/mobile/api/original/package-info.java | 5 +++++ .../prebid/mobile/api/rendering/listeners/package-info.java | 4 ++++ .../java/org/prebid/mobile/api/rendering/package-info.java | 4 ++++ .../mobile/api/rendering/pluginrenderer/package-info.java | 4 ++++ .../src/main/java/org/prebid/mobile/package-info.java | 5 +++++ .../java/org/prebid/mobile/eventhandlers/package-info.java | 4 ++++ .../java/com/applovin/mediation/adapters/package-info.java | 4 ++++ 12 files changed, 50 insertions(+) create mode 100644 PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/exceptions/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/listeners/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/package-info.java create mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/package-info.java create mode 100644 PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/package-info.java create mode 100644 PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/package-info.java diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/package-info.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/package-info.java new file mode 100644 index 000000000..b02ec8f1a --- /dev/null +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/package-info.java @@ -0,0 +1,4 @@ +/** + * Adapters for AdMob mediation integration of the Prebid SDK. + */ +package org.prebid.mobile.admob; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/package-info.java new file mode 100644 index 000000000..4936a788f --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/package-info.java @@ -0,0 +1,4 @@ +/** + * Common data classes for the SDK integration. + */ +package org.prebid.mobile.api.data; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/exceptions/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/exceptions/package-info.java new file mode 100644 index 000000000..d0be3398b --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/exceptions/package-info.java @@ -0,0 +1,4 @@ +/** + * Common exceptions. + */ +package org.prebid.mobile.api.exceptions; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/package-info.java new file mode 100644 index 000000000..12c053e62 --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/package-info.java @@ -0,0 +1,4 @@ +/** + * Listeners for the mediation integration. + */ +package org.prebid.mobile.api.mediation.listeners; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/package-info.java new file mode 100644 index 000000000..ba598e15f --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/package-info.java @@ -0,0 +1,4 @@ +/** + * Ad units for the mediation integration of the SDK. + */ +package org.prebid.mobile.api.mediation; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/package-info.java new file mode 100644 index 000000000..456be684d --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/package-info.java @@ -0,0 +1,5 @@ +/** + * Universal Prebid ad unit for multi-format request + * with access to the bid response data. + */ +package org.prebid.mobile.api.original; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/listeners/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/listeners/package-info.java new file mode 100644 index 000000000..dc10ed993 --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/listeners/package-info.java @@ -0,0 +1,4 @@ +/** + * Listeners for the rendering API integration. + */ +package org.prebid.mobile.api.rendering.listeners; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/package-info.java new file mode 100644 index 000000000..deb825c93 --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/package-info.java @@ -0,0 +1,4 @@ +/** + * Ad units for the rendering integration of the SDK. + */ +package org.prebid.mobile.api.rendering; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/package-info.java new file mode 100644 index 000000000..b4ec26120 --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/package-info.java @@ -0,0 +1,4 @@ +/** + * Package for configuring custom rendering plugins. + */ +package org.prebid.mobile.api.rendering.pluginrenderer; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/package-info.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/package-info.java new file mode 100644 index 000000000..7bb19c369 --- /dev/null +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/package-info.java @@ -0,0 +1,5 @@ +/** + * Root package with ad units for the 'original API' + * integration of the SDK and common classes for all SDK. + */ +package org.prebid.mobile; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/package-info.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/package-info.java new file mode 100644 index 000000000..6dc318bb9 --- /dev/null +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/package-info.java @@ -0,0 +1,4 @@ +/** + * Adapters for Google Ad Manager mediation integration of the Prebid SDK. + */ +package org.prebid.mobile.eventhandlers; \ No newline at end of file diff --git a/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/package-info.java b/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/package-info.java new file mode 100644 index 000000000..547e08d23 --- /dev/null +++ b/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/package-info.java @@ -0,0 +1,4 @@ +/** + * Adapters for AppLovin MAX mediation integration of the Prebid SDK. + */ +package com.applovin.mediation.adapters; \ No newline at end of file From d540fbf1c47e061c9e3f432d9eb64cbf35fa65a3 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Wed, 7 Aug 2024 10:59:34 +0200 Subject: [PATCH 11/22] feat: add header documentation to the public classes --- .../admob/AdMobMediationBannerUtils.java | 6 ++ .../AdMobMediationInterstitialUtils.java | 5 ++ .../admob/AdMobMediationRewardedUtils.java | 5 ++ .../mobile/admob/PrebidBannerAdapter.java | 3 + .../mobile/admob/PrebidBaseAdapter.java | 3 + .../admob/PrebidInterstitialAdapter.java | 3 + .../mobile/admob/PrebidNativeAdMapper.java | 3 + .../mobile/admob/PrebidNativeAdapter.java | 3 + .../mobile/admob/PrebidRewardedAdapter.java | 3 + .../main/java/org/prebid/mobile/AdUnit.java | 3 + .../java/org/prebid/mobile/BannerAdUnit.java | 3 + .../org/prebid/mobile/BannerBaseAdUnit.java | 3 +- .../org/prebid/mobile/BannerParameters.java | 4 +- .../main/java/org/prebid/mobile/BidLog.java | 86 ------------------- .../java/org/prebid/mobile/CacheManager.java | 4 + .../java/org/prebid/mobile/ClickTracker.java | 3 + .../prebid/mobile/ClickTrackerListener.java | 3 + .../java/org/prebid/mobile/ContentObject.java | 7 ++ .../java/org/prebid/mobile/DataObject.java | 6 ++ .../org/prebid/mobile/ExternalUserId.java | 9 +- .../src/main/java/org/prebid/mobile/Host.java | 3 + .../org/prebid/mobile/ImpressionTracker.java | 3 + .../mobile/ImpressionTrackerListener.java | 3 + .../prebid/mobile/InStreamVideoAdUnit.java | 4 +- .../org/prebid/mobile/InterstitialAdUnit.java | 3 + .../main/java/org/prebid/mobile/LogUtil.java | 9 ++ .../java/org/prebid/mobile/NativeAdUnit.java | 10 +++ .../java/org/prebid/mobile/NativeAsset.java | 3 + .../java/org/prebid/mobile/NativeData.java | 6 ++ .../org/prebid/mobile/NativeDataAsset.java | 6 ++ .../org/prebid/mobile/NativeEventTracker.java | 10 +++ .../java/org/prebid/mobile/NativeImage.java | 6 ++ .../org/prebid/mobile/NativeImageAsset.java | 6 ++ .../org/prebid/mobile/NativeParameters.java | 1 + .../java/org/prebid/mobile/NativeTitle.java | 3 + .../org/prebid/mobile/NativeTitleAsset.java | 3 + .../org/prebid/mobile/OnCompleteListener.java | 3 + .../prebid/mobile/OnCompleteListener2.java | 3 + .../org/prebid/mobile/ParametersMatcher.java | 5 ++ .../java/org/prebid/mobile/PrebidMobile.java | 4 + .../org/prebid/mobile/PrebidNativeAd.java | 3 + .../mobile/PrebidNativeAdEventListener.java | 3 + .../prebid/mobile/PrebidNativeAdListener.java | 3 + .../java/org/prebid/mobile/ResultCode.java | 3 + .../prebid/mobile/RewardedVideoAdUnit.java | 3 + .../prebid/mobile/SharedNetworkManager.java | 4 + .../main/java/org/prebid/mobile/Signals.java | 3 + .../org/prebid/mobile/TargetingParams.java | 3 + .../src/main/java/org/prebid/mobile/Util.java | 12 +-- .../org/prebid/mobile/VideoBaseAdUnit.java | 3 + .../org/prebid/mobile/VideoParameters.java | 1 + .../mobile/api/data/BannerAdPosition.java | 3 + .../org/prebid/mobile/api/data/BidInfo.java | 3 + .../mobile/api/data/FetchDemandResult.java | 3 + .../mobile/api/data/InitializationStatus.java | 7 ++ .../org/prebid/mobile/api/data/Position.java | 3 + .../mobile/api/data/VideoPlacementType.java | 4 + .../api/mediation/MediationBannerAdUnit.java | 5 ++ .../api/mediation/MediationBaseAdUnit.java | 3 + .../MediationBaseFullScreenAdUnit.java | 5 ++ .../MediationInterstitialAdUnit.java | 3 + .../api/mediation/MediationNativeAdUnit.java | 3 + .../MediationRewardedVideoAdUnit.java | 5 ++ .../listeners/OnFetchCompleteListener.java | 4 + .../api/original/OnFetchDemandResult.java | 3 + .../mobile/api/original/PrebidAdUnit.java | 4 + .../mobile/api/original/PrebidRequest.java | 3 + .../mobile/api/rendering/BannerView.java | 3 + .../api/rendering/BaseInterstitialAdUnit.java | 3 + .../mobile/api/rendering/DisplayView.java | 5 +- .../api/rendering/InterstitialAdUnit.java | 3 + .../api/rendering/InterstitialView.java | 4 + .../api/rendering/PrebidDisplayView.java | 3 + ...MobileInterstitialControllerInterface.java | 3 + .../mobile/api/rendering/PrebidRenderer.java | 5 +- .../mobile/api/rendering/RewardedAdUnit.java | 3 + .../mobile/api/rendering/VideoView.java | 5 ++ .../pluginrenderer/PluginEventListener.java | 3 + .../PrebidMobilePluginRegister.java | 3 + .../PrebidMobilePluginRenderer.java | 5 +- .../prebid/mobile/eventhandlers/AdEvent.java | 3 + .../eventhandlers/GamBannerEventHandler.java | 7 +- .../GamInterstitialEventHandler.java | 5 ++ .../GamRewardedEventHandler.java | 5 ++ .../eventhandlers/PublisherAdViewWrapper.java | 5 +- .../PublisherInterstitialAdWrapper.java | 9 +- .../eventhandlers/RewardedAdWrapper.java | 9 +- .../adapters/PrebidMaxMediationAdapter.java | 3 + 88 files changed, 345 insertions(+), 110 deletions(-) delete mode 100644 PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BidLog.java diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java index dd51ef53e..5630c711f 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java @@ -2,8 +2,11 @@ import android.os.Bundle; import android.util.Log; + import androidx.annotation.Nullable; + import com.google.android.gms.ads.AdView; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; import org.prebid.mobile.rendering.bidding.display.PrebidMediationDelegate; @@ -14,6 +17,9 @@ import java.lang.ref.WeakReference; import java.util.HashMap; +/** + * Internal mediation delegate. + */ public class AdMobMediationBannerUtils implements PrebidMediationDelegate { private static final String TAG = "BannerMediationUtils"; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationInterstitialUtils.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationInterstitialUtils.java index a1e5bb30c..f785556ea 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationInterstitialUtils.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationInterstitialUtils.java @@ -1,12 +1,17 @@ package org.prebid.mobile.admob; import android.os.Bundle; + import androidx.annotation.Nullable; + import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; import org.prebid.mobile.rendering.bidding.display.PrebidMediationDelegate; import java.util.HashMap; +/** + * Internal mediation delegate. + */ public class AdMobMediationInterstitialUtils implements PrebidMediationDelegate { private final Bundle extras; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationRewardedUtils.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationRewardedUtils.java index 94f980c39..991c69455 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationRewardedUtils.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationRewardedUtils.java @@ -1,12 +1,17 @@ package org.prebid.mobile.admob; import android.os.Bundle; + import androidx.annotation.Nullable; + import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; import org.prebid.mobile.rendering.bidding.display.PrebidMediationDelegate; import java.util.HashMap; +/** + * Internal mediation delegate. + */ public class AdMobMediationRewardedUtils implements PrebidMediationDelegate { private final Bundle extras; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBannerAdapter.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBannerAdapter.java index 4e17689b4..c994c42cf 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBannerAdapter.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBannerAdapter.java @@ -16,6 +16,9 @@ import org.prebid.mobile.rendering.bidding.display.BidResponseCache; import org.prebid.mobile.rendering.bidding.listeners.DisplayViewListener; +/** + * Prebid banner adapter for AdMob integration. + */ public class PrebidBannerAdapter extends PrebidBaseAdapter { public static final String EXTRA_RESPONSE_ID = "PrebidBannerAdapterExtraId"; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBaseAdapter.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBaseAdapter.java index 3005e2f69..7fbbb5400 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBaseAdapter.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidBaseAdapter.java @@ -21,6 +21,9 @@ import java.util.HashMap; import java.util.List; +/** + * Base Prebid adapter for all ad types. + */ public abstract class PrebidBaseAdapter extends Adapter { private final VersionInfo prebidVersion = getPrebidVersion(); diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidInterstitialAdapter.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidInterstitialAdapter.java index ce6423032..7dc67d0e2 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidInterstitialAdapter.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidInterstitialAdapter.java @@ -12,6 +12,9 @@ import org.prebid.mobile.rendering.bidding.display.InterstitialController; import org.prebid.mobile.rendering.bidding.interfaces.InterstitialControllerListener; +/** + * Prebid interstitial adapter for AdMob integration. + */ public class PrebidInterstitialAdapter extends PrebidBaseAdapter { public static final String EXTRA_RESPONSE_ID = "PrebidInterstitialAdapterExtraId"; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdMapper.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdMapper.java index a5619af36..66df79f42 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdMapper.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdMapper.java @@ -32,6 +32,9 @@ import java.util.ArrayList; import java.util.Map; +/** + * Prebid native ad mapper for converting to AdMob native ad. + */ public class PrebidNativeAdMapper extends UnifiedNativeAdMapper { private final PrebidNativeAd prebidAd; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdapter.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdapter.java index 406cd49da..3b8fcf40d 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdapter.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidNativeAdapter.java @@ -19,6 +19,9 @@ import java.util.HashMap; import java.util.Set; +/** + * Prebid native adapter for AdMob integration. + */ public class PrebidNativeAdapter extends PrebidBaseAdapter { private static final String TAG = "PrebidNative"; diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidRewardedAdapter.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidRewardedAdapter.java index 8f5c4c3cc..c36eeb855 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidRewardedAdapter.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/PrebidRewardedAdapter.java @@ -13,6 +13,9 @@ import org.prebid.mobile.rendering.bidding.display.InterstitialController; import org.prebid.mobile.rendering.bidding.interfaces.InterstitialControllerListener; +/** + * Prebid rewarded adapter for AdMob integration. + */ @Keep public class PrebidRewardedAdapter extends PrebidBaseAdapter { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java index a522a19a0..ce48a612c 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java @@ -51,6 +51,9 @@ import java.util.Map; import java.util.Set; +/** + * Base ad unit for the original API. + */ public abstract class AdUnit { protected AdUnitConfiguration configuration = new AdUnitConfiguration(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java index f8940733d..612d47d1c 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java @@ -25,6 +25,9 @@ import java.util.EnumSet; import java.util.HashSet; +/** + * Original API banner ad unit for displaying banner ad. + */ public class BannerAdUnit extends BannerBaseAdUnit { public BannerAdUnit(@NonNull String configId, int width, int height) { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerBaseAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerBaseAdUnit.java index fb2892584..3b09d1bd3 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerBaseAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerBaseAdUnit.java @@ -25,7 +25,7 @@ import java.util.List; /** - * Contains Banner and Video parameters. + * Base banner ad unit with banner and video parameters. */ public abstract class BannerBaseAdUnit extends AdUnit { @@ -89,6 +89,7 @@ public void setOrtbConfig(@Nullable String ortbConfig) { } /** + * Banner parameters. * Describes an OpenRTB banner object */ @Deprecated diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerParameters.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerParameters.java index 87ff94430..ec0f0d631 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerParameters.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerParameters.java @@ -8,7 +8,9 @@ import java.util.Set; /** - * Describes an OpenRTB banner object + * Banner parameters for the + * OpenRTB + * banner object. */ public class BannerParameters { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BidLog.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BidLog.java deleted file mode 100644 index 011aac5c1..000000000 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BidLog.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.prebid.mobile; - -public class BidLog { - private BidLogEntry lastEntry; - - private static BidLog instance; - - public static BidLog getInstance() { - if (instance == null) { - instance = new BidLog(); - } - return instance; - } - - private BidLog() { - - } - - public BidLogEntry getLastBid() { - return lastEntry; - } - - public void setLastEntry(BidLogEntry entry) { - this.lastEntry = entry; - } - - public void cleanLog() { - this.lastEntry = null; - } - - public static class BidLogEntry { - private String requestUrl; - private String requestBody; - private int responseCode; - private boolean containsTopBid; - private String response; - - public BidLogEntry() { - this.requestUrl = ""; - this.requestBody = ""; - this.responseCode = -1; - this.containsTopBid = false; - this.response = ""; - } - - public String getRequestUrl() { - return requestUrl; - } - - public void setRequestUrl(String requestUrl) { - this.requestUrl = requestUrl; - } - - public String getRequestBody() { - return requestBody; - } - - public void setRequestBody(String requestBody) { - this.requestBody = requestBody; - } - - public int getResponseCode() { - return responseCode; - } - - public void setResponseCode(int responseCode) { - this.responseCode = responseCode; - } - - public String getResponse() { - return response; - } - - public void setResponse(String response) { - this.response = response; - } - - public boolean containsTopBid() { - return containsTopBid; - } - - public void setContainsTopBid(boolean containsTopBid) { - this.containsTopBid = containsTopBid; - } - } -} diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/CacheManager.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/CacheManager.java index 5eb3f83f7..c92ba68e9 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/CacheManager.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/CacheManager.java @@ -26,6 +26,10 @@ import java.util.HashMap; import java.util.UUID; +/** + * Original API cache manager. Manages saving and receiving cached ad. + * It is also responsible for native ad expiration. + */ public class CacheManager { private static final int NATIVE_AD_EXPIRY_TIMEOUT = 300000; private static HashMap savedValues = new HashMap<>(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTracker.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTracker.java index 4f583cf25..6713e0e6e 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTracker.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTracker.java @@ -22,6 +22,9 @@ import org.prebid.mobile.http.HTTPGet; import org.prebid.mobile.http.HTTPResponse; +/** + * Internal click tracker. + */ class ClickTracker { private String url; private boolean fired = false; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTrackerListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTrackerListener.java index 9ce3506f8..5aa61e5cc 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTrackerListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ClickTrackerListener.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Internal click tracker listener. + */ public interface ClickTrackerListener { public void onClickTrackerFired(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ContentObject.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ContentObject.java index e8e89341d..9c5b30610 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ContentObject.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ContentObject.java @@ -2,6 +2,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -9,6 +10,9 @@ import java.util.ArrayList; import java.util.List; +/** + * Application content object for additional targeting. + */ public class ContentObject { /** @@ -442,6 +446,9 @@ public void setProducer(@Nullable ProducerObject producerObject) { this.producerObject = producerObject; } + /** + * Producer info. + */ public static class ProducerObject { /** diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/DataObject.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/DataObject.java index 0201c9759..fcf9addf8 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/DataObject.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/DataObject.java @@ -10,6 +10,9 @@ import java.util.ArrayList; +/** + * Data content object for additional targeting. + */ public class DataObject { /** @@ -113,6 +116,9 @@ public int hashCode() { return result; } + /** + * Segment object. + */ public static class SegmentObject { /** diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ExternalUserId.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ExternalUserId.java index 320661e5a..f91eabd88 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ExternalUserId.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ExternalUserId.java @@ -18,14 +18,19 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; /** - * Defines the User Id Object from an External Third Party Source + * User id object from an external third-party source for additional targeting. */ public class ExternalUserId { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Host.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Host.java index 968c1d759..9f2df912b 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Host.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Host.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Host for requesting ad. + */ public enum Host { /** diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTracker.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTracker.java index c4bf4869a..169182750 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTracker.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTracker.java @@ -22,6 +22,9 @@ import org.prebid.mobile.http.HTTPGet; import org.prebid.mobile.http.HTTPResponse; +/** + * Impression tracker for native ad. + */ class ImpressionTracker { private String url; private VisibilityDetector visibilityDetector; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTrackerListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTrackerListener.java index d12c72295..7956da01f 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTrackerListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ImpressionTrackerListener.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Impression tracker listener. + */ public interface ImpressionTrackerListener { public void onImpressionTrackerFired(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java index 3f365ce7c..9ab7e1bdb 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java @@ -17,13 +17,15 @@ package org.prebid.mobile; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import org.prebid.mobile.api.data.AdFormat; import java.util.EnumSet; +/** + * Original API in-stream video ad unit. + */ public class InStreamVideoAdUnit extends VideoBaseAdUnit { public InStreamVideoAdUnit(@NonNull String configId, int width, int height) { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java index e8ba74f90..0a5aeb95e 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java @@ -27,6 +27,9 @@ import java.util.EnumSet; +/** + * Original API interstitial ad unit. + */ public class InterstitialAdUnit extends BannerBaseAdUnit { public InterstitialAdUnit(@NonNull String configId) { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/LogUtil.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/LogUtil.java index 46b0c084c..9ba33285a 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/LogUtil.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/LogUtil.java @@ -21,6 +21,9 @@ import androidx.annotation.NonNull; import androidx.annotation.Size; +/** + * Prebid logger. Allows to control log level. + */ public class LogUtil { private static final String BASE_TAG = "PrebidMobile"; @@ -176,6 +179,9 @@ private static String getTagWithBase(String tag) { } } + /** + * Internal interface. + */ public interface PrebidLogger { void println(int messagePriority, String tag, String message); @@ -183,6 +189,9 @@ public interface PrebidLogger { void e(final String tag, String message, Throwable throwable); } + /** + * Default implementation. + */ private static class LogCatLogger implements PrebidLogger { @Override diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java index f3cfd7299..60703f6fc 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java @@ -15,6 +15,7 @@ import java.util.HashMap; /** + * Original API native ad unit. * For details of the configuration of native imps, please check this documentation: * https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf */ @@ -55,6 +56,9 @@ public void onError(AdException exception) { }; } + /** + * Context type for native request. + */ public enum CONTEXT_TYPE { CONTENT_CENTRIC(1), SOCIAL_CENTRIC(2), @@ -91,6 +95,9 @@ public void setContextType(CONTEXT_TYPE type) { nativeConfiguration.setContextType(type); } + /** + * Context subtype for native request. + */ public enum CONTEXTSUBTYPE { GENERAL(10), ARTICAL(11), @@ -136,6 +143,9 @@ public void setContextSubType(CONTEXTSUBTYPE type) { nativeConfiguration.setContextSubtype(type); } + /** + * Placement type for native request. + */ public enum PLACEMENTTYPE { CONTENT_FEED(1), CONTENT_ATOMIC_UNIT(2), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAsset.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAsset.java index 89eca3db3..06bf453bd 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAsset.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAsset.java @@ -2,6 +2,9 @@ import org.json.JSONObject; +/** + * Base class for requesting native assets. + */ public abstract class NativeAsset { enum REQUEST_ASSET { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeData.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeData.java index a214e4f5d..fd1180b2f 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeData.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeData.java @@ -2,6 +2,9 @@ import androidx.annotation.NonNull; +/** + * Response object for native data asset. + */ public class NativeData { private final int typeNumber; @@ -42,6 +45,9 @@ public boolean equals(Object object) { return typeNumber == that.typeNumber && value.equals(that.value); } + /** + * Enum type of native data. + */ public enum Type { SPONSORED_BY, DESCRIPTION, diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeDataAsset.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeDataAsset.java index 8a9abb633..f49872974 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeDataAsset.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeDataAsset.java @@ -3,11 +3,17 @@ import org.json.JSONArray; import org.json.JSONObject; +/** + * Native data object for requesting asset. + */ public class NativeDataAsset extends NativeAsset { public NativeDataAsset() { super(REQUEST_ASSET.DATA); } + /** + * Data type. + */ public enum DATA_TYPE { SPONSORED(1), DESC(2), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeEventTracker.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeEventTracker.java index a35940d0e..8b27e51d8 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeEventTracker.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeEventTracker.java @@ -5,7 +5,14 @@ import java.util.ArrayList; +/** + * Native event tracker for requesting ad. + */ public class NativeEventTracker { + + /** + * Event type. + */ public enum EVENT_TYPE { IMPRESSION(1), VIEWABLE_MRC50(2), @@ -39,6 +46,9 @@ private boolean inExistingValue(int id) { } } + /** + * Event tracking method. + */ public enum EVENT_TRACKING_METHOD { IMAGE(1), JS(2), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImage.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImage.java index 5eff94d45..12d36c2a1 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImage.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImage.java @@ -2,6 +2,9 @@ import androidx.annotation.NonNull; +/** + * Response object for native image asset. + */ public class NativeImage { private final int typeNumber; @@ -42,6 +45,9 @@ public boolean equals(Object object) { return typeNumber == that.typeNumber && url.equals(that.url); } + /** + * Enum type of native image. + */ public enum Type { ICON, MAIN_IMAGE, diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImageAsset.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImageAsset.java index 852716121..839ae4bc4 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImageAsset.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeImageAsset.java @@ -5,6 +5,9 @@ import java.util.ArrayList; +/** + * Native image object for requesting asset. + */ public class NativeImageAsset extends NativeAsset { @Deprecated @@ -26,6 +29,9 @@ public NativeImageAsset(int minWidth, int minHeight) { hmin = minHeight; } + /** + * Image type. + */ public enum IMAGE_TYPE { ICON(1), MAIN(3), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeParameters.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeParameters.java index 9608ff0e5..f622c408e 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeParameters.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeParameters.java @@ -9,6 +9,7 @@ import java.util.List; /** + * Native parameters. * For details of the configuration of native parameters, please check this documentation: * https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf */ diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitle.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitle.java index 758291d3f..ab9ad8664 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitle.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitle.java @@ -2,6 +2,9 @@ import androidx.annotation.NonNull; +/** + * Response object for native title asset. + */ public class NativeTitle { private final String text; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitleAsset.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitleAsset.java index e3ecccf1b..e4c887c85 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitleAsset.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeTitleAsset.java @@ -3,6 +3,9 @@ import org.json.JSONArray; import org.json.JSONObject; +/** + * Native title object for requesting asset. + */ public class NativeTitleAsset extends NativeAsset { private int len; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener.java index 10192f04a..ca9f33b97 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener.java @@ -18,6 +18,9 @@ import androidx.annotation.MainThread; +/** + * Fetch demand listener for original API. + */ public interface OnCompleteListener { /** * This method will be called when PrebidMobile finishes attaching keywords to your ad object. diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener2.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener2.java index d92b88dab..17106dda3 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener2.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/OnCompleteListener2.java @@ -21,6 +21,9 @@ import java.util.Map; +/** + * Additional fetch demand listener. + */ public interface OnCompleteListener2 { /** * This method will be called when PrebidMobile finishes attaching keywords to unmodifiableMap. diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ParametersMatcher.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ParametersMatcher.java index dfcdc8167..fbc19ef21 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ParametersMatcher.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ParametersMatcher.java @@ -1,13 +1,18 @@ package org.prebid.mobile; import android.os.Bundle; + import androidx.annotation.Nullable; + import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Iterator; +/** + * Internal class for comparing parameters in adapters. + */ public class ParametersMatcher { private static final String TAG = "ParametersMatcher"; 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..0aaf52e4d 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 @@ -43,6 +43,10 @@ import java.util.List; import java.util.Map; +/** + * Main class for managing Prebid SDK. It allows to initialize, set log level + * and manage internal behaviour. + */ public class PrebidMobile { public static boolean isCoppaEnabled = false; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAd.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAd.java index 1f422af38..6b5177349 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAd.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAd.java @@ -37,6 +37,9 @@ import java.util.ArrayList; import java.util.List; +/** + * Response native ad object for all assets. + */ public class PrebidNativeAd { private static final String TAG = "PrebidNativeAd"; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdEventListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdEventListener.java index bba6f7531..a06f7f888 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdEventListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdEventListener.java @@ -18,6 +18,9 @@ import androidx.annotation.WorkerThread; +/** + * Native events listener. + */ public interface PrebidNativeAdEventListener { /** diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdListener.java index 5b8adfd24..3b5787888 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/PrebidNativeAdListener.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Native ad listener. + */ public interface PrebidNativeAdListener { /** * A successful Prebid Native ad is returned diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ResultCode.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ResultCode.java index 0f3c1f60d..423ac0732 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ResultCode.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/ResultCode.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Result code for fetch demand. + */ public enum ResultCode { /** * The attaching keywords was successful, which means diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/RewardedVideoAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/RewardedVideoAdUnit.java index 04e07ccba..2d36c4120 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/RewardedVideoAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/RewardedVideoAdUnit.java @@ -24,6 +24,9 @@ import java.util.EnumSet; +/** + * Original API rewarded video ad unit. + */ public class RewardedVideoAdUnit extends VideoBaseAdUnit { public RewardedVideoAdUnit(@NonNull String configId) { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/SharedNetworkManager.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/SharedNetworkManager.java index ece93a3cc..f502d4172 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/SharedNetworkManager.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/SharedNetworkManager.java @@ -20,6 +20,7 @@ import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; + import org.prebid.mobile.http.HTTPGet; import org.prebid.mobile.http.HTTPResponse; import org.prebid.mobile.http.HttpErrorCode; @@ -29,6 +30,9 @@ import java.util.Timer; import java.util.TimerTask; +/** + * Internal class for network operations. + */ public class SharedNetworkManager { private static SharedNetworkManager manager; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Signals.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Signals.java index 9d9f6b358..d47a4f0d0 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Signals.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Signals.java @@ -16,6 +16,9 @@ package org.prebid.mobile; +/** + * Signals for the request. + */ public class Signals { static class SingleContainerInt { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/TargetingParams.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/TargetingParams.java index 2b6c24dcd..69095b7e0 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/TargetingParams.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/TargetingParams.java @@ -128,6 +128,9 @@ public static void setYearOfBirth(int yob) throws Exception { } } + /** + * Gender. + */ public enum GENDER { FEMALE, MALE, diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Util.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Util.java index c3e5aa3d1..2d8d79a6b 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Util.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/Util.java @@ -38,6 +38,9 @@ import java.util.Random; import java.util.Set; +/** + * Utils for original API reflection manipulations. + */ public class Util { @@ -65,12 +68,6 @@ private Util() { } - public interface ResizeInBannerNativeListener { - void onResizePrebidAdSuccessful(); - - void onPrebidAdNotFound(); - } - @Nullable static JSONObject getObjectWithoutEmptyValues(@NonNull JSONObject jsonObject) { @@ -512,6 +509,9 @@ static List convertJSONArray(JSONArray jsonArray) throws Exception { } + /** + * Internal interface. + */ public interface Function1 { R apply(T element); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoBaseAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoBaseAdUnit.java index d41d20162..b984a78e0 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoBaseAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoBaseAdUnit.java @@ -24,6 +24,9 @@ import java.util.EnumSet; import java.util.List; +/** + * Video base ad unit with video parameters. + */ public abstract class VideoBaseAdUnit extends AdUnit { VideoBaseAdUnit(@NonNull String configId, @NonNull EnumSet adType) { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoParameters.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoParameters.java index 11e740439..71d5c697a 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoParameters.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/VideoParameters.java @@ -6,6 +6,7 @@ import java.util.List; /** + * Video parameters for requesting ad. * Describes an OpenRTB video object */ public class VideoParameters { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BannerAdPosition.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BannerAdPosition.java index 0e06f9601..00ee3e634 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BannerAdPosition.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BannerAdPosition.java @@ -18,6 +18,9 @@ import org.prebid.mobile.rendering.models.AdPosition; +/** + * Banner ad position for additional targeting. + */ public enum BannerAdPosition { UNDEFINED(-1), UNKNOWN(0), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BidInfo.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BidInfo.java index 4a1f6be3a..c532719d5 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BidInfo.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/BidInfo.java @@ -11,6 +11,9 @@ import java.util.Map; +/** + * Bid info object for {@link org.prebid.mobile.api.original.PrebidAdUnit}. + */ public class BidInfo { @NonNull diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/FetchDemandResult.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/FetchDemandResult.java index c004bd45c..09099ff19 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/FetchDemandResult.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/FetchDemandResult.java @@ -19,6 +19,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +/** + * Enum fetch demand status for all ads. + */ public enum FetchDemandResult { /** diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/InitializationStatus.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/InitializationStatus.java index 53f784570..2f2cac09d 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/InitializationStatus.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/InitializationStatus.java @@ -1,7 +1,14 @@ package org.prebid.mobile.api.data; +import android.content.Context; + import androidx.annotation.Nullable; +import org.prebid.mobile.rendering.listeners.SdkInitializationListener; + +/** + * Initialization status for {@link org.prebid.mobile.PrebidMobile#initializeSdk(Context, SdkInitializationListener)}. + */ public enum InitializationStatus { SUCCEEDED, diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/Position.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/Position.java index 9c027486d..6ebc300b4 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/Position.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/Position.java @@ -2,6 +2,9 @@ import androidx.annotation.Nullable; +/** + * Control item position. It's used for controlling rendering API button positions. + */ public enum Position { TOP_LEFT, TOP, diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/VideoPlacementType.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/VideoPlacementType.java index ece4beb8b..23aa73e78 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/VideoPlacementType.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/data/VideoPlacementType.java @@ -17,8 +17,12 @@ package org.prebid.mobile.api.data; import androidx.annotation.Nullable; + import org.prebid.mobile.rendering.models.PlacementType; +/** + * Video placement type for additional targeting. + */ public enum VideoPlacementType { IN_BANNER(2), IN_ARTICLE(3), diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java index 54eb1a680..86b5fbd41 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java @@ -17,7 +17,9 @@ package org.prebid.mobile.api.mediation; import android.content.Context; + import androidx.annotation.NonNull; + import org.prebid.mobile.AdSize; import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.data.AdFormat; @@ -27,6 +29,9 @@ import org.prebid.mobile.rendering.models.AdPosition; import org.prebid.mobile.rendering.utils.broadcast.ScreenStateReceiver; +/** + * Mediation banner ad unit for Rendering API with AdMob or AppLovin MAX. + */ public class MediationBannerAdUnit extends MediationBaseAdUnit { private static final String TAG = MediationBannerAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseAdUnit.java index f2da65a60..fd0ee6b27 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseAdUnit.java @@ -43,6 +43,9 @@ import java.util.Map; import java.util.Set; +/** + * Internal base mediation ad unit. + */ public abstract class MediationBaseAdUnit { private static final String TAG = MediationBaseAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseFullScreenAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseFullScreenAdUnit.java index 0bd11a939..15e1cfd0d 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseFullScreenAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBaseFullScreenAdUnit.java @@ -1,12 +1,17 @@ package org.prebid.mobile.api.mediation; import android.content.Context; + import androidx.annotation.FloatRange; import androidx.annotation.Nullable; + import org.prebid.mobile.AdSize; import org.prebid.mobile.api.data.Position; import org.prebid.mobile.rendering.bidding.display.PrebidMediationDelegate; +/** + * Internal base interstitial ad unit. + */ public abstract class MediationBaseFullScreenAdUnit extends MediationBaseAdUnit { private static final String TAG = MediationBaseFullScreenAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java index 1a418b158..ae2c0840e 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java @@ -29,6 +29,9 @@ import java.util.EnumSet; +/** + * Mediation interstitial ad unit for Rendering API with AdMob or AppLovin MAX. + */ public class MediationInterstitialAdUnit extends MediationBaseFullScreenAdUnit { private static final String TAG = MediationInterstitialAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java index 0d2a7d716..73bb1a7cf 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java @@ -15,6 +15,9 @@ import java.util.ArrayList; import java.util.Set; +/** + * Mediation native ad unit for Rendering API with AdMob or AppLovin MAX. + */ public class MediationNativeAdUnit { private static final String TAG = "MediationNativeAdUnit"; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java index 23baee374..f52f968c5 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java @@ -17,7 +17,9 @@ package org.prebid.mobile.api.mediation; import android.content.Context; + import androidx.annotation.NonNull; + import org.prebid.mobile.AdSize; import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.data.AdFormat; @@ -28,6 +30,9 @@ import org.prebid.mobile.rendering.bidding.display.PrebidMediationDelegate; import org.prebid.mobile.rendering.models.AdPosition; +/** + * Mediation rewarded ad unit for Rendering API with AdMob or AppLovin MAX. + */ public class MediationRewardedVideoAdUnit extends MediationBaseFullScreenAdUnit { private static final String TAG = "MediationRewardedAdUnit"; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/OnFetchCompleteListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/OnFetchCompleteListener.java index 8a0cc3607..7dc4b9723 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/OnFetchCompleteListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/listeners/OnFetchCompleteListener.java @@ -17,8 +17,12 @@ package org.prebid.mobile.api.mediation.listeners; import androidx.annotation.MainThread; + import org.prebid.mobile.api.data.FetchDemandResult; +/** + * Fetch demand listener for mediation ad units. + */ public interface OnFetchCompleteListener { @MainThread diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/OnFetchDemandResult.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/OnFetchDemandResult.java index 8777b40ef..502915624 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/OnFetchDemandResult.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/OnFetchDemandResult.java @@ -4,6 +4,9 @@ import org.prebid.mobile.api.data.BidInfo; +/** + * Fetch demand listener for original API {@link PrebidAdUnit}. + */ public interface OnFetchDemandResult { void onComplete(@NonNull BidInfo bidInfo); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java index db2567dca..9d4c8ed08 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java @@ -11,6 +11,10 @@ import org.prebid.mobile.ResultCode; import org.prebid.mobile.api.data.BidInfo; +/** + * Universal ad unit for original API. It allows to make multi-format request. + * Fetch demand result provides access to bid info data {@link BidInfo}. + */ public class PrebidAdUnit { @NonNull diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidRequest.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidRequest.java index 5a5ed2883..7f81cccf4 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidRequest.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidRequest.java @@ -13,6 +13,9 @@ import java.util.Map; import java.util.Set; +/** + * Request parameters for {@link PrebidAdUnit}. + */ public class PrebidRequest { @Nullable diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java index a295fba6a..b020e92a4 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BannerView.java @@ -65,6 +65,9 @@ import java.util.Map; import java.util.Set; +/** + * Ad view for banner ad with rendering API. + */ public class BannerView extends FrameLayout { private final static String TAG = BannerView.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BaseInterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BaseInterstitialAdUnit.java index e3b7ffb24..f5bb7bf99 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BaseInterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/BaseInterstitialAdUnit.java @@ -48,6 +48,9 @@ import java.util.Map; import java.util.Set; +/** + * Internal base interstitial ad unit for rendering API. + */ public abstract class BaseInterstitialAdUnit { private static final String TAG = BaseInterstitialAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/DisplayView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/DisplayView.java index c89fcca93..fded8f015 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/DisplayView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/DisplayView.java @@ -23,14 +23,17 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.api.rendering.pluginrenderer.PrebidMobilePluginRegister; import org.prebid.mobile.api.rendering.pluginrenderer.PrebidMobilePluginRenderer; import org.prebid.mobile.configuration.AdUnitConfiguration; import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; +import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.rendering.bidding.listeners.DisplayViewListener; import org.prebid.mobile.rendering.networking.WinNotifier; +/** + * Internal view for {@link BannerView}. + */ public class DisplayView extends FrameLayout { private View adView; private AdUnitConfiguration adUnitConfiguration; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialAdUnit.java index 3111f9acf..d196c3105 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialAdUnit.java @@ -40,6 +40,9 @@ import java.util.EnumSet; +/** + * Interstitial ad unit for rendering API. + */ public class InterstitialAdUnit extends BaseInterstitialAdUnit { private static final String TAG = InterstitialAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialView.java index 6e3a72199..8391c10b6 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/InterstitialView.java @@ -20,6 +20,7 @@ import android.content.res.Configuration; import android.util.Log; import android.view.View; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.exceptions.AdException; import org.prebid.mobile.configuration.AdUnitConfiguration; @@ -39,6 +40,9 @@ import java.util.Arrays; import java.util.List; +/** + * Internal view for {@link InterstitialAdUnit}. + */ public class InterstitialView extends BaseAdView { private static final String TAG = InterstitialView.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidDisplayView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidDisplayView.java index 939514811..2aecdd72c 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidDisplayView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidDisplayView.java @@ -39,6 +39,9 @@ import org.prebid.mobile.rendering.views.interstitial.InterstitialManager; import org.prebid.mobile.rendering.views.video.VideoViewListener; +/** + * Internal view renderer for plugin renderer. + */ public class PrebidDisplayView extends FrameLayout { private final static String TAG = DisplayView.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidMobileInterstitialControllerInterface.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidMobileInterstitialControllerInterface.java index 5915f712d..75e41fe2f 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidMobileInterstitialControllerInterface.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidMobileInterstitialControllerInterface.java @@ -19,6 +19,9 @@ import org.prebid.mobile.configuration.AdUnitConfiguration; import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; +/** + * Interface for plugin renderer. + */ public interface PrebidMobileInterstitialControllerInterface { void loadAd(AdUnitConfiguration adUnitConfiguration, BidResponse bidResponse); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidRenderer.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidRenderer.java index e00b710b6..559d6fd56 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidRenderer.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/PrebidRenderer.java @@ -28,7 +28,6 @@ import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.data.AdFormat; import org.prebid.mobile.api.exceptions.AdException; -import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.api.rendering.pluginrenderer.PluginEventListener; import org.prebid.mobile.api.rendering.pluginrenderer.PrebidMobilePluginRenderer; import org.prebid.mobile.configuration.AdUnitConfiguration; @@ -36,8 +35,12 @@ import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; import org.prebid.mobile.rendering.bidding.display.InterstitialController; import org.prebid.mobile.rendering.bidding.interfaces.InterstitialControllerListener; +import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.rendering.bidding.listeners.DisplayViewListener; +/** + * Default Prebid renderer for plugin renderer functionality. + */ public class PrebidRenderer implements PrebidMobilePluginRenderer { @Override diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/RewardedAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/RewardedAdUnit.java index d118f4d08..019cbf67e 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/RewardedAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/RewardedAdUnit.java @@ -32,6 +32,9 @@ import java.util.EnumSet; +/** + * Rewarded ad unit for rendering API. + */ public class RewardedAdUnit extends BaseInterstitialAdUnit { private static final String TAG = RewardedAdUnit.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/VideoView.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/VideoView.java index ca759b8fd..b502bc2b1 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/VideoView.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/VideoView.java @@ -20,7 +20,9 @@ import android.util.Log; import android.view.View; import android.widget.FrameLayout; + import androidx.core.content.ContextCompat; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.exceptions.AdException; import org.prebid.mobile.configuration.AdUnitConfiguration; @@ -40,6 +42,9 @@ import org.prebid.mobile.rendering.views.video.VideoViewListener; import org.prebid.mobile.rendering.views.webview.mraid.Views; +/** + * Internal video player view for displaying banner video ads. + */ public class VideoView extends BaseAdView { private final static String TAG = VideoView.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PluginEventListener.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PluginEventListener.java index 8992ee9fb..a040c762c 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PluginEventListener.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PluginEventListener.java @@ -16,6 +16,9 @@ package org.prebid.mobile.api.rendering.pluginrenderer; +/** + * Plugin renderer event listener. + */ public interface PluginEventListener { /** * Plugin renderer name, same as the one registered on PrebidMobilePluginRegister diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRegister.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRegister.java index dd25bb006..d5d5f4930 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRegister.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRegister.java @@ -27,6 +27,9 @@ import java.util.List; import java.util.Map; +/** + * Plugin registerer. + */ public class PrebidMobilePluginRegister { public static final String PREBID_MOBILE_RENDERER_NAME = "PrebidRenderer"; diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRenderer.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRenderer.java index b9920673d..605c4ec00 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRenderer.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/rendering/pluginrenderer/PrebidMobilePluginRenderer.java @@ -24,12 +24,15 @@ import org.json.JSONObject; import org.prebid.mobile.api.rendering.PrebidMobileInterstitialControllerInterface; -import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.configuration.AdUnitConfiguration; import org.prebid.mobile.rendering.bidding.data.bid.BidResponse; import org.prebid.mobile.rendering.bidding.interfaces.InterstitialControllerListener; +import org.prebid.mobile.rendering.bidding.listeners.DisplayVideoListener; import org.prebid.mobile.rendering.bidding.listeners.DisplayViewListener; +/** + * Main plugin renderer interface. + */ public interface PrebidMobilePluginRenderer { String getName(); diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/AdEvent.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/AdEvent.java index ef1318be5..46b0cbc40 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/AdEvent.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/AdEvent.java @@ -16,6 +16,9 @@ package org.prebid.mobile.eventhandlers; +/** + * Ad event. + */ public enum AdEvent { APP_EVENT_RECEIVED, LOADED, diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamBannerEventHandler.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamBannerEventHandler.java index 87f0f1228..c526ef9bf 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamBannerEventHandler.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamBannerEventHandler.java @@ -21,7 +21,9 @@ import android.os.Handler; import android.os.Looper; import android.view.View; + import androidx.annotation.NonNull; + import org.prebid.mobile.AdSize; import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.exceptions.AdException; @@ -31,9 +33,8 @@ import org.prebid.mobile.rendering.bidding.listeners.BannerEventListener; /** - * This class is compatible with Prebid Rendering SDK v1.10. - * This class implements the communication between the Prebid Rendering SDK and the GAM SDK for a given ad - * unit. It implements the Prebid Rendering SDK EventHandler interface. Prebid Rendering SDK notifies (using EventHandler interface) + * Banner event handler for communication between Prebid rendering API and the GAM SDK. + * It implements the Prebid Rendering SDK EventHandler interface. Prebid Rendering SDK notifies (using EventHandler interface) * to make a request to GAM SDK and pass the targeting parameters. This class also creates the GAM's * PublisherAdViews, initializes them and listens for the callback methods. And pass the GAM ad event to * Prebid Rendering SDK via BannerEventListener. diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamInterstitialEventHandler.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamInterstitialEventHandler.java index 45d7da507..a120d536b 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamInterstitialEventHandler.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamInterstitialEventHandler.java @@ -20,7 +20,9 @@ import android.app.Activity; import android.os.Handler; import android.os.Looper; + import androidx.annotation.NonNull; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.exceptions.AdException; import org.prebid.mobile.eventhandlers.global.Constants; @@ -30,6 +32,9 @@ import java.lang.ref.WeakReference; +/** + * Interstitial event handler for communication between Prebid rendering API and the GAM SDK. + */ public class GamInterstitialEventHandler implements InterstitialEventHandler, GamAdEventListener { private static final String TAG = GamInterstitialEventHandler.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamRewardedEventHandler.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamRewardedEventHandler.java index 4a41d213b..ddab59222 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamRewardedEventHandler.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/GamRewardedEventHandler.java @@ -20,8 +20,10 @@ import android.app.Activity; import android.os.Handler; import android.os.Looper; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.api.exceptions.AdException; import org.prebid.mobile.eventhandlers.global.Constants; @@ -31,6 +33,9 @@ import java.lang.ref.WeakReference; +/** + * Rewarded event handler for communication between Prebid rendering API and the GAM SDK. + */ public class GamRewardedEventHandler implements RewardedEventHandler, GamAdEventListener { private static final String TAG = GamRewardedEventHandler.class.getSimpleName(); diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherAdViewWrapper.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherAdViewWrapper.java index aedc667cc..3a73ea691 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherAdViewWrapper.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherAdViewWrapper.java @@ -19,13 +19,16 @@ import android.content.Context; import android.util.Log; import android.view.View; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.LoadAdError; import com.google.android.gms.ads.admanager.AdManagerAdRequest; import com.google.android.gms.ads.admanager.AdManagerAdView; import com.google.android.gms.ads.admanager.AppEventListener; + import org.prebid.mobile.AdSize; import org.prebid.mobile.LogUtil; import org.prebid.mobile.eventhandlers.global.Constants; @@ -36,7 +39,7 @@ import java.util.Map; /** - * This class is responsible for wrapping usage of PublisherAdView from GAM SDK. + * Internal wrapper of PublisherAdView from GAM SDK. * To achieve safe integration between various GAM SDK versions we have to wrap all PublisherAdView method execution in try / catch. * This class instance should be created via newInstance method, which will catch any potential exception on PublisherAdView / PublisherAdViewWrapper instance creation */ diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherInterstitialAdWrapper.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherInterstitialAdWrapper.java index e138155a3..27a8a554c 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherInterstitialAdWrapper.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/PublisherInterstitialAdWrapper.java @@ -16,10 +16,14 @@ package org.prebid.mobile.eventhandlers; +import static org.prebid.mobile.eventhandlers.global.Constants.APP_EVENT; + import android.app.Activity; import android.util.Log; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import com.google.android.gms.ads.AdError; import com.google.android.gms.ads.FullScreenContentCallback; import com.google.android.gms.ads.LoadAdError; @@ -27,6 +31,7 @@ import com.google.android.gms.ads.admanager.AdManagerInterstitialAd; import com.google.android.gms.ads.admanager.AdManagerInterstitialAdLoadCallback; import com.google.android.gms.ads.admanager.AppEventListener; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.eventhandlers.utils.GamUtils; import org.prebid.mobile.rendering.bidding.data.bid.Bid; @@ -35,10 +40,8 @@ import java.util.HashMap; import java.util.Map; -import static org.prebid.mobile.eventhandlers.global.Constants.APP_EVENT; - /** - * This class is responsible for wrapping usage of PublisherInterstitialAd from GAM SDK. + * Internal wrapper of PublisherInterstitialAd from GAM SDK. * To achieve safe integration between various GAM SDK versions we have to wrap all PublisherAdView method execution in try / catch. * This class instance should be created via newInstance method, which will catch any potential exception on PublisherInterstitialAd / PublisherInterstitialAdWrapper instance creation */ diff --git a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/RewardedAdWrapper.java b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/RewardedAdWrapper.java index 741379153..f2d45b097 100644 --- a/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/RewardedAdWrapper.java +++ b/PrebidMobile/PrebidMobile-gamEventHandlers/src/main/java/org/prebid/mobile/eventhandlers/RewardedAdWrapper.java @@ -16,12 +16,16 @@ package org.prebid.mobile.eventhandlers; +import static org.prebid.mobile.eventhandlers.global.Constants.APP_EVENT; + import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.util.Log; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import com.google.android.gms.ads.AdError; import com.google.android.gms.ads.FullScreenContentCallback; import com.google.android.gms.ads.LoadAdError; @@ -30,6 +34,7 @@ import com.google.android.gms.ads.rewarded.RewardItem; import com.google.android.gms.ads.rewarded.RewardedAd; import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback; + import org.prebid.mobile.LogUtil; import org.prebid.mobile.eventhandlers.utils.GamUtils; import org.prebid.mobile.rendering.bidding.data.bid.Bid; @@ -38,10 +43,8 @@ import java.util.HashMap; import java.util.Map; -import static org.prebid.mobile.eventhandlers.global.Constants.APP_EVENT; - /** - * This class is responsible for wrapping usage of RewardedAd from GAM SDK. + * Internal wrapper of rewarded ad from GAM SDK. * To achieve safe integration between various GAM SDK versions we have to wrap all PublisherAdView method execution in try / catch. * This class instance should be created via newInstance method, which will catch any potential exception on RewardedAd / RewardedAdWrapper instance creation */ diff --git a/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/PrebidMaxMediationAdapter.java b/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/PrebidMaxMediationAdapter.java index 3d13e8ee4..32c73c260 100644 --- a/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/PrebidMaxMediationAdapter.java +++ b/PrebidMobile/PrebidMobile-maxAdapters/src/main/java/com/applovin/mediation/adapters/PrebidMaxMediationAdapter.java @@ -23,6 +23,9 @@ import org.prebid.mobile.PrebidMobile; import org.prebid.mobile.TargetingParams; +/** + * Prebid mediation adapter for AppLovin MAX integration. + */ public class PrebidMaxMediationAdapter extends MediationAdapterBase implements MaxAdViewAdapter, MaxInterstitialAdapter, MaxRewardedAdapter, MaxNativeAdAdapter { public static final String TAG = PrebidMaxMediationAdapter.class.getSimpleName(); From 0004b15748d4cd30704c0d29c504e05d417e0e5c Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Wed, 7 Aug 2024 14:46:26 +0200 Subject: [PATCH 12/22] feat: add documentation to the main public methods --- .../admob/AdMobMediationBannerUtils.java | 2 +- .../main/java/org/prebid/mobile/AdUnit.java | 41 ++++++++-- .../java/org/prebid/mobile/BannerAdUnit.java | 22 +++-- .../prebid/mobile/InStreamVideoAdUnit.java | 3 + .../org/prebid/mobile/InterstitialAdUnit.java | 8 +- .../java/org/prebid/mobile/NativeAdUnit.java | 6 ++ .../java/org/prebid/mobile/PrebidMobile.java | 81 ++++++++++++++++++- .../api/mediation/MediationBannerAdUnit.java | 19 ++++- .../MediationInterstitialAdUnit.java | 5 ++ .../api/mediation/MediationNativeAdUnit.java | 28 +++++-- .../MediationRewardedVideoAdUnit.java | 8 ++ .../api/original/MultiformatAdUnitFacade.java | 2 +- .../mobile/api/original/PrebidAdUnit.java | 28 +++++++ 13 files changed, 225 insertions(+), 28 deletions(-) diff --git a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java index 5630c711f..1251e9acc 100644 --- a/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java +++ b/PrebidMobile/PrebidMobile-admobAdapters/src/main/java/org/prebid/mobile/admob/AdMobMediationBannerUtils.java @@ -18,7 +18,7 @@ import java.util.HashMap; /** - * Internal mediation delegate. + * Banner mediation delegate. */ public class AdMobMediationBannerUtils implements PrebidMediationDelegate { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java index ce48a612c..fae031209 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/AdUnit.java @@ -87,12 +87,18 @@ public void setAutoRefreshPeriodMillis( configuration.setAutoRefreshDelay(periodMillis / 1000); } + /** + * Auto refresh interval for banner ad. + */ public void setAutoRefreshInterval( @IntRange(from = AUTO_REFRESH_DELAY_MIN / 1000, to = AUTO_REFRESH_DELAY_MAX / 1000) int seconds ) { configuration.setAutoRefreshDelay(seconds); } + /** + * Resumes auto refresh interval after stopping. + */ public void resumeAutoRefresh() { LogUtil.verbose("Resuming auto refresh..."); if (bidLoader != null) { @@ -100,6 +106,9 @@ public void resumeAutoRefresh() { } } + /** + * Stops auto refresh interval. + */ public void stopAutoRefresh() { LogUtil.verbose("Stopping auto refresh..."); if (bidLoader != null) { @@ -107,6 +116,9 @@ public void stopAutoRefresh() { } } + /** + * Destroy ad unit and stop downloading. + */ public void destroy() { if (bidLoader != null) { bidLoader.destroy(); @@ -127,7 +139,14 @@ public void fetchDemand(@NonNull final OnCompleteListener2 listener) { }); } - public void fetchDemand(Object adObj, @NonNull OnCompleteListener listener) { + /** + * Loads ad and applies keywords to the ad object. + * + * @param adObject AdMob's ({@code AdManagerAdRequest} or {@code AdManagerAdRequest.Builder}) + * or AppLovin's ({@code MaxNativeAdLoader}) ad object + * @param listener callback when operation is completed (success or fail) + */ + public void fetchDemand(Object adObject, @NonNull OnCompleteListener listener) { if (TextUtils.isEmpty(PrebidMobile.getPrebidServerAccountId())) { LogUtil.error("Empty account id."); listener.onComplete(ResultCode.INVALID_ACCOUNT_ID); @@ -170,8 +189,8 @@ public void fetchDemand(Object adObj, @NonNull OnCompleteListener listener) { return; } - if (Util.supportedAdObject(adObj) || allowNullableAdObject) { - adObject = adObj; + if (Util.supportedAdObject(adObject) || allowNullableAdObject) { + this.adObject = adObject; bidLoader = new BidLoader( configuration, createBidListener(listener) @@ -188,12 +207,17 @@ public void fetchDemand(Object adObj, @NonNull OnCompleteListener listener) { bidLoader.load(); } else { - adObject = null; + this.adObject = null; listener.onComplete(ResultCode.INVALID_AD_OBJECT); } } + /** + * Loads ad and saves it to cache. + * + * @param listener callback when operation is completed (success or fail) + */ public void fetchDemand(OnFetchDemandResult listener) { if (listener == null) { LogUtil.error("Parameter OnFetchDemandResult in fetchDemand() must be not null."); @@ -310,6 +334,7 @@ public void addContextKeywords(Set keywords) { /** * This method allows to remove specific context keyword from adunit context targeting + * * @deprecated Use removeExtKeyword */ @Deprecated @@ -407,9 +432,13 @@ public void setGpid(@Nullable String gpid) { } @Nullable - public String getOrtbConfig() { return configuration.getOrtbConfig();} + public String getOrtbConfig() { + return configuration.getOrtbConfig(); + } - public void setOrtbConfig(@Nullable String ortbConfig) {configuration.setOrtbConfig(ortbConfig);} + public void setOrtbConfig(@Nullable String ortbConfig) { + configuration.setOrtbConfig(ortbConfig); + } protected BidRequesterListener createBidListener(OnCompleteListener originalListener) { return new BidRequesterListener() { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java index 612d47d1c..32a319f57 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/BannerAdUnit.java @@ -30,24 +30,36 @@ */ public class BannerAdUnit extends BannerBaseAdUnit { + /** + * Default constructor for banner ad. + * + * @param configId config id + * @param width ad width + * @param height ad height + */ public BannerAdUnit(@NonNull String configId, int width, int height) { super(configId, EnumSet.of(AdFormat.BANNER)); configuration.addSize(new AdSize(width, height)); } /** - * Constructor for multi-format or video banner request. + * Constructor with ad formats. * - * @param adUnitFormats

- * for multi-format request `EnumSet.of(AdUnitFormat.DISPLAY, AdUnitFormat.VIDEO);` - *

- * for video banner `EnumSet.of(AdUnitFormat.VIDEO);` + * @param configId config id + * @param width ad width + * @param height ad height + * @param adUnitFormats ad formats ({@link AdUnitFormat}).
+ * For multi-format request {@code EnumSet.of(AdUnitFormat.DISPLAY, AdUnitFormat.VIDEO);}
+ * For only video request {@code EnumSet.of(AdUnitFormat.VIDEO);} */ public BannerAdUnit(@NonNull String configId, int width, int height, EnumSet adUnitFormats) { super(configId, AdFormat.fromSet(adUnitFormats, false)); configuration.addSize(new AdSize(width, height)); } + /** + * Add additional size. + */ public void addAdditionalSize(int width, int height) { configuration.addSize(new AdSize(width, height)); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java index 9ab7e1bdb..ba815fad0 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InStreamVideoAdUnit.java @@ -28,6 +28,9 @@ */ public class InStreamVideoAdUnit extends VideoBaseAdUnit { + /** + * Default constructor. + */ public InStreamVideoAdUnit(@NonNull String configId, int width, int height) { super(configId, EnumSet.of(AdFormat.VAST)); configuration.addSize(new AdSize(width, height)); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java index 0a5aeb95e..64b7e6102 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/InterstitialAdUnit.java @@ -32,12 +32,18 @@ */ public class InterstitialAdUnit extends BannerBaseAdUnit { + /** + * Default constructor. + */ public InterstitialAdUnit(@NonNull String configId) { super(configId, EnumSet.of(AdFormat.INTERSTITIAL)); configuration.setAdPosition(AdPosition.FULLSCREEN); } - public InterstitialAdUnit(@NonNull String configId, int minWidthPerc, int minHeightPerc) { + /** + * Constructor with min percentage width and height. + */ + public InterstitialAdUnit(@NonNull String configId, @IntRange(from = 0, to = 100) int minWidthPerc, @IntRange(from = 0, to = 100) int minHeightPerc) { this(configId); configuration.setMinSizePercentage(new AdSize(minWidthPerc, minHeightPerc)); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java index 60703f6fc..f2295545c 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/NativeAdUnit.java @@ -21,10 +21,16 @@ */ public class NativeAdUnit extends AdUnit { + /** + * Internal key for caching native ad. + */ public static final String BUNDLE_KEY_CACHE_ID = "NativeAdUnitCacheId"; private final NativeAdUnitConfiguration nativeConfiguration; + /** + * Default constructor. + */ public NativeAdUnit(@NonNull String configId) { super(configId, EnumSet.of(AdFormat.NATIVE)); nativeConfiguration = configuration.getNativeConfiguration(); 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 0aaf52e4d..86b65ad93 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 @@ -145,18 +145,33 @@ public class PrebidMobile { private PrebidMobile() { } + + /** + * {@link #useCacheForReportingWithRenderingApi} + */ public static boolean isUseCacheForReportingWithRenderingApi() { return useCacheForReportingWithRenderingApi; } + /** + * Sets boolean for caching ad for rendering API. + * + * @param useCacheForReportingWithRenderingApi + */ public static void setUseCacheForReportingWithRenderingApi(boolean useCacheForReportingWithRenderingApi) { PrebidMobile.useCacheForReportingWithRenderingApi = useCacheForReportingWithRenderingApi; } + /** + * {@link #setTimeoutMillis(int)}. + */ public static int getTimeoutMillis() { return timeoutMillis; } + /** + * Sets connection timeout for bid request. + */ public static void setTimeoutMillis(int timeoutMillis) { PrebidMobile.timeoutMillis = timeoutMillis; } @@ -181,10 +196,16 @@ public static Host getPrebidServerHost() { return host; } + /** + * Allows the SDK to share geolocation if permission is granted by the user. + */ public static void setShareGeoLocation(boolean share) { PrebidMobile.shareGeoLocation = share; } + /** + * {@link #setShareGeoLocation(boolean)} + */ public static boolean isShareGeoLocation() { return shareGeoLocation; } @@ -257,10 +278,16 @@ public static Context getApplicationContext() { return PrebidContextHolder.getContext(); } + /** + * Sets stored auction response for testing purposes. + */ public static void setStoredAuctionResponse(@Nullable String storedAuctionResponse) { PrebidMobile.storedAuctionResponse = storedAuctionResponse; } + /** + * {@link #setStoredAuctionResponse(String)} + */ @Nullable public static String getStoredAuctionResponse() { return storedAuctionResponse; @@ -312,19 +339,31 @@ public static boolean isSdkInitialized() { return PrebidContextHolder.getContext() != null && InitializationNotifier.wereTasksCompletedSuccessfully(); } + /** + * {@link #setLogLevel(LogLevel)} + */ public static LogLevel getLogLevel() { return PrebidMobile.logLevel; } + /** + * Sets log level for the SDK. + */ public static void setLogLevel(LogLevel logLevel) { PrebidMobile.logLevel = logLevel; } + /** + * {@link #setCustomLogger(PrebidLogger)} + */ @Nullable public static PrebidLogger getCustomLogger() { return PrebidMobile.customLogger; } + /** + * Sets custom logger for the SDK. + */ public static void setCustomLogger(@NonNull PrebidLogger logger) { PrebidMobile.customLogger = logger; } @@ -381,22 +420,38 @@ public static void setCustomStatusEndpoint(String url) { } } + /** + * {@link #setCustomStatusEndpoint(String)} + */ @Nullable public static String getCustomStatusEndpoint() { return customStatusEndpoint; } + + /** + * Sets 'includewinners' parameter for ad request to receive additional info about winners in response. + */ public static void setIncludeWinnersFlag(boolean includeWinners) { PrebidMobile.includeWinners = includeWinners; } + /** + * {@link #setIncludeWinnersFlag(boolean)} + */ public static boolean getIncludeWinnersFlag() { return PrebidMobile.includeWinners; } + /** + * Sets 'includebidderkeys' parameter for ad request to receive additional info about bidders. + */ public static boolean setIncludeBidderKeysFlag(boolean includeBidderKeys) { return PrebidMobile.includeBidderKeys = includeBidderKeys; } + /** + * {@link #setIncludeBidderKeysFlag(boolean)} + */ public static boolean getIncludeBidderKeysFlag() { return PrebidMobile.includeBidderKeys; } @@ -410,8 +465,7 @@ public static void setPbsConfig(PBSConfig pbsConfig) { } /** - * Priority Policy: PBSConfig > SDKConfig > Default - * @return creativeFactoryTimeout in ms + * {@link #setCreativeFactoryTimeout(int)} */ public static int getCreativeFactoryTimeout() { if (pbsConfig != null){ @@ -422,6 +476,11 @@ public static int getCreativeFactoryTimeout() { return creativeFactoryTimeout; } + /** + * Sets creative factory timeout. It's time to parse and render banner ads. + * + * @param creativeFactoryTimeout in ms (default 6000ms) + */ public static void setCreativeFactoryTimeout(int creativeFactoryTimeout) { PrebidMobile.creativeFactoryTimeout = creativeFactoryTimeout; } @@ -439,23 +498,37 @@ public static int getCreativeFactoryTimeoutPreRenderContent() { return creativeFactoryTimeoutPreRenderContent; } + + /** + * Sets creative factory timeout for prerender content. It's time to parse and render interstitial ads. + * + * @param creativeFactoryTimeoutPreRenderContent in ms (default 30000ms) + */ public static void setCreativeFactoryTimeoutPreRenderContent(int creativeFactoryTimeoutPreRenderContent) { PrebidMobile.creativeFactoryTimeoutPreRenderContent = creativeFactoryTimeoutPreRenderContent; } - //region PluginRenderer methods + /** + * Registers plugin renderer for displaying ad in custom wrapper. + * Prebid SDK will choose this renderer only if the winning bid contains this renderer. + */ public static void registerPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) { PrebidMobilePluginRegister.getInstance().registerPlugin(prebidMobilePluginRenderer); } + /** + * Remove plugin renderer. {@link #registerPluginRenderer(PrebidMobilePluginRenderer)} + */ public static void unregisterPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) { PrebidMobilePluginRegister.getInstance().unregisterPlugin(prebidMobilePluginRenderer); } + /** + * Return whether SDK already registered this renderer. + */ public static Boolean containsPluginRenderer(PrebidMobilePluginRenderer prebidMobilePluginRenderer) { return PrebidMobilePluginRegister.getInstance().containsPlugin(prebidMobilePluginRenderer); } - //endregion /** * LogLevel for logging control. diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java index 86b5fbd41..f6b436c3f 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationBannerAdUnit.java @@ -40,6 +40,14 @@ public class MediationBannerAdUnit extends MediationBaseAdUnit { private boolean adFailed; + /** + * Default constructor. + * + * @param context {@link Context} + * @param configId config id + * @param size ad size + * @param mediationDelegate mediation delegate ({@code AdMobBannerMediationUtils} or {@code MaxMediationBannerUtils}. + */ public MediationBannerAdUnit( Context context, String configId, @@ -60,6 +68,9 @@ protected final void initAdConfig( adUnitConfig.setAdFormat(AdFormat.BANNER); } + /** + * Destroy ad unit. + */ @Override public void destroy() { super.destroy(); @@ -84,10 +95,14 @@ protected void initBidLoader() { }); } + /** + * Loads ad and applies mediation delegate. + * + * @param listener callback when operation is completed (success or fail) + */ @Override public final void fetchDemand( - @NonNull - OnFetchCompleteListener listener + @NonNull OnFetchCompleteListener listener ) { super.fetchDemand(listener); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java index ae2c0840e..a81b7c017 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationInterstitialAdUnit.java @@ -62,6 +62,11 @@ public MediationInterstitialAdUnit( adUnitConfig.setAdUnitFormats(adUnitFormats); } + /** + * Loads ad and applies mediation delegate. + * + * @param listener callback when operation is completed (success or fail) + */ @Override public final void fetchDemand(@NonNull OnFetchCompleteListener listener) { super.fetchDemand(listener); diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java index 73bb1a7cf..f3d7cd020 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationNativeAdUnit.java @@ -25,19 +25,31 @@ public class MediationNativeAdUnit { private final Object adObject; private final NativeAdUnit nativeAdUnit; + /** + * Default constructor. + * + * @param configId config id. + * @param adObject AdMob's ({@code AdManagerAdRequest} or {@code AdManagerAdRequest.Builder}) + * or AppLovin's ({@code MaxNativeAdLoader}) ad object + */ public MediationNativeAdUnit( - @NonNull String configId, - @NonNull Object adObject + @NonNull String configId, + @NonNull Object adObject ) { this.adObject = adObject; this.nativeAdUnit = new NativeAdUnit(configId); } + /** + * Loads ad and applies mediation delegate. + * + * @param listener callback when operation is completed (success or fail) + */ public void fetchDemand( - @NonNull OnFetchCompleteListener listener + @NonNull OnFetchCompleteListener listener ) { nativeAdUnit.fetchDemand(adObject, resultCode -> - listener.onComplete(convertResultCode(resultCode)) + listener.onComplete(convertResultCode(resultCode)) ); } @@ -110,15 +122,15 @@ public ArrayList getUserData() { } public void addExtData( - String key, - String value + String key, + String value ) { nativeAdUnit.addExtData(key, value); } public void updateExtData( - String key, - Set value + String key, + Set value ) { nativeAdUnit.updateExtData(key, value); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java index f52f968c5..db07b06a5 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/mediation/MediationRewardedVideoAdUnit.java @@ -37,6 +37,9 @@ public class MediationRewardedVideoAdUnit extends MediationBaseFullScreenAdUnit private static final String TAG = "MediationRewardedAdUnit"; + /** + * Default constructor. + */ public MediationRewardedVideoAdUnit( Context context, String configId, @@ -45,6 +48,11 @@ public MediationRewardedVideoAdUnit( super(context, configId, null, mediationDelegate); } + /** + * Loads ad and applies mediation delegate. + * + * @param listener callback when operation is completed (success or fail) + */ public void fetchDemand(@NonNull OnFetchCompleteListener listener) { super.fetchDemand(listener); } diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/MultiformatAdUnitFacade.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/MultiformatAdUnitFacade.java index 35c4efe8f..adc4e039a 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/MultiformatAdUnitFacade.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/MultiformatAdUnitFacade.java @@ -32,7 +32,7 @@ /** * Internal AdUnit implementation that is used for PrebidAdUnit - * with multiformat configuration. It separates logic for multiformat ad unit. + * with multi-format configuration. It separates logic for multi-format ad unit. */ class MultiformatAdUnitFacade extends AdUnit { diff --git a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java index 9d4c8ed08..e1b4a0703 100644 --- a/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java +++ b/PrebidMobile/PrebidMobile-core/src/main/java/org/prebid/mobile/api/original/PrebidAdUnit.java @@ -22,10 +22,19 @@ public class PrebidAdUnit { @Nullable private MultiformatAdUnitFacade adUnit; + /** + * Default constructor. + */ public PrebidAdUnit(@NonNull String configId) { this.configId = configId; } + /** + * Loads ad and calls listener with bid info data. + * + * @param request request object + * @param listener callback when operation is completed (success or fail) + */ public void fetchDemand( PrebidRequest request, OnFetchDemandResult listener @@ -33,6 +42,13 @@ public void fetchDemand( baseFetchDemand(request, null, listener); } + /** + * Loads ad, applies keywords to the ad object, and calls listener with bid info data. + * @param adObject AdMob's ({@code AdManagerAdRequest} or @{@code AdManagerAdRequest.Builder}) + * or AppLovin's ({@code MaxNativeAdLoader}) ad object + * @param request request object + * @param listener callback when operation is completed (success or fail) + */ public void fetchDemand( Object adObject, PrebidRequest request, @@ -41,6 +57,9 @@ public void fetchDemand( baseFetchDemand(request, adObject, listener); } + /** + * Auto refresh interval for banner ad. + */ public void setAutoRefreshInterval( @IntRange(from = AUTO_REFRESH_DELAY_MIN / 1000, to = AUTO_REFRESH_DELAY_MAX / 1000) int seconds ) { @@ -49,18 +68,27 @@ public void setAutoRefreshInterval( } } + /** + * Resumes auto refresh interval after stopping. + */ public void resumeAutoRefresh() { if (adUnit != null) { adUnit.resumeAutoRefresh(); } } + /** + * Stops auto refresh interval. + */ public void stopAutoRefresh() { if (adUnit != null) { adUnit.stopAutoRefresh(); } } + /** + * Destroy ad unit and stop downloading. + */ public void destroy() { if (adUnit != null) { adUnit.destroy(); From 8b0d75f0af4f2bae9b420b2583102fbdbf5d2428 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Wed, 7 Aug 2024 14:48:44 +0200 Subject: [PATCH 13/22] fix: header --- PrebidMobile/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PrebidMobile/build.gradle b/PrebidMobile/build.gradle index 833c7fb2d..d3389e74e 100644 --- a/PrebidMobile/build.gradle +++ b/PrebidMobile/build.gradle @@ -7,8 +7,8 @@ dependencies { task combinedJavadoc(type: Javadoc, dependsOn: assemble) { title = """ -

Prebid Mobile Android SDK

-

Documentation to the public API.

+

Prebid Mobile Android SDK.

+

Documentation to the public API.

""" var sourcePaths = project(":PrebidMobile-core").files("src/main/java") From d666fb0c1c65782c7fce94632e86769664e28f2d Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:03:11 +0200 Subject: [PATCH 14/22] feat: upload docs with GitHub actions --- .github/workflows/upload-docs.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/upload-docs.yml diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml new file mode 100644 index 000000000..4a5d14658 --- /dev/null +++ b/.github/workflows/upload-docs.yml @@ -0,0 +1,38 @@ +name: Upload Docs iOS + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - 'test-doc-*' + +jobs: + upload-docs: + + runs-on: macos-latest + + steps: + - name: Generate docs + run: | + rm -rf docs + ./gradlew :PrebidMobile:combinedJavadoc + cp -r PrebidMobile/build/combinedJavadoc docs + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: docs + - name: Commit documentation changes + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git status + TAG_NAME=${{ github.ref }} + TAG_NAME=${TAG_NAME#refs/tags/} + echo "Current tag: $TAG_NAME" + git add -A && git commit -m "Generate docs - $TAG_NAME" + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: docs From 3ca3e2c090f5b56127313d03d36801e17d41def3 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:14:35 +0200 Subject: [PATCH 15/22] fix: uploading #1 --- .github/workflows/upload-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index 4a5d14658..fbbbed753 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -12,6 +12,7 @@ jobs: runs-on: macos-latest steps: + - uses: actions/checkout@v4 - name: Generate docs run: | rm -rf docs From 1697f269458291e4759c8cf8fae32fb5e344058c Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:20:24 +0200 Subject: [PATCH 16/22] fix: uploading #2 --- .github/workflows/upload-docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index fbbbed753..7a23e7d66 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -13,6 +13,10 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' - name: Generate docs run: | rm -rf docs From 810b48272e03110b46a2f53b1cf9320c5a37b2d5 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:32:41 +0200 Subject: [PATCH 17/22] fix: uploading #3 --- .github/workflows/upload-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index 7a23e7d66..fabb156e8 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -35,7 +35,8 @@ jobs: TAG_NAME=${{ github.ref }} TAG_NAME=${TAG_NAME#refs/tags/} echo "Current tag: $TAG_NAME" - git add -A && git commit -m "Generate docs - $TAG_NAME" + git add docs/ + git commit -m "Generate docs - $TAG_NAME" - name: Push changes uses: ad-m/github-push-action@master with: From b443f2c1fcbddd7a538ac2cf2c16051cf419ab5c Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:44:05 +0200 Subject: [PATCH 18/22] fix: uploading #4 --- .github/workflows/upload-docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index fabb156e8..d03229fd0 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -27,6 +27,7 @@ jobs: with: fetch-depth: 0 ref: docs + clean: false - name: Commit documentation changes run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" @@ -35,7 +36,8 @@ jobs: TAG_NAME=${{ github.ref }} TAG_NAME=${TAG_NAME#refs/tags/} echo "Current tag: $TAG_NAME" - git add docs/ + ls -l + git add docs git commit -m "Generate docs - $TAG_NAME" - name: Push changes uses: ad-m/github-push-action@master From 0e30d73e2b0e6c53b71cad2e5859f1a422670f51 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Thu, 22 Aug 2024 09:55:43 +0200 Subject: [PATCH 19/22] fix: uploading #5 --- .github/workflows/upload-docs.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index d03229fd0..8e694bf7c 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -1,4 +1,4 @@ -name: Upload Docs iOS +name: Upload Docs Android on: push: @@ -19,9 +19,8 @@ jobs: distribution: 'temurin' - name: Generate docs run: | - rm -rf docs ./gradlew :PrebidMobile:combinedJavadoc - cp -r PrebidMobile/build/combinedJavadoc docs + cp -r PrebidMobile/build/combinedJavadoc docs_new - name: Checkout repository uses: actions/checkout@v4 with: @@ -37,6 +36,9 @@ jobs: TAG_NAME=${TAG_NAME#refs/tags/} echo "Current tag: $TAG_NAME" ls -l + rm -rf docs + cp -r docs_new docs + rm -rf docs_new git add docs git commit -m "Generate docs - $TAG_NAME" - name: Push changes From f8e557a03d272617ae3f8aac9c192e61650527aa Mon Sep 17 00:00:00 2001 From: Yuriy Velichko Date: Tue, 24 Sep 2024 10:57:08 +0300 Subject: [PATCH 20/22] doc: update description --- PrebidMobile/build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PrebidMobile/build.gradle b/PrebidMobile/build.gradle index d3389e74e..f90d92038 100644 --- a/PrebidMobile/build.gradle +++ b/PrebidMobile/build.gradle @@ -7,8 +7,11 @@ dependencies { task combinedJavadoc(type: Javadoc, dependsOn: assemble) { title = """ -

Prebid Mobile Android SDK.

-

Documentation to the public API.

+

Prebid Mobile SDK - Android API Reference

+

Prebid Android SDK is an open-source monetization library that allows you to integrate header bidding demand partners into the mobile app in various ways. The integration documentation can be found here.

+

This section is autogenerated documentation describing the SDK's public classes, methods, and other code structures. It doesn't provide any integration guides but always provides updated API references.

+

The documentation is generated for each SDK release.

+

If you see any inconsistency or want to improve the process, you are always welcome to contribute to Prebid Mobile Android SDK on GitHub.

""" var sourcePaths = project(":PrebidMobile-core").files("src/main/java") From c1c74c8b960d61c0108b0188a20f715d8f85195a Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Tue, 24 Sep 2024 10:57:28 +0200 Subject: [PATCH 21/22] fix: disable publishing with Circle CI --- .circleci/config.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f127940c..181e091bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,36 +62,6 @@ jobs: name: Test Frameworks command: scripts/testPrebidMobile.sh - # Below is the definition of your job to build and test your app, you can rename and customize it as you want. - generate-documentation: - # These next lines define the Android machine image executor. - # See: https://circleci.com/docs/2.0/executor-types/ - executor: - name: android/android-machine - tag: default - # Add steps to the job - # See: https://circleci.com/docs/2.0/configuration-reference/#steps - steps: - # Checkout the code as the first step. - - checkout - - android/change-java-version: - java-version: 17 - # And finally run the release build - - run: - name: Test Frameworks - command: | - ./gradlew :PrebidMobile:combinedJavadoc - git config --local user.name "CircleCI" && git config --local user.email "valentin.petrovich@postindustria.com" - git checkout docs - git pull --rebase - rm -rf docs - cp -r PrebidMobile/build/combinedJavadoc docs - git add ./docs - git commit -m "Javadoc publication" - git push - - store_artifacts: - path: ./PrebidMobile/build/combinedJavadoc - # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: @@ -111,6 +81,3 @@ workflows: name: Run Unit Tests - Prebid Mobile - android-test: name: Run Smoke UI Tests - Demo App Kotlin - Android 11 - # TODO: Move to release branch only - - generate-documentation: - name: Generating documentation From aa5415cd551058b814f9d240a5f7a1df662bafc5 Mon Sep 17 00:00:00 2001 From: Valentin Petrovych Date: Mon, 30 Sep 2024 15:04:34 +0200 Subject: [PATCH 22/22] feat: check docs size before commiting --- .github/workflows/upload-docs.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upload-docs.yml b/.github/workflows/upload-docs.yml index 8e694bf7c..af76ea2e1 100644 --- a/.github/workflows/upload-docs.yml +++ b/.github/workflows/upload-docs.yml @@ -36,9 +36,16 @@ jobs: TAG_NAME=${TAG_NAME#refs/tags/} echo "Current tag: $TAG_NAME" ls -l - rm -rf docs - cp -r docs_new docs - rm -rf docs_new + + MIN_SIZE=5120 + if [ -d docs_new ] && [ "$(du -s docs_new | cut -f1)" -ge "$MIN_SIZE" ]; then + rm -rf docs + cp -r docs_new docs + rm -rf docs_new + else + echo "docs_new directory either does not exist or is too small." + exit 1 + fi git add docs git commit -m "Generate docs - $TAG_NAME" - name: Push changes