0
votes

I'm using NotificationCompat.Builder to build notification, which based on app configuration can make sound or vibrate or both. All works fine BUT when phone is switched to vibrate mode then the notifications vibrate even when they have only sound enabled. Why does builder.setSound result in vibration when phone is switched to vibrate mode? Is there a way to get rid of that?

I found similar SO question but it does not seem to resolve my problem.

here are few versions, tested on Samsung Galaxy Note 3

compileSdkVersion 23
minSdkVersion 14
targetSdkVersion 23
1

1 Answers

1
votes

Why does builder.setSound result in vibration when phone is switched to vibrate mode?

Because that's what vibrate mode does. It replaces ringtones and other notification sounds with a vibration pattern, so the user knows that there was a notification, but the alert is (usually) inaudible.

Is there a way to get rid of that?

You are welcome to not call setSound() when the user has vibration mode on.