-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from ProteGO-Safe/release/4.8.0
Release/4.8.0
- Loading branch information
Showing
32 changed files
with
285 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
app/src/main/java/pl/gov/mc/protegosafe/logging/NoLoggingTree.kt
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
app/src/main/java/pl/gov/mc/protegosafe/logging/WebViewTimber.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package pl.gov.mc.protegosafe.logging | ||
|
||
import org.koin.core.KoinComponent | ||
import org.koin.core.inject | ||
import pl.gov.mc.protegosafe.data.db.WebViewLoggingDataStore | ||
import timber.log.Timber | ||
|
||
object WebViewTimber : Timber.Tree(), KoinComponent { | ||
private val webViewLoggingDataStore: WebViewLoggingDataStore by inject() | ||
|
||
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) { | ||
if (webViewLoggingDataStore.isLoggingEnabled) { | ||
when { | ||
t != null -> { | ||
Timber.e(t, message) | ||
} | ||
else -> { | ||
Timber.d(message) | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/src/stageDebug/java/pl/gov/mc/protegosafe/helpers/GetWebViewLoggingStatusUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package pl.gov.mc.protegosafe.helpers | ||
|
||
import io.reactivex.Single | ||
import io.reactivex.schedulers.Schedulers | ||
import pl.gov.mc.protegosafe.data.db.WebViewLoggingDataStore | ||
import pl.gov.mc.protegosafe.domain.executor.PostExecutionThread | ||
|
||
class GetWebViewLoggingStatusUseCase( | ||
private val webViewLoggingDataStore: WebViewLoggingDataStore, | ||
private val postExecutionThread: PostExecutionThread | ||
) { | ||
fun execute(): Single<Boolean> { | ||
return Single.fromCallable { | ||
webViewLoggingDataStore.isLoggingEnabled | ||
} | ||
.subscribeOn(Schedulers.io()) | ||
.observeOn(postExecutionThread.scheduler) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/stageDebug/java/pl/gov/mc/protegosafe/helpers/SetWebViewLoggingEnabledUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package pl.gov.mc.protegosafe.helpers | ||
|
||
import io.reactivex.Completable | ||
import io.reactivex.Single | ||
import io.reactivex.schedulers.Schedulers | ||
import pl.gov.mc.protegosafe.data.db.WebViewLoggingDataStore | ||
import pl.gov.mc.protegosafe.domain.executor.PostExecutionThread | ||
|
||
class SetWebViewLoggingEnabledUseCase( | ||
private val webViewLoggingDataStore: WebViewLoggingDataStore, | ||
private val postExecutionThread: PostExecutionThread | ||
) { | ||
fun execute(isEnabled: Boolean): Single<String> { | ||
return Completable.fromAction { | ||
webViewLoggingDataStore.isLoggingEnabled = isEnabled | ||
}.toSingle { | ||
if (isEnabled) { | ||
"Web view logging enabled" | ||
} else { | ||
"Web view logging disabled" | ||
} | ||
} | ||
.subscribeOn(Schedulers.io()) | ||
.observeOn(postExecutionThread.scheduler) | ||
} | ||
} |
Oops, something went wrong.