Refactor some common code and make detecting sdcard paths more robust.

Change-Id: I6555f6b82e94f8eee0400eddaaffc0442d5e1c41
4 files changed