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

Commit 72ab7baa authored by Matheo Levallois's avatar Matheo Levallois
Browse files

refactor: factorize foundation e parentalControl provider string into a variable

parent 4fa8b7bc
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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_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_AGE.toUri()
        val cursor = context.contentResolver.query(uri, null, null, null, null)

        cursor?.use {