Java Code Examples for android.os.Parcel.writeStrongBinder()

The following are Jave code examples for showing how to use writeStrongBinder() of the android.os.Parcel 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: DroidIPC   File: ServiceManagerImpl.java   View Source Code Vote up 6 votes
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();
	}
	
}
 
Example 2
Project: PlusGram   File: ICustomTabsService.java   View Source Code Vote up 6 votes
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;
}
 
Example 3
Project: JobSchedulerCompat   File: GcmJobServiceTest.java   View Source Code Vote up 5 votes
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);
}
 
Example 4
Project: boohee_v5.6   File: IAlixPay.java   View Source Code Vote up 5 votes
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();
    }
}
 
Example 5
Project: airgram   File: ICustomTabsService.java   View Source Code Vote up 5 votes
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;
}
 
Example 6
Project: TPlayer   File: PendingResultData.java   View Source Code Vote up 5 votes
@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);
}
 
Example 7
Project: atlas   File: IActivityManager.java   View Source Code Vote up 5 votes
@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);
}
 
Example 8
Project: letv   File: RemoteDeviceManager.java   View Source Code Vote up 5 votes
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();
    }
}
 
Example 9
Project: boohee_v5.6   File: IMediaSession.java   View Source Code Vote up 5 votes
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();
    }
}
 
Example 10
Project: boohee_v5.6   File: MediaSessionCompat.java   View Source Code Vote up 5 votes
public void writeToParcel(Parcel dest, int flags) {
    if (VERSION.SDK_INT >= 21) {
        dest.writeParcelable((Parcelable) this.mInner, flags);
    } else {
        dest.writeStrongBinder((IBinder) this.mInner);
    }
}
 
Example 11
Project: container   File: PendingIntentData.java   View Source Code Vote up 5 votes
public static PendingIntent readPendingIntent(IBinder binder) {
    Parcel parcel = Parcel.obtain();
    parcel.writeStrongBinder(binder);
    parcel.setDataPosition(0);
    try {
        return PendingIntent.readPendingIntentOrNullFromParcel(parcel);
    } finally {
        parcel.recycle();
    }
}
 
Example 12
Project: letv   File: ResultReceiver.java   View Source Code Vote up 5 votes
public void writeToParcel(Parcel out, int flags) {
    synchronized (this) {
        if (this.mReceiver == null) {
            this.mReceiver = new MyResultReceiver();
        }
        out.writeStrongBinder(this.mReceiver.asBinder());
    }
}
 
Example 13
Project: letv   File: IMediaSession.java   View Source Code Vote up 5 votes
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();
    }
}
 
Example 14
Project: letv   File: MediaSessionCompat.java   View Source Code Vote up 5 votes
public void writeToParcel(Parcel dest, int flags) {
    if (VERSION.SDK_INT >= 21) {
        dest.writeParcelable((Parcelable) this.mInner, flags);
    } else {
        dest.writeStrongBinder((IBinder) this.mInner);
    }
}
 
Example 15
Project: VirtualHook   File: PendingIntentData.java   View Source Code Vote up 5 votes
public static PendingIntent readPendingIntent(IBinder binder) {
    Parcel parcel = Parcel.obtain();
    parcel.writeStrongBinder(binder);
    parcel.setDataPosition(0);
    try {
        return PendingIntent.readPendingIntentOrNullFromParcel(parcel);
    } finally {
        parcel.recycle();
    }
}
 
Example 16
Project: VirtualHook   File: PendingResultData.java   View Source Code Vote up 5 votes
@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);
}
 
Example 17
Project: PlusGram   File: ICustomTabsService.java   View Source Code Vote up 5 votes
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;
}
 
Example 18
Project: TPlayer   File: PendingIntentData.java   View Source Code Vote up 5 votes
public static PendingIntent readPendingIntent(IBinder binder) {
    Parcel parcel = Parcel.obtain();
    parcel.writeStrongBinder(binder);
    parcel.setDataPosition(0);
    try {
        return PendingIntent.readPendingIntentOrNullFromParcel(parcel);
    } finally {
        parcel.recycle();
    }
}
 
Example 19
Project: IPCServiceManager   File: BinderParcel.java   View Source Code Vote up 4 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeStrongBinder(mBinder);
}
 
Example 20
Project: springreplugin   File: ParcelBinder.java   View Source Code Vote up 4 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeStrongBinder(mBinder);
}