Skip to content
Snippets Groups Projects
Unverified Commit efaa0ff3 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Remove code smell in DefaultTracingStatus (DEV) #3148

parent 58913fd8
No related branches found
No related tags found
No related merge requests found
......@@ -43,21 +43,12 @@ class DefaultTracingStatus @Inject constructor(
) {
scope.launch {
try {
if (enable) {
if (isEnabled()) {
onSuccess(true)
} else {
asyncStart()
onSuccess(true)
}
} else {
if (!isEnabled()) {
onSuccess(false)
} else {
asyncStop()
onSuccess(false)
}
if (enable && !isEnabled()) {
asyncStart()
} else if (!enable && isEnabled()) {
asyncStop()
}
onSuccess(enable)
} catch (e: Exception) {
if (e is ApiException && e.statusCode == ExposureNotificationStatusCodes.RESOLUTION_REQUIRED) {
Timber.tag(TAG).i(e, "Permission needs to be granted by user.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment