Speed up "Saving Application Details" part of repo update
Fixes 506.
This does the thing mentioned in 506 (renaming temp table, rather than copying data). In the process, I also identified that the temp tables were missing key indexes which slowed the process down. This fix took the update time from ~100 seconds to ~60 seconds on my Nexus 4.
Below are a couple of log cats from before and after the change (this logging is not part of this MR, it was just for diagnosing the problem).
Before change:
AppProvider D Calculating whether apps are compatible, based on whether any of their apks are compatible
D Update compatible flags took 20244ms
D Calculating suggested versions for all apps which specify an upstream version code.
D Update suggested from upstream took 17808ms
D Calculating suggested versions for all apps which don't specify an upstream version code.
D Update suggested from latest took 129ms
AppProvider D Update icon URLs took 7879ms
UpdateService I Updating repo(s) complete, took 104 seconds to complete.
After change:
AppProvider D Calculating whether apps are compatible, based on whether any of their apks are compatible
D Update compatible flags took 1047ms
D Calculating suggested versions for all apps which specify an upstream version code.
D Update suggested from upstream took 601ms
D Calculating suggested versions for all apps which don't specify an upstream version code.
D Update suggested from latest took 136ms
D Update icon URLs took 887ms
UpdateService I Updating repo(s) complete, took 63 seconds to complete.