Skip to content

Commit 8ba2f76

Browse files
runningcodeclaude
andcommitted
feat(android-distribution): Run checkForUpdate on background thread (EME-413)
Implement async version of checkForUpdate that runs on a background thread instead of blocking the calling thread. The callback is invoked on the background thread, allowing callers to dispatch to main thread if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent cf708bd commit 8ba2f76

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sentry-android-distribution/src/main/java/io/sentry/android/distribution/DistributionIntegration.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,17 @@ public class DistributionIntegration(context: Context) : Integration, IDistribut
8686
/**
8787
* Check for available updates asynchronously using a callback.
8888
*
89+
* Note: The callback will be invoked on a background thread. If you need to update UI or perform
90+
* main-thread operations, dispatch the result to the main thread yourself.
91+
*
8992
* @param onResult Callback that will be called with the UpdateStatus result
9093
*/
9194
public override fun checkForUpdate(onResult: IDistributionApi.UpdateCallback) {
92-
// TODO implement this in a async way
93-
val result = checkForUpdateBlocking()
94-
onResult.onResult(result)
95+
Thread {
96+
val result = checkForUpdateBlocking()
97+
onResult.onResult(result)
98+
}
99+
.start()
95100
}
96101

97102
/**

0 commit comments

Comments
 (0)