summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riley Andrews <riandrews@google.com> 2015-11-04 20:37:18 +0000
committer android-build-merger <android-build-merger@google.com> 2015-11-04 20:37:18 +0000
commit132bb1e4b10755d2bc0810135511fd999badbe4b (patch)
tree49cc6f07d754dcbd424869db948646274345f589
parent34e9b5b2e418dd43e374dcbb3be27710c53d4b9c (diff)
parent6c1144dc0f8b2452ca2a204ca471e2d23339d5a3 (diff)
Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev am: c8bb39d98d am: 2c740f1dcf
am: 6c1144dc0f * commit '6c1144dc0f8b2452ca2a204ca471e2d23339d5a3': Convert ashmem bitmap thresholds to constants.
-rw-r--r--core/java/android/app/Notification.java5
-rw-r--r--graphics/java/android/graphics/drawable/Icon.java5
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 21060e4b13e5..4acfa294b289 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -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) {
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java
index 44d7530c6c11..d800acbe805e 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());
}
}