Disable CHANGELOG popup on application upgrade #250
|
@ -178,6 +178,7 @@ public class SWADMain extends MenuExpandableListActivity {
|
|||
|
||||
//If this is an upgrade, show upgrade dialog
|
||||
} else if (lastVersion < currentVersion) {
|
||||
//showUpgradeDialog(this);
|
||||
upgradeApp(lastVersion, currentVersion);
|
||||
}
|
||||
|
||||
|
@ -239,6 +240,8 @@ public class SWADMain extends MenuExpandableListActivity {
|
|||
* @param currentVersion Current version of application
|
||||
*/
|
||||
private void firstRun(int currentVersion) {
|
||||
Log.i(TAG, "Running application for first time. Setting current version to " + currentVersion);
|
||||
|
||||
Intent activity = new Intent(this, AccountAuthenticator.class);
|
||||
|
||||
//Configure automatic synchronization
|
||||
|
@ -249,6 +252,8 @@ public class SWADMain extends MenuExpandableListActivity {
|
|||
firstRun = true;
|
||||
|
||||
Preferences.initializeSelectedCourse();
|
||||
|
||||
Log.i(TAG, "First initialization completed successfully");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,7 +262,8 @@ public class SWADMain extends MenuExpandableListActivity {
|
|||
* @param currentVersion Version to which the application is updated
|
||||
*/
|
||||
private void upgradeApp(int lastVersion, int currentVersion) throws NoSuchAlgorithmException {
|
||||
showUpgradeDialog(this);
|
||||
Log.i(TAG, "Upgrading application from version " + lastVersion + " to version " + currentVersion);
|
||||
|
||||
dbHelper.upgradeDB();
|
||||
|
||||
if(lastVersion < 52) {
|
||||
|
@ -280,6 +286,8 @@ public class SWADMain extends MenuExpandableListActivity {
|
|||
}
|
||||
|
||||
Preferences.setLastVersion(currentVersion);
|
||||
|
||||
Log.i(TAG, "Application upgraded from version " + lastVersion + " to version " + currentVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2320,6 +2320,7 @@ public class DataBaseHelper {
|
|||
* Clean data of all tables from database. Removes users photos from external storage
|
||||
*/
|
||||
public void cleanTables() {
|
||||
Log.i(TAG, "Emptying all tables");
|
||||
|
||||
db.emptyTables();
|
||||
compactDB();
|
||||
|
@ -2372,6 +2373,7 @@ public class DataBaseHelper {
|
|||
* Compact the database
|
||||
*/
|
||||
private void compactDB() {
|
||||
Log.i(TAG, "Compacting database");
|
||||
db.getDB().execSQL("VACUUM;");
|
||||
Log.i(TAG, "Database compacted");
|
||||
}
|
||||
|
@ -2390,6 +2392,9 @@ public class DataBaseHelper {
|
|||
*/
|
||||
public void upgradeDB() {
|
||||
int dbVersion = db.getDB().getVersion();
|
||||
|
||||
Log.i(TAG, "Upgrading database");
|
||||
|
||||
/*
|
||||
* Modify database keeping data:
|
||||
* 1. Create temporary table __DB_TABLE_GROUPS (with the new model)
|
||||
|
|
Loading…
Reference in New Issue
Block a user