From 61d2bbef5e4b12a7a72ab22fc463e411258455f8 Mon Sep 17 00:00:00 2001 From: Tobias Thierer Date: Tue, 29 Sep 2020 23:22:20 +0100 Subject: [PATCH] DataChangedJournal: Make nonfinal to partially fix a test breakage. Context: KeyValueBackupTask's ctor takes a DataChangedJournal instance. KeyValueBackupTaskTest uses a mock instance to check that remove() is called. http://ag/12218310 made DataChangedJournal final, breaking the test. This CL fixes the failure cause by making the class nonfinal. Note that the test still fails because at least one unrelated failure cause remains - see http://b/162022005#comment11 In the longer term, we may want to consider splitting DataChangedJournal into an interface/abstract class + a concrete implementation; there's no good reason why KeyValueBackupTask and KeyValueBackupReporter need to depend on specifically the implementation class, when all they're calling is remove() and toString(). However, the change to make the class final wasn't important, and reverting it is the easiest / fasted way to unbreak the test. Bug: 162022005 Test: atest KeyValueBackupTaskTest Change-Id: I22b2a5d65f03c4ccdcc718ed3866d37ba9441385 --- .../java/com/android/server/backup/DataChangedJournal.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/backup/java/com/android/server/backup/DataChangedJournal.java b/services/backup/java/com/android/server/backup/DataChangedJournal.java index 0e7fc93df7cc3..4eb1d9a6a7c5c 100644 --- a/services/backup/java/com/android/server/backup/DataChangedJournal.java +++ b/services/backup/java/com/android/server/backup/DataChangedJournal.java @@ -40,7 +40,7 @@ import java.util.function.Consumer; *

This information is persisted to the filesystem so that it is not lost in the event of a * reboot. */ -public final class DataChangedJournal { +public class DataChangedJournal { private static final String TAG = "DataChangedJournal"; private static final String FILE_NAME_PREFIX = "journal";