fix: Android 12.0/12.1/13 crash
This commit is contained in:
+12
-11
@@ -33,7 +33,7 @@ public final class InteractionJankMonitorWrapper {
|
||||
*/
|
||||
public static void begin(View v, @Cuj.CujType int cujType) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return;
|
||||
InteractionJankMonitor.getInstance().begin(v, cujType);
|
||||
// InteractionJankMonitor.getInstance().begin(v, cujType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ public final class InteractionJankMonitorWrapper {
|
||||
Configuration.Builder builder =
|
||||
Configuration.Builder.withView(cujType, v)
|
||||
.setTimeout(timeout);
|
||||
InteractionJankMonitor.getInstance().begin(builder);
|
||||
// InteractionJankMonitor.getInstance().begin(builder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,12 +60,12 @@ public final class InteractionJankMonitorWrapper {
|
||||
*/
|
||||
public static void begin(View v, @Cuj.CujType int cujType, String tag) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return;
|
||||
Configuration.Builder builder =
|
||||
Configuration.Builder.withView(cujType, v);
|
||||
if (!TextUtils.isEmpty(tag)) {
|
||||
builder.setTag(tag);
|
||||
}
|
||||
InteractionJankMonitor.getInstance().begin(builder);
|
||||
// Configuration.Builder builder =
|
||||
// Configuration.Builder.withView(cujType, v);
|
||||
// if (!TextUtils.isEmpty(tag)) {
|
||||
// builder.setTag(tag);
|
||||
// }
|
||||
// InteractionJankMonitor.getInstance().begin(builder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ public final class InteractionJankMonitorWrapper {
|
||||
*/
|
||||
public static void end(@Cuj.CujType int cujType) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return;
|
||||
InteractionJankMonitor.getInstance().end(cujType);
|
||||
// InteractionJankMonitor.getInstance().end(cujType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,12 +83,13 @@ public final class InteractionJankMonitorWrapper {
|
||||
*/
|
||||
public static void cancel(@Cuj.CujType int cujType) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return;
|
||||
InteractionJankMonitor.getInstance().cancel(cujType);
|
||||
// InteractionJankMonitor.getInstance().cancel(cujType);
|
||||
}
|
||||
|
||||
/** Return true if currently instrumenting a trace session. */
|
||||
public static boolean isInstrumenting(@Cuj.CujType int cujType) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return false;
|
||||
return InteractionJankMonitor.getInstance().isInstrumenting(cujType);
|
||||
// return InteractionJankMonitor.getInstance().isInstrumenting(cujType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user