Extracted BT connection logic from from MainActivity to BluetoothConnectionService. To achieve this MainActivity dependency had to be removed from BluetoothUtilImpl.
Few notable points:
Tried to avoid any behavior changes. However few was mandatory:
Notification will be always visible when tracking is in progress.
BT adapter status check and dialog requiring to turn on BT will be executed when connect/scan menu item is pressed.
I currently don't have Onewheel. All development was made with Mocked BT connection. So need very thorough testing with real device. I see few possible scenarios how to move forward:
Merge this PR into master. Other ppl with Onewheel could help to find all issues. This would required to fix all issues before next release.
Merge this into separate branch like development. This would not block next release, but I doubt that anyone will test these changes.
Leave this PR hanging and wait until I get my Onewheel. Then I could test changes myself on real device. Order was estimated on end of August :(
This was quite hard refactoring because of representation layer is tangled with connection logic. I explicitly tried to move code without any major clean-ups to preserve original logic. Will make separate PRs to improve architecture and make code testable.
Tried to split refactoring into logical commits for easier PR review. If some decisions are not clear please ask.
Didn't add any special logic/data/info to new notification. IMO this can be implemented in separate PR after discussion what should be shown there.
Added some random icon for notification. This also can be improved in separate PRs :)
This is how new notifications looks after toggling connect button:
With Don't keep activities mode ON. Activity is destroyed when minimized and new Activity created when app started. Service still running in background and new Activity reconnects to existing Service
Please report any issues. Will try to fix them ASAP. I hope to make this app fully android P compatible until my Onewheel arrives.
@audkar good stuff. i'll try and test this w/ my OW+ soon/today (XR is in the shop). If it works as expected, we can merge to master. Edit - moving to master, makes this easier to test.
refs #23
Extracted BT connection logic from from
MainActivity
toBluetoothConnectionService
. To achieve thisMainActivity
dependency had to be removed fromBluetoothUtilImpl
.Few notable points:
master
. Other ppl with Onewheel could help to find all issues. This would required to fix all issues before next release.development
. This would not block next release, but I doubt that anyone will test these changes.This is how new notifications looks after toggling connect button:
With
Don't keep activities
mode ON. Activity is destroyed when minimized and new Activity created when app started. Service still running in background and new Activity reconnects to existing ServicePlease report any issues. Will try to fix them ASAP. I hope to make this app fully android P compatible until my Onewheel arrives.