Expand testing of Mainline data migration.

Add tests for audio, video, images, pending, trashed, favorites, and
ownership, to verify that they're all migrated as we expect.

Since development iteration with APEX can be tricky and slow, add a
new "deploy.sh" shell script to avoid the need for a reboot.  Expand
logging shell script to catch all possible package names.

Fix transaction issue with migration logic; we're already in a
transaction from SQLiteOpenHelper, and we can't nest transactions,
so move to using SAVEPOINT and ROLLBACK instead.

Fix bugs in both migration and scanning to ensure that we include
all files, including those which are pending or trashed.

Fix obscure bug in ID_NOT_PARENT_CLAUSE which would call all media
deletions to fail when there was a "NULL" parent anywhere in the
database.

Bug: 144247087
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: If4e0ec70ecf333d444e2195fe3c005aa2c9c5feb
6 files changed