diff options
author | Riley Andrews <riandrews@android.com> | 2015-11-01 23:36:04 -0800 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-11-03 14:35:17 -0800 |
commit | a2dbe43122f5f8cb72d21ab4c9e7a9d570ba5d2e (patch) | |
tree | 2572a968a023e994a96e41f1a1d17753140fb6d6 /graphics/java | |
parent | 423244469797cbaccd66f5ed210841647d7072e8 (diff) | |
download | frameworks_base-a2dbe43122f5f8cb72d21ab4c9e7a9d570ba5d2e.zip frameworks_base-a2dbe43122f5f8cb72d21ab4c9e7a9d570ba5d2e.tar.gz frameworks_base-a2dbe43122f5f8cb72d21ab4c9e7a9d570ba5d2e.tar.bz2 |
Limit persistent ashmem backed fds to a minimum of 128kB.
Bug 25256717
Change-Id: Ieb356006df0a6545b89de44d3d8fd4b46312b3b8
Signed-off-by: Riley Andrews <riandrews@google.com>
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/drawable/Icon.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java index 26232a9..44d7530 100644 --- a/graphics/java/android/graphics/drawable/Icon.java +++ b/graphics/java/android/graphics/drawable/Icon.java @@ -382,7 +382,9 @@ public final class Icon implements Parcelable { * @hide */ public void convertToAshmem() { - if (mType == TYPE_BITMAP && getBitmap().isMutable()) { + if (mType == TYPE_BITMAP && + getBitmap().isMutable() && + getBitmap().getAllocationByteCount() >= (128 * (1 << 10))) { setBitmap(getBitmap().createAshmemBitmap()); } } |