0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-10 13:05:05 +00:00

EN: Do not log isEnabled calls

Some apps make excessive use of this method, so better not log it
This commit is contained in:
Marvin W 2020-12-20 12:43:38 +01:00
parent c30e05ee68
commit 8b49b05585
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
2 changed files with 6 additions and 4 deletions

View file

@ -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"

View file

@ -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)