summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2020-07-23 23:16:47 +0100
committerTobias Thierer <tobiast@google.com>2020-07-26 21:10:36 +0100
commit2b3004dcc1bf13106741af4464da69012de1b279 (patch)
tree660fe356e373581bfdb9631ed70b8338a63d4e1c /libs/hwui/renderthread/RenderThread.cpp
parent112e3c2d049d304b0aa57750fcaa6415ea2b6fef (diff)
Fix DataChangedJournalTest.equals().
Problems: 1. The class implemented equals() but not hashCode() 2. equals() attempted to canonicalize the underlying path and silently returned false if the I/O operation failed. Fixes: 1. Implemented hashCode(). 2. Stopped equals() attempting canonicalization and built in directly on top of File.equals() instead. I also considered moving the canonicalization to the DataChangedJournal ctor, but that - had the undesirable side effect of stopping interaction with the journal for reasons other than the file itself being corrupt, and - posed the problem of what to do in case of an IOException during construction. The downside of course is that caller which (inappropriately) relied on equals() doing canonicalization can no longer rely on that. I didn't find any such callers. Note: When DateChangedJournal.listJournals() fails to perform a directory listing (e.g. if the journal directory doesn't exist), it currently still returns an (empty) ArrayList<DateChangedJournal>. This CL does not address this, but in a follow-up CL I might change this to return an unmodifiable List or Set<DateChangedJournal>, and throw an IOException if the directory contents can't be listed. Bug: 162022005 Test: atest FrameworksServicesTests:com.android.server.backup.DataChangedJournalTest Change-Id: I94f35f9a3082f398758fe5b03fb8d260e4fb3e1b
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
0 files changed, 0 insertions, 0 deletions