warning: [deprecation] VIBRATOR_SERVICE in Context has been deprecated

Reference:

https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE

This constant has been deprecated from API level 31, so you can safely manage this situation with:

Vibrator vibrator;

if (Build.VERSION.SDK_INT >= 31) {
    VibratorManager vibratorM = (VibratorManager) getApplicationContext()
        .getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
    vibrator = vibratorM.getDefaultVibrator();
} else
    vibrator = (Vibrator) getApplicationContext
        .getSystemService(Context.VIBRATOR_SERVICE);

// then continue for example with...
vibrator.cancel();

Related: https://www.cascablog.it/2024/04/01/warning-deprecation-vibratelongint-in-vibrator-has-been-deprecated/