diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java b/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java index 38b37a263..3803a3e9a 100644 --- a/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java +++ b/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java @@ -18,7 +18,9 @@ package com.android.incallui.ringtone; import com.google.common.base.Preconditions; +import android.content.ContentResolver; import android.net.Uri; +import android.provider.Settings; import android.support.annotation.Nullable; import com.android.contacts.common.compat.CompatUtils; @@ -70,6 +72,17 @@ public class DialerRingtoneManager { } /** + * Determines if an incoming call should vibrate as well as ring. + * + * @param resolver {@link ContentResolver} used to look up the + * {@link Settings.System#VIBRATE_WHEN_RINGING} setting. + * @return {@code true} if the call should vibrate, {@code false} otherwise. + */ + public boolean shouldVibrate(ContentResolver resolver) { + return Settings.System.getInt(resolver, Settings.System.VIBRATE_WHEN_RINGING, 0) != 0; + } + + /** * The incoming callState is never set as {@link State#CALL_WAITING} because * {@link Call#translateState(int)} doesn't account for that case, check for it here */ |