Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev
am: c8bb39d98d
* commit 'c8bb39d98d7c2a07f1a5c745f6e89e379e4a25f0':
Convert ashmem bitmap thresholds to constants.
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 21060e4..4acfa29 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3966,6 +3966,9 @@
return this;
}
+ /** @hide */
+ public static final int MIN_ASHMEM_BITMAP_SIZE = 128 * (1 << 10);
+
/**
* @hide
*/
@@ -3974,7 +3977,7 @@
super.purgeResources();
if (mPicture != null &&
mPicture.isMutable() &&
- mPicture.getAllocationByteCount() >= (128 * (1 << 10))) {
+ mPicture.getAllocationByteCount() >= MIN_ASHMEM_BITMAP_SIZE) {
mPicture = mPicture.createAshmemBitmap();
}
if (mBigLargeIcon != null) {
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 @@
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 void convertToAshmem() {
if (mType == TYPE_BITMAP &&
getBitmap().isMutable() &&
- getBitmap().getAllocationByteCount() >= (128 * (1 << 10))) {
+ getBitmap().getAllocationByteCount() >= MIN_ASHMEM_ICON_SIZE) {
setBitmap(getBitmap().createAshmemBitmap());
}
}