Skip to content

Commit eb00f95

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
2 parents 13ab2c9 + e4c56d9 commit eb00f95

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)