diff --git a/README.md b/README.md index dec691d95..9ac3b08d4 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ As the name alludes, BCR intends to be a basic as possible. The project will hav 4. Enable call recording and pick an output directory. If no output directory is selected or if the output directory is no longer accessible, then recordings will be saved to `/sdcard/Android/data/com.chiller3.bcr/files`. + When enabling call recording the first time, BCR will prompt for microphone, notification (Android 13+), and contacts permissions. Microphone and notification permissions are required for BCR to be able to record phone calls in the background. + + The contacts permission is optional, but if allowed, contact names will be added to the recordings' filenames. BCR never sends contact information anywhere. In fact, it does not even have the `INTERNET` permission. However, other third party applications may be able to see the contact names if they can access the output directory. + 5. To install future updates, there are a couple methods: * If installed via Magisk, the module can be updated right from Magisk Manager's modules tab. Flashing the new version in Magisk manually also works just as well. diff --git a/app/src/main/java/com/chiller3/bcr/Permissions.kt b/app/src/main/java/com/chiller3/bcr/Permissions.kt index b3795f7a2..28685313a 100644 --- a/app/src/main/java/com/chiller3/bcr/Permissions.kt +++ b/app/src/main/java/com/chiller3/bcr/Permissions.kt @@ -20,6 +20,7 @@ object Permissions { } val REQUIRED: Array = arrayOf(Manifest.permission.RECORD_AUDIO) + NOTIFICATION + val OPTIONAL: Array = arrayOf(Manifest.permission.READ_CONTACTS) private fun isGranted(context: Context, permission: String) = ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED diff --git a/app/src/main/java/com/chiller3/bcr/SettingsActivity.kt b/app/src/main/java/com/chiller3/bcr/SettingsActivity.kt index f59a66da7..66594c7a5 100644 --- a/app/src/main/java/com/chiller3/bcr/SettingsActivity.kt +++ b/app/src/main/java/com/chiller3/bcr/SettingsActivity.kt @@ -42,7 +42,8 @@ class SettingsActivity : AppCompatActivity() { private val requestPermissionRequired = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { granted -> - if (granted.all { it.value }) { + // Call recording can still be enabled if optional permissions were not granted + if (granted.all { it.key !in Permissions.REQUIRED || it.value }) { prefCallRecording.isChecked = true } else { startActivity(Permissions.getAppInfoIntent(requireContext())) @@ -174,7 +175,8 @@ class SettingsActivity : AppCompatActivity() { prefCallRecording -> if (Permissions.haveRequired(context)) { return true } else { - requestPermissionRequired.launch(Permissions.REQUIRED) + // Ask for optional permissions the first time only + requestPermissionRequired.launch(Permissions.REQUIRED + Permissions.OPTIONAL) } // This is only reachable if battery optimization is not already inhibited prefInhibitBatteryOpt -> requestInhibitBatteryOpt.launch(