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


Java Parcel.readStrongBinder方法代码示例

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


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

示例1: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    try {
        switch (code) {
            case INTERFACE_TRANSACTION: {
                reply.writeString(DESCRIPTOR);
                return true;
            }
            case TRANSACTION_subscribe_0: {
                data.enforceInterface(DESCRIPTOR);
                RemoteEventListener arg_stb_0;
                arg_stb_0 = new RemoteEventListener_Proxy(data.readStrongBinder());
                serviceImpl.subscribe(arg_stb_0);
                return true;
            }
            case TRANSACTION_unsubscribe_1: {
                data.enforceInterface(DESCRIPTOR);
                serviceImpl.unsubscribe();
                return true;
            }
        }
    } catch (Exception re) {
    }
    return super.onTransact(code, data, reply, flags);
}
 
开发者ID:josesamuel,项目名称:RxRemote,代码行数:26,代码来源:RemoteEventManager_Stub.java

示例2: findService

import android.os.Parcel; //导入方法依赖的package包/类
private IBinder findService(String name){
	Parcel data = Parcel.obtain();
	data.writeString(name);
	Parcel reply = Parcel.obtain();
	try {
		mRemoteServiceManager.transact(ServiceContext.GET_SERVICE, data, reply, 0);
		IBinder service = reply.readStrongBinder();
		log("getService result binder = " + service);
		return service;
	} catch (RemoteException e) {
		e.printStackTrace();
		log("getService exception");
		return null;
	} finally {
		data.recycle();
		reply.recycle();
	}
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:19,代码来源:ServiceManagerImpl.java

示例3: createFromParcel

import android.os.Parcel; //导入方法依赖的package包/类
public Token createFromParcel(Parcel in) {
    Object readParcelable;
    if (VERSION.SDK_INT >= 21) {
        readParcelable = in.readParcelable(null);
    } else {
        readParcelable = in.readStrongBinder();
    }
    return new Token(readParcelable);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:MediaSessionCompat.java

示例4: PendingResultData

import android.os.Parcel; //导入方法依赖的package包/类
protected PendingResultData(Parcel in) {
    this.mType = in.readInt();
    this.mOrderedHint = in.readByte() != 0;
    this.mInitialStickyHint = in.readByte() != 0;
    this.mToken = in.readStrongBinder();
    this.mSendingUser = in.readInt();
    this.mFlags = in.readInt();
    this.mResultCode = in.readInt();
    this.mResultData = in.readString();
    this.mResultExtras = in.readBundle();
    this.mAbortBroadcast = in.readByte() != 0;
    this.mFinished = in.readByte() != 0;
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:14,代码来源:PendingResultData.java

示例5: GcmIntentParser

import android.os.Parcel; //导入方法依赖的package包/类
/**
 * Iterates over the map looking for the {@link #BUNDLE_KEY_CALLBACK} key to try and read the {@link IBinder}
 * straight from the parcelled data. This is entirely dependent on the implementation of Parcel, but these specific
 * parts of {@link Parcel} / {@link Bundle} haven't changed since 2008 and newer versions of Android will ship
 * with newer versions of Google Play services which embed the IBinder directly into the {@link Bundle}
 * (no need to deal with the {@link android.os.Parcelable} issues).
 */
GcmIntentParser(Bundle data) throws RuntimeException {
    if (data == null) {
        throw new IllegalArgumentException();
    }

    jobId = Integer.valueOf(data.getString(BUNDLE_KEY_TAG));

    extras = data.getBundle(BUNDLE_KEY_EXTRAS);

    triggeredContentUris = data.getParcelableArrayList(BUNDLE_KEY_TRIGGERED_URIS);

    if (triggeredContentUris != null) {
        triggeredContentAuthorities = new ArrayList<>();
        for (Uri triggeredContentUri : triggeredContentUris) {
            triggeredContentAuthorities.add(triggeredContentUri.getAuthority());
        }
    }

    Parcel parcel = toParcel(data);
    try {
        int numEntries = checkNonEmptyBundleHeader(parcel);
        for (int i = 0; i < numEntries; i++) {
            String key = null;
            if (shouldReadKeysAsStrings()) {
                key = parcel.readString();
            } else {
                Object entryKeyObj = parcel.readValue(getClass().getClassLoader());
                if (entryKeyObj instanceof String) {
                    key = (String) entryKeyObj;
                }
            }

            if (key == null) {
                continue;
            }

            if (BUNDLE_KEY_CALLBACK.equals(key)
                    && parcel.readInt() == VAL_PARCELABLE
                    && PENDING_CALLBACK_CLASS.equals(parcel.readString())) {
                callback = parcel.readStrongBinder();
                break;
            }
        }
    } finally {
        parcel.recycle();
    }

    if (extras == null || callback == null) {
        throw new IllegalArgumentException();
    }
}
 
开发者ID:Doist,项目名称:JobSchedulerCompat,代码行数:59,代码来源:GcmIntentParser.java

示例6: ContentProviderHolder

import android.os.Parcel; //导入方法依赖的package包/类
protected ContentProviderHolder(Parcel in) {
    info = in.readParcelable(ProviderInfo.class.getClassLoader());
    connection = in.readStrongBinder();
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:5,代码来源:ContentProviderHolder.java

示例7: ParcelBinder

import android.os.Parcel; //导入方法依赖的package包/类
private ParcelBinder(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:4,代码来源:ParcelBinder.java

示例8: BinderParcelable

import android.os.Parcel; //导入方法依赖的package包/类
BinderParcelable(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:4,代码来源:BinderCursor.java

示例9: BinderParcel

import android.os.Parcel; //导入方法依赖的package包/类
private BinderParcel(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
开发者ID:devyok,项目名称:IPCServiceManager,代码行数:4,代码来源:BinderParcel.java

示例10: onTransact

import android.os.Parcel; //导入方法依赖的package包/类
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply,
		int flags) throws RemoteException {
	
	
	if(code == ServiceContext.SERVER_READY) {
		
		IBinder remoteServiceManager = data.readStrongBinder();
		
		final ServiceManagerImpl clientServiceManager = ServiceManagerImpl.createLocalServiceManager(sClientContext, remoteServiceManager);
		
		Log.i("ServiceInitializeNotifier", "[Bundle Trasanct] "+getLocalSerivceManagerPackage()+" CommandCallback ok ");
		
		CoreThread.getHandler().post(new Runnable() {
			
			@Override
			public void run() {
				
				notifyAllListeners(clientServiceManager);
				
			}
		});
		
		reply.writeInt(ServiceContext.SUCCESS);
		
		sServerInitTime = (System.currentTimeMillis() - startTime);
		
	}
	
	return true;
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:32,代码来源:ServiceManagerImpl.java


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