Java Code Examples for android.os.Bundle.getBinder()

The following are Jave code examples for showing how to use getBinder() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: VirtualAPK   File: PluginUtil.java   View Source Code Vote up 5 votes
public static IBinder getBinder(Bundle bundle, String key) {
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        return bundle.getBinder(key);
    } else {
        try {
            return (IBinder) ReflectUtil.invoke(Bundle.class, bundle, "getIBinder", key);
        } catch (Exception e) {
        }

        return null;
    }
}
 
Example 2
Project: VirtualHook   File: BundleCompat.java   View Source Code Vote up 5 votes
public static IBinder getBinder(Bundle bundle, String key) {
	if (Build.VERSION.SDK_INT >= 18) {
		return bundle.getBinder(key);
	} else {
		return mirror.android.os.Bundle.getIBinder.call(bundle, key);
	}
}
 
Example 3
Project: DroidIPC   File: BundleReceiveDecorator.java   View Source Code Vote up 5 votes
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
		throws RemoteException {
	
	if(code == ServiceContext.TRANSACT_BUNDLE_SENDER) {
		Bundle bundle = data.readBundle();
		
		IBinder binder = bundle.getBinder(ServiceContext.EXTRA_CALLBACK);
		
		Bundle result = onReceiver(bundle,new IBinderCallback(binder));
		reply.writeBundle(result);
	}
	
	return true;
}
 
Example 4
Project: TPlayer   File: BundleCompat.java   View Source Code Vote up 5 votes
public static IBinder getBinder(Bundle bundle, String key) {
    if (Build.VERSION.SDK_INT >= 18) {
        return bundle.getBinder(key);
    } else {
        return mirror.android.os.Bundle.getIBinder.call(bundle, key);
    }
}
 
Example 5
Project: container   File: BundleCompat.java   View Source Code Vote up 5 votes
public static IBinder getBinder(Bundle bundle, String key) {
	if (Build.VERSION.SDK_INT >= 18) {
		return bundle.getBinder(key);
	} else {
		return mirror.android.os.Bundle.getIBinder.call(bundle, key);
	}
}
 
Example 6
Project: DroidIPC   File: ServiceManagerImpl.java   View Source Code Vote up 4 votes
static ServiceManagerImpl createClientServiceManager(Context context,Intent intent) {
	
	log("createClientServiceManager");
	
	Bundle binders = intent.getBundleExtra(ServiceContext.EXTRA_BUNDLE);
	IBinder remoteServiceManager = binders.getBinder(ServiceContext.EXTRA_BUNDLE_BINDER);
	
	int cmd = intent.getIntExtra(ServiceContext.EXTRA_COMMAND, ServiceContext.CMD_CREATE_CLIENT_SERVICE_MANAGER);
	
	log("createClientServiceManager cmd = " + cmd);
	
	ServiceManagerImpl serviceManager = ServiceManagerImpl.createLocalServiceManager(context, remoteServiceManager);
	
	return serviceManager;
}
 
Example 7
Project: boohee_v5.6   File: BundleCompatJellybeanMR2.java   View Source Code Vote up 4 votes
public static IBinder getBinder(Bundle bundle, String key) {
    return bundle.getBinder(key);
}
 
Example 8
Project: DroidIPC   File: RemoteClientCommandListener.java   View Source Code Vote up 3 votes
@Override
protected void onHandleCommand(int cmd, Intent intent) {
	
	if(cmd == ServiceContext.CMD_GET_SERVER_SERVICE_MANAGER) {
		
		Bundle binders = intent.getBundleExtra(ServiceContext.EXTRA_BUNDLE);
		IBinder serverReadyBinder = binders.getBinder(ServiceContext.EXTRA_BUNDLE_SERVER_READY_BINDER);
		String packageName = binders.getString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME);
		
		ServerReadyNotifier serverReadyNotifier = new ServerReadyNotifier(packageName,serverReadyBinder);
		serverReadyNotifier.runInCoreThread();
		
	}
	
}