File tree Expand file tree Collapse file tree 3 files changed +2
-19
lines changed
core/java/android/hardware
services/camera/libcameraservice Expand file tree Collapse file tree 3 files changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ public void release() {
110110
111111 private static class CameraSoundPlayer implements Runnable {
112112 private int mSoundId ;
113- private int mAudioStreamType ;
114113 private MediaPlayer mPlayer ;
115114 private Thread mThread ;
116115 private boolean mExit ;
@@ -147,7 +146,7 @@ public void run() {
147146 }
148147 mPlayer = new MediaPlayer ();
149148 try {
150- mPlayer .setAudioStreamType (mAudioStreamType );
149+ mPlayer .setAudioStreamType (AudioManager . STREAM_SYSTEM_ENFORCED );
151150 mPlayer .setDataSource (soundFilePath );
152151 mPlayer .setLooping (false );
153152 mPlayer .prepare ();
@@ -179,11 +178,6 @@ public void run() {
179178
180179 public CameraSoundPlayer (int soundId ) {
181180 mSoundId = soundId ;
182- if (SystemProperties .get ("ro.camera.sound.forced" , "0" ).equals ("0" )) {
183- mAudioStreamType = AudioManager .STREAM_MUSIC ;
184- } else {
185- mAudioStreamType = AudioManager .STREAM_SYSTEM_ENFORCED ;
186- }
187181 }
188182
189183 public void play () {
Original file line number Diff line number Diff line change @@ -97,16 +97,6 @@ void CameraService::onFirstRef()
9797 setCameraFree (i);
9898 }
9999 }
100-
101- // Read the system property to determine if we have to use the
102- // AUDIO_STREAM_ENFORCED_AUDIBLE type.
103- char value[PROPERTY_VALUE_MAX];
104- property_get (" ro.camera.sound.forced" , value, " 0" );
105- if (strcmp (value, " 0" ) != 0 ) {
106- mAudioStreamType = AUDIO_STREAM_ENFORCED_AUDIBLE;
107- } else {
108- mAudioStreamType = AUDIO_STREAM_MUSIC;
109- }
110100}
111101
112102CameraService::~CameraService () {
@@ -295,7 +285,7 @@ void CameraService::setCameraFree(int cameraId) {
295285MediaPlayer* CameraService::newMediaPlayer (const char *file) {
296286 MediaPlayer* mp = new MediaPlayer ();
297287 if (mp->setDataSource (file, NULL ) == NO_ERROR) {
298- mp->setAudioStreamType (mAudioStreamType );
288+ mp->setAudioStreamType (AUDIO_STREAM_ENFORCED_AUDIBLE );
299289 mp->prepare ();
300290 } else {
301291 LOGE (" Failed to load CameraService sounds: %s" , file);
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ class CameraService :
7676 void setCameraFree (int cameraId);
7777
7878 // sounds
79- audio_stream_type_t mAudioStreamType ;
8079 MediaPlayer* newMediaPlayer (const char *file);
8180
8281 Mutex mSoundLock ;
You can’t perform that action at this time.
0 commit comments