Code example for Binder

0
     *   {@link android.Manifest.permission#VIBRATE} 
     * @throws RemoteException 
     */ 
    public void testVibrate() throws RemoteException { 
        try { 
            mVibratorService.vibrate(Process.myUid(), null, 2000, new Binder());
            fail("vibrate did not throw SecurityException as expected");
        } catch (SecurityException e) {
            // expected 
        } 
    } 
 
    /** 
     * Test that calling {@link android.os.IVibratorService#vibratePattern(long[], 
     * int, android.os.IBinder)} requires permissions. 
     * <p>Tests permission: 
     *   {@link android.Manifest.permission#VIBRATE} 
     * @throws RemoteException 
     */ 
    public void testVibratePattern() throws RemoteException { 
        try {