Skip to content

[BUG] Host activity is stopped during payment confirmation / 3DS flow #13130

Description

@lwasyl

Summary

Several Stripe SDK activities are declared with opaque themes, which causes the activity below them in the stack to receive onStop() when they're launched. In our app, the underlying activity plays audio, and when Stripe launches 3DS flow, our main activity is stopped and the audio stops playing.

The expectation is that payment confirmation and 3DS flows shouldn't fully stop the host activity, since they're transient, modal-ish steps that the user returns from within seconds. Some Stripe themes already declare translucency themselves.

I verified that overriding the theme of every Stripe activity with a translucent one keeps the main activity started, and audio keeps playing. However, such client-side fix is brittle because we have to manually define which activities use which themes, and override them only to add android:windowIsTranslucent attribute.

Request: ship Stripe activities with translucent themes by default. I'm not deeply familiar with Stripe internals so I don't know which exactly activities this is — I know that we observe the problem during 3DS flow but I imagine any other non-translucent Stripe activity will have the same issue.

Code to reproduce

  1. Host an activity that holds a long-lived resource (e.g. a WebSocket, an active media surface, a camera session) and tears it down in onStop().
  2. From that activity, launch a payment that requires confirmation / 3DS through Stripe.
  3. Observe that the host activity reaches onStop() the moment the Stripe activity is shown, tearing the long-lived resource down.

Android version

I've reproduced on Android API 36.1 but have reports from other Android versions as well

Impacted devices

Not device-specific I believe

Installation method

Gradle dependency

Dependency Versions

stripe-android: 22.5.0
Android Gradle Plugin: 9.2.0
Gradle: 9.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions