Add new public API to allow call screening
This CL adds a new service that the default dialer can implement to
screen incoming calls.
If the service is implemented then Telecom uses it to decide if a call
should be shown to the user or rejected.
Note, I initially tried to simply extend InCallService instead of
creating a whole new service. The problem with this approach is that:
- this breaks some in call services which show UI as soon as they are
bound to
- the in call service lifecycle is tightly coupled to adding and
removing calls. Call screening happens before a call is added which
makes it a bad fit to in call service
- call screening is a function of only the default dialer's in call
service but the existing code also binds to "controller" call
services
For these reasons it seemed simpler to just create a new optional
service.
BUG: 22857261
Change-Id: I53f2ef93360e0af19b6ce45af21026be6cf3a7f3
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index f5e704d..313d6d0 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1406,6 +1406,13 @@
<permission android:name="android.permission.BIND_INCALL_SERVICE"
android:protectionLevel="signature|privileged" />
+ <!-- Must be required by a {@link android.telecom.CallScreeningService},
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_SCREENING_SERVICE"
+ android:protectionLevel="signature|privileged" />
+
<!-- Must be required by a {@link android.telecom.ConnectionService},
to ensure that only the system can bind to it.
@deprecated {@link android.telecom.ConnectionService}s should require