diff options
author | Winson Chung <winsonc@google.com> | 2011-12-01 14:55:41 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-01 14:55:41 -0800 |
commit | cea32ecd3aef013bc5da6e401eeb8e9e8cd1b595 (patch) | |
tree | ca21f6d795957152f0ca681e33e896fc00606aad /packages | |
parent | 5a7c91769f011bc150c9def9edab9cccb4761c66 (diff) | |
parent | 8d513eaef78f2d908dba41968ef8a13d36bb7a68 (diff) | |
download | frameworks_base-cea32ecd3aef013bc5da6e401eeb8e9e8cd1b595.zip frameworks_base-cea32ecd3aef013bc5da6e401eeb8e9e8cd1b595.tar.gz frameworks_base-cea32ecd3aef013bc5da6e401eeb8e9e8cd1b595.tar.bz2 |
Merge "Adding a sound when you take a screenshot. (Bug 5617734)" into ics-mr1
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index 2dcd80d..2232995 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -34,6 +34,7 @@ import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.PointF; +import android.hardware.CameraSound; import android.net.Uri; import android.os.AsyncTask; import android.os.Environment; @@ -49,6 +50,7 @@ import android.view.ViewGroup; import android.view.WindowManager; import android.view.animation.Interpolator; import android.widget.ImageView; + import com.android.systemui.R; import java.io.File; @@ -254,6 +256,8 @@ class GlobalScreenshot { private float mBgPadding; private float mBgPaddingScale; + private CameraSound mCameraSound; + /** * @param context everything needs a context :( @@ -303,6 +307,9 @@ class GlobalScreenshot { // Scale has to account for both sides of the bg mBgPadding = (float) r.getDimensionPixelSize(R.dimen.global_screenshot_bg_padding); mBgPaddingScale = mBgPadding / mDisplayMetrics.widthPixels; + + // Setup the Camera shutter sound + mCameraSound = new CameraSound(); } /** @@ -413,6 +420,9 @@ class GlobalScreenshot { mScreenshotLayout.post(new Runnable() { @Override public void run() { + // Play the shutter sound to notify that we've taken a screenshot + mCameraSound.playSound(CameraSound.SHUTTER_CLICK); + mScreenshotView.setLayerType(View.LAYER_TYPE_HARDWARE, null); mScreenshotView.buildLayer(); mScreenshotAnimation.start(); |