/** * Method to handle the incoming activity data. There are two kind of messages we currently know: * - the first one is 11 bytes long and contains metadata (how many bytes to expect, when the data * starts, etc.) - the second one is 20 bytes long and contains the actual activity data * * <p>The first message type is parsed by this method, for every other length of the value param, * bufferActivityData is called. * * @param value * @see #bufferActivityData(byte[]) */ private void handleActivityNotif(byte[] value) { if (value.length == activityMetadataLength) { handleActivityMetadata(value); } else { bufferActivityData(value); } LOG.debug( "activity data: length: " + value.length + ", remaining bytes: " + activityStruct.activityDataRemainingBytes); GB.updateTransferNotification( getContext().getString(R.string.busy_task_fetch_activity_data), true, (int) (((float) (activityStruct.activityDataUntilNextHeader - activityStruct.activityDataRemainingBytes)) / activityStruct.activityDataUntilNextHeader * 100), getContext()); if (activityStruct.isBlockFinished()) { sendAckDataTransfer( activityStruct.activityDataTimestampToAck, activityStruct.activityDataUntilNextHeader); GB.updateTransferNotification("", false, 100, getContext()); } }