61ef747e0e
AssetManager instances are created by zygote and passed to all its children so that they don't have to individually open frameworks-res.apk. This creates a problem for determining the current file offset when using lseek() on those files, because you can't guarantee the cross-process locking of a mutex. Luckily, Linux implements pread() to get around this suckiness. The problem is that only Linux implements this, so we have to keep the old locking for use on host builds with aapt and friends. aapt doesn't have this same problem of sharing file descriptors across forked processes, so we can keep the local AutoMutex to protect accesses of those files. Change-Id: Ibe9f11499a53fe345f50fbaea438815ec0fd363e |
||
---|---|---|
.. | ||
tests | ||
Android.mk | ||
Asset.cpp | ||
AssetDir.cpp | ||
AssetManager.cpp | ||
BackupData.cpp | ||
BackupHelpers.cpp | ||
BufferedTextOutput.cpp | ||
CallStack.cpp | ||
Debug.cpp | ||
FileMap.cpp | ||
Flattenable.cpp | ||
Looper.cpp | ||
misc.cpp | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
ObbFile.cpp | ||
Pool.cpp | ||
README | ||
RefBase.cpp | ||
ResourceTypes.cpp | ||
SharedBuffer.cpp | ||
Static.cpp | ||
StopWatch.cpp | ||
StreamingZipInflater.cpp | ||
String8.cpp | ||
String16.cpp | ||
StringArray.cpp | ||
SystemClock.cpp | ||
TextOutput.cpp | ||
Threads.cpp | ||
Timers.cpp | ||
VectorImpl.cpp | ||
ZipFileCRO.cpp | ||
ZipFileRO.cpp | ||
ZipUtils.cpp |
Android Utility Function Library If you need a feature that is native to Linux but not present on other platforms, construct a platform-dependent implementation that shares the Linux interface. That way the actual device runs as "light" as possible. If that isn't feasible, create a system-independent interface and hide the details. The ultimate goal is *not* to create a super-duper platform abstraction layer. The goal is to provide an optimized solution for Linux with reasonable implementations for other platforms.