diff options
| -rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index c844a6e..24da4c9 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1246,8 +1246,8 @@ public class NotificationManagerService extends INotificationManager.Stub final boolean convertSoundToVibration = !hasCustomVibrate && (useDefaultSound || notification.sound != null) - && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE) - && (Settings.System.getInt(mContext.getContentResolver(), Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, 1) != 0); + && shouldConvertSoundToVibration() + && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE); // The DEFAULT_VIBRATE flag trumps any custom vibration. final boolean useDefaultVibrate = @@ -1299,6 +1299,11 @@ public class NotificationManagerService extends INotificationManager.Stub idOut[0] = id; } + private boolean shouldConvertSoundToVibration() { + return Settings.System.getInt(mContext.getContentResolver(), + Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, 1) != 0; + } + private boolean inQuietHours() { if (mQuietHoursEnabled && (mQuietHoursStart != mQuietHoursEnd)) { // Get the date in "quiet hours" format. |
