wongpiwat / trust-location

A Flutter plugin for detecting mock location on Android device. (Supports only high accuracy location mode)
https://pub.dev/packages/trust_location
BSD 3-Clause "New" or "Revised" License
15 stars 8 forks source link

ANR triggered by main thread waiting for too long #22

Open TheManuz opened 10 months ago

TheManuz commented 10 months ago

I've got 49 ANRs on 21 users caused by this package (logged on Firebase Crashlytics).

This is the stacktrace:

main (timed waiting):tid=1 systid=8469 
       at sun.misc.Unsafe.park(Native method)
       at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1090)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1390)
       at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
       at com.google.android.gms.internal.location.zzau.getLastLocation()
       at com.wongpiwat.trust_location.LocationAssistant.checkInitialLocation(LocationAssistant.java)
       at com.wongpiwat.trust_location.LocationAssistant.access$600(LocationAssistant.java)
       at com.wongpiwat.trust_location.LocationAssistant$8.onResult(LocationAssistant.java)
       at com.wongpiwat.trust_location.LocationAssistant$8.onResult(LocationAssistant.java)
       at com.google.android.gms.common.api.internal.BasePendingResult$CallbackHandler.handleMessage()
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:263)
       at android.app.ActivityThread.main(ActivityThread.java:8292)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)

Is there something that can be done?