Merge "Update UsageStatsSerivce#KEEP_LEGACY_DIR." into rvc-dev am: 35afbf3271 am: 7f4c5c3071

Change-Id: I6592738532d95597e48bb80d872ae0fe76685b9c
This commit is contained in:
Automerger Merge Worker
2020-03-14 01:54:55 +00:00

View File

@@ -137,8 +137,7 @@ public class UsageStatsService extends SystemService implements
private static final File USAGE_STATS_LEGACY_DIR = new File( private static final File USAGE_STATS_LEGACY_DIR = new File(
Environment.getDataSystemDirectory(), "usagestats"); Environment.getDataSystemDirectory(), "usagestats");
// For migration purposes, indicates whether to keep the legacy usage stats directory or not // 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 = false;
private static final boolean KEEP_LEGACY_DIR = true;
private static final char TOKEN_DELIMITER = '/'; private static final char TOKEN_DELIMITER = '/';
@@ -648,7 +647,7 @@ public class UsageStatsService extends SystemService implements
private void deleteLegacyDir(int userId) { private void deleteLegacyDir(int userId) {
final File legacyUserDir = new File(USAGE_STATS_LEGACY_DIR, Integer.toString(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); deleteRecursively(legacyUserDir);
if (legacyUserDir.exists()) { if (legacyUserDir.exists()) {
Slog.w(TAG, "Error occurred while attempting to delete legacy usage stats " Slog.w(TAG, "Error occurred while attempting to delete legacy usage stats "