Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb12a6ec authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

Merge branch 'allow_reading_telemetry_state' into 'main'

Allow reading telemetry state

See merge request !3
parents 5bfaf7ef 47d748d8
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ plugins {

def versionMajor = 0
def versionMinor = 0
def versionPatch = 3
def versionPatch = 4
def releasePatch = "alpha"


+2 −2
Original line number Diff line number Diff line
@@ -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) {