Skip to content

Commit e70a32a

Browse files
Jean-Baptiste QueruAndroid Git Automerger
authored andcommitted
am eb00f95: Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
* commit 'eb00f951439cd724863d267e8e8d77414383d93f': VibratorService: Fix to ensure actual delay in a vibrate pattern
2 parents 5a60f05 + eb00f95 commit e70a32a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

services/java/com/android/server/VibratorService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ private class VibrateThread extends Thread {
441441

442442
private void delay(long duration) {
443443
if (duration > 0) {
444-
long bedtime = SystemClock.uptimeMillis();
444+
long bedtime = duration + SystemClock.uptimeMillis();
445445
do {
446446
try {
447447
this.wait(duration);
@@ -451,8 +451,7 @@ private void delay(long duration) {
451451
if (mDone) {
452452
break;
453453
}
454-
duration = duration
455-
- SystemClock.uptimeMillis() - bedtime;
454+
duration = bedtime - SystemClock.uptimeMillis();
456455
} while (duration > 0);
457456
}
458457
}

0 commit comments

Comments
 (0)