summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/screenshot
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-22 12:19:52 -0700
committerWinson Chung <winsonc@google.com>2011-07-25 11:19:43 -0700
commitd859fa399133da32705415e138c897f263ae99ad (patch)
tree34979065fa6672a93a6bea753768e3738c7e78c5 /packages/SystemUI/src/com/android/systemui/screenshot
parent895de9269fa125bf3903c21faf5e8d2750bfb000 (diff)
downloadframeworks_base-d859fa399133da32705415e138c897f263ae99ad.zip
frameworks_base-d859fa399133da32705415e138c897f263ae99ad.tar.gz
frameworks_base-d859fa399133da32705415e138c897f263ae99ad.tar.bz2
Preventing screenshots when waking from sleep.
- Fixing crash in SystemUI when trying to access external storage while it is not mounted Change-Id: I3d9a05c155b83a2cc39915caebad4b7016025d09
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/screenshot')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 83a5578..02a955b 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -87,7 +87,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
Context context = params[0].context;
Bitmap image = params[0].image;
- try{
+ try {
long currentTime = System.currentTimeMillis();
String date = new SimpleDateFormat("MM-dd-yy-kk-mm-ss").format(new Date(currentTime));
String imageDir = Environment.getExternalStoragePublicDirectory(
@@ -114,7 +114,9 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
out.close();
params[0].result = 0;
- }catch(IOException e){
+ } catch (Exception e) {
+ // IOException/UnsupportedOperationException may be thrown if external storage is not
+ // mounted
params[0].result = 1;
}