From 7ef69d43d84fd6ce95e9274c9c1d19a06b5709e1 Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Tue, 15 Jan 2013 23:48:45 +0100 Subject: Notification sound-to-vibration conversion toggle Allows to change the new feature of AOSP 4.2, where all notification are changed to vibrations on vibrate mode. Instead, allow the old behaviour to silence sound notifications and to only play vibrations if desired. Alle credits go to romanbb from AOKP, I just ported it. Original AOKP-Commit: https://github.com/AOKP/frameworks_base/commit/c1b2bb9b5d0c33e790973841bb2acaa5ea5d51fe Change-Id: Id27dd2975d3383f6d7395a0ee995d7832e87ca66 --- services/java/com/android/server/NotificationManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'services/java/com/android/server/NotificationManagerService.java') diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 757160e..c844a6e 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1246,7 +1246,8 @@ public class NotificationManagerService extends INotificationManager.Stub final boolean convertSoundToVibration = !hasCustomVibrate && (useDefaultSound || notification.sound != null) - && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE); + && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE) + && (Settings.System.getInt(mContext.getContentResolver(), Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, 1) != 0); // The DEFAULT_VIBRATE flag trumps any custom vibration. final boolean useDefaultVibrate = -- cgit v1.1