ANR
2021-08-31 本文已影响0人
fyg
![](https://img.haomeiwen.com/i2598119/0fe3437999194d69.png)
"main" prio=5 tid=1 TimedWaiting
| group="main" sCount=1 dsCount=0 flags=1 obj=0x72254420 self=0xec3eee00
| sysTid=28590 nice=-10 cgrp=top-app sched=0/0 handle=0xec93e470
| state=S schedstat=( 1732300519 624509275 2726 ) utm=131 stm=42 core=4 HZ=100
| stack=0xff1dd000-0xff1df000 stackSize=8192KB
| held mutexes=
at java.lang.Object.wait(Native method)
- waiting on <0x0788b7e0> (a com.taobao.dp.util.b)
at java.lang.Object.wait(Object.java:442)
at com.taobao.dp.DeviceSecuritySDKImpl.initSync(unavailable:-1)
- locked <0x0788b7e0> (a com.taobao.dp.util.b)
at com.alibaba.wireless.security.open.umid.UMIDComponent.initUMIDSync(unavailable:-1)
at com.alibaba.security.realidentity.build.Rb.e(SourceFile:7)
at com.alibaba.security.realidentity.build.C.i(SourceFile:1)
at com.alibaba.security.realidentity.build.lc.b(SourceFile:6)
at com.alibaba.security.realidentity.build.Ub.a(SourceFile:5)
at com.alibaba.security.realidentity.build.Ub.<init>(SourceFile:3)
at com.alibaba.security.realidentity.build.C.a(SourceFile:13)
at com.alibaba.security.realidentity.build.C.a(SourceFile:5)
at com.alibaba.security.realidentity.RPVerify.init(SourceFile:2)
at com.alibaba.security.realidentity.RPVerify.init(SourceFile:1)
at com.jiuxian.client.comm.f.run(SourceFile:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:239)
at android.app.ActivityThread.main(ActivityThread.java:8142)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
android 主线程什么时候空闲?
如下两种情况会处于空闲状态
/**
* 该方法在某些机型不调用,勿用(弹权限页面后,该页面不调用,同意权限后直接进入下个页面的情况)
* @param hasFocus
*/
@Deprecated
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
}
private Handler mHandler;
private MessageQueue messageQueue = null;
{
mHandler = new Handler(Looper.getMainLooper());
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Looper looper = mHandler.getLooper();
Class<Looper> clazz = (Class<Looper>) looper.getClass();
Method method = clazz.getMethod("getQueue", null);
messageQueue = (MessageQueue) method.invoke(looper, null);
messageQueue.addIdleHandler(this);
}else{
}
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
}
}