Avoid nested transactions

Even though previous change standardizes on blocking nested transactions
inside MediaProvider, nested transactions are used at applyBatch() due
to using different volume names for "external" or triggering scan. So we
can meet b1->b2->s1->s2->e1->e2 or b1->b2->s2->e2->s1->e1. The former
was worse than the latter before appling previous change since
IllegalStateException happens. To resolve this, converted volume name is
used instead of pure volume name. Even we see if SQLite is in
transaction to avoid nested transactions.

Bug: 147778656
Test: atest MediaProviderTests
Change-Id: I45670d62b8593c67d2cf4bea6ac9a28abd890bc3
2 files changed