Created
April 6, 2021 07:03
-
-
Save nimeacuerdo/1b56a201a5969f2b7ec14b00040df5e8 to your computer and use it in GitHub Desktop.
Example of module that declares initial permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Module | |
class ContactsModule { | |
@Provides | |
@ElementsIntoSet | |
@InitialPermission | |
fun provideInitialPermissions(): Set<InitialPermissionData> { | |
return if (ContactsFeatureStatus.isEnabled) { | |
setOf( | |
InitialPermissionData( | |
"contacts", setOf(Manifest.permission.READ_CONTACTS), | |
R.string.contacts_disclaimer_title, | |
R.string.contacts_disclaimer_detail_title, | |
R.string.contacts_disclaimer_detail_description | |
) | |
) | |
} else { | |
emptySet() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment