diff options
| author | 2022-09-22 17:08:32 +0000 | |
|---|---|---|
| committer | 2022-10-08 17:37:03 +0000 | |
| commit | 4146674d0693180624a27e20c4dd0505898e6778 (patch) | |
| tree | dcc1d1705e77aead17edb17e553090e6523700e3 /libs/androidfw/StringPool.cpp | |
| parent | 91226107447742253e6fc7444ebeb52e4f785f42 (diff) | |
Have AssetFileDescriptor.AutoCloseInputStream use pread
Previously two AssetFileDescriptors pointing to the same file could be
using the same underlying file descriptor and reading from both would
provide unexpected results since they would both modify the file offset
in the kernel data structure.
Test: Added testTwoFileDescriptorsWorkIndependently() to
android.content.res.cts.AssetFileDescriptor_AutoCloseInputStreamTest
Test: atest AssetFileDescriptor_AutoCloseInputStreamTest
Fix: 168310122
Change-Id: Ibf3c9ff0207544e3b227511aae93c8f4ddf52867
Override getChannel() in AssetFileDescriptor.AutoCloseInputStream
Previous fix do not have getChannel() handled which caused issues. This
is to override getChannel().
Test: Added testGetChannel() to
android.content.res.cts.AssetFileDescriptor_AutoCloseInputStreamTest
Test: atest AssetFileDescriptor_AutoCloseInputStreamTest
Bug: 168310122
Change-Id: I472655c91491fd33ef0c2631d94fc0b8d0328404
Adding OffsetCorrectFileChannel help to correct offset
Test: Added testGetChannel() to
android.content.res.cts.AssetFileDescriptor_AutoCloseInputStreamTest
Test: atest AssetFileDescriptor_AutoCloseInputStreamTest
Bug: 168310122
Change-Id: I9ed584ac795cabbed6a4e297c61c224233b9575c
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions