summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/LayoutInflater.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 26a5b26889fd..85695fc98d66 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -19,6 +19,7 @@ package android.view;
import android.graphics.Canvas;
import android.os.Handler;
import android.os.Message;
+import android.os.Trace;
import android.widget.FrameLayout;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -423,6 +424,8 @@ public abstract class LayoutInflater {
*/
public View inflate(XmlPullParser parser, ViewGroup root, boolean attachToRoot) {
synchronized (mConstructorArgs) {
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "inflate");
+
final AttributeSet attrs = Xml.asAttributeSet(parser);
Context lastContext = (Context)mConstructorArgs[0];
mConstructorArgs[0] = mContext;
@@ -520,6 +523,8 @@ public abstract class LayoutInflater {
mConstructorArgs[1] = null;
}
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+
return result;
}
}
@@ -547,6 +552,8 @@ public abstract class LayoutInflater {
Class<? extends View> clazz = null;
try {
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, name);
+
if (constructor == null) {
// Class not found in the cache, see if it's real, and try to add it
clazz = mContext.getClassLoader().loadClass(
@@ -615,6 +622,8 @@ public abstract class LayoutInflater {
+ (clazz == null ? "<unknown>" : clazz.getName()));
ie.initCause(e);
throw ie;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
}
}