Can a third-party application implement CallScreeningService in android 7?

The Android 24 API layer introduces a new service called CallScreeningService . The documentation says that the service can be performed using the default decoder to display incoming calls. I would like to implement this service in my own application, preferably without creating a complete set of applications, but a simple, naive implementation is apparently ignored by the OS when an incoming call arrives.

Debugging AndroidManifest.xml:

<service android:name="com.example.callbouncer.CallService" android:permission="android.permission.BIND_SCREENING_SERVICE">
    <intent-filter>
        <action android:name="android.telecom.CallScreeningService"/>
    </intent-filter>
</service>

CallService.java:

// imports...
public class CallService extends CallScreeningService {
    @Override
    public void onScreenCall(Call.Details callDetails) {
        CallResponse.Builder response = new CallResponse.Builder();
        Log.e("CallBouncer", "Call screening service triggered");
        respondToCall(callDetails, response.build() );
    }
}

, , , . - (, / ), ? , , ? , , -, AOSP ?

+6
1

, :

(. getDefaultDialerPackage()), .

, ( , : , ).

+3

Source: https://habr.com/ru/post/1016770/


All Articles