Make recents use immutable ashmem bitmaps for things it frequently passes across binder.
Bug 21037890 Change-Id: Ieb29be3ff68f3db3f07df02f171325ed77915fdf
This commit is contained in:
@@ -621,10 +621,11 @@ public class Recents extends SystemUI
|
||||
mHeaderBar.draw(c);
|
||||
c.setBitmap(null);
|
||||
}
|
||||
Bitmap thumbnailImmutable = thumbnail.createAshmemBitmap();
|
||||
|
||||
mStartAnimationTriggered = false;
|
||||
return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
|
||||
thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
|
||||
thumbnailImmutable, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
|
||||
toTaskRect.height(), mHandler, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -490,6 +490,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
|
||||
// Notify the system to skip the thumbnail layer by using an ALPHA_8 bitmap
|
||||
b = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
|
||||
}
|
||||
Bitmap bImmut = b.createAshmemBitmap();
|
||||
ActivityOptions.OnAnimationStartedListener animStartedListener = null;
|
||||
if (lockToTask) {
|
||||
animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
|
||||
@@ -515,7 +516,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
|
||||
sourceView.getHandler(), animStartedListener);
|
||||
} else {
|
||||
opts = ActivityOptions.makeThumbnailAspectScaleUpAnimation(sourceView,
|
||||
b, offsetX, offsetY, transform.rect.width(), transform.rect.height(),
|
||||
bImmut, offsetX, offsetY, transform.rect.width(), transform.rect.height(),
|
||||
sourceView.getHandler(), animStartedListener);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user