diff options
| author | 2013-04-10 11:42:44 -0700 | |
|---|---|---|
| committer | 2013-04-10 11:42:44 -0700 | |
| commit | 09f7b93a184d12e5ed584206d903982b3e0915e5 (patch) | |
| tree | 8ecadabd1630f1bc6f8f47662fbcf764b79c92a1 | |
| parent | 50b9eb1c7375a87525d44a036337a8ba18eba55b (diff) | |
Instrument views inflation in systrace
Change-Id: If3cd80bc430893c701432f165b4c1f5943a4143c
| -rw-r--r-- | core/java/android/view/LayoutInflater.java | 9 |
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); } } |