diff options
author | Winson Chung <winsonc@google.com> | 2011-07-25 17:20:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-25 17:20:19 -0700 |
commit | eedc6f0d7dc7dc8ce86d787ce532ed0aa2d61d91 (patch) | |
tree | 370baca41968733d29d4bcde1a8dbf2f8cce7049 /packages/SystemUI/src/com/android/systemui/screenshot | |
parent | 82a94afa96eb6830b09bb007f278d9f8d8362733 (diff) | |
parent | 753e40b1472563987489bd5b187ced4c1b608b0d (diff) | |
download | frameworks_base-eedc6f0d7dc7dc8ce86d787ce532ed0aa2d61d91.zip frameworks_base-eedc6f0d7dc7dc8ce86d787ce532ed0aa2d61d91.tar.gz frameworks_base-eedc6f0d7dc7dc8ce86d787ce532ed0aa2d61d91.tar.bz2 |
Merge "Using the filename as the media title for screenshots and changing filename format."
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/screenshot')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index 02a955b..3e037c1 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -78,7 +78,8 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi SaveImageInBackgroundData> { private static final String TAG = "SaveImageInBackgroundTask"; private static final String SCREENSHOTS_DIR_NAME = "Screenshots"; - private static final String SCREENSHOT_FILE_PATH_TEMPLATE = "%s/%s/Screenshot_%s-%d.png"; + private static final String SCREENSHOT_FILE_NAME_TEMPLATE = "Screenshot_%s.png"; + private static final String SCREENSHOT_FILE_PATH_TEMPLATE = "%s/%s/%s"; @Override protected SaveImageInBackgroundData doInBackground(SaveImageInBackgroundData... params) { @@ -89,18 +90,18 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi try { long currentTime = System.currentTimeMillis(); - String date = new SimpleDateFormat("MM-dd-yy-kk-mm-ss").format(new Date(currentTime)); + String date = new SimpleDateFormat("yyyy-MM-dd-kk-mm-ss").format(new Date(currentTime)); String imageDir = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES).getAbsolutePath(); - String imageFilePath = String.format(SCREENSHOT_FILE_PATH_TEMPLATE, - imageDir, SCREENSHOTS_DIR_NAME, - date, currentTime % 1000); + String imageFileName = String.format(SCREENSHOT_FILE_NAME_TEMPLATE, date); + String imageFilePath = String.format(SCREENSHOT_FILE_PATH_TEMPLATE, imageDir, + SCREENSHOTS_DIR_NAME, imageFileName); // Save the screenshot to the MediaStore ContentValues values = new ContentValues(); values.put(MediaStore.Images.ImageColumns.DATA, imageFilePath); - values.put(MediaStore.Images.ImageColumns.TITLE, "Screenshot"); - values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, "Screenshot"); + values.put(MediaStore.Images.ImageColumns.TITLE, imageFileName); + values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, imageFileName); values.put(MediaStore.Images.ImageColumns.DATE_TAKEN, currentTime); values.put(MediaStore.Images.ImageColumns.DATE_ADDED, currentTime); values.put(MediaStore.Images.ImageColumns.DATE_MODIFIED, currentTime); |