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

* commit 'eb00f951439cd724863d267e8e8d77414383d93f':
  VibratorService: Fix to ensure actual delay in a vibrate pattern
This commit is contained in:
Jean-Baptiste Queru
2012-08-27 08:11:19 -07:00
committed by Android Git Automerger

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);
} }
} }