am 7f33f6e9: am 38b987ab: am 0155856a: Fix AudioService rotation helper thread

* commit '7f33f6e92fa22f47af2f8d61883197013fae4c66':
  Fix AudioService rotation helper thread
This commit is contained in:
Jean-Michel Trivi
2015-10-06 00:27:18 +00:00
committed by Android Git Automerger

View File

@@ -192,16 +192,18 @@ class RotationHelper {
}
public void run() {
int newRotation;
while (mWaitCounter < WAIT_TIMES_MS.length) {
updateOrientation();
int waitTimeMs;
synchronized(mCounterLock) {
waitTimeMs = WAIT_TIMES_MS[mWaitCounter];
waitTimeMs = mWaitCounter < WAIT_TIMES_MS.length ?
WAIT_TIMES_MS[mWaitCounter] : 0;
mWaitCounter++;
}
try {
sleep(waitTimeMs);
if (waitTimeMs > 0) {
sleep(waitTimeMs);
updateOrientation();
}
} catch (InterruptedException e) { }
}
}