Skip to content

Commit

Permalink
add VibrateUtils comment
Browse files Browse the repository at this point in the history
  • Loading branch information
simplepeng committed Apr 25, 2024
1 parent 19349b9 commit c7ebceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class VibrateActivity : CommonActivity() {
CommonItemClick(R.string.vibrate_background) {
backHome()
mContentView.postDelayed({
// VibrateUtils.vibrate(1000) -- can not vibrate in background
VibrateUtils.vibrateCompat(longArrayOf(0, 1000, 1000, 2000, 2000, 1000), 1)
// VibrateUtils.vibrateCompat(1000)
}, 1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void vibrate(final long milliseconds, AudioAttributes attributes)
}

/**
* VibrateCompat
* VibrateCompat - Can vibrate in background
* <p>Must hold {@code <uses-permission android:name="android.permission.VIBRATE" />}</p>
*
* @param milliseconds he number of milliseconds to vibrate.
Expand Down Expand Up @@ -106,7 +106,7 @@ public static void vibrate(final long[] pattern, final int repeat, AudioAttribut
}

/**
* VibrateCompat
* VibrateCompat - Can vibrate in background
* <p>Must hold {@code <uses-permission android:name="android.permission.VIBRATE" />}</p>
*
* @param pattern An array of longs of times for which to turn the vibrator on or off.
Expand Down

0 comments on commit c7ebceb

Please sign in to comment.