Partager via


Connection.OnSilence Method

Definition

Notifies this Connection of a request to silence the ringer.

[Android.Runtime.Register("onSilence", "()V", "GetOnSilenceHandler", ApiSince=29)]
public virtual void OnSilence ();
[<Android.Runtime.Register("onSilence", "()V", "GetOnSilenceHandler", ApiSince=29)>]
abstract member OnSilence : unit -> unit
override this.OnSilence : unit -> unit
Attributes

Remarks

Notifies this Connection of a request to silence the ringer.

The ringer may be silenced by any of the following methods: <ul> <li>TelecomManager#silenceRinger()</li> <li>The user presses the volume-down button while a call is ringing.</li> </ul>

Self-managed ConnectionService implementations should override this method in their Connection implementation and implement logic to silence their app's ringtone. If your app set the ringtone as part of the incoming call Notification (see #onShowIncomingCallUi()), it should re-post the notification now, except call android.app.Notification.Builder#setOnlyAlertOnce(boolean) with true. This will ensure the ringtone sound associated with your android.app.NotificationChannel stops playing.

Java documentation for android.telecom.Connection.onSilence().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to