diff options
Diffstat (limited to 'src/com/android/camera/FocusManager.java')
-rw-r--r-- | src/com/android/camera/FocusManager.java | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/com/android/camera/FocusManager.java b/src/com/android/camera/FocusManager.java index bdf4766..e25c95e 100644 --- a/src/com/android/camera/FocusManager.java +++ b/src/com/android/camera/FocusManager.java @@ -26,6 +26,7 @@ import android.graphics.Rect; import android.graphics.RectF; import android.hardware.Camera.Area; import android.hardware.Camera.Parameters; +import android.hardware.Camera.Sound; import android.os.Handler; import android.os.Message; import android.util.Log; @@ -59,7 +60,6 @@ public class FocusManager { private boolean mLockAeAwbNeeded; private boolean mAeAwbLock; private Matrix mMatrix; - private SoundPlayer mSoundPlayer; private View mFocusIndicatorRotateLayout; private FocusIndicatorView mFocusIndicator; private View mPreviewFrame; @@ -81,6 +81,7 @@ public class FocusManager { public void startFaceDetection(); public void stopFaceDetection(); public void setFocusParameters(); + public void playSound(int soundId); } private class MainHandler extends Handler { @@ -221,9 +222,9 @@ public class FocusManager { // Do not play the sound in continuous autofocus mode. It does // not do a full scan. The focus callback arrives before doSnap // so the state is always STATE_FOCUSING. - if (!Parameters.FOCUS_MODE_CONTINUOUS_PICTURE.equals(mFocusMode) - && mSoundPlayer != null) { - mSoundPlayer.play(); + if (!Parameters.FOCUS_MODE_CONTINUOUS_PICTURE. + equals(mFocusMode)) { + mListener.playSound(Sound.FOCUS_COMPLETE); } } else { mState = STATE_FAIL; @@ -346,18 +347,6 @@ public class FocusManager { } } - public void initializeSoundPlayer(AssetFileDescriptor fd) { - mSoundPlayer = new SoundPlayer(fd); - } - - public void releaseSoundPlayer() { - if (mSoundPlayer != null) { - mSoundPlayer.release(); - mSoundPlayer = null; - } - } - - // This can only be called after mParameters is initialized. public String getFocusMode() { if (mOverrideFocusMode != null) return mOverrideFocusMode; |