Code example for Binder

0
     *   {@link android.Manifest.permission#VIBRATE} 
     * @throws RemoteException 
     */ 
    public void testVibratePattern() throws RemoteException { 
        try { 
            mHardwareService.vibratePattern(new long[] {0}, 0, new Binder());
            fail("vibratePattern did not throw SecurityException as expected");
        } catch (SecurityException e) {
            // expected 
        } 
    } 
 
    /** 
     * Test that calling {@link android.os.IHardwareService#cancelVibrate()} requires permissions. 
     * <p>Tests permission: 
     *   {@link android.Manifest.permission#VIBRATE} 
     * @throws RemoteException 
     */ 
    public void testCancelVibrate() throws RemoteException { 
        try { 
            mHardwareService.cancelVibrate();