-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathDistributionInternal.kt
More file actions
41 lines (35 loc) · 1.35 KB
/
DistributionInternal.kt
File metadata and controls
41 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package io.sentry.android.distribution.internal
import android.content.Context
import io.sentry.Sentry
import io.sentry.android.distribution.DistributionOptions
import io.sentry.android.distribution.UpdateStatus
/** Internal implementation for build distribution functionality. */
internal object DistributionInternal {
private var isInitialized = false
@Synchronized
fun init(context: Context, distributionOptions: DistributionOptions) {
// TODO: Implementation will be added in future PR
isInitialized = true
}
fun isEnabled(): Boolean {
return isInitialized
}
fun checkForUpdateBlocking(context: Context): UpdateStatus {
val buildIdentifier = Sentry.getCurrentScopes().options.proguardUuid
return if (!buildIdentifier.isNullOrEmpty()) {
UpdateStatus.Error(
"Build identifier from ProGuard UUID: $buildIdentifier. HTTP client and API models coming in future PRs."
)
} else {
UpdateStatus.Error(
"No ProGuard UUID found. Ensure sentry-debug-meta.properties contains io.sentry.ProguardUuids or set via manifest."
)
}
}
fun checkForUpdateAsync(context: Context, onResult: (UpdateStatus) -> Unit) {
// For now, just call the blocking version and return the result
// In future PRs, this will be truly async
val result = checkForUpdateBlocking(context)
onResult(result)
}
}