if(amplitude > 255 || amplitude < 1)
amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
This commit is contained in:
parent
eb68c99d99
commit
5c59f7732e
@ -146,8 +146,11 @@ public class SensorMapsActivity extends FragmentActivity implements OnMapReadyCa
|
|||||||
if(!mDeviceCanVibrate)
|
if(!mDeviceCanVibrate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
if (Build.VERSION.SDK_INT >= 26) {
|
if(amplitude > 255 || amplitude < 1)
|
||||||
|
amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
|
||||||
|
if (Build.VERSION.SDK_INT >= 26) {
|
||||||
if(duration == 0)
|
if(duration == 0)
|
||||||
{
|
{
|
||||||
v.cancel(); //stop vibration if still running
|
v.cancel(); //stop vibration if still running
|
||||||
|
Loading…
x
Reference in New Issue
Block a user