From 47d748d8ab9d594143dcb8720001251d372d28a6 Mon Sep 17 00:00:00 2001 From: SayantanRC Date: Wed, 11 Jan 2023 14:46:33 +0530 Subject: [PATCH] Allow reading telemetry state --- lib/build.gradle | 2 +- lib/src/main/java/foundation/e/lib/telemetry/Telemetry.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/build.gradle b/lib/build.gradle index 10793d2..c8131c9 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -7,7 +7,7 @@ plugins { def versionMajor = 0 def versionMinor = 0 -def versionPatch = 3 +def versionPatch = 4 def releasePatch = "alpha" diff --git a/lib/src/main/java/foundation/e/lib/telemetry/Telemetry.kt b/lib/src/main/java/foundation/e/lib/telemetry/Telemetry.kt index 1ad424e..5fc3639 100644 --- a/lib/src/main/java/foundation/e/lib/telemetry/Telemetry.kt +++ b/lib/src/main/java/foundation/e/lib/telemetry/Telemetry.kt @@ -16,7 +16,7 @@ object Telemetry { */ fun init(identifier: String, application: Application) { this.identifier = identifier - if (shouldEnableSentry(application)) { + if (isTelemetryEnabled(application)) { SentryAndroid.init(application) { options -> options.dsn = identifier } @@ -35,7 +35,7 @@ object Telemetry { * Read from OS developer options. * Pass false by default. */ - private fun shouldEnableSentry(application: Application): Boolean { + fun isTelemetryEnabled(application: Application): Boolean { return try { Settings.System.getInt(application.contentResolver, SETTINGS_TELEMETRY_FIELD) == 1 } catch (e: Settings.SettingNotFoundException) { -- GitLab