summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/Settings.java8
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java3
2 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a0802b4..0251a4f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3410,6 +3410,14 @@ public final class Settings {
@Deprecated
public static final String WIFI_WATCHDOG_PING_TIMEOUT_MS =
Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS;
+
+ /**
+ * toggle to "fix" the following: (found in NotificationManagerService)
+ * new in 4.2: if there was supposed to be a sound and we're in vibrate mode,
+ * we always vibrate, even if no vibration was specified
+ */
+ public static final String NOTIFICATION_CONVERT_SOUND_TO_VIBRATION = "convert_sound_to_vibration";
+
}
/**
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 =