Limit persistent ashmem backed fds to a minimum of 128kB.
Bug 25256717
Change-Id: Ieb356006df0a6545b89de44d3d8fd4b46312b3b8
Signed-off-by: Riley Andrews <riandrews@google.com>
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index f3f2428..a2e8fd1 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3969,7 +3969,9 @@
@Override
public void purgeResources() {
super.purgeResources();
- if (mPicture != null && mPicture.isMutable()) {
+ if (mPicture != null &&
+ mPicture.isMutable() &&
+ mPicture.getAllocationByteCount() >= (128 * (1 << 10))) {
mPicture = mPicture.createAshmemBitmap();
}
if (mBigLargeIcon != null) {