Egis
Egis

Reputation: 5141

How to determine if vibration setting is on?

On android how can I know if vibration setting is turned on? I know how to get ringer mode (normal, silent, vibrate) from AudioManager but that's not what I want. On most android devices there's this setting "Vibrate when ringing". I want to know the value of this setting. enter image description here

Upvotes: 0

Views: 400

Answers (1)

Egis
Egis

Reputation: 5141

I found it! This is how it's done.

    boolean vibrateWhenRinging = false;
    try {
        vibrateWhenRinging = (Settings.System.getInt(getContentResolver(), "vibrate_when_ringing") == 1);
    } catch (SettingNotFoundException e) {
    }

Upvotes: 2

Related Questions