ANR issue

43 views
Skip to first unread message

Wang Wei

unread,
Sep 7, 2022, 8:14:50 AM9/7/22
to zxing
I'm handling an Android ANR issue. The root cause is the onDraw method in ViewfinderView calls synchronized method in CameraManager. it's means the main thread will be blocked is the lock is hold by another thread.  And I found the lock is hold by the openDriver method which is pending on Camera.open.  According to the notes of API "Caution: On some devices, this method may take a long time to complete"

So I want to remove synchronized from the openDriver methold. Beacuase I found too many synchronized method in CameraManager are called from main thread. Can you give me some suggestion?
Reply all
Reply to author
Forward
0 new messages