当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.putBinder方法代码示例

本文整理汇总了Java中android.os.Bundle.putBinder方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putBinder方法的具体用法?Java Bundle.putBinder怎么用?Java Bundle.putBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putBinder方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendCommand

import android.os.Bundle; //导入方法依赖的package包/类
public static void sendCommand(Context context,ResolveInfo resolveInfo,int cmd) {
	
	ServiceInfo serviceInfo = resolveInfo.serviceInfo;
	String sender = serviceInfo.packageName;
	Intent intent = new Intent();
	intent.setAction(serviceInfo.packageName+"._SERVICE_");
	intent.setPackage(sender);
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_BINDER, ServiceManagerThread.getDefault());
	binderBunder.putString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME, sender);
	
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, cmd);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendCommand start service pkg name = "+serviceInfo.packageName+", class name = " + serviceInfo.name);
	
	ComponentName componentName = context.startService(intent);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendCommand start service result = " + componentName);
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:21,代码来源:RemoteCommandSender.java

示例2: sendServerCommand

import android.os.Bundle; //导入方法依赖的package包/类
public static void sendServerCommand(Context context,int cmd,IBinder callback){
	Intent intent = new Intent();
	intent.setAction(ServiceContext.ACTION_REMOTE_CLIENT_COMMAND);
	intent.setPackage(ServiceContext.SERVER_PACKAGE_NAME);
	
	String sender = context.getPackageName();
	
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_SERVER_READY_BINDER, callback);
	binderBunder.putString(ServiceContext.EXTRA_BUNDLE_PACKAGE_NAME, sender);
	
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, cmd);
	
	ComponentName componentName = context.startService(intent);
	
	LogControler.print(Level.INFO, "[RemoteCommandSender] "+sender+" sendServerCommand start service result = " + componentName);
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:19,代码来源:RemoteCommandSender.java

示例3: attachToActivityManagerService

import android.os.Bundle; //导入方法依赖的package包/类
private static void attachToActivityManagerService(Context context) {
	
	LogControler.print(Level.INFO, "[ServerManagerThread] attach To ActivityManagerService");
	
	Intent intent = new Intent(ServiceContext.ACTION_RECEIVE_SERVICE_MANAGER);
	Bundle binderBunder = new Bundle();
	binderBunder.putBinder(ServiceContext.EXTRA_BUNDLE_BINDER, ServiceManagerThread.getDefault());
	intent.putExtra(ServiceContext.EXTRA_BUNDLE, binderBunder);
	intent.putExtra(ServiceContext.EXTRA_COMMAND, ServiceContext.CMD_CREATE_CLIENT_SERVICE_MANAGER);
	context.sendStickyBroadcast(intent);
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:12,代码来源:ServiceManagerThread.java

示例4: writeRemoter

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Writes the @Remoter data
 */
private void writeRemoter(Object data, Bundle bundle, String keyPrefix) throws Exception {
    Class remoterInterfaceClass = getRemoterBinder(data);
    if (remoterInterfaceClass != null) {
        Class remoterStubClass = Class.forName(remoterInterfaceClass.getName() + "_Stub");
        Constructor constructor = remoterStubClass.getConstructor(remoterInterfaceClass);
        IBinder binder = (IBinder) constructor.newInstance(data);
        bundle.putString(RemoteEventManager.REMOTE_DATA_EXTRA + keyPrefix, remoterInterfaceClass.getName());
        bundle.putBinder(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix, binder);
    }
}
 
开发者ID:josesamuel,项目名称:RxRemote,代码行数:14,代码来源:RemoteEventController.java

示例5: putBinder

import android.os.Bundle; //导入方法依赖的package包/类
public static void putBinder(Bundle bundle, String key, IBinder value) {
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        bundle.putBinder(key, value);
    } else {
        try {
            ReflectUtil.invoke(Bundle.class, bundle, "putIBinder", new Class[]{String.class, IBinder.class}, key, value);
        } catch (Exception e) {
        }
    }
}
 
开发者ID:didi,项目名称:VirtualAPK,代码行数:11,代码来源:PluginUtil.java

示例6: putBinder

import android.os.Bundle; //导入方法依赖的package包/类
public static void putBinder(Bundle bundle, String key, IBinder value) {
	if (Build.VERSION.SDK_INT >= 18) {
		bundle.putBinder(key, value);
	} else {
		mirror.android.os.Bundle.putIBinder.call(bundle, key, value);
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:8,代码来源:BundleCompat.java

示例7: putBinder

import android.os.Bundle; //导入方法依赖的package包/类
public static void putBinder(Bundle bundle, String key, IBinder value) {
    if (Build.VERSION.SDK_INT >= 18) {
        bundle.putBinder(key, value);
    } else {
        mirror.android.os.Bundle.putIBinder.call(bundle, key, value);
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:8,代码来源:BundleCompat.java

示例8: putBinder

import android.os.Bundle; //导入方法依赖的package包/类
public static void putBinder(Bundle bundle, String key, IBinder binder) {
    bundle.putBinder(key, binder);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:BundleCompatJellybeanMR2.java

示例9: send

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Bundle send(Bundle bundle) {
	
	bundle.putBinder(ServiceContext.EXTRA_CALLBACK, new IBinderCallback(mCallback));
	
	return mBundleSender.send(bundle);
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:8,代码来源:BundleSendDecorator.java


注:本文中的android.os.Bundle.putBinder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。