owntracks/android — pull request #74 by GeorgeHahn (2014-10-10 05:10:41+00:00)
Title: AltBeacon Improvements

Feature: #70
Code: #71
User controls: #73

- [ ] Add handler for beacon ranging periods
- [x] Add handler for beacon ranging enable
- [ ] Add BT state listener to stop ranging when BT is disabled and resume when it's enabled

Fixes some bugs around BT being disabled. Works in all situations except the (very important) one where the user disables BT while ranging is active. To do that, I need to get Android to notify me when BT is disabled.

I'm not terribly happy with this code - I'm essentially using mBeaconManager as a flag that I should probably be handling with service state. Say the word and I'll refactor it.