Code example for Vibrator

Methods: hasVibrator

0
        @SuppressWarnings("unused") 
        public void vibrate(long milliseconds) {
            milliseconds = Math.min(milliseconds, MAX_VIBRATE_DURATION_MS);
            mVibrator.vibrate(milliseconds);
        } 
 
        @JavascriptInterface 
        @SuppressWarnings("unused") 
        public void vibrate(long[] pattern, int repeat) {
            for (int i = 0; i < pattern.length; ++i) {
                pattern[i] = Math.min(pattern[i], MAX_VIBRATE_DURATION_MS);
            } 
 
            repeat = -1;
 
            mVibrator.vibrate(pattern, repeat);
        } 
 
        @JavascriptInterface 
        @SuppressWarnings("unused") 
        public void cancel() {