An Android app to reject calls from numbers matching various conditions.
Use Android Studio
- On Android versions before Q (API v29) the app does not always get notified about a call to reject it before the ringer can start. This is fixed in Q with the CallScreeningService API.
- On Android Oreo 8.0 (API v26) the app cannot block calls.
ITelephony.endCall()strictly requiresMODIFY_PHONE_STATEon this version. API v27 refactoredTelecomServicefor the new public call APIs, which allowed the legacy reflection to work again. - On Android versions before Lollipop (API v21) the app must run as a system app to block calls.
Releases are automated via GitHub Actions. Pushing a tag matching v<major>.<minor>.<patch> (e.g. v1.2.3) runs unit tests, builds a signed release APK, and publishes it as a GitHub Release.
Build provenance is attested so you can verify an APK was built from this repository with the GitHub CLI tool:
gh attestation verify call-filter-<version>.apk -R erik-perri/android-call-filterUnit tests run without an emulator:
./gradlew testDebugUnitTestWhen running instrumentation tests via the Android Studio gutter, an emulator must be running. The can also be provisioned automatically using Gradle Managed Devices. Because the test libraries require a higher minSdk than the app itself, pass -PtestMinSdk=26:
# Run on a specific device (e.g. API 29)
./gradlew pixel2Api29DebugAndroidTest -PtestMinSdk=26
# Run on all configured devices (API 27, 28, 29, 35)
# We limit parallel devices to 1 to save local system resources
./gradlew allDevicesDebugAndroidTest -PtestMinSdk=26 -Dandroid.testoptions.manageddevices.maxparallel=1To run tests on a physical device or a manually opened emulator:
./gradlew connectedDebugAndroidTest

