summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-08-17 16:20:47 -0700
committerDianne Hackborn <hackbod@google.com>2011-08-17 17:45:05 -0700
commitfc8fa638617efb5695a1f89ea75375faebbe2a40 (patch)
tree685aeed4995ea17399accf5d46545038235d5105 /graphics
parent9a5505f0253a9114aea6192a22da6ec1c1b85ed2 (diff)
downloadframeworks_base-fc8fa638617efb5695a1f89ea75375faebbe2a40.zip
frameworks_base-fc8fa638617efb5695a1f89ea75375faebbe2a40.tar.gz
frameworks_base-fc8fa638617efb5695a1f89ea75375faebbe2a40.tar.bz2
Fix issue #5128639: SystemUI grows by 10MB after taking a screenshot
We now do the screenshot in a separate process. Also change the recents panel to not use hardware acceleration on lower-end devices. And improve how it gets shown to not load all data up-front which results in a long delay when you have lots of recents. Change-Id: Ia309a90f9939e5405758621b3f7114597bd0c02a
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/LayerDrawable.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index 49dbbca..6698d31 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -277,10 +277,19 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
*/
public boolean setDrawableByLayerId(int id, Drawable drawable) {
final ChildDrawable[] layers = mLayerState.mChildren;
- drawable.setCallback(this);
for (int i = mLayerState.mNum - 1; i >= 0; i--) {
if (layers[i].mId == id) {
+ if (layers[i].mDrawable != null) {
+ if (drawable != null) {
+ Rect bounds = layers[i].mDrawable.getBounds();
+ drawable.setBounds(bounds);
+ }
+ layers[i].mDrawable.setCallback(null);
+ }
+ if (drawable != null) {
+ drawable.setCallback(this);
+ }
layers[i].mDrawable = drawable;
return true;
}