Skip to content
Commit fcf671be authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak Committed by Android (Google) Code Review
Browse files

Fix EBADF in TTS synthesizeToFile method.

Recent TTS change altered how the TextToSpeech.synthesizeToFile method
operates. Previously, synthesis service was responsible for creating
output file. Now, client API creates a file and then sends opened file
descriptor using ParcelFileDescriptor.

On service side, I forgot to keep a reference to a ParcelFileDescriptor object.
When GC was removing it, it was closing underlying file descriptor, resulting
in a EBADF error for all following writes to the output file.

This change makes use of a ParcelFileDescriptor.AutoCloseOutputStream to keep a
reference to the ParcelFileDescriptor. It will be referenced until we are done
with writing.

Change-Id: I8327af0eaeabaebfbbd8816d959783e89086a7c5
parent f4d6f153
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment