diff options
| author | Elliott Hughes <enh@google.com> | 2013-10-29 13:32:33 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-29 13:32:33 -0700 |
| commit | 8f592378a1ea7f31d57253dc202f42707ef4da36 (patch) | |
| tree | ff92cf68202608d8fdd76e3f47a208a2933f725d /libs | |
| parent | 569220399841ae1a3fd62a1b77fa087bca2ee0f3 (diff) | |
| parent | 69920427ea01421d34f3a7576bdd135527b20859 (diff) | |
| download | frameworks_base-8f592378a1ea7f31d57253dc202f42707ef4da36.zip frameworks_base-8f592378a1ea7f31d57253dc202f42707ef4da36.tar.gz frameworks_base-8f592378a1ea7f31d57253dc202f42707ef4da36.tar.bz2 | |
am 69920427: Merge "Fix a variety of small publicly-reported bugs."
* commit '69920427ea01421d34f3a7576bdd135527b20859':
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 b08c36b..9156725 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -431,7 +431,7 @@ void AssetManager::setLocaleLocked(const char* locale) delete[] mLocale; } mLocale = strdupNew(locale); - + updateResourceParamsLocked(); } @@ -674,7 +674,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 @@ -688,7 +688,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); @@ -890,7 +890,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) { @@ -898,28 +898,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); @@ -1738,7 +1738,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)); |
