feat(volkskrant): stop ad SDK initialisation at startup #24
Labels
No labels
area/architecture
area/build-ci
area/bytecode
area/code-quality
area/docs
area/extension
area/fingerprint
area/security
area/tests
Bug report
Feature request
review
sev/low
sev/medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midas/midas-patches#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #16.
Feature description
Hide ads stops every ad request, but the ad SDKs are still initialised at app start (already noted in
docs/apps/volkskrant.mdunder "Not covered"). Skipping that init saves startup time, memory and network traffic. Extend Hide ads, or add it as an option there.Findings (7.52.0)
nl.persgroep.edition.application.startup.task.AdvertisementStartupTask.onStartup()does almost nothing. It only callsuserProfileSynchronizer.updateUserIds()and logs "StartupTask#onStartup advertisement completed".nl.persgroep.edition.di.AdvertisementModule$Companion.provideAdvertisementInitConfigHandler(...)buildsbe.persgroep.advertising.banner.config.InitConfigHandler.InitConfigHandler$1loads the shipped, cached or fetched init config.SDKsInitializer.init(Context, InitConfig, CoroutineScope, Continuation), which initialises Xandr (initializeXandr, log "Xandr initialization timed out after") and the OptOut SDK (OptOutSDKConfigurator.initialize).HeaderBiddingWarmUp/PrebidHeaderBiddingSideEffect.AdvertisementModule.provideAdManagerreturnsinitConfigHandler.getAdManager(), which Hide ads'AdManager.loadpath no longer reaches.com.google.android.gms.ads.MobileAdsInitProvider(initOrder 100). There is no explicitMobileAds.initializecall.GameAdPlayerImaModuleKt). It is already covered for video by the shared video-ads patch.Approach
SDKsInitializer.init(returnUnit; it is a suspend function, so check its return convention) and the Prebid warm-up.MobileAdsInitProviderwith a resource patch on the manifest, or disable it through its meta-data.MobileAdsAPIs anywhere else at startup; that would crash with the provider removed.InitConfigHandlerconstructible:getAdManager()must still return an object, because Hilt injects it.Risk
The puzzles/games SDK may expect an initialised IMA or ad stack. Test a puzzle.
Done when
docs/apps/volkskrant.md: move the item out of "Not covered".