本文整理汇总了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);
}
示例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();
}
}
示例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);
}
示例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;
}
示例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();
}
}
示例6: ContentProviderHolder
import android.os.Parcel; //导入方法依赖的package包/类
protected ContentProviderHolder(Parcel in) {
info = in.readParcelable(ProviderInfo.class.getClassLoader());
connection = in.readStrongBinder();
}
示例7: ParcelBinder
import android.os.Parcel; //导入方法依赖的package包/类
private ParcelBinder(Parcel source) {
mBinder = source.readStrongBinder();
}
示例8: BinderParcelable
import android.os.Parcel; //导入方法依赖的package包/类
BinderParcelable(Parcel source) {
mBinder = source.readStrongBinder();
}
示例9: BinderParcel
import android.os.Parcel; //导入方法依赖的package包/类
private BinderParcel(Parcel source) {
mBinder = source.readStrongBinder();
}
示例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;
}