Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"

This commit is contained in:
Jean-Baptiste Queru
2012-08-27 07:55:41 -07:00
committed by android code review

View File

@@ -441,7 +441,7 @@ public class VibratorService extends IVibratorService.Stub
private void delay(long duration) { private void delay(long duration) {
if (duration > 0) { if (duration > 0) {
long bedtime = SystemClock.uptimeMillis(); long bedtime = duration + SystemClock.uptimeMillis();
do { do {
try { try {
this.wait(duration); this.wait(duration);
@@ -451,8 +451,7 @@ public class VibratorService extends IVibratorService.Stub
if (mDone) { if (mDone) {
break; break;
} }
duration = duration duration = bedtime - SystemClock.uptimeMillis();
- SystemClock.uptimeMillis() - bedtime;
} while (duration > 0); } while (duration > 0);
} }
} }