From 957eea5115b9f72508c33942dbf02f3a54de1a7f Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 6 Apr 2012 15:24:05 +0800 Subject: Ensure screenshots saved through DDMS end with .png. This patch simply makes sure that the filename will have a .png extension when saving a screenshot through DDMS. Change-Id: Idb00259ac456fcaf11ee99736663fc7ddbbc505b Signed-off-by: Sebastian Roth --- ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ddms/libs') diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java index d0c8a2f..b0f885a 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java @@ -321,6 +321,10 @@ public class ScreenShotDialog extends Dialog { // the value the dialog was initialized with. It does however return // the full path as its return value, so just pick the path from // there. + if (!fileName.endsWith(".png")) { + fileName = fileName + ".png"; + } + String saveDir = new File(fileName).getParent(); if (saveDir != null) { DdmUiPreferences.getStore().setValue("lastImageSaveDir", saveDir); -- cgit v1.1