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

Verified Commit 8b49b055 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

EN: Do not log isEnabled calls

Some apps make excessive use of this method, so better not log it
parent c30e05ee
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -122,6 +122,10 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit
                }
            }
        }
        if (oldVersion == 9) {
            Log.d(TAG, "Get rid of isEnabled log entries")
            db.delete(TABLE_APP_LOG, "method = ?", arrayOf("isEnabled"));
        }
        Log.d(TAG, "Finished database upgrade")
    }

@@ -830,7 +834,7 @@ class ExposureDatabase private constructor(private val context: Context) : SQLit

    companion object {
        private const val DB_NAME = "exposure.db"
        private const val DB_VERSION = 9
        private const val DB_VERSION = 10
        private const val DB_SIZE_TOO_LARGE = 256L * 1024 * 1024
        private const val MAX_DELETE_TIME = 5000L
        private const val TABLE_ADVERTISEMENTS = "advertisements"
+1 −3
Original line number Diff line number Diff line
@@ -151,9 +151,7 @@ class ExposureNotificationServiceImpl(private val context: Context, private val
    override fun isEnabled(params: IsEnabledParams) {
        lifecycleScope.launchWhenStarted {
            val isAuthorized = ExposureDatabase.with(context) { database ->
                database.isAppAuthorized(packageName).also {
                    if (it) database.noteAppAction(packageName, "isEnabled")
                }
                database.isAppAuthorized(packageName)
            }
            try {
                params.callback.onResult(Status.SUCCESS, isAuthorized && ExposurePreferences(context).enabled)