本文整理汇总了C++中Parcel::writeInterfaceToken方法的典型用法代码示例。如果您正苦于以下问题:C++ Parcel::writeInterfaceToken方法的具体用法?C++ Parcel::writeInterfaceToken怎么用?C++ Parcel::writeInterfaceToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parcel
的用法示例。
在下文中一共展示了Parcel::writeInterfaceToken方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getParameter
status_t getParameter(int key, Parcel *reply)
{
Parcel data;
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
data.writeInt32(key);
return remote()->transact(GET_PARAMETER, data, reply);
}
示例2: resume
status_t resume() {
Parcel request;
request.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
Parcel reply;
remote()->transact(RESUME, request, &reply);
return reply.readInt32();
}
示例3: suspend
status_t suspend() {
Parcel request;
request.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
Parcel reply;
remote()->transact(SUSPEND, request, &reply);
return reply.readInt32();
}
示例4: getMetadata
status_t getMetadata(bool update_only, bool apply_filter, Parcel *reply)
{
Parcel request;
request.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
// TODO: Burning 2 ints for 2 boolean. Should probably use flags in an int here.
request.writeInt32(update_only);
request.writeInt32(apply_filter);
remote()->transact(GET_METADATA, request, reply);
return reply->readInt32();
}
示例5: android_os_Parcel_writeInterfaceToken
static void android_os_Parcel_writeInterfaceToken(JNIEnv* env, jclass clazz, jint nativePtr,
jstring name)
{
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
if (parcel != NULL) {
// In the current implementation, the token is just the serialized interface name that
// the caller expects to be invoking
const jchar* str = env->GetStringCritical(name, 0);
if (str != NULL) {
parcel->writeInterfaceToken(String16((const char16_t*)str, env->GetStringLength(name)));
env->ReleaseStringCritical(name, str);
}
}
}
示例6: pullBatteryData
virtual status_t pullBatteryData(Parcel* reply) {
Parcel data;
data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor());
return remote()->transact(PULL_BATTERY_DATA, data, reply);
}