Handle failure of creating MediaPlayer properly

MediaPlayer::setDataSource() doesn't fail with a non-existing file. So
we should check the result of MediaPlayer::prepare() as well.

Note that MediaPlayer::disconnect() is called instead of deleting
MediaPlayer directly because the latter causes crash of CameraService.
MediaPlayer::disconnect() is called even in
CameraService::releaseSound().

Bug: 74376839
Test: tested an app using CameraService
Change-Id: Idf68837a55d14ad47dbbedff0256269bd90f9dfd
2 files changed