Skip to content

Commit ba37d59

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

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)