本文整理了Java中android.os.Trace.isTagEnabled()
方法的一些代码示例,展示了Trace.isTagEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Trace.isTagEnabled()
方法的具体详情如下:
包路径:android.os.Trace
类名称:Trace
方法名:isTagEnabled
暂无
代码示例来源:origin: robolectric/robolectric
/** Starts a new trace section with given name. */
@Implementation(minSdk = JELLY_BEAN_MR2)
protected static void beginSection(String sectionName) {
if (Trace.isTagEnabled(TRACE_TAG_APP)) {
if (crashOnIncorrectUsage) {
if (sectionName.length() > MAX_SECTION_NAME_LEN) {
throw new IllegalArgumentException("sectionName is too long");
}
} else if (sectionName == null) {
Log.w(TAG, "Section name cannot be null");
return;
} else if (sectionName.length() > MAX_SECTION_NAME_LEN) {
Log.w(TAG, "Section name is too long");
return;
}
synchronized (lock) {
currentSections.addFirst(sectionName);
}
}
}
代码示例来源:origin: robolectric/robolectric
/**
* Ends the most recent active trace section.
*
* @throws {@link AssertionError} if called without any active trace section.
*/
@Implementation(minSdk = JELLY_BEAN_MR2)
protected static void endSection() {
if (Trace.isTagEnabled(TRACE_TAG_APP)) {
synchronized (lock) {
if (currentSections.isEmpty()) {
Log.e(TAG, "Trying to end a trace section that was never started");
return;
}
previousSections.offer(currentSections.removeFirst());
}
}
}
代码示例来源:origin: org.robolectric/shadows-framework
/**
* Ends the most recent active trace section.
*
* @throws {@link AssertionError} if called without any active trace section.
*/
@Implementation(minSdk = JELLY_BEAN_MR2)
protected static void endSection() {
if (Trace.isTagEnabled(TRACE_TAG_APP)) {
synchronized (lock) {
if (currentSections.isEmpty()) {
Log.e(TAG, "Trying to end a trace section that was never started");
return;
}
previousSections.offer(currentSections.removeFirst());
}
}
}
代码示例来源:origin: org.robolectric/shadows-framework
/** Starts a new trace section with given name. */
@Implementation(minSdk = JELLY_BEAN_MR2)
protected static void beginSection(String sectionName) {
if (Trace.isTagEnabled(TRACE_TAG_APP)) {
if (crashOnIncorrectUsage) {
if (sectionName.length() > MAX_SECTION_NAME_LEN) {
throw new IllegalArgumentException("sectionName is too long");
}
} else if (sectionName == null) {
Log.w(TAG, "Section name cannot be null");
return;
} else if (sectionName.length() > MAX_SECTION_NAME_LEN) {
Log.w(TAG, "Section name is too long");
return;
}
synchronized (lock) {
currentSections.addFirst(sectionName);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!