本文整理汇总了Java中com.google.protos.ipc.invalidation.AndroidService.InternalDowncall类的典型用法代码示例。如果您正苦于以下问题:Java InternalDowncall类的具体用法?Java InternalDowncall怎么用?Java InternalDowncall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InternalDowncall类属于com.google.protos.ipc.invalidation.AndroidService包,在下文中一共展示了InternalDowncall类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toCompactString
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Appends a description of the given internal {@code downcall} to the given {@code builder}. */
public static TextBuilder toCompactString(TextBuilder builder,
InternalDowncall downcall) {
if (downcall == null) {
return builder;
}
builder.append(ProtocolIntents.INTERNAL_DOWNCALL_KEY).append("::");
if (downcall.hasServerMessage()) {
toCompactString(builder, downcall.getServerMessage());
} else if (downcall.hasNetworkStatus()) {
toCompactString(builder, downcall.getNetworkStatus());
} else if (downcall.hasNetworkAddrChange()) {
builder.append("newtworkAddrChange()");
} else if (downcall.hasCreateClient()) {
toCompactString(builder, downcall.getCreateClient());
} else {
builder.append(UNKNOWN_MESSAGE);
}
return builder;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:21,代码来源:AndroidStrings.java
示例2: hasField
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Returns whether {@code field} is present in {@code message}. */
@Override
@SuppressWarnings("unchecked")
public boolean hasField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
InternalDowncall message = (InternalDowncall) rawMessage;
if (field == VERSION) {
return message.hasVersion();
}
if (field == SERVER_MESSAGE) {
return message.hasServerMessage();
}
if (field == NETWORK_STATUS) {
return message.hasNetworkStatus();
}
if (field == NETWORK_ADDR_CHANGE) {
return message.hasNetworkAddrChange();
}
if (field == CREATE_CLIENT) {
return message.hasCreateClient();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:25,代码来源:AndroidServiceAccessor.java
示例3: getField
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Returns the {@code field} from {@code message}. */
@Override
@SuppressWarnings("unchecked")
public Object getField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
InternalDowncall message = (InternalDowncall) rawMessage;
if (field == VERSION) {
return message.getVersion();
}
if (field == SERVER_MESSAGE) {
return message.getServerMessage();
}
if (field == NETWORK_STATUS) {
return message.getNetworkStatus();
}
if (field == NETWORK_ADDR_CHANGE) {
return message.getNetworkAddrChange();
}
if (field == CREATE_CLIENT) {
return message.getCreateClient();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:25,代码来源:AndroidServiceAccessor.java
示例4: newBuilder
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
private static InternalDowncall.Builder newBuilder() {
return InternalDowncall.newBuilder().setVersion(ANDROID_PROTOCOL_VERSION_VALUE);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:4,代码来源:ProtocolIntents.java
示例5: isInternalDowncallValid
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Returns whether {@code downcall} has a valid set of fields with valid values. */
boolean isInternalDowncallValid(InternalDowncall downcall) {
return checkMessage(downcall, InternalDowncallInfos.INTERNAL_DOWNCALL_MSG);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:5,代码来源:AndroidIntentProtocolValidator.java
示例6: tryParseExtra
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Appends a description of any known extra or appends 'UNKNOWN' if none are recognized. */
private static boolean tryParseExtra(TextBuilder builder, Intent intent)
throws InvalidProtocolBufferException {
byte[] data;
data = intent.getByteArrayExtra(ProtocolIntents.SCHEDULER_KEY);
if (data != null) {
AndroidSchedulerEvent schedulerEvent = AndroidSchedulerEvent.parseFrom(data);
toCompactString(builder, schedulerEvent);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.OUTBOUND_MESSAGE_KEY);
if (data != null) {
AndroidNetworkSendRequest outboundMessage = AndroidNetworkSendRequest.parseFrom(data);
toCompactString(builder, outboundMessage);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.LISTENER_UPCALL_KEY);
if (data != null) {
ListenerUpcall upcall = ListenerUpcall.parseFrom(data);
toCompactString(builder, upcall);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.INTERNAL_DOWNCALL_KEY);
if (data != null) {
InternalDowncall internalDowncall = InternalDowncall.parseFrom(data);
toCompactString(builder, internalDowncall);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.CLIENT_DOWNCALL_KEY);
if (data != null) {
ClientDowncall clientDowncall = ClientDowncall.parseFrom(data);
toCompactString(builder, clientDowncall);
return true;
}
// Didn't recognize any intents.
return false;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:44,代码来源:AndroidStrings.java
注:本文中的com.google.protos.ipc.invalidation.AndroidService.InternalDowncall类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论