本文整理汇总了Java中android.os.Parcel.writeStrongBinder方法的典型用法代码示例。如果您正苦于以下问题:Java Parcel.writeStrongBinder方法的具体用法?Java Parcel.writeStrongBinder怎么用?Java Parcel.writeStrongBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Parcel
的用法示例。
在下文中一共展示了Parcel.writeStrongBinder方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: managedSelf
import android.os.Parcel; //导入方法依赖的package包/类
private void managedSelf(String packageName) {
log("managedSelf package name = " + packageName);
Parcel data = Parcel.obtain();
data.writeString(packageName);
data.writeStrongBinder(this);
Parcel reply = Parcel.obtain();
try {
mRemoteServiceManager.transact(ServiceContext.MANAGED_CLIENT_SIVMGR, data, reply, 0);
} catch (RemoteException e) {
e.printStackTrace();
log("managedSelf exception");
}finally {
data.recycle();
reply.recycle();
}
}
示例2: updateVisuals
import android.os.Parcel; //导入方法依赖的package包/类
public boolean updateVisuals(ICustomTabsCallback callback, Bundle bundle) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
if (bundle != null) {
_data.writeInt(1);
bundle.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(6, _data, _reply, 0);
_reply.readException();
_result = 0 != _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
示例3: executeService
import android.os.Parcel; //导入方法依赖的package包/类
private void executeService(int jobId) {
Intent intent = new Intent(GcmJobService.ACTION_EXECUTE);
intent.putExtra(GcmIntentParser.BUNDLE_KEY_TAG, String.valueOf(jobId));
intent.putExtra(GcmIntentParser.BUNDLE_KEY_EXTRAS, Bundle.EMPTY);
Parcel parcel = Parcel.obtain();
try {
parcel.writeStrongBinder(new Binder());
parcel.setDataPosition(0);
intent.putExtra(GcmIntentParser.BUNDLE_KEY_CALLBACK, new PendingCallback(parcel));
} finally {
parcel.recycle();
}
service.onStartCommand(intent, 0, 0);
}
示例4: unregisterCallback
import android.os.Parcel; //导入方法依赖的package包/类
public final void unregisterCallback(IRemoteServiceCallback iRemoteServiceCallback) throws RemoteException {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken(Stub.DESCRIPTOR);
obtain.writeStrongBinder(iRemoteServiceCallback != null ? iRemoteServiceCallback.asBinder() : null);
this.a.transact(4, obtain, obtain2, 0);
obtain2.readException();
} finally {
obtain2.recycle();
obtain.recycle();
}
}
示例5: mayLaunchUrl
import android.os.Parcel; //导入方法依赖的package包/类
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
if (url != null) {
_data.writeInt(1);
url.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeTypedList(otherLikelyBundles);
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
_result = 0 != _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
示例6: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.mType);
dest.writeByte(this.mOrderedHint ? (byte) 1 : (byte) 0);
dest.writeByte(this.mInitialStickyHint ? (byte) 1 : (byte) 0);
dest.writeStrongBinder(this.mToken);
dest.writeInt(this.mSendingUser);
dest.writeInt(this.mFlags);
dest.writeInt(this.mResultCode);
dest.writeString(this.mResultData);
dest.writeBundle(this.mResultExtras);
dest.writeByte(this.mAbortBroadcast ? (byte) 1 : (byte) 0);
dest.writeByte(this.mFinished ? (byte) 1 : (byte) 0);
}
示例7: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
info.writeToParcel(dest, 0);
if (provider != null) {
dest.writeStrongBinder(provider.asBinder());
} else {
dest.writeStrongBinder(null);
}
dest.writeStrongBinder(connection);
dest.writeInt(noReleaseNeeded ? 1:0);
}
示例8: registerDeviceCallback
import android.os.Parcel; //导入方法依赖的package包/类
public void registerDeviceCallback(String deviceId, DeviceCallback callback, int events) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(deviceId);
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
_data.writeInt(events);
this.mRemote.transact(5, _data, _reply, 0);
ExceptionUtils.readExceptionFromParcel(_reply);
} finally {
_reply.recycle();
_data.recycle();
}
}
示例9: registerCallbackListener
import android.os.Parcel; //导入方法依赖的package包/类
public void registerCallbackListener(IMediaControllerCallback cb) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeStrongBinder(cb != null ? cb.asBinder() : null);
this.mRemote.transact(3, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例10: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
public void writeToParcel(Parcel dest, int flags) {
if (VERSION.SDK_INT >= 21) {
dest.writeParcelable((Parcelable) this.mInner, flags);
} else {
dest.writeStrongBinder((IBinder) this.mInner);
}
}
示例11: readPendingIntent
import android.os.Parcel; //导入方法依赖的package包/类
public static PendingIntent readPendingIntent(IBinder binder) {
Parcel parcel = Parcel.obtain();
parcel.writeStrongBinder(binder);
parcel.setDataPosition(0);
try {
return PendingIntent.readPendingIntentOrNullFromParcel(parcel);
} finally {
parcel.recycle();
}
}
示例12: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
public void writeToParcel(Parcel out, int flags) {
synchronized (this) {
if (this.mReceiver == null) {
this.mReceiver = new MyResultReceiver();
}
out.writeStrongBinder(this.mReceiver.asBinder());
}
}
示例13: unregisterCallbackListener
import android.os.Parcel; //导入方法依赖的package包/类
public void unregisterCallbackListener(IMediaControllerCallback cb) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeStrongBinder(cb != null ? cb.asBinder() : null);
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例14: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeStrongBinder(mBinder);
}