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

Commit 19b15032 authored by Brandon Liu's avatar Brandon Liu
Browse files

Override close() to fix LEAKED_CLOSABLE

Bug: b/277624740
Test: Verify affected test pass
Change-Id: If0860f6bbe16fb8e2eb137d39ba8789cb2b083bc
parent bdcfdadf
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -280,6 +280,12 @@ public class AssetFileDescriptor implements Parcelable, Closeable {
        public FileChannel getChannel() {
            return mDelegateInputStream.getChannel();
        }
        @Override
        public void close() throws IOException {
            // Make the mDelegateInputStream own file descriptor and super.close()
            // is not needed here to avoid double close the file descriptor.
            mDelegateInputStream.close();
        }
    }

    /**