summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/screenshot
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2012-11-06 16:29:46 -0800
committerDoris Liu <tianliu@google.com>2012-11-06 16:29:46 -0800
commit5aa011b18a532a1ffa598649230e3cf33822d48e (patch)
tree9d24c0d4dc9ccbfaaa4e9ca2e0bd37e1ac286e96 /packages/SystemUI/src/com/android/systemui/screenshot
parentacff0272d6c0c38cbfa1d9f4dee73ebe04a95819 (diff)
downloadframeworks_base-5aa011b18a532a1ffa598649230e3cf33822d48e.zip
frameworks_base-5aa011b18a532a1ffa598649230e3cf33822d48e.tar.gz
frameworks_base-5aa011b18a532a1ffa598649230e3cf33822d48e.tar.bz2
Adding width and height into screenshot metadata
Bug: 7486020 Change-Id: I375cf9f1065bd1c75558d5f986e7e483cfd4a404
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/screenshot')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 2723f82..03de89bd 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -91,6 +91,8 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
private String mImageFilePath;
private long mImageTime;
private BigPictureStyle mNotificationStyle;
+ private int mImageWidth;
+ private int mImageHeight;
// WORKAROUND: We want the same notification across screenshots that we update so that we don't
// spam a user's notification drawer. However, we only show the ticker for the saving state
@@ -113,11 +115,11 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
SCREENSHOTS_DIR_NAME, mImageFileName);
// Create the large notification icon
- int imageWidth = data.image.getWidth();
- int imageHeight = data.image.getHeight();
+ mImageWidth = data.image.getWidth();
+ mImageHeight = data.image.getHeight();
int iconSize = data.iconSize;
- final int shortSide = imageWidth < imageHeight ? imageWidth : imageHeight;
+ final int shortSide = mImageWidth < mImageHeight ? mImageWidth : mImageHeight;
Bitmap preview = Bitmap.createBitmap(shortSide, shortSide, data.image.getConfig());
Canvas c = new Canvas(preview);
Paint paint = new Paint();
@@ -125,8 +127,8 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
desat.setSaturation(0.25f);
paint.setColorFilter(new ColorMatrixColorFilter(desat));
Matrix matrix = new Matrix();
- matrix.postTranslate((shortSide - imageWidth) / 2,
- (shortSide - imageHeight) / 2);
+ matrix.postTranslate((shortSide - mImageWidth) / 2,
+ (shortSide - mImageHeight) / 2);
c.drawBitmap(data.image, matrix, paint);
c.drawColor(0x40FFFFFF);
@@ -183,6 +185,8 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
values.put(MediaStore.Images.ImageColumns.DATE_ADDED, mImageTime);
values.put(MediaStore.Images.ImageColumns.DATE_MODIFIED, mImageTime);
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
+ values.put(MediaStore.Images.ImageColumns.WIDTH, mImageWidth);
+ values.put(MediaStore.Images.ImageColumns.HEIGHT, mImageHeight);
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
String subjectDate = new SimpleDateFormat("hh:mma, MMM dd, yyyy")