Loading app/src/main/java/foundation/e/apps/provider/AgeRatingProvider.kt +14 −14 Original line number Diff line number Diff line Loading @@ -112,15 +112,9 @@ class AgeRatingProvider : ContentProvider() { if (packageNames.isEmpty()) return@withContext cursor ensureAgeGroupDataExists() if (!setupAuthDataIfExists()) return@withContext null val ageValidityDeferred = packageNames.map { packageName -> async { if (!setupAuthDataIfExists()) return@async null getAppAgeValidity(packageName) } } val validityList = ageValidityDeferred.awaitAll() compileAppBlockList(cursor, validityList, packageNames) compileAppBlockList(cursor, packageNames) } catch (e: Exception) { Timber.e("AgeRatingProvider", "Error fetching age ratings", e) } Loading Loading @@ -157,11 +151,16 @@ class AgeRatingProvider : ContentProvider() { return validateResult.data ?: false } private fun compileAppBlockList( private suspend fun compileAppBlockList( cursor: MatrixCursor, validityList: List<Boolean?>, packageNames: List<String>, ) { withContext(IO) { val validityList = packageNames.map { packageName -> async { getAppAgeValidity(packageName) } }.awaitAll() validityList.forEachIndexed { index: Int, isValid: Boolean? -> if (isValid != true) { // Collect package names for blocklist Loading @@ -169,6 +168,7 @@ class AgeRatingProvider : ContentProvider() { } } } } override fun onCreate(): Boolean { val appContext = context?.applicationContext ?: error("Null context in ${this::class.java.name}") Loading Loading
app/src/main/java/foundation/e/apps/provider/AgeRatingProvider.kt +14 −14 Original line number Diff line number Diff line Loading @@ -112,15 +112,9 @@ class AgeRatingProvider : ContentProvider() { if (packageNames.isEmpty()) return@withContext cursor ensureAgeGroupDataExists() if (!setupAuthDataIfExists()) return@withContext null val ageValidityDeferred = packageNames.map { packageName -> async { if (!setupAuthDataIfExists()) return@async null getAppAgeValidity(packageName) } } val validityList = ageValidityDeferred.awaitAll() compileAppBlockList(cursor, validityList, packageNames) compileAppBlockList(cursor, packageNames) } catch (e: Exception) { Timber.e("AgeRatingProvider", "Error fetching age ratings", e) } Loading Loading @@ -157,11 +151,16 @@ class AgeRatingProvider : ContentProvider() { return validateResult.data ?: false } private fun compileAppBlockList( private suspend fun compileAppBlockList( cursor: MatrixCursor, validityList: List<Boolean?>, packageNames: List<String>, ) { withContext(IO) { val validityList = packageNames.map { packageName -> async { getAppAgeValidity(packageName) } }.awaitAll() validityList.forEachIndexed { index: Int, isValid: Boolean? -> if (isValid != true) { // Collect package names for blocklist Loading @@ -169,6 +168,7 @@ class AgeRatingProvider : ContentProvider() { } } } } override fun onCreate(): Boolean { val appContext = context?.applicationContext ?: error("Null context in ${this::class.java.name}") Loading