diff options
-rw-r--r-- | core/java/android/hardware/CameraSound.java | 8 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 12 | ||||
-rw-r--r-- | services/camera/libcameraservice/CameraService.h | 1 |
3 files changed, 2 insertions, 19 deletions
diff --git a/core/java/android/hardware/CameraSound.java b/core/java/android/hardware/CameraSound.java index 32de0cd..dc97ff0 100644 --- a/core/java/android/hardware/CameraSound.java +++ b/core/java/android/hardware/CameraSound.java @@ -110,7 +110,6 @@ public class CameraSound { private static class CameraSoundPlayer implements Runnable { private int mSoundId; - private int mAudioStreamType; private MediaPlayer mPlayer; private Thread mThread; private boolean mExit; @@ -147,7 +146,7 @@ public class CameraSound { } mPlayer = new MediaPlayer(); try { - mPlayer.setAudioStreamType(mAudioStreamType); + mPlayer.setAudioStreamType(AudioManager.STREAM_SYSTEM_ENFORCED); mPlayer.setDataSource(soundFilePath); mPlayer.setLooping(false); mPlayer.prepare(); @@ -179,11 +178,6 @@ public class CameraSound { public CameraSoundPlayer(int soundId) { mSoundId = soundId; - if (SystemProperties.get("ro.camera.sound.forced", "0").equals("0")) { - mAudioStreamType = AudioManager.STREAM_MUSIC; - } else { - mAudioStreamType = AudioManager.STREAM_SYSTEM_ENFORCED; - } } public void play() { diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index bb0e664..52d9bf35 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -97,16 +97,6 @@ void CameraService::onFirstRef() setCameraFree(i); } } - - // Read the system property to determine if we have to use the - // AUDIO_STREAM_ENFORCED_AUDIBLE type. - char value[PROPERTY_VALUE_MAX]; - property_get("ro.camera.sound.forced", value, "0"); - if (strcmp(value, "0") != 0) { - mAudioStreamType = AUDIO_STREAM_ENFORCED_AUDIBLE; - } else { - mAudioStreamType = AUDIO_STREAM_MUSIC; - } } CameraService::~CameraService() { @@ -295,7 +285,7 @@ void CameraService::setCameraFree(int cameraId) { MediaPlayer* CameraService::newMediaPlayer(const char *file) { MediaPlayer* mp = new MediaPlayer(); if (mp->setDataSource(file, NULL) == NO_ERROR) { - mp->setAudioStreamType(mAudioStreamType); + mp->setAudioStreamType(AUDIO_STREAM_ENFORCED_AUDIBLE); mp->prepare(); } else { LOGE("Failed to load CameraService sounds: %s", file); diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index cdfbc56..bad41f5 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -76,7 +76,6 @@ private: void setCameraFree(int cameraId); // sounds - audio_stream_type_t mAudioStreamType; MediaPlayer* newMediaPlayer(const char *file); Mutex mSoundLock; |