Exit Region detected when still in region

I have a use case where I need to detect the exact event of exit region when it happens (a reasonable delay of up to 30 seconds is OK). I saw that occasionally I receive a exit and enter region while the phone is close to the beacon.
I set the beacon to transmit at 200 ms’ with -20dBm and I am using an Android phone (Nexus 6 with android 7.0). I am using a scan rate of 4.5 seconds and a in-between scans period of 9 seconds. I see that after 30 minutes ± 20 minutes I can get an exit and re enter event.
Can I do any thing to prevent this? If for instance, I will increase my scan rate to 5 seconds and 4 seconds in between scans, would that make any difference?

Yup, I’d definitely experiment with the scan windows. By default, we use a 10-second scan window, and that’s after extensive testing with multiple Android devices, in order to minimize the “false exits”. 4.5 sounds like cutting it too close, especially for less responsive Android devices. We’re also working on some improvements to monitoring, so keep an eye on the Android SDK changelog, and keep the SDK in your app up-to-date (:

Where do these “scan windows” get set?

I have tried using the setBackgroundScanPeriodMethod, but I am still getting odd behavior. There is an exit immediately followed by an enter, even when my phone is sitting right next to the beacon and I haven’t moved from the beacon at all.

Thanks for any additional advice you can provide.