Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0f888800 authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

Close MQDescriptor internal FDs while writing to Parcel to transfer to native code.



Though ParcelFileDescriptors do close the wrapped fds in finalize(), GC
may not run for a while so it is beneficial to close them explicitly.

Also recycle the temporary Parcel written into by MQDescriptor since
that dups the MQDescriptor's fds as well. They're not needed after the
native FMQ Reader has been created since the MQDescriptor in the native
code dups those descriptors upon creation from the AParcel as well.

Bug: 383702975

Flag: EXEMPT; bugfix

Test: Run test app with StrictMode on, no longer get android.os.strictmode.LeakedClosableViolation
      for ParceFileDescriptor

Change-Id: Ic2a49577f1e0da13dbc33ef14a2a437966aebc99
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
parent 9165f171
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment