android.os.Parcel#writeStrongBinder ( )源码实例Demo

下面列出了android.os.Parcel#writeStrongBinder ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TelePlus-Android   文件: ICustomTabsService.java
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;
}
 
源代码2 项目: TelePlus-Android   文件: ICustomTabsService.java
public boolean requestPostMessageChannel(ICustomTabsCallback callback, Uri postMessageOrigin) 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(postMessageOrigin != null) {
            _data.writeInt(1);
            postMessageOrigin.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(7, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
源代码3 项目: android_9.0.0_r45   文件: DragEvent.java
/**
 * Creates a {@link android.os.Parcel} object from this DragEvent object.
 * @param dest A {@link android.os.Parcel} object in which to put the DragEvent object.
 * @param flags Flags to store in the Parcel.
 */
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(mAction);
    dest.writeFloat(mX);
    dest.writeFloat(mY);
    dest.writeInt(mDragResult ? 1 : 0);
    if (mClipData == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        mClipData.writeToParcel(dest, flags);
    }
    if (mClipDescription == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        mClipDescription.writeToParcel(dest, flags);
    }
    if (mDragAndDropPermissions == null) {
        dest.writeInt(0);
    } else {
        dest.writeInt(1);
        dest.writeStrongBinder(mDragAndDropPermissions.asBinder());
    }
}
 
源代码4 项目: Telegram-FOSS   文件: ICustomTabsService.java
public boolean newSession(ICustomTabsCallback callback) 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);
        this.mRemote.transact(3, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
源代码5 项目: TelePlus-Android   文件: ICustomTabsService.java
public boolean requestPostMessageChannel(ICustomTabsCallback callback, Uri postMessageOrigin) 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(postMessageOrigin != null) {
            _data.writeInt(1);
            postMessageOrigin.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(7, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
源代码6 项目: android_9.0.0_r45   文件: JobParameters.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(jobId);
    dest.writePersistableBundle(extras);
    dest.writeBundle(transientExtras);
    if (clipData != null) {
        dest.writeInt(1);
        clipData.writeToParcel(dest, flags);
        dest.writeInt(clipGrantFlags);
    } else {
        dest.writeInt(0);
    }
    dest.writeStrongBinder(callback);
    dest.writeInt(overrideDeadlineExpired ? 1 : 0);
    dest.writeTypedArray(mTriggeredContentUris, flags);
    dest.writeStringArray(mTriggeredContentAuthorities);
    if (network != null) {
        dest.writeInt(1);
        network.writeToParcel(dest, flags);
    } else {
        dest.writeInt(0);
    }
    dest.writeInt(stopReason);
    dest.writeString(debugStopReason);
}
 
源代码7 项目: TelePlus-Android   文件: IPostMessageService.java
public void onPostMessage(ICustomTabsCallback callback, String message, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    try {
        _data.writeInterfaceToken("android.support.customtabs.IPostMessageService");
        _data.writeStrongBinder(callback != null?callback.asBinder():null);
        _data.writeString(message);
        if(extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(3, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

}
 
源代码8 项目: Telegram   文件: ICustomTabsService.java
public int postMessage(ICustomTabsCallback callback, String message, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    int _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null?callback.asBinder():null);
        _data.writeString(message);
        if(extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(8, _data, _reply, 0);
        _reply.readException();
        _result = _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
源代码9 项目: TelePlus-Android   文件: ICustomTabsService.java
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;
}
 
源代码10 项目: android_9.0.0_r45   文件: OperationResult.java
@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeInt(resultCode);
    out.writeStrongBinder(token);
    out.writeLong(operationHandle);
    out.writeInt(inputConsumed);
    out.writeByteArray(output);
    outParams.writeToParcel(out, flags);
}
 
源代码11 项目: Telegram-FOSS   文件: ICustomTabsService.java
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;
}
 
源代码12 项目: TelePlus-Android   文件: ICustomTabsService.java
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;
}
 
源代码13 项目: Telegram   文件: ICustomTabsService.java
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;
}
 
源代码14 项目: letv   文件: MediaSessionCompat.java
public void writeToParcel(Parcel dest, int flags) {
    if (VERSION.SDK_INT >= 21) {
        dest.writeParcelable((Parcelable) this.mInner, flags);
    } else {
        dest.writeStrongBinder((IBinder) this.mInner);
    }
}
 
源代码15 项目: android_9.0.0_r45   文件: PendingIntent.java
/**
 * Convenience function for writing either a PendingIntent or null pointer to
 * a Parcel.  You must use this with {@link #readPendingIntentOrNullFromParcel}
 * for later reading it.
 *
 * @param sender The PendingIntent to write, or null.
 * @param out Where to write the PendingIntent.
 */
public static void writePendingIntentOrNullToParcel(@Nullable PendingIntent sender,
        @NonNull Parcel out) {
    out.writeStrongBinder(sender != null ? sender.mTarget.asBinder() : null);
    if (sender != null) {
        OnMarshaledListener listener = sOnMarshaledListener.get();
        if (listener != null) {
            listener.onMarshaled(sender, out, 0 /* flags */);
        }
    }
}
 
源代码16 项目: ParcelableGenerator   文件: ParcelUtil.java
private static void writeValueInternal(Parcel dest, Object v) {
    if (v == null) {
        dest.writeInt(VAL_NULL);
    } else if (v instanceof String) {
        dest.writeInt(VAL_STRING);
        dest.writeString((String) v);
    } else if (v instanceof Integer) {
        dest.writeInt(VAL_INTEGER);
        dest.writeInt((Integer) v);
    } else if (v instanceof Map) {
        dest.writeInt(VAL_MAP);
        writeMap(dest, (Map) v);
    } else if (v instanceof Bundle) {
        // Must be before Parcelable
        dest.writeInt(VAL_BUNDLE);
        dest.writeBundle((Bundle) v);
    } else if (v instanceof Parcelable) {
        dest.writeInt(VAL_PARCELABLE);
        dest.writeParcelable((Parcelable) v, 0);
    } else if (v instanceof Short) {
        dest.writeInt(VAL_SHORT);
        dest.writeInt(((Short) v).intValue());
    } else if (v instanceof Long) {
        dest.writeInt(VAL_LONG);
        dest.writeLong((Long) v);
    } else if (v instanceof Float) {
        dest.writeInt(VAL_FLOAT);
        dest.writeFloat((Float) v);
    } else if (v instanceof Double) {
        dest.writeInt(VAL_DOUBLE);
        dest.writeDouble((Double) v);
    } else if (v instanceof Boolean) {
        dest.writeInt(VAL_BOOLEAN);
        dest.writeInt((Boolean) v ? 1 : 0);
    } else if (v instanceof CharSequence) {
        // Must be after String
        dest.writeInt(VAL_CHARSEQUENCE);
        TextUtils.writeToParcel((CharSequence) v, dest, 0);
    } else if (v instanceof List) {
        dest.writeInt(VAL_LIST);
        writeList(dest, (List) v);
    } else if (v instanceof SparseArray) {
        dest.writeInt(VAL_SPARSEARRAY);
        writeSparseArray(dest, (SparseArray<Object>) v);
    } else if (v instanceof boolean[]) {
        dest.writeInt(VAL_BOOLEANARRAY);
        dest.writeBooleanArray((boolean[]) v);
    } else if (v instanceof byte[]) {
        dest.writeInt(VAL_BYTEARRAY);
        dest.writeByteArray((byte[]) v);
    } else if (v instanceof String[]) {
        dest.writeInt(VAL_STRINGARRAY);
        dest.writeStringArray((String[]) v);
    } else if (v instanceof CharSequence[]) {
        // Must be after String[] and before Object[]
        dest.writeInt(VAL_CHARSEQUENCEARRAY);
        CharSequence[] val = (CharSequence[]) v;
        int N = val.length;
        dest.writeInt(N);
        for (int i = 0; i < N; i++) {
            TextUtils.writeToParcel((CharSequence) val[i], dest, 0);
        }
    } else if (v instanceof IBinder) {
        dest.writeInt(VAL_IBINDER);
        dest.writeStrongBinder((IBinder) v);
    } else if (v instanceof Parcelable[]) {
        dest.writeInt(VAL_PARCELABLEARRAY);
        dest.writeParcelableArray((Parcelable[]) v, 0);
    } else if (v instanceof Object[]) {
        dest.writeInt(VAL_OBJECTARRAY);
        writeArray(dest, (Object[]) v);
    } else if (v instanceof int[]) {
        dest.writeInt(VAL_INTARRAY);
        dest.writeIntArray((int[]) v);
    } else if (v instanceof long[]) {
        dest.writeInt(VAL_LONGARRAY);
        dest.writeLongArray((long[]) v);
    } else if (v instanceof Byte) {
        dest.writeInt(VAL_BYTE);
        dest.writeInt((Byte) v);
    } else if (v instanceof Serializable) {
        // Must be last
        dest.writeInt(VAL_SERIALIZABLE);
        dest.writeSerializable((Serializable) v);
    } else {
        throw new RuntimeException("Parcel: unable to marshal value " + v);
    }
}
 
源代码17 项目: external-nfc-api   文件: Acr1251UReader.java
@Override
public void writeToParcel(Parcel dest, int flags) {
	dest.writeString(name);
	dest.writeStrongBinder(readerControl.asBinder());
}
 
源代码18 项目: android_9.0.0_r45   文件: WindowId.java
public void writeToParcel(Parcel out, int flags) {
    out.writeStrongBinder(mToken.asBinder());
}
 
@Override
public void writeToParcel(Parcel parcel, int flags) {
  parcel.writeStrongBinder(binder);
}
 
源代码20 项目: springreplugin   文件: ParcelBinder.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeStrongBinder(mBinder);
}
 
 方法所在类
 同类方法