Java 类com.google.android.gms.wearable.internal.MessageEventParcelable 实例源码

项目:android_packages_apps_GmsCore    文件:MessageHandler.java   
@Override
public void onRpcRequest(Request rpcRequest) {
    Log.d(TAG, "onRpcRequest: " + rpcRequest);
    if (TextUtils.isEmpty(rpcRequest.targetNodeId) || rpcRequest.targetNodeId.equals(wearable.getLocalNodeId())) {
        MessageEventParcelable messageEvent = new MessageEventParcelable();
        messageEvent.data = rpcRequest.rawData != null ? rpcRequest.rawData.toByteArray() : null;
        messageEvent.path = rpcRequest.path;
        messageEvent.requestId = rpcRequest.requestId + 31 * (rpcRequest.generation + 527);
        messageEvent.sourceNodeId = TextUtils.isEmpty(rpcRequest.sourceNodeId) ? peerNodeId : rpcRequest.sourceNodeId;

        wearable.sendMessageReceived(rpcRequest.packageName, messageEvent);
    } else if (rpcRequest.targetNodeId.equals(peerNodeId)) {
        // Drop it
    } else {
        // TODO: find next hop
    }
    try {
        getConnection().writeMessage(new RootMessage.Builder().heartbeat(new Heartbeat()).build());
    } catch (IOException e) {
        onDisconnected();
    }
}
项目:FMTech    文件:WearableListenerService.java   
public final void zza(final MessageEventParcelable paramMessageEventParcelable)
{
  zzb(new Runnable()
  {
    public final void run() {}
  }, "onMessageReceived", paramMessageEventParcelable);
}
项目:android_external_GmsLib    文件:WearableListenerService.java   
@Override
public void onMessageReceived(final MessageEventParcelable messageEvent) throws RemoteException {
    post(new Runnable() {
        @Override
        public void run() {
            WearableListenerService.this.onMessageReceived(messageEvent);
        }
    });
}
项目:android_packages_apps_GmsCore    文件:WearableImpl.java   
public void sendMessageReceived(String packageName, MessageEventParcelable messageEvent) {
    Log.d(TAG, "onMessageReceived: " + messageEvent);
    try {
        getListener(packageName, "com.google.android.gms.wearable.MESSAGE_RECEIVED", Uri.parse("wear://" + getLocalNodeId() + "/" + messageEvent.getPath()))
                .onMessageReceived(messageEvent);
    } catch (RemoteException e) {
        Log.w(TAG, e);
    }
}