diff options
author | Winson Chung <winsonc@google.com> | 2013-01-17 00:27:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-01-17 00:27:24 +0000 |
commit | 103bc3342efe2a8a9a3a26f2e115bd1b58e0ed77 (patch) | |
tree | 9b1e72cc149bab2f27af84e27f74982032b7c69a /packages/SystemUI/src/com/android/systemui/screenshot | |
parent | b16dcd14b5d4bb44cdb4bdab04f2fa59bef3f524 (diff) | |
parent | cd6a9ef58c4a01b9117e74fb9223a773898f68a0 (diff) | |
download | frameworks_base-103bc3342efe2a8a9a3a26f2e115bd1b58e0ed77.zip frameworks_base-103bc3342efe2a8a9a3a26f2e115bd1b58e0ed77.tar.gz frameworks_base-103bc3342efe2a8a9a3a26f2e115bd1b58e0ed77.tar.bz2 |
Merge "Clearing screenshot bitmap references and recycling bitmap data immediately after saving. (Bug 7974275)"
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/screenshot')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java | 12 |
1 files changed, 12 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 db9b219..17b0b50 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -220,13 +220,21 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi resolver.update(uri, values, null, null); params[0].imageUri = uri; + params[0].image = null; params[0].result = 0; } catch (Exception e) { // IOException/UnsupportedOperationException may be thrown if external storage is not // mounted + params[0].imageUri = null; + params[0].image = null; params[0].result = 1; } + // Recycle the bitmap data + if (image != null) { + image.recycle(); + } + return params[0]; } @@ -461,6 +469,10 @@ class GlobalScreenshot { // Save the screenshot once we have a bit of time now saveScreenshotInWorkerThread(finisher); mWindowManager.removeView(mScreenshotLayout); + + // Clear any references to the bitmap + mScreenBitmap = null; + mScreenshotView.setImageBitmap(null); } }); mScreenshotLayout.post(new Runnable() { |