android: vibrate out of the synchronized section
This commit is contained in:
parent
2d03662a9a
commit
cc26e255e0
|
@ -415,16 +415,20 @@ public class VirtualJoystickDelegate {
|
|||
@Override
|
||||
public void run() {
|
||||
while (!stopping) {
|
||||
boolean doVibrate;
|
||||
synchronized (this) {
|
||||
doVibrate = false;
|
||||
try {
|
||||
this.wait();
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
if (vibrate) {
|
||||
vibrator.vibrate(Emulator.vibrationDuration);
|
||||
doVibrate = true;
|
||||
vibrate = false;
|
||||
}
|
||||
}
|
||||
if (doVibrate)
|
||||
vibrator.vibrate(Emulator.vibrationDuration);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue