Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b34ce0 authored by Varun Shah's avatar Varun Shah
Browse files

Update UsageStatsDatabase#KEEP_BACKUP_DIR.

Delete the backup usage stats directory on a successful upgrade to v5.
This was kept as true such that a revert to the previous version  would
be possible if needed.

Also indicate that an upgrade was performed such that relevant data is
pruned on dogfood builds.

Bug: 139937606
Test: manual: dir is deleted on migration.
Change-Id: I60285dc812a045bc82dd68a6e7ae87c2d3563adc
parent 6d03d973
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -98,8 +98,7 @@ public class UsageStatsDatabase {

    // Persist versioned backup files.
    // Should be false, except when testing new versions
    // STOPSHIP: b/139937606 this should be false on launch
    static final boolean KEEP_BACKUP_DIR = true;
    static final boolean KEEP_BACKUP_DIR = false;

    private static final String TAG = "UsageStatsDatabase";
    private static final boolean DEBUG = UsageStatsService.DEBUG;
@@ -412,6 +411,7 @@ public class UsageStatsDatabase {
        }

        if (mBackupsDir.exists() && !KEEP_BACKUP_DIR) {
            mUpgradePerformed = true; // updated here to ensure that data is cleaned up
            deleteDirectory(mBackupsDir);
        }
    }