Condividi tramite


AudioManager.RingerMode Property

Definition

Returns the current ringtone mode. -or- Sets the ringer mode.

public virtual Android.Media.RingerMode RingerMode { [Android.Runtime.Register("getRingerMode", "()I", "GetGetRingerModeHandler")] get; [Android.Runtime.Register("setRingerMode", "(I)V", "GetSetRingerMode_IHandler")] set; }
[<get: Android.Runtime.Register("getRingerMode", "()I", "GetGetRingerModeHandler")>]
[<set: Android.Runtime.Register("setRingerMode", "(I)V", "GetSetRingerMode_IHandler")>]
member this.RingerMode : Android.Media.RingerMode with get, set

Property Value

The current ringtone mode, one of #RINGER_MODE_NORMAL, #RINGER_MODE_SILENT, or #RINGER_MODE_VIBRATE.

Attributes

Remarks

Property getter documentation:

Returns the current ringtone mode.

Java documentation for android.media.AudioManager.getRingerMode().

Property setter documentation:

Sets the ringer mode.

Silent mode will mute the volume and will not vibrate. Vibrate mode will mute the volume and vibrate. Normal mode will be audible and may vibrate according to user settings.

This method has no effect if the device implements a fixed volume policy as indicated by #isVolumeFixed(). *

From N onward, ringer mode adjustments that would toggle Do Not Disturb are not allowed unless the app has been granted Do Not Disturb Access. See NotificationManager#isNotificationPolicyAccessGranted().

Java documentation for android.media.AudioManager.setRingerMode(int).

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

See also