How to make IN_CALL_SERVICE_RINGING work?

245 Views Asked by At

Android docs:

public static final String METADATA_IN_CALL_SERVICE_RINGING A boolean meta-data value indicating whether an InCallService implements ringing. Dialer implementations (see getDefaultDialerPackage()) which would also like to override the system provided ringing should set this meta-data to true in the manifest registration of their InCallService.

When true, it is the InCallService's responsibility to play a ringtone for all incoming calls.

My code:

    <service
        android:name=".InCallServ"
        android:exported="true"
        android:permission="android.permission.BIND_INCALL_SERVICE">
        <meta-data
            android:name="android.telecom.IN_CALL_SERVICE_UI"
            android:value="true" />
        <meta-data
            android:name="android.telecom.IN_CALL_SERVICE_RINGING"
            android:value="true" />
        <intent-filter>
            <action android:name="android.telecom.InCallService" />
        </intent-filter>
    </service>

I expected that as a result, since now my Phone app is "responsible" for this, there will be no ringtone at all and I can then add my own if necessary. But no changes happened. What did I do wrong or what did I not do to disable the default ringtone?

P.S. I forgot to add "no changes happened" - this is on real smartphones. On the Android Studio emulator, everything is according to the documentation.

1

There are 1 best solutions below

0
ssiiaa.x On

It seems to be the peculiarities of the firmware of this particular smartphone. But instead there is an option to set the default ringtone to NONE. All this of course is sad, but it's Android.