public DataItemRecord putData(PutDataRequest request, String packageName) { DataItemInternal dataItem = new DataItemInternal(fixHost(request.getUri().getHost(), true), request.getUri().getPath()); for (Map.Entry<String, Asset> assetEntry : request.getAssets().entrySet()) { Asset asset = prepareAsset(packageName, assetEntry.getValue()); if (asset != null) { nodeDatabase.putAsset(asset, true); dataItem.addAsset(assetEntry.getKey(), asset); } } dataItem.data = request.getData(); DataItemRecord record = putDataItem(packageName, PackageUtils.firstSignatureDigest(context, packageName), getLocalNodeId(), dataItem); syncRecordToAll(record); return record; }
@Override public PendingResult<DataItemResult> putDataItem(GoogleApiClient client, PutDataRequest request) { throw new UnsupportedOperationException(); }
/** * Creates a {@link PutDataRequest} containing the data and assets in this * {@link PutDataMapRequest}. */ public PutDataRequest asPutDataRequest() { // TODO return PutDataRequest.create((Uri) null); }
/** * Adds a {@link DataItem} to the Android Wear network. The updated item is synchronized across * all devices. */ PendingResult<DataItemResult> putDataItem(GoogleApiClient client, PutDataRequest request);