diff options
author | Winson Chung <winsonc@google.com> | 2013-01-16 14:59:18 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-01-16 15:01:11 -0800 |
commit | cd6a9ef58c4a01b9117e74fb9223a773898f68a0 (patch) | |
tree | a5cd4400d909f0fa88b31ed02ca61d43c785ba5c /packages/SystemUI/src/com/android/systemui/screenshot | |
parent | 35654b61e8fe7bc85afcb076ddbb590d51c5865f (diff) | |
download | frameworks_base-cd6a9ef58c4a01b9117e74fb9223a773898f68a0.zip frameworks_base-cd6a9ef58c4a01b9117e74fb9223a773898f68a0.tar.gz frameworks_base-cd6a9ef58c4a01b9117e74fb9223a773898f68a0.tar.bz2 |
Clearing screenshot bitmap references and recycling bitmap data immediately after saving. (Bug 7974275)
Change-Id: Icb71d28eb80105757026d7fac530db936b327500
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 03de89bd..f419273 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -217,13 +217,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]; } @@ -458,6 +466,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() { |