Merge branch 'two-0.101-fixes' into 'master'

Two 0.101 fixes

This includes two fixes for 0.101.  One of them has already been included in stable-v0.100 for 0.100.1.

See merge request !337
This commit is contained in:
Daniel Martí 2016-06-16 19:14:25 +00:00
commit 4f67437bc9
2 changed files with 9 additions and 3 deletions

View File

@ -566,7 +566,7 @@ class DBHelper extends SQLiteOpenHelper {
* table for the first time. * table for the first time.
*/ */
private void recreateInstalledAppTable(SQLiteDatabase db, int oldVersion) { private void recreateInstalledAppTable(SQLiteDatabase db, int oldVersion) {
if (oldVersion >= 57) { if (oldVersion >= 56) {
return; return;
} }
Utils.debugLog(TAG, "(re)creating 'installed app' database table."); Utils.debugLog(TAG, "(re)creating 'installed app' database table.");

View File

@ -459,11 +459,17 @@ public class InstallManagerService extends Service {
return ACTIVE_APPS.get(getApkFromActive(urlString).packageName); return ACTIVE_APPS.get(getApkFromActive(urlString).packageName);
} }
/**
* Remove the URL from this service, and return the {@link Apk}. This returns
* an empty {@code Apk} instance if we get a null one so the code doesn't need
* lots of null guards.
*/
private static Apk removeFromActive(String urlString) { private static Apk removeFromActive(String urlString) {
Apk apk = ACTIVE_APKS.remove(urlString); Apk apk = ACTIVE_APKS.remove(urlString);
if (apk != null) { if (apk == null) {
ACTIVE_APPS.remove(apk.packageName); return new Apk();
} }
ACTIVE_APPS.remove(apk.packageName);
return apk; return apk;
} }