Merge change 21901 into eclair
* changes: Check for a timeout <= 0 before adding the vibration.
This commit is contained in:
@@ -141,8 +141,11 @@ public class HardwareService extends IHardwareService.Stub {
|
|||||||
!= PackageManager.PERMISSION_GRANTED) {
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
throw new SecurityException("Requires VIBRATE permission");
|
throw new SecurityException("Requires VIBRATE permission");
|
||||||
}
|
}
|
||||||
if (mCurrentVibration != null
|
// We're running in the system server so we cannot crash. Check for a
|
||||||
&& mCurrentVibration.hasLongerTimeout(milliseconds)) {
|
// timeout of 0 or negative. This will ensure that a vibration has
|
||||||
|
// either a timeout of > 0 or a non-null pattern.
|
||||||
|
if (milliseconds <= 0 || (mCurrentVibration != null
|
||||||
|
&& mCurrentVibration.hasLongerTimeout(milliseconds))) {
|
||||||
// Ignore this vibration since the current vibration will play for
|
// Ignore this vibration since the current vibration will play for
|
||||||
// longer than milliseconds.
|
// longer than milliseconds.
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user