Shutdown and Draining
The default behavior of most SDKs is to send out events over the network asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
The Android SDK automatically stores the Sentry events on the device's disk before trying to send them. This way any unsent events due to app shutdown will be sent on the next app start.
You can use
Sentry.flush(timeoutMillis: Long) to block execution and wait for any unsent events to be sent.