diff options
| author | 2015-11-04 20:18:35 +0000 | |
|---|---|---|
| committer | 2015-11-04 20:18:35 +0000 | |
| commit | c8bb39d98d7c2a07f1a5c745f6e89e379e4a25f0 (patch) | |
| tree | b2e10f10f409efbf009b37dbbb4104550e2ed079 | |
| parent | 10eb6ab94b932c33a708e007b0681b26930260e3 (diff) | |
| parent | 0394a0c399582d4401646cf2324f3148c3028531 (diff) | |
Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev
| -rw-r--r-- | core/java/android/app/Notification.java | 5 | ||||
| -rw-r--r-- | graphics/java/android/graphics/drawable/Icon.java | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a2e8fd134996..6a4f6a142735 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -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) { 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()); } } |