Add method to remove file from history based on matching file path.

NotificationHistoryDatabase sometimes attempts to read a file that doesn't exist; this happens because scheduled history file deletions (for files >24h old) weren't correctly removing AtomicFiles from the mHistoryFiles list due to using the built in LinkedList remove() method. The new method explictly removes the first file in history matching the file path deleted, rather than attempting to use AtomicFile equality.

Test: atest NotificationHistoryDatabaseTest; manually verified that NotiHistoryDatabase stopped erroring
Fixes: 185257041
Change-Id: I56c4a3293166a84e29920afe5549171becdaa496
2 files changed