{"action":"created","issue":{"url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/289","repository_url":"https://api.github.com/repos/AltBeacon/android-beacon-library","labels_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/289/labels{/name}","comments_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/289/comments","events_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/289/events","html_url":"https://github.com/AltBeacon/android-beacon-library/issues/289","id":107310858,"number":289,"title":"Lollipop long period scan broke phone's Bluetooth","user":{"login":"jbarmanet","id":3404246,"avatar_url":"https://avatars.githubusercontent.com/u/3404246?v=3","gravatar_id":"","url":"https://api.github.com/users/jbarmanet","html_url":"https://github.com/jbarmanet","followers_url":"https://api.github.com/users/jbarmanet/followers","following_url":"https://api.github.com/users/jbarmanet/following{/other_user}","gists_url":"https://api.github.com/users/jbarmanet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbarmanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbarmanet/subscriptions","organizations_url":"https://api.github.com/users/jbarmanet/orgs","repos_url":"https://api.github.com/users/jbarmanet/repos","events_url":"https://api.github.com/users/jbarmanet/events{/privacy}","received_events_url":"https://api.github.com/users/jbarmanet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-09-19T05:14:34Z","updated_at":"2016-05-04T00:16:32Z","closed_at":null,"body":"In order to test if my beacons signal was stable enough, I let them on contact all night long with 2 phones, one on Android 4.4, the other on Android 5.1.1\r\nBelow is my scanning service code... \r\n\r\nIn the morning the Android 4.4 was still scanning successfully the beacons.\r\nBut the Android 5.1.1 stopped after 8 consecutive hours, and I have this repeating in the logs : \r\n\r\n    09-19 06:42:11.914: E/CycledLeScannerForLollipop(11355): Scan Failed\r\n    09-19 06:42:18.964: I/MonitorService(11355): didRangeBeaconsInRegion, number of beacons detected = 0\r\n    09-19 06:42:18.970: E/CycledLeScannerForLollipop(11355): Scan Failed\r\n    09-19 06:42:26.059: I/MonitorService(11355): didRangeBeaconsInRegion, number of beacons detected = 0\r\n\r\nWorst than this : the Bluetooth of the Android 5.1.1 device is broken... I can no longer activate it / deactivate it, and neither of the connected devices (headset etc.) can connect to it. \r\nEven if I restart my App. \r\nEven if I uninstall my App (just to be sure...)... \r\n\r\nSo at the end it looks like it broke the Bluetooth of this phone... and the Bluetooth came back only after rebooting the device. \r\n\r\nIs there any precaution to take when scanning continuously beacons ? (for example maybe interrupting sometimes the scan could make it more stable ?? I have no idea what is playing behind the scene here...) \r\n\r\nThanks for your feedback\r\n\r\n\r\n    public class MonitorService extends Service implements BeaconConsumer \r\n    {\r\n\t\r\n\t\tprotected static final String TAG = \"MonitorService\";\r\n\t    private BeaconManager beaconManager;\r\n\t\t\r\n\t\t\r\n\t\t@Override\r\n\t    public void onCreate() \r\n\t    {\r\n\t\t    super.onCreate();\r\n\t\t\r\n\t\t\tbeaconManager = BeaconManager.getInstanceForApplication(this);\r\n\t\t    beaconManager.getBeaconParsers().add(new BeaconParser().\r\n\t\t            setBeaconLayout(\"m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24\"));\r\n\t\t\r\n\t\t    beaconManager.setForegroundScanPeriod(5000l);\r\n\t\t    beaconManager.setBackgroundScanPeriod(5000l);\r\n\t\t    beaconManager.setForegroundBetweenScanPeriod(1100l);\r\n\t\t    beaconManager.setBackgroundBetweenScanPeriod(1100l);\r\n\t\t\r\n\t\t\tsetupBeaconManager();\r\n\t    }\r\n\t\r\n\t\r\n\t    private void setupBeaconManager()\r\n\t    {\r\n\t\t    if (!beaconManager.isBound(this))\r\n\t\t        beaconManager.bind(this);\r\n\t    }\r\n\t\r\n\t    \r\n\t    private void unsetBeaconManager()\r\n\t    {\r\n\t\t    if (beaconManager.isBound(this))\r\n\t\t    {\r\n\t\t        beaconManager.unbind(this);\r\n\t\t\t\ttry \r\n\t\t        {\r\n\t\t            beaconManager.stopRangingBeaconsInRegion(new Region(\"apr\", null, null, null));\r\n\t\t        } \r\n\t\t        catch (RemoteException e) \r\n\t\t        {  \r\n\t\t            Log.i(TAG, \"RemoteException = \"+e.toString());\r\n\t\t        }\r\n\t\t    }\r\n\t    }\r\n\t\r\n\t\r\n\t    @Override\r\n\t    public void onBeaconServiceConnect() \r\n\t    {\r\n\t\t    beaconManager.setRangeNotifier(new RangeNotifier() {\r\n\t\t        @Override \r\n\t\t        public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) \r\n\t\t        {\r\n\t\t            Log.i(TAG,\"didRangeBeaconsInRegion, number of beacons detected = \"+beacons.size());\r\n\t\t        }\r\n\t\t    });\r\n\t\t\r\n\t\t    try \r\n\t\t    {\r\n\t\t        beaconManager.startRangingBeaconsInRegion(new Region(\"apr\", null, null, null));\r\n\t\t    } \r\n\t\t    catch (RemoteException e) \r\n\t\t    {  \r\n\t\t        Log.i(TAG, \"RemoteException = \"+e.toString());\r\n\t\t    }\r\n\t    }\r\n\t\r\n\t    @Override\r\n\t    public void onDestroy() \r\n\t    {\r\n\t\t    unsetBeaconManager();\r\n\t\t\tsuper.onDestroy();\r\n\t    }\r\n    }"},"comment":{"url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/comments/216705414","html_url":"https://github.com/AltBeacon/android-beacon-library/issues/289#issuecomment-216705414","issue_url":"https://api.github.com/repos/AltBeacon/android-beacon-library/issues/289","id":216705414,"user":{"login":"Berger89","id":17617106,"avatar_url":"https://avatars.githubusercontent.com/u/17617106?v=3","gravatar_id":"","url":"https://api.github.com/users/Berger89","html_url":"https://github.com/Berger89","followers_url":"https://api.github.com/users/Berger89/followers","following_url":"https://api.github.com/users/Berger89/following{/other_user}","gists_url":"https://api.github.com/users/Berger89/gists{/gist_id}","starred_url":"https://api.github.com/users/Berger89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Berger89/subscriptions","organizations_url":"https://api.github.com/users/Berger89/orgs","repos_url":"https://api.github.com/users/Berger89/repos","events_url":"https://api.github.com/users/Berger89/events{/privacy}","received_events_url":"https://api.github.com/users/Berger89/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T00:16:32Z","updated_at":"2016-05-04T00:16:32Z","body":"Same issue on the oneplus one and android 6.0.1"}}