Fix crash when activity for file upload is not present.

Ensure that there is an activity to handle the intents
that the file upload control fires. If not, fallback to
the default upload control. This CL also refactors the
code to be (hopefully :)) easier to follow.

Bug:3447924
Change-Id: Ie5f7b448ec1c6abc7da7df29b94cc120d3b2c60e
2 files changed