Example usage for android.telecom TelecomManager silenceRinger

List of usage examples for android.telecom TelecomManager silenceRinger

Introduction

In this page you can find the example usage for android.telecom TelecomManager silenceRinger.

Prototype

@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void silenceRinger() 

Source Link

Document

Silences the ringer if a ringing call exists.

Usage

From source file:com.mobileglobe.android.customdialer.common.compat.telecom.TelecomManagerCompat.java

/**
 * Silences the ringer if a ringing call exists. Noop if {@link TelecomManager#silenceRinger()}
 * is unavailable./*w w w  .  j  av a2s . co m*/
 *
 * @param telecomManager the TelecomManager to use to silence the ringer.
 */
public static void silenceRinger(@Nullable TelecomManager telecomManager) {
    if (telecomManager != null && (CompatUtils.isMarshmallowCompatible()
            || CompatUtils.isMethodAvailable(TELECOM_MANAGER_CLASS, "silenceRinger"))) {
        telecomManager.silenceRinger();
    }
}