chenxiaolong / BCR

A Basic Call Recorder for rooted Android devices
GNU General Public License v3.0
1.67k stars 109 forks source link

Add support for auto-record rules #327

Closed chenxiaolong closed 1 year ago

chenxiaolong commented 1 year ago

Every call is always recorded initially and the rules determine if the recording should be deleted at the end of the call. The user can override the rules during the middle of a call by using the Delete and Restore buttons in BCR's notification. This allows the user to decide to keep the recording later in the call, even if auto-record was disabled for the caller.

The supported rule types are:

If BCR is not granted the Contacts permission, then only "All other calls" will be available. For simplicity of implementation, there is no way to add rules for specific phone numbers--only contacts. This way Android can do the hard work of performing phone number comparisons.

Rules are processed in order and while the rule matching mechanism can handle an arbitrary rule order, the configuration interface enforces that all the contact rules come first in sorted order, followed by "Unknown calls" and "All other calls". This is again done for simplicity of implementation. This should be sufficient for most use cases, with the caveat that conference calls will follow whichever rule matches first for any of the participants in the call.

This rule mechanism replaces the old "initially paused" setting. Pausing and unpausing no longer has any relation to whether a recording is kept. The old setting will be migrated to the new "Unknown calls" and "All other calls" rules.

Fixes: #320

chenxiaolong commented 1 year ago

screenshot of the auto-record rules configuration interface with the help message dialog shown screenshot of BCR's notification showing the new delete and restore buttons