For service - activity communications, bind the service instead.
Also:
* Force portrait, get rid of old land layout
* Do not use network on autoState
* Properly handle download notification actions - w/o dismissing
* Stop using shared prefs to trigger service events
* Improve and simplify a lot of code
* Get rid of some edge case crashes
* Many other fixes I can't recall
This was VERY expansive. Can actually feel the difference in responsiveness.
Considerably less CPU usage and CPU time after this fix.
Also make sure we're rate limited to at least 250ms everywhere except sum verify
Also allows the user to actually pause (without a network interrupt)
Stop button UI was reworked for this as well
Better reflects a network error is resume-able as well
Many other minor bug & code fixes while at it
When the user removes the update zip after we're in ready to flash state he could still press on flash
which results in STATE_ERROR_AB_FLASH but we still have the ready prefs set
To avoid just clear the state when the package is not found
* Adapt for latest SDK
* Get rid of many deprecations
* Use apply() instead of commit() where possible for shared prefs
* Many others like unused vars, bad formatting, bad practices and so on
Really too lazy to list all, just take a look.
Also unify the mess that was going on there. Use one function for all.
Always show progress when we check the whole file again.
Few other minor improvements
Making android disable encryption for the OTA zip and rebooting to recovery to flash it.
Also remove CWM recovery support. This thing is way too old and too dead.
Also refelct:
E/update_engine(1463): [ERROR:update_attempter_android.cc(90)] Replying with failure: pc:0x6241ff04b8: An update already applied, waiting for reboot
with the reboot notice, instead of being stuck at 0%
Also cleanup some code. More to come.
We don't actually need to use scoped storage, just ask correctly for a full storage perm
Finally target latest SDK, this is probably not backwards compatible so also change the minimum
Also improve AndroidManifest, get rid of dangerous permissions such as
http communication and useless ones.
Who needs a specific checkbox for each network????
Also get rid of deprecated API calls all over the place, properly use
ConnectivityManager. Clean the NetworkState class
* Simplify some logic
* Get rid of unused imports
* Global vars that can be final / static should be
* Correctly handle & compare strings all across
* Get rid of useless castings, conversions, scoping etc
* Make this mess slightly more readable
* Many many more. Too lazy to sum up all
Left todo:
Get rid of deprecation all across, this is gonna be a huge pain in the
future if we don't.