diff options
author | Varun Shah <varunshah@google.com> | 2019-12-20 10:56:42 -0800 |
---|---|---|
committer | Varun Shah <varunshah@google.com> | 2020-03-04 23:24:01 +0000 |
commit | 7dbf65f0326d421b339e4ec6ff3f19d3c7863718 (patch) | |
tree | 387b2f3e8360300244adec1736d36e2c5cbff4d8 | |
parent | 6d03d973c02feff88019b246e6506f2b072fc535 (diff) |
Update UsageStatsSerivce#KEEP_LEGACY_DIR.
Delete legacy usage stats directory on a successful migration to CE.
This was kept as true such that a revert to the legacy would be possible
if needed.
Bug: 138323140
Test: manual: dir is deleted on migration.
Change-Id: I727df5d9139bfa1601cd02d979732f0d912bd29d
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 0d1b3523bf9b..bbe9851520a1 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -137,8 +137,7 @@ public class UsageStatsService extends SystemService implements private static final File USAGE_STATS_LEGACY_DIR = new File( Environment.getDataSystemDirectory(), "usagestats"); // For migration purposes, indicates whether to keep the legacy usage stats directory or not - // STOPSHIP: b/138323140 this should be false on launch - private static final boolean KEEP_LEGACY_DIR = true; + private static final boolean KEEP_LEGACY_DIR = false; private static final char TOKEN_DELIMITER = '/'; @@ -648,7 +647,7 @@ public class UsageStatsService extends SystemService implements private void deleteLegacyDir(int userId) { final File legacyUserDir = new File(USAGE_STATS_LEGACY_DIR, Integer.toString(userId)); - if (!KEEP_LEGACY_DIR) { + if (!KEEP_LEGACY_DIR && legacyUserDir.exists()) { deleteRecursively(legacyUserDir); if (legacyUserDir.exists()) { Slog.w(TAG, "Error occurred while attempting to delete legacy usage stats " |