summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2016-04-14 15:44:35 -0700
committerTim Murray <timmurray@google.com>2016-04-14 16:06:29 -0700
commit98e80076c6c4e31f04c580c8774eeea4036d32c1 (patch)
treedfd7fc79f951ae1c5f93300f08c5debbef45e5ec /libs/androidfw/AssetManager.cpp
parent4ecc096b625dce65970b785f156d24d32cff5e64 (diff)
Revert "Optimize ResTable::getLocales() to improve bindApplication performance"
This reverts commit 5520581b5f043fb858b5b2044ff33ad8545a6d38. bug 28189634 Change-Id: I2d2b859f6d9bd44434fa901cce990583f514980c
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
-rw-r--r--libs/androidfw/AssetManager.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index 715c875d064d..6913f43a87c3 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -34,7 +34,9 @@
#include <utils/String8.h>
#include <utils/threads.h>
#include <utils/Timers.h>
-#include <utils/Trace.h>
+#ifdef __ANDROID__
+#include <cutils/trace.h>
+#endif
#include <assert.h>
#include <dirent.h>
@@ -52,6 +54,14 @@
_rc; })
#endif
+#ifdef __ANDROID__
+#define MY_TRACE_BEGIN(x) ATRACE_BEGIN(x)
+#define MY_TRACE_END() ATRACE_END()
+#else
+#define MY_TRACE_BEGIN(x)
+#define MY_TRACE_END()
+#endif
+
using namespace android;
static const bool kIsDebug = false;
@@ -613,7 +623,7 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, bool appAsLib) con
ResTable* sharedRes = NULL;
bool shared = true;
bool onlyEmptyResources = true;
- ATRACE_NAME(ap.path.string());
+ MY_TRACE_BEGIN(ap.path.string());
Asset* idmap = openIdmapLocked(ap);
size_t nextEntryIdx = mResources->getTableCount();
ALOGV("Looking for resource asset in '%s'\n", ap.path.string());
@@ -693,6 +703,8 @@ bool AssetManager::appendPathToResTable(const asset_path& ap, bool appAsLib) con
if (idmap != NULL) {
delete idmap;
}
+ MY_TRACE_END();
+
return onlyEmptyResources;
}
@@ -740,7 +752,6 @@ const ResTable* AssetManager::getResTable(bool required) const
void AssetManager::updateResourceParamsLocked() const
{
- ATRACE_CALL();
ResTable* res = mResources;
if (!res) {
return;