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

Commit 5b9b9c62 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

remove trackTelemetryOptionChange()

parent 85462f28
Loading
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -2,9 +2,6 @@ package foundation.e.lib.telemetry

import android.annotation.SuppressLint
import android.app.Application
import android.database.ContentObserver
import android.os.Handler
import android.os.Looper
import android.provider.Settings
import foundation.e.lib.telemetry.Constants.SETTINGS_TELEMETRY_FIELD
import io.sentry.Sentry
@@ -66,30 +63,6 @@ object Telemetry {
        }
    }

    /**
     * Check if telemetry option is changed using ContentObserver.
     */
    fun trackTelemetryOptionChange() {
        val handler = Handler(Looper.getMainLooper())
        val contentResolver = application.contentResolver
        val telemetryOptionObserver = object : ContentObserver(handler) {
            override fun onChange(selfChange: Boolean) {
                super.onChange(selfChange)
                if (isTelemetryEnabled != checkTelemetryDeveloperOption()) {
                    Sentry.endSession()
                    init(identifier, application, enableOsTag)
                }

            }
        }

        contentResolver.registerContentObserver(
            Settings.System.getUriFor(SETTINGS_TELEMETRY_FIELD),
            true,
            telemetryOptionObserver
        )
    }

    /**
     * Send a simple string message.
     *