Attempt at fixing race condition during boot.

We've found local evidence that on fast hardware that the
MediaProvider.updateVolumes() method can be invoked while the
device is still unlocking.  This can cause a race condition due to
the "reportUnmounted" logic in StorageManagerService.getVolumeList()
which attempts to hide all volumes from apps until after the user
has been unlocked.

Since MediaProvider itself is the one hosting the FUSE daemon, it
always needs to know the real underlying state of volumes, so this
change adds special treatment to never augment the mount state
when the caller is the FUSE daemon.

Bug: 159189865
Test: manual
Change-Id: Id86e86aa942a697877860961d20ff0d8458dbc10
1 file changed