Loading services/java/com/android/server/NotificationManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -1128,13 +1128,13 @@ public class NotificationManagerService extends INotificationManager.Stub final boolean hasCustomVibrate = notification.vibrate != null; // new in 4.2: if there was supposed to be a sound and we're in vibrate mode, // and no other vibration is specified, we apply the default vibration anyway // and no other vibration is specified, we fall back to vibration final boolean convertSoundToVibration = !hasCustomVibrate && hasValidSound && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE); // The DEFAULT_VIBRATE flag trumps any custom vibration. // The DEFAULT_VIBRATE flag trumps any custom vibration AND the fallback. final boolean useDefaultVibrate = (notification.defaults & Notification.DEFAULT_VIBRATE) != 0; Loading @@ -1147,8 +1147,8 @@ public class NotificationManagerService extends INotificationManager.Stub // does not have the VIBRATE permission. long identity = Binder.clearCallingIdentity(); try { mVibrator.vibrate(convertSoundToVibration ? mFallbackVibrationPattern : mDefaultVibrationPattern, mVibrator.vibrate(useDefaultVibrate ? mDefaultVibrationPattern : mFallbackVibrationPattern, ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1); } finally { Binder.restoreCallingIdentity(identity); Loading Loading
services/java/com/android/server/NotificationManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -1128,13 +1128,13 @@ public class NotificationManagerService extends INotificationManager.Stub final boolean hasCustomVibrate = notification.vibrate != null; // new in 4.2: if there was supposed to be a sound and we're in vibrate mode, // and no other vibration is specified, we apply the default vibration anyway // and no other vibration is specified, we fall back to vibration final boolean convertSoundToVibration = !hasCustomVibrate && hasValidSound && (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE); // The DEFAULT_VIBRATE flag trumps any custom vibration. // The DEFAULT_VIBRATE flag trumps any custom vibration AND the fallback. final boolean useDefaultVibrate = (notification.defaults & Notification.DEFAULT_VIBRATE) != 0; Loading @@ -1147,8 +1147,8 @@ public class NotificationManagerService extends INotificationManager.Stub // does not have the VIBRATE permission. long identity = Binder.clearCallingIdentity(); try { mVibrator.vibrate(convertSoundToVibration ? mFallbackVibrationPattern : mDefaultVibrationPattern, mVibrator.vibrate(useDefaultVibrate ? mDefaultVibrationPattern : mFallbackVibrationPattern, ((notification.flags & Notification.FLAG_INSISTENT) != 0) ? 0: -1); } finally { Binder.restoreCallingIdentity(identity); Loading