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

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

源代码1 项目: android_9.0.0_r45   文件: SoundTrigger.java
/** @hide */
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(status);
    dest.writeInt(soundModelHandle);
    dest.writeByte((byte) (captureAvailable ? 1 : 0));
    dest.writeInt(captureSession);
    dest.writeInt(captureDelayMs);
    dest.writeInt(capturePreambleMs);
    dest.writeByte((byte) (triggerInData ? 1 : 0));
    if (captureFormat != null) {
        dest.writeByte((byte)1);
        dest.writeInt(captureFormat.getSampleRate());
        dest.writeInt(captureFormat.getEncoding());
        dest.writeInt(captureFormat.getChannelMask());
    } else {
        dest.writeByte((byte)0);
    }
    dest.writeBlob(data);
}
 
源代码2 项目: android_9.0.0_r45   文件: SoundTrigger.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(status);
    dest.writeInt(soundModelHandle);
    dest.writeByte((byte) (captureAvailable ? 1 : 0));
    dest.writeInt(captureSession);
    dest.writeInt(captureDelayMs);
    dest.writeInt(capturePreambleMs);
    dest.writeByte((byte) (triggerInData ? 1 : 0));
    if (captureFormat != null) {
        dest.writeByte((byte)1);
        dest.writeInt(captureFormat.getSampleRate());
        dest.writeInt(captureFormat.getEncoding());
        dest.writeInt(captureFormat.getChannelMask());
    } else {
        dest.writeByte((byte)0);
    }
    dest.writeBlob(data);
    dest.writeTypedArray(keyphraseExtras, flags);
}
 
源代码3 项目: android_9.0.0_r45   文件: RecommendationInfo.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeCharSequence(mPackageName);
    dest.writeCharSequence(mName);

    int numDiscoveredPrinters = mDiscoveredPrinters.size();
    dest.writeInt(numDiscoveredPrinters);

    for (InetAddress printer : mDiscoveredPrinters) {
        dest.writeBlob(printer.getAddress());
    }

    dest.writeByte((byte) (mRecommendsMultiVendorService ? 1 : 0));
}
 
源代码4 项目: android_9.0.0_r45   文件: SoundTrigger.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(uuid.toString());
    if (vendorUuid == null) {
        dest.writeInt(-1);
    } else {
        dest.writeInt(vendorUuid.toString().length());
        dest.writeString(vendorUuid.toString());
    }
    dest.writeBlob(data);
    dest.writeTypedArray(keyphrases, flags);
}
 
源代码5 项目: android_9.0.0_r45   文件: SoundTrigger.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(uuid.toString());
    if (vendorUuid == null) {
        dest.writeInt(-1);
    } else {
        dest.writeInt(vendorUuid.toString().length());
        dest.writeString(vendorUuid.toString());
    }
    dest.writeBlob(data);
}
 
源代码6 项目: android_9.0.0_r45   文件: SoundTrigger.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeByte((byte) (captureRequested ? 1 : 0));
    dest.writeByte((byte) (allowMultipleTriggers ? 1 : 0));
    dest.writeTypedArray(keyphrases, flags);
    dest.writeBlob(data);
}
 
源代码7 项目: android_9.0.0_r45   文件: UsageEvents.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    Parcel data = Parcel.obtain();
    data.writeInt(mEventCount);
    data.writeInt(mIndex);
    if (mEventCount > 0) {
        data.writeStringArray(mStringPool);

        if (mEventsToWrite != null) {
            // Write out the events
            Parcel p = Parcel.obtain();
            try {
                p.setDataPosition(0);
                for (int i = 0; i < mEventCount; i++) {
                    final Event event = mEventsToWrite.get(i);
                    writeEventToParcel(event, p, flags);
                }

                final int listByteLength = p.dataPosition();

                // Write the total length of the data.
                data.writeInt(listByteLength);

                // Write our current position into the data.
                data.writeInt(0);

                // Write the data.
                data.appendFrom(p, 0, listByteLength);
            } finally {
                p.recycle();
            }

        } else if (mParcel != null) {
            // Write the total length of the data.
            data.writeInt(mParcel.dataSize());

            // Write out current position into the data.
            data.writeInt(mParcel.dataPosition());

            // Write the data.
            data.appendFrom(mParcel, 0, mParcel.dataSize());
        } else {
            throw new IllegalStateException(
                    "Either mParcel or mEventsToWrite must not be null");
        }
    }
    // Data can be too large for a transact. Write the data as a Blob, which will be written to
    // ashmem if too large.
    dest.writeBlob(data.marshall());
}
 
源代码8 项目: android_9.0.0_r45   文件: SoundTrigger.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(status);
    dest.writeInt(soundModelHandle);
    dest.writeBlob(data);
}
 
 方法所在类
 同类方法