Open Masaaki-Sato opened 7 years ago
I suspect this is a device-specific optimization. . I am not sure there is any way to make this universal unless we make the interval configurable. If so, you could set it to 14 min in the manifest.
I am open to better ideas.
Android 7 force converts long running scans to opportunistic scan with an intent of preventing abusive apps. The duration is 30 minutes for a long running scan. This is undocumented, mentioned in this post: https://blog.classycode.com/undocumented-android-7-ble-behavior-changes-d1a9bd87d983
Expected behavior
Never move to opportunistic scan mode in long running test
Actual behavior
Moved to opportunistic scan mode
Steps to reproduce this behavior
(described in this topic)
Mobile device model and OS version
ASUS ZenWatch3 (Android 7.1.1/Android Wear 2.0) Polar M600 (Android 7.1.1/Android Wear 2.0)
Android Beacon Library version
2.12.2
Hi, all
Thank you very much for great library and support!
We are trying to create beacon scan application for smart watch with this library (2.12.2) and found different behavior in moving to opportunistic scan mode.
As it is described in this library we added following line to avoid opportunistic scan mode, and also changed "ScanPeriod" for our application.
And then I did long running test and found that watches still moved to opportunistic scan mode when they are unplugged. Here are log data captured from Polar M600.
As log data reported above, opportunistic mode seems to started at 963161 millis (about 16min) so I changed the value of ANDROID_N_MAX_SCAN_DURATION_MILLIS to 14min. Apparently this change works but I'm not sure if this is OK for other wearable devices or not.
Is this a OS/Device specific?
Thank you very much in advance.