From b38fcc375ce2d13b3e378b21673b6cd5b273e100 Mon Sep 17 00:00:00 2001 From: Riley Andrews Date: Tue, 3 Nov 2015 23:36:52 -0800 Subject: Convert ashmem bitmap thresholds to constants. Bug 25256717 Change-Id: I23e2795ef8798d83bf60dcbd6ff2e7093fcaa9b0 Signed-off-by: Riley Andrews --- graphics/java/android/graphics/drawable/Icon.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java index 44d7530..d800acb 100644 --- a/graphics/java/android/graphics/drawable/Icon.java +++ b/graphics/java/android/graphics/drawable/Icon.java @@ -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()); } } -- cgit v1.1