From c9ea1546592863e580b71b4f9b05841ac722f4c3 Mon Sep 17 00:00:00 2001 From: MatheoLevallois Date: Mon, 27 Oct 2025 15:16:06 +0100 Subject: [PATCH 1/2] refactor: factorize foundation e parentalControl provider string into a variable --- .../data/parentalcontrol/ParentalControlRepository.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt b/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt index 02f5e49c4..5b0b40bd3 100644 --- a/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt +++ b/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt @@ -31,15 +31,17 @@ class ParentalControlRepository @Inject constructor( ) { companion object { - private const val URI_PARENTAL_CONTROL_PROVIDER = - "content://foundation.e.parentalcontrol.provider/age" + private const val PARENTAL_CONTROL_PROVIDER = + "foundation.e.parentalcontrol.provider" + private const val URI_PARENTAL_CONTROL_PROVIDER_AGE = + "content://$PARENTAL_CONTROL_PROVIDER/age" private const val URI_PARENTAL_CONTROL_INSTALL_TYPE_APP_MANAGEMENT = - "content://foundation.e.parentalcontrol.provider/protectionmode" + "content://$PARENTAL_CONTROL_PROVIDER/protectionmode" const val KEY_PARENTAL_GUIDANCE = "parental guidance" } fun getSelectedAgeGroup(): Age { - val uri = URI_PARENTAL_CONTROL_PROVIDER.toUri() + val uri = URI_PARENTAL_CONTROL_PROVIDER_AGE.toUri() val cursor = context.contentResolver.query(uri, null, null, null, null) cursor?.use { -- GitLab From 0dca536c537c56dc0af5e9fc265d98b3a0c7cbca Mon Sep 17 00:00:00 2001 From: MatheoLevallois Date: Wed, 29 Oct 2025 11:54:10 +0100 Subject: [PATCH 2/2] refactor: change URI_PARENTAL_CONTROL_PROVIDER_AGE -> URI_PARENTAL_CONTROL_AGE --- .../e/apps/data/parentalcontrol/ParentalControlRepository.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt b/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt index 5b0b40bd3..59f97ca6a 100644 --- a/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt +++ b/app/src/main/java/foundation/e/apps/data/parentalcontrol/ParentalControlRepository.kt @@ -33,7 +33,7 @@ class ParentalControlRepository @Inject constructor( companion object { private const val PARENTAL_CONTROL_PROVIDER = "foundation.e.parentalcontrol.provider" - private const val URI_PARENTAL_CONTROL_PROVIDER_AGE = + private const val URI_PARENTAL_CONTROL_AGE = "content://$PARENTAL_CONTROL_PROVIDER/age" private const val URI_PARENTAL_CONTROL_INSTALL_TYPE_APP_MANAGEMENT = "content://$PARENTAL_CONTROL_PROVIDER/protectionmode" @@ -41,7 +41,7 @@ class ParentalControlRepository @Inject constructor( } fun getSelectedAgeGroup(): Age { - val uri = URI_PARENTAL_CONTROL_PROVIDER_AGE.toUri() + val uri = URI_PARENTAL_CONTROL_AGE.toUri() val cursor = context.contentResolver.query(uri, null, null, null, null) cursor?.use { -- GitLab