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

Commit c8bb39d9 authored by Riley Andrews's avatar Riley Andrews Committed by Android (Google) Code Review
Browse files

Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev

parents 10eb6ab9 0394a0c3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3963,6 +3963,9 @@ public class Notification implements Parcelable
            return this;
        }

        /** @hide */
        public static final int MIN_ASHMEM_BITMAP_SIZE = 128 * (1 << 10);

        /**
         * @hide
         */
@@ -3971,7 +3974,7 @@ public class Notification implements Parcelable
            super.purgeResources();
            if (mPicture != null &&
                mPicture.isMutable() &&
                mPicture.getAllocationByteCount() >= (128 * (1 << 10))) {
                mPicture.getAllocationByteCount() >= MIN_ASHMEM_BITMAP_SIZE) {
                mPicture = mPicture.createAshmemBitmap();
            }
            if (mBigLargeIcon != null) {
+4 −1
Original line number Diff line number Diff line
@@ -377,6 +377,9 @@ public final class Icon implements Parcelable {
        return loadDrawable(context);
    }

    /** @hide */
    public static final int MIN_ASHMEM_ICON_SIZE = 128 * (1 << 10);

    /**
     * Puts the memory used by this instance into Ashmem memory, if possible.
     * @hide
@@ -384,7 +387,7 @@ public final class Icon implements Parcelable {
    public void convertToAshmem() {
        if (mType == TYPE_BITMAP &&
            getBitmap().isMutable() &&
            getBitmap().getAllocationByteCount() >= (128 * (1 << 10))) {
            getBitmap().getAllocationByteCount() >= MIN_ASHMEM_ICON_SIZE) {
            setBitmap(getBitmap().createAshmemBitmap());
        }
    }