Skip to content

Commit

Permalink
fix: voip vibrate
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Oct 3, 2024
1 parent d05c2d7 commit 97d35cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ private static void startRinging(Context context, int account, long user_id) {
} else if (vibrate == 3) {
duration *= 2;
}
vibrator.vibrate(new long[]{0, duration, 500}, 0);
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
.build();
vibrator.vibrate(new long[]{0, duration, 500}, 0, audioAttributes);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3148,7 +3148,11 @@ private void startRingtoneAndVibration(long chatID) {
} else if (vibrate == 3) {
duration *= 2;
}
vibrator.vibrate(new long[]{0, duration, 500}, 0);
AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
.build();
vibrator.vibrate(new long[]{0, duration, 500}, 0, audioAttributes);
}
}
}
Expand Down

0 comments on commit 97d35cc

Please sign in to comment.