MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / openNonAsset

Method openNonAsset

libs/androidfw/AssetManager.cpp:706–736  ·  view source on GitHub ↗

* Open a non-asset file as if it were an asset. * * The "fileName" is the partial path starting from the application * name. */

Source from the content-addressed store, hash-verified

704 * name.
705 */
706Asset* AssetManager::openNonAsset(const char* fileName, AccessMode mode)
707{
708 AutoMutex _l(mLock);
709
710 LOG_FATAL_IF(mAssetPaths.size() == 0, "No assets added to AssetManager");
711
712
713 if (mCacheMode != CACHE_OFF && !mCacheValid)
714 loadFileNameCacheLocked();
715
716 /*
717 * For each top-level asset path, search for the asset.
718 */
719
720 size_t i = mAssetPaths.size();
721 while (i > 0) {
722 i--;
723 ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string());
724
725 //Skip theme/icon attached assets
726 if (mAssetPaths.itemAt(i).prefixPath.length() > 0) continue;
727
728 Asset* pAsset = openNonAssetInPathLocked(
729 fileName, mode, mAssetPaths.itemAt(i));
730 if (pAsset != NULL) {
731 return pAsset != kExcludedAsset ? pAsset : NULL;
732 }
733 }
734
735 return NULL;
736}
737
738Asset* AssetManager::openNonAsset(void* cookie, const char* fileName, AccessMode mode)
739{

Callers 4

doListFunction · 0.45
getNfcAidCategoriesFunction · 0.45
doDumpFunction · 0.45
parseFromZipMethod · 0.45

Calls 3

stringMethod · 0.80
sizeMethod · 0.65
lengthMethod · 0.45

Tested by

no test coverage detected