Add MediaProvider/MediaScanner testing aid

Given a media provider database, this lets you recreate a file tree
that when scanned by the media scanner will give you largely the same
database again.

Change-Id: Ie675fa7bb565525e4907d542116cc4c6ffd55e45
Merge "Add MediaProvider/MediaScanner testing aid"
am 007645ee: Enforce permissions on path in _DATA column.

* commit '007645ee2c67b83ffdd90d0e583ec866c60c4614':
  Enforce permissions on path in _DATA column.
am 46e56db3: Don\'t insert duplicate entries into the genre map

* commit '46e56db35b1ac30062db31f38b04cb719bba6bd8':
  Don't insert duplicate entries into the genre map
am 5619dbb4: Fix media provider dumpsys

* commit '5619dbb4338e9acea165f4cc0f1791d00e8df445':
  Fix media provider dumpsys
Check external storage volume ID to ensure media is actually mounted.

Programs may request to media scan files (via MediaScannerConnection::scanFile)
before external storage is mounted.  If that happens, MediaProvider creates
an external-ffffffff.db (volume ID -1) database once external storage is
mounted, instead of the one with the expected volume ID.

Later, if android.process.media is killed and respawned, the real external
database (that is, the one corresponding to the actual external storage
volume ID) is attached.  At best, that database contains stale records.
However, in conjunction with another bug (where the LRU database garbage
collector prunes all but one external database), most often a new, empty
database is created.  This results in the sudden disappearance of all
ringtones and media from programs that depend on the media database.

Change-Id: If4e23b52cd09a640e26852916eef53710c27d933
am d4e1312b: Set the right parent id

* commit 'd4e1312b4927b2bdd1f47e3d989f7293635c1125':
  Set the right parent id
am 677d5c9a: Speed up schema update

* commit '677d5c9a353fd956c9cb981ca38d9fb351c0421d':
  Speed up schema update
am 988280a7: Optimize bucket name, enhance logging

* commit '988280a7b7cba5888b943a6db05aab703fd9c35a':
  Optimize bucket name, enhance logging
Import translations. DO NOT MERGE

Change-Id: Ie87b23ee271ac56a746aca161ad9427899cf77f0
Merge "Check external storage volume ID to ensure media is actually mounted."
am 086f6926: Merge "Check external storage volume ID to ensure media is actually mounted."

* commit '086f6926e70b3269af0bdf66dd8501ebf49469f9':
  Check external storage volume ID to ensure media is actually mounted.
am 4b6b8d02: am 086f6926: Merge "Check external storage volume ID to ensure media is actually mounted."

* commit '4b6b8d02415b23d1e98d7f320e7aee6c8ffcae4f':
  Check external storage volume ID to ensure media is actually mounted.
am f3329452: Open file directly when external storage emulated.

* commit 'f3329452c5554f4a3bcd3c41d7ec669a0d55c997':
  Open file directly when external storage emulated.
am 52e925fc: am f3329452: Open file directly when external storage emulated.

* commit '52e925fc3b61fdef0e7218fb89d7e154b95ff447':
  Open file directly when external storage emulated.
am 16f31d6f: Merge "Handle _ and % in paths" into jb-dev

* commit '16f31d6fbe946ce7912ee6ddddd4b3660d3e66e7':
  Handle _ and % in paths
am ff42294a: am 16f31d6f: Merge "Handle _ and % in paths" into jb-dev

* commit 'ff42294a2b050913c172b580a892a9e40aae24d2':
  Handle _ and % in paths
am 090b69b2: Merge "Handle the case case." into jb-dev

* commit '090b69b2def68199dfa5206fc8f03b7f7d084985':
  Handle the case case.
am 91842bef: am 090b69b2: Merge "Handle the case case." into jb-dev

* commit '91842bef7759efbeb3830ce1728289dc6b7d17c8':
  Handle the case case.
am 877f0a4d: Merge "Treat missing Cursor as FNFE." into jb-dev

* commit '877f0a4d23d4be09a2c3b2f3e637cc3d1332e160':
  Treat missing Cursor as FNFE.