Code example for Binder

Methods: addService

	public void testAddService() { 
        try { 
            // The security in the service manager is that you can't replace 
            // a service that is already published. 
            Binder binder = new Binder();
            ServiceManager.addService("activity", binder);
            fail("ServiceManager.addService did not throw SecurityException as"
                    + " expected"); 
        } catch (SecurityException e) {
            // expected 
    public void testSetPermissionController() { 
        try { 
            IPermissionController pc = new IPermissionController.Stub() {
                public boolean checkPermission(java.lang.String permission, int pid, int uid) {
                    return true; 
Connect your IDE to all the code out there  Get Codota for Java