diff options
| author | Elliott Hughes <enh@google.com> | 2013-10-29 13:35:04 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-29 13:35:04 -0700 |
| commit | ed84dea928a5a830a19b5bcab7ad05a7e92f3279 (patch) | |
| tree | 3433335ce3be3a69f12b957130e95b4d19f74e3f /libs | |
| parent | 2fcefe45718af44452b725b61f4051f507cb7e5d (diff) | |
| parent | 8f592378a1ea7f31d57253dc202f42707ef4da36 (diff) | |
| download | frameworks_base-ed84dea928a5a830a19b5bcab7ad05a7e92f3279.zip frameworks_base-ed84dea928a5a830a19b5bcab7ad05a7e92f3279.tar.gz frameworks_base-ed84dea928a5a830a19b5bcab7ad05a7e92f3279.tar.bz2 | |
am 8f592378: am 69920427: Merge "Fix a variety of small publicly-reported bugs."
* commit '8f592378a1ea7f31d57253dc202f42707ef4da36':
Fix a variety of small publicly-reported bugs.
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/androidfw/AssetManager.cpp | 22 | ||||
| -rw-r--r-- | libs/androidfw/ObbFile.cpp | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 6667daf..1066715 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -432,7 +432,7 @@ void AssetManager::setLocaleLocked(const char* locale) delete[] mLocale; } mLocale = strdupNew(locale); - + updateResourceParamsLocked(); } @@ -675,7 +675,7 @@ const ResTable* AssetManager::getResTable(bool required) const mZipSet.setZipResourceTableAsset(ap.path, ass); } } - + if (i == 0 && ass != NULL) { // If this is the first resource table in the asset // manager, then we are going to cache it so that we @@ -689,7 +689,7 @@ const ResTable* AssetManager::getResTable(bool required) const } } else { ALOGV("loading resource table %s\n", ap.path.string()); - Asset* ass = const_cast<AssetManager*>(this)-> + ass = const_cast<AssetManager*>(this)-> openNonAssetInPathLocked("resources.arsc", Asset::ACCESS_BUFFER, ap); @@ -891,7 +891,7 @@ Asset* AssetManager::openInLocaleVendorLocked(const char* fileName, AccessMode m /* look at the filesystem on disk */ String8 path(createPathNameLocked(ap, locale, vendor)); path.appendPath(fileName); - + String8 excludeName(path); excludeName.append(kExcludeExtension); if (::getFileType(excludeName.string()) != kFileTypeNonexistent) { @@ -899,28 +899,28 @@ Asset* AssetManager::openInLocaleVendorLocked(const char* fileName, AccessMode m //printf("+++ excluding '%s'\n", (const char*) excludeName); return kExcludedAsset; } - + pAsset = openAssetFromFileLocked(path, mode); - + if (pAsset == NULL) { /* try again, this time with ".gz" */ path.append(".gz"); pAsset = openAssetFromFileLocked(path, mode); } - + if (pAsset != NULL) pAsset->setAssetSource(path); } else { /* find in cache */ String8 path(createPathNameLocked(ap, locale, vendor)); path.appendPath(fileName); - + AssetDir::FileInfo tmpInfo; bool found = false; - + String8 excludeName(path); excludeName.append(kExcludeExtension); - + if (mCache.indexOf(excludeName) != NAME_NOT_FOUND) { /* go no farther */ //printf("+++ Excluding '%s'\n", (const char*) excludeName); @@ -1739,7 +1739,7 @@ bool AssetManager::fncScanAndMergeDirLocked( // XXX This is broken -- the filename cache needs to hold the base // asset path separately from its filename. - + partialPath = createPathNameLocked(ap, locale, vendor); if (dirName[0] != '\0') { partialPath.appendPath(dirName); diff --git a/libs/androidfw/ObbFile.cpp b/libs/androidfw/ObbFile.cpp index 21e06c8..ec59f06 100644 --- a/libs/androidfw/ObbFile.cpp +++ b/libs/androidfw/ObbFile.cpp @@ -133,7 +133,7 @@ bool ObbFile::parseObbFile(int fd) { lseek64(fd, fileLength - kFooterTagSize, SEEK_SET); - char *footer = new char[kFooterTagSize]; + char footer[kFooterTagSize]; actual = TEMP_FAILURE_RETRY(read(fd, footer, kFooterTagSize)); if (actual != kFooterTagSize) { ALOGW("couldn't read footer signature: %s\n", strerror(errno)); |
