Only notify when transaction was successful.

An earlier change shifted sending notifications until after the
transaction was actually ended, but that started sending notifications
regardless of success or failure of the transaction.  To resolve this,
we now track the successful state of each transaction.

SQLite itself supports nested transactions, but these can be very
tedious to track correctly, so this change standardizes on blocking
nested transactions inside MediaProvider.  Adjust deleteRecursive()
to no longer rely on nested transactions.

Bug: 147778656
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ic104d51b5bd65938884ca738309781bf2e6ff067
2 files changed