This rewrites the download manager to properly handle all possible download states, and cancel/clean up after itself properly (previously it could get in a stuck state and hang a thread forever, lagging the device from download state queries every millisecond)
Additionally, this handles the event the download was cancelled through a coroutine cancellation, and cancels the download subsequently and cleans up after itself (so the entire installation process will not go on now either)
This rewrites the download manager to properly handle all possible download states, and cancel/clean up after itself properly (previously it could get in a stuck state and hang a thread forever, lagging the device from download state queries every millisecond)
Additionally, this handles the event the download was cancelled through a coroutine cancellation, and cancels the download subsequently and cleans up after itself (so the entire installation process will not go on now either)
Could possibly be a fix for #50 as well