Skip to content

[Prototype] [Android] Prototype an autoinit#949

Draft
FranAguilera wants to merge 1 commit intomainfrom
franjam/prototype-auto-init
Draft

[Prototype] [Android] Prototype an autoinit#949
FranAguilera wants to merge 1 commit intomainfrom
franjam/prototype-auto-init

Conversation

@FranAguilera
Copy link
Copy Markdown
Contributor

Do not review, just for sharing

@FranAguilera FranAguilera force-pushed the franjam/prototype-auto-init branch 4 times, most recently from 3caf08e to 79b0fe0 Compare April 17, 2026 12:00
@FranAguilera FranAguilera force-pushed the franjam/prototype-auto-init branch from 79b0fe0 to bed8f21 Compare April 17, 2026 12:06
@github-actions
Copy link
Copy Markdown

Size Comparison Report (x86_64)

Metric APK (KB) SO (KB)
Baseline 3415 1280
Current 3415 1280
Difference 0 0

APK size unchanged. SO size unchanged.

@github-actions
Copy link
Copy Markdown

Android Benchmark Results

Device: PR: Emulator - Android SDK built for x86_64 (API 31) | main: Emulator - Android SDK built for x86_64 (API 31)

Note: Benchmarks run on emulator. Results may vary between runs and may differ from physical devices.

Allocations

Test PR main Δ
logHttpNetworkLog50FieldsAndHeadersAndFieldProviders 923 923 0.0%
logNotMatched5000Fields 10 10 0.0%
logNotMatchedNoFields 1 1 0.0%
trackSpansWithFields 140 140 0.0%
trackSpansWithoutFields 55 55 0.0%
webViewBridgeBridgeReady 61 60 +1.7%
webViewBridgeCustomLog 65 65 0.0%
webViewBridgeInvalidJson 38 38 0.0%
webViewBridgeWebVitalCLS 177 177 0.0%

Timing

Test PR main Δ
logHttpNetworkLog50FieldsAndHeadersAndFieldProviders 244.47 us 248.67 us -1.7%
logNotMatched5000Fields 2.49 ms 2.48 ms +0.6%
logNotMatchedNoFields 452 ns 459 ns -1.5%
trackSpansWithFields 494.43 us 483.21 us +2.3%
trackSpansWithoutFields 7.90 us 7.86 us +0.6%
webViewBridgeBridgeReady 7.96 us 8.21 us -3.1%
webViewBridgeCustomLog 8.74 us 9.19 us -4.9%
webViewBridgeInvalidJson 97.94 us 157.88 us -38.0%
webViewBridgeWebVitalCLS 20.48 us 20.25 us +1.1%

*/
class CaptureInitializer : Initializer<Unit> {
override fun create(context: Context) {
val appContext = context.applicationContext
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do this then we don't need the ContextHolder dep, or you could do val appContext = ContextHolder.APP_CONTEXT here instead


override fun dependencies(): List<Class<out Initializer<*>>> = listOf(ContextHolder::class.java)

private fun buildSessionStrategy(metadata: android.os.Bundle): io.bitdrift.capture.providers.session.SessionStrategy {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we go down this route I'd like to see us wrap all the metadata strongly-typed parsing logic inside our Configuration class so the properties stay in sync

checkReleaseBuilds = true
disable.add("GradleDependency")
disable.add("AndroidGradlePluginVersion")
disable.add("EnsureInitializerMetadata")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required? I'm hoping we don't have to ask customers to do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants