camera2-portability: Play shutter sound for camera2 captures

Bug: 17109582
Change-Id: I73321cdbb2972b2d1e9bc2de93192fbb506347e7
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2AgentImpl.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2AgentImpl.java
index e675796..d139c62 100644
--- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2AgentImpl.java
+++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCamera2AgentImpl.java
@@ -35,6 +35,7 @@
 import android.hardware.camera2.params.MeteringRectangle;
 import android.media.Image;
 import android.media.ImageReader;
+import android.media.MediaActionSound;
 import android.os.Build;
 import android.os.Handler;
 import android.os.HandlerThread;
@@ -63,6 +64,7 @@
     private final CameraStateHolder mCameraState;
     private final DispatchThread mDispatchThread;
     private final CameraManager mCameraManager;
+    private final MediaActionSound mNoisemaker;
 
     /**
      * Number of camera devices.  The length of {@code mCameraDevices} does not reveal this
@@ -88,6 +90,8 @@
         mDispatchThread = new DispatchThread(mCameraHandler, mCameraHandlerThread);
         mDispatchThread.start();
         mCameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
+        mNoisemaker = new MediaActionSound();
+        mNoisemaker.load(MediaActionSound.SHUTTER_CLICK);
 
         mNumCameraDevices = 0;
         mCameraDevices = new ArrayList<String>();
@@ -915,7 +919,6 @@
                 }});
         }
 
-        // TODO: Implement
         @Override
         public void takePicture(final Handler handler,
                                 final CameraShutterCallback shutter,
@@ -932,6 +935,7 @@
                         handler.post(new Runnable() {
                             @Override
                             public void run() {
+                                mNoisemaker.play(MediaActionSound.SHUTTER_CLICK);
                                 shutter.onShutter(AndroidCamera2ProxyImpl.this);
                             }});
                     }