Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ac56502 authored by Riley Andrews's avatar Riley Andrews
Browse files

Make recents use immutable ashmem bitmaps for things it frequently passes across binder.

Bug 21037890
Change-Id: Ieb29be3ff68f3db3f07df02f171325ed77915fdf
parent b2694cc3
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -621,10 +621,11 @@ public class Recents extends SystemUI
                mHeaderBar.draw(c);
                mHeaderBar.draw(c);
                c.setBitmap(null);
                c.setBitmap(null);
            }
            }
            Bitmap thumbnailImmutable = thumbnail.createAshmemBitmap();


            mStartAnimationTriggered = false;
            mStartAnimationTriggered = false;
            return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
            return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
                    thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
                    thumbnailImmutable, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
                    toTaskRect.height(), mHandler, this);
                    toTaskRect.height(), mHandler, this);
        }
        }


+2 −1
Original line number Original line Diff line number Diff line
@@ -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
                // Notify the system to skip the thumbnail layer by using an ALPHA_8 bitmap
                b = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
                b = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
            }
            }
            Bitmap bImmut = b.createAshmemBitmap();
            ActivityOptions.OnAnimationStartedListener animStartedListener = null;
            ActivityOptions.OnAnimationStartedListener animStartedListener = null;
            if (lockToTask) {
            if (lockToTask) {
                animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
                animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
@@ -515,7 +516,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
                        sourceView.getHandler(), animStartedListener);
                        sourceView.getHandler(), animStartedListener);
            } else {
            } else {
                opts = ActivityOptions.makeThumbnailAspectScaleUpAnimation(sourceView,
                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);
                        sourceView.getHandler(), animStartedListener);
            }
            }
        }
        }