When using the OpenPGP API library, data _returned_ from the OpenKeychain app is through the ParcelFileDescriptor stream is likely to get truncated! #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is because the TransferThread doesn't necessarily read all available data back from the OpenKeychain service, because it is stopped immediately after the "execute" call has returned (it's stopped by input.close();)
The obvious solution of simply waiting for (joining) the TransferThread unfortunately does not work, because the TransferThread can not detect remote stream close/end due to the way the pipe FileDescriptors are set up.
This is because the FileDescriptors are "dup"ed when going through parcels, the input ParcelFileDescriptor never realises that the FileDescriptor at the service side has been closed. It works though if the return pipe gets set up on the service side.
Note: The testcase OpenPgpServiceTest doesn't really test IPC as it runs in the same process! I've therefore created a standalone test app