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

Commit 6c1144dc authored by Riley Andrews's avatar Riley Andrews Committed by android-build-merger
Browse files

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

am: 2c740f1d

* commit '2c740f1d':
  Convert ashmem bitmap thresholds to constants.
parents a853bb45 2c740f1d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3966,6 +3966,9 @@ public class Notification implements Parcelable
            return this;
        }

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

        /**
         * @hide
         */
@@ -3974,7 +3977,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());
        }
    }